This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="twitter:card" content="player" /> | |
<meta name="twitter:site" content="@polluterofminds" /> | |
<meta name="twitter:title" content="Pinata Instant Games" /> | |
<meta | |
name="twitter:description" |
This file contains 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 { MongoClient } from "mongodb"; | |
const uri = process.env.MONGO_URI; | |
const client = new MongoClient(uri); | |
export default async function handler(req, res) { | |
if (req.method === "POST") { | |
try { | |
const database = client.db("pinata"); | |
const artists = database.collection("artists"); |
This file contains 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 { expect } = require("chai"); | |
const URI = "ipfs://QmTXCPCpdruEQ5HspoTQq6C4uJhP4V66PE89Ja7y8CEJCw"; | |
const URI2 = "ipfs://QmTXCPwpdruEQ5HBpoTQq6C4uJhP4V66PE89Ja7y8CEJC2" | |
describe("AppNFT", function () { | |
async function deploy() { | |
const [owner, otherAccount] = await ethers.getSigners(); | |
const AppNFT = await ethers.getContractFactory("AppNFT"); | |
const appNft = await AppNFT.deploy(URI); |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
contract AppNFT is ERC721URIStorage { | |
using Counters for Counters.Counter; | |
Counters.Counter public versions; | |
mapping(uint256 => string) public builds; |
This file contains 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, { useEffect, useState } from "react"; | |
import { useAccount, useConnect, useSignMessage, useDisconnect } from 'wagmi'; | |
const Authenticate = ({ cid, setPostContent, setAuthenticated }) => { | |
const [mounted, setMounted] = useState(false) | |
const [messageId, setMessageId] = useState(null); | |
const [signature, setSignature] = useState(null); | |
useEffect(() => { | |
if(messageId && signature) { |
This file contains 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 from "react"; | |
const Skeleton = () => { | |
return ( | |
<div className="card"> | |
<div className="header"> | |
<div className="img"></div> | |
<div className="details"> | |
<span className="name"></span> | |
<span className="about"></span> |
This file contains 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 Head from 'next/head' | |
import { useState, useEffect } from 'react' | |
import Posts from '../components/Posts' | |
import Skeleton from '../components/Skeleton'; | |
export default function Home({ data }) { | |
const [posts, setPosts] = useState([]) | |
const [loading, setLoading] = useState(true); | |
const [offset, setOffset] = useState(0); | |
const [limit, setLimit] = useState(10); |
This file contains 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 Music = () => { | |
const { data: session, status } = useSession(); | |
const [loading, setLoading] = useState(true); | |
const [address, setAddress] = useState(""); | |
const [index, setIndex] = useState([]); | |
const [contentUrls, setUrls] = useState([]); |
This file contains 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 Head from "next/head"; | |
import { getCsrfToken, signIn, useSession } from 'next-auth/react' | |
import { SiweMessage } from 'siwe' | |
import { useAccount, useConnect, useNetwork, useSignMessage } from 'wagmi'; | |
import { useRouter } from "next/router"; | |
import { useEffect } from "react"; | |
export default function Home() { | |
const router = useRouter(); | |
const [{ data: connectData }, connect] = useConnect() |
This file contains 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 { SessionProvider } from "next-auth/react" | |
import "../styles/globals.css" | |
import { WagmiProvider } from "wagmi" | |
export default function App({ Component, pageProps }) { | |
return ( | |
<WagmiProvider autoConnect> | |
<SessionProvider session={pageProps.session} refetchInterval={0}> | |
<Component {...pageProps} /> | |
</SessionProvider> |