This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { getSession } from "next-auth/react"; | |
| import { Submarine } from "pinata-submarine"; | |
| const submarine = new Submarine(process.env.SUBMARINE_KEY, process.env.GATEWAY_URL); | |
| export default async function handler(req, res) { | |
| try { | |
| const session = await getSession({ req }); | |
| if (!session) { | |
| return res.status(401).send("Not signed in"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { getSession } from "next-auth/react"; | |
| import formidable from "formidable"; | |
| import fs from "fs"; | |
| import { Submarine } from "pinata-submarine"; | |
| const submarine = new Submarine(process.env.SUBMARINE_KEY, process.env.GATEWAY_URL); | |
| const IDENTIFIER = "YOUR UNIQUE ID"; | |
| export const config = { | |
| api: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import NextAuth from "next-auth" | |
| import CredentialsProvider from "next-auth/providers/credentials" | |
| import { getCsrfToken } from "next-auth/react" | |
| import { SiweMessage } from "siwe" | |
| import { ethers } from "ethers" | |
| const validateNFTOwnership = async (address) => { | |
| try { | |
| const { abi } = require("../../../helpers/erc721"); | |
| const contractAddress = process.env.CONTRACT_ADDRESS; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require("fs"); | |
| const FormData = require("form-data"); | |
| const rfs = require("recursive-fs"); | |
| const basePathConverter = require("base-path-converter"); | |
| const got = require('got'); | |
| const submarineDirectory = async () => { | |
| const url = `https://managed.mypinata.cloud/api/v1/content`; | |
| const src = "RELATIVE PATH TO DIRECTORY TO UPLOAD"; | |
| var status = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const abi = [ | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "string", | |
| "name": "baseURI", | |
| "type": "string" | |
| }, | |
| { | |
| "internalType": "uint256", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { getSession } from "next-auth/react"; | |
| import formidable from "formidable"; | |
| import fs from "fs"; | |
| import FormData from "form-data" | |
| const API_ENDPOINT = "https://managed.mypinata.cloud/api/v1"; | |
| const IDENTIFIER = "YOUR APP UUID"; | |
| export const config = { | |
| api: { | |
| bodyParser: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect, useRef } from "react"; | |
| import { signOut, useSession } from "next-auth/react"; | |
| import Link from "next/link"; | |
| const Gallery = () => { | |
| const { data: session, status } = useSession(); | |
| const [loading, setLoading] = useState(true); | |
| const [address, setAddress] = useState(""); | |
| const [index, setIndex] = useState([]); | |
| const [imageUrls, setImageUrls] = useState([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { getSession } from "next-auth/react"; | |
| const API_ENDPOINT = "https://managed.mypinata.cloud/api/v1"; | |
| export default async function handler(req, res) { | |
| try { | |
| const session = await getSession({ req }); | |
| if (!session) { | |
| return res.status(401).send("Not signed in"); | |
| } | |
| const { id, cid } = req.query; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from 'react' | |
| import { signOut, useSession } from "next-auth/react" | |
| import Link from 'next/link'; | |
| const Gallery = () => { | |
| const { data: session, status } = useSession() | |
| const [loading, setLoading] = useState(true); | |
| const [address, setAddress] = useState(""); | |
| const [index, setIndex] = useState([]); | |
| const [imageUrls, setImageUrls] = useState([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from 'react' | |
| import { signOut, useSession } from "next-auth/react" | |
| import Link from 'next/link'; | |
| const Gallery = () => { | |
| const { data: session, status } = useSession() | |
| const [loading, setLoading] = useState(true); | |
| const [address, setAddress] = useState(""); | |
| const [index, setIndex] = useState([]); |