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
| y = 'yes' | |
| n = 'no' | |
| s = 'yes', 'no' | |
| def shut_down(i): | |
| if i == y: | |
| return 'shutting down' | |
| if i == n: | |
| return 'abort' | |
| if i == s: |
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
| def turn_page(sender): | |
| page = sender.name | |
| v = ui.load_view(page) | |
| if min(ui.get_screen_size()) >= 768: | |
| # Pad | |
| v.frame = (0, 0, 360, 400) | |
| v.present('sheet') | |
| else: | |
| # iPhone | |
| v.background_color = 'indigo' |
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, { useEffect, useState, ReactNode } from 'react'; | |
| import { ethers } from 'ethers'; | |
| import { Spinner } from '@chakra-ui/react'; | |
| export interface TokenGateProps { | |
| /** | |
| * The provider or signer to fetch the address from the ens | |
| */ | |
| provider: ethers.providers.Web3Provider; | |
| /** | |
| * The token 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
| interface BalanceCardProps { | |
| isAccountBalanceHidden: boolean; | |
| secretName: string; | |
| accountName: string; | |
| balance: number | string | null; | |
| cardType: 'account' | 'total' | 'overall'; | |
| } | |
| function BalanceCard({ | |
| isAccountBalanceHidden, |
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
| 'use client' | |
| import { useState, useEffect } from 'react' | |
| import { isAddress } from 'viem' | |
| import { normalize } from 'viem/ens' | |
| import { mainnet, sepolia } from 'wagmi/chains' | |
| import { createConfig, useEnsAddress, http } from 'wagmi' | |
| import { Input } from './ui/input' | |
| import { Separator } from './ui/separator' | |
| type EthAddressInputProps = { | |
| label: string |
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
| 'use client' | |
| import { useBalance, useReadContract } from 'wagmi' | |
| import { formatEther } from 'viem' | |
| import { toBigInt } from 'ethers' | |
| import { useEffect } from 'react' | |
| const abi = [ | |
| { | |
| type: 'function', | |
| name: 'balanceOf', |
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
| 'use client' | |
| import React, { useState } from 'react' | |
| import { useNftMetaData } from '@/hooks/useNft' // Import the hook from its file | |
| import Image from 'next/image' | |
| import { erc721Abi } from 'viem' | |
| import { useReadContract } from 'wagmi' | |
| const IPFS_GATEWAY = 'https://ipfs.io/ipfs/' | |
| type Address = `0x${string}` | undefined |
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 { useEffect, useState } from 'react' | |
| import { erc721Abi } from 'viem' | |
| import { useReadContract } from 'wagmi' | |
| const IPFS_GATEWAY = 'https://ipfs.io/ipfs/' | |
| interface NftMetadata { | |
| name: string | |
| image: string | |
| description: string |
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 { PrismaAdapter } from "@auth/prisma-adapter"; | |
| import { | |
| getServerSession, | |
| type DefaultSession, | |
| type NextAuthOptions, | |
| } from "next-auth"; | |
| import { type Adapter } from "next-auth/adapters"; | |
| import Credentials from "next-auth/providers/credentials"; | |
| import { SiweMessage } from "siwe"; | |
| import { createPublicClient, http } from "viem"; |
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
| "use client"; | |
| import React, { useCallback, useEffect, useMemo, useState } from "react"; | |
| import type { Hex } from "viem"; | |
| import { useAccount, usePublicClient, useSignMessage } from "wagmi"; | |
| import { SiweMessage } from "siwe"; | |
| import { Button } from "./button"; | |
| import { useQuery } from "@tanstack/react-query"; | |
| import { signIn } from "next-auth/react"; | |
| import { parseErc6492Signature } from "viem/experimental"; | |
| // Function to fetch nonce from the backend |
OlderNewer