From 3dd57ed9f3a59c579781ef80046926ab4032428a Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Mon, 21 Oct 2024 16:08:03 -0700 Subject: [PATCH 1/8] bump viem version, replace goerli with baseSepolia --- .eslintrc.yaml | 15 - .../vite-wagmi-ethers-rainbowkit/package.json | 12 +- .../vite-wagmi-ethers-rainbowkit/src/App.tsx | 16 +- .../src/hooks/useEthersSigner.ts | 7 +- .../vite-wagmi-ethers-rainbowkit/src/main.tsx | 42 +- .../vite-wagmi-ethers-rainbowkit/src/wagmi.ts | 29 - examples/vite-wagmi-ethers/package.json | 13 +- examples/vite-wagmi-ethers/src/App.tsx | 21 +- examples/vite-wagmi-ethers/src/main.tsx | 35 +- examples/vite-wagmi-ethers/src/wagmi.ts | 6 +- examples/vite-wagmi-ethers6/package.json | 13 +- examples/vite-wagmi-ethers6/src/App.tsx | 16 +- examples/vite-wagmi-ethers6/src/main.tsx | 24 +- examples/vite-wagmi-ethers6/src/wagmi.ts | 15 - examples/vite-wagmi-viem/package.json | 12 +- examples/vite-wagmi-viem/src/App.tsx | 41 +- examples/vite-wagmi-viem/src/main.tsx | 15 +- examples/vite-wagmi-viem/src/wagmi.ts | 15 - package.json | 20 +- packages/sdk/abis/ERC1155.ts | 70 +- packages/sdk/abis/ERC20.ts | 192 +- packages/sdk/abis/ERC6551RegistryV2.json | 262 +- packages/sdk/abis/ERC721.ts | 50 +- packages/sdk/abis/IERC6551AccountV2.json | 214 +- packages/sdk/abis/MultiCallAuthenticated.ts | 474 +- packages/sdk/abis/index.ts | 26 +- packages/sdk/package.json | 123 +- packages/sdk/src/TokenboundClient.ts | 1704 ++--- packages/sdk/src/constants/crossChain.ts | 126 +- .../src/constants/eip1167Implementation.ts | 3 +- packages/sdk/src/constants/index.ts | 10 +- packages/sdk/src/constants/interfaces.ts | 2 +- packages/sdk/src/constants/multicall.ts | 6 +- .../sdk/src/constants/tokenboundAddresses.ts | 66 +- packages/sdk/src/functions/crossChain.ts | 109 +- packages/sdk/src/functions/index.ts | 6 +- packages/sdk/src/functions/viemV2.ts | 413 +- packages/sdk/src/functions/viemV3.ts | 299 +- packages/sdk/src/index.ts | 148 +- packages/sdk/src/test/TestAll.test.ts | 2312 +++--- packages/sdk/src/test/config/anvil.ts | 16 +- packages/sdk/src/test/config/base.ts | 11 +- packages/sdk/src/test/config/index.ts | 6 +- packages/sdk/src/test/config/mints.ts | 36 +- packages/sdk/src/test/config/setup.ts | 2 +- packages/sdk/src/test/config/shell.ts | 13 +- packages/sdk/src/test/constants/addresses.ts | 6 +- packages/sdk/src/test/constants/anvil.ts | 91 +- packages/sdk/src/test/constants/index.ts | 6 +- packages/sdk/src/test/constants/regexes.ts | 2 +- packages/sdk/src/test/mockWallet.tsx | 32 +- packages/sdk/src/test/types/index.ts | 2 +- packages/sdk/src/test/types/testers.ts | 12 +- packages/sdk/src/test/utils/clients.ts | 42 +- packages/sdk/src/test/utils/debug.ts | 30 +- packages/sdk/src/test/utils/ethToWei.ts | 4 +- packages/sdk/src/test/utils/getAnvilLogs.ts | 14 +- packages/sdk/src/test/utils/getWETHBalance.ts | 30 +- .../sdk/src/test/utils/getZora1155Balance.ts | 32 +- .../sdk/src/test/utils/getZora721Balance.ts | 32 +- packages/sdk/src/test/utils/index.ts | 16 +- packages/sdk/src/test/utils/shellCommand.ts | 28 +- .../sdk/src/test/wagmi-cli-hooks/generated.ts | 6488 ++++++++++------- .../sdk/src/types/abstractEthersSigner.ts | 4 +- .../abstractEthersTransactionResponse.ts | 4 +- packages/sdk/src/types/addresses.ts | 2 +- packages/sdk/src/types/anvilAccount.ts | 8 +- packages/sdk/src/types/callData.ts | 8 +- packages/sdk/src/types/contractABIPair.ts | 8 +- packages/sdk/src/types/erc6551Bytecode.ts | 16 +- packages/sdk/src/types/index.ts | 24 +- packages/sdk/src/types/messages.ts | 18 +- packages/sdk/src/types/multicall.ts | 16 +- packages/sdk/src/types/operations.ts | 13 +- packages/sdk/src/types/params.ts | 187 +- packages/sdk/src/types/prettify.ts | 4 +- packages/sdk/src/utils/addressToUint8Array.ts | 16 +- .../src/utils/chainIdToChain.testDISABLED.ts | 6 +- packages/sdk/src/utils/chainIdToChain.ts | 82 +- .../sdk/src/utils/getImplementationName.ts | 24 +- packages/sdk/src/utils/index.ts | 14 +- packages/sdk/src/utils/messageTypeguards.ts | 30 +- .../sdk/src/utils/normalizeEthersMessage.ts | 20 +- packages/sdk/src/utils/resolvePossibleENS.ts | 30 +- packages/sdk/src/utils/segmentBytecode.ts | 16 +- packages/sdk/tsconfig.json | 38 +- packages/sdk/vite.config.ts | 82 +- packages/sdk/vitest.config.ts | 38 +- packages/sdk/wagmi.config.ts | 144 +- pnpm-lock.yaml | 3109 ++------ 90 files changed, 8649 insertions(+), 9245 deletions(-) delete mode 100644 .eslintrc.yaml delete mode 100644 examples/vite-wagmi-ethers-rainbowkit/src/wagmi.ts delete mode 100644 examples/vite-wagmi-ethers6/src/wagmi.ts delete mode 100644 examples/vite-wagmi-viem/src/wagmi.ts diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index abfef9e..0000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,15 +0,0 @@ -root: true -extends: - - "prettier" -rules: - "no-unexpected-multiline": "warn" - "react/display-name": "off" - "semi": 0 - "react/no-unescaped-entities": 0 -plugins: - - "@typescript-eslint" -parser: "@typescript-eslint/parser" -parserOptions: - project: - - "./tsconfig.json" - - "./.eslintrc.js" diff --git a/examples/vite-wagmi-ethers-rainbowkit/package.json b/examples/vite-wagmi-ethers-rainbowkit/package.json index b2ba209..39e9967 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/package.json +++ b/examples/vite-wagmi-ethers-rainbowkit/package.json @@ -10,15 +10,17 @@ }, "dependencies": { "@tokenbound/sdk": "workspace:^", + "@wagmi/core": "^2.13.9", "buffer": "^6.0.3", - "@rainbow-me/rainbowkit": "^1.0.11", + "@tanstack/react-query": "^5.59.15", + "@rainbow-me/rainbowkit": "^2.2.0", "ethers": "^5.7.2", "process": "^0.11.10", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", "util": "^0.12.5", - "viem": "^2.10.5", - "wagmi": "^2.3.1" + "viem": "^2.21.32", + "wagmi": "^2.12.20" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/vite-wagmi-ethers-rainbowkit/src/App.tsx b/examples/vite-wagmi-ethers-rainbowkit/src/App.tsx index f4bb07f..420f125 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/src/App.tsx +++ b/examples/vite-wagmi-ethers-rainbowkit/src/App.tsx @@ -8,8 +8,14 @@ import { parseUnits, getAddress } from 'viem' import { useCallback, useEffect } from 'react' import { useEthersSigner } from './hooks' -// const sendingTBA = '0x047A2F5c8C97948675786e9a1A12EB172CF802a1' // Sapienz #5 on Goerli w/ V2 contract: https://tokenbound.org/assets/goerli/0x26c55c8d83d657b2fc1df497f0c991e3612bc6b2/5 -const sendingTBA = '0xa2221cc0f5012D60d0bF91B840A4Ef990D44Ae39' // Sapienz #5 on Goerli w/ V3 contract +// Origin NFT: MoonTrees #0 on Base Sepolia +const originNFT = { + tokenContract: getAddress('0xcf7ea35b7421a8ff2ff460a939e294ac13a05342'), + tokenId: '0', +} + +// TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia +const sendingTBA = '0x5F50CAf6244d10C32965354F8c4d84D84503D42D' const recipientAddress = getAddress('0x9FefE8a875E7a9b0574751E191a2AF205828dEA4') const ethAmount = 0.005 const ethAmountWei = parseUnits(`${ethAmount}`, 18) @@ -23,9 +29,9 @@ export function App() { useEffect(() => { async function testTokenboundClass() { - const account = await tokenboundClient.getAccount({ - tokenContract: '0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb', - tokenId: '9', + const account = tokenboundClient.getAccount({ + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, }) const preparedExecution = await tokenboundClient.prepareExecution({ diff --git a/examples/vite-wagmi-ethers-rainbowkit/src/hooks/useEthersSigner.ts b/examples/vite-wagmi-ethers-rainbowkit/src/hooks/useEthersSigner.ts index 81c0f98..32ca16b 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/src/hooks/useEthersSigner.ts +++ b/examples/vite-wagmi-ethers-rainbowkit/src/hooks/useEthersSigner.ts @@ -1,5 +1,6 @@ import * as React from 'react' -import { type WalletClient, useWalletClient } from 'wagmi' +import { useWalletClient } from 'wagmi' +import { type WalletClient } from 'viem' import { providers } from 'ethers' // Ethers.js Adapters for Wagmi Wallet Client @@ -7,13 +8,15 @@ import { providers } from 'ethers' export function walletClientToSigner(walletClient: WalletClient) { const { account, chain, transport } = walletClient + if(!chain) throw new Error('Chain not found') + const network = { chainId: chain.id, name: chain.name, ensAddress: chain.contracts?.ensRegistry?.address, } const provider = new providers.Web3Provider(transport, network) - const signer = provider.getSigner(account.address) + const signer = provider.getSigner(account?.address) return signer } diff --git a/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx b/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx index ddb6bd4..8fdb32a 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx +++ b/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx @@ -2,24 +2,38 @@ import '@rainbow-me/rainbowkit/styles.css' import * as React from 'react' import * as ReactDOM from 'react-dom/client' -import { RainbowKitProvider } from '@rainbow-me/rainbowkit' -import { WagmiConfig } from 'wagmi' -import { wagmiConfig, chains } from './wagmi' +import { WagmiProvider } from 'wagmi'; + +import { + mainnet, + baseSepolia, +} from 'wagmi/chains'; +import { + QueryClientProvider, + QueryClient, +} from "@tanstack/react-query"; import { App } from './App' +import { + getDefaultConfig, + RainbowKitProvider, +} from '@rainbow-me/rainbowkit' +const queryClient = new QueryClient(); + +const config = getDefaultConfig({ + appName: 'My RainbowKit App', + projectId: 'YOUR_PROJECT_ID', + chains: [baseSepolia], +}); ReactDOM.createRoot(document.getElementById('root')!).render( - - - - - + + + + + + + ) diff --git a/examples/vite-wagmi-ethers-rainbowkit/src/wagmi.ts b/examples/vite-wagmi-ethers-rainbowkit/src/wagmi.ts deleted file mode 100644 index d61b128..0000000 --- a/examples/vite-wagmi-ethers-rainbowkit/src/wagmi.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { getDefaultWallets } from "@rainbow-me/rainbowkit"; -import { configureChains, createConfig } from "wagmi"; -import { goerli } from 'wagmi/chains' - -import { alchemyProvider } from 'wagmi/providers/alchemy'; -import { publicProvider } from 'wagmi/providers/public'; - - -const NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID = '6319aa80666a39009543c309a5828a1b' - -export const { chains, publicClient } = configureChains( - [goerli], - [ - alchemyProvider({ apiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY! }), - publicProvider() - ] -); - -const { connectors } = getDefaultWallets({ - appName: 'Tokenbound SDK Example with RainbowKit', - projectId: NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID, - chains -}); - -export const wagmiConfig = createConfig({ - autoConnect: true, - connectors, - publicClient, -}) \ No newline at end of file diff --git a/examples/vite-wagmi-ethers/package.json b/examples/vite-wagmi-ethers/package.json index 7e9deaf..cdc8b4d 100644 --- a/examples/vite-wagmi-ethers/package.json +++ b/examples/vite-wagmi-ethers/package.json @@ -11,15 +11,16 @@ "dependencies": { "@tokenbound/sdk": "workspace:^", "buffer": "^6.0.3", - "@tanstack/react-query": "^5.17.19", - "@rainbow-me/rainbowkit": "2.0.0-beta.2", + "@tanstack/react-query": "^5.59.15", + "@rainbow-me/rainbowkit": "2.2.0", + "connectkit": "1.8.2", "ethers": "^5.7.2", "process": "^0.11.10", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", "util": "^0.12.5", - "viem": "^2.10.5", - "wagmi": "^2.3.1" + "viem": "^2.21.32", + "wagmi": "^2.12.20" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/vite-wagmi-ethers/src/App.tsx b/examples/vite-wagmi-ethers/src/App.tsx index 3b70306..a3b7244 100644 --- a/examples/vite-wagmi-ethers/src/App.tsx +++ b/examples/vite-wagmi-ethers/src/App.tsx @@ -7,15 +7,18 @@ import { parseUnits, getAddress } from 'viem' import { useCallback, useEffect } from 'react' import { useEthersSigner } from './hooks' -// const sendingTBA = '0x047A2F5c8C97948675786e9a1A12EB172CF802a1' // Sapienz #5 on Goerli w/ V2 contract: https://tokenbound.org/assets/goerli/0x26c55c8d83d657b2fc1df497f0c991e3612bc6b2/5 -const sendingTBA = '0xa2221cc0f5012D60d0bF91B840A4Ef990D44Ae39' // Sapienz #5 on Goerli w/ V3 contract +// Origin NFT: MoonTrees #0 on Base Sepolia +const originNFT = { + tokenContract: getAddress('0xcf7ea35b7421a8ff2ff460a939e294ac13a05342'), + tokenId: '0', +} + +// TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia +const sendingTBA = '0x5F50CAf6244d10C32965354F8c4d84D84503D42D' const recipientAddress = getAddress('0x9FefE8a875E7a9b0574751E191a2AF205828dEA4') const ethAmount = 0.005 const ethAmountWei = parseUnits(`${ethAmount}`, 18) -const TOKEN_CONTRACT = `0x26c55c8d83d657b2fc1df497f0c991e3612bc6b2` -const TOKEN_ID = '5' - export function App() { const { isConnected, address } = useAccount() const signer = useEthersSigner({ chainId: 5 }) @@ -32,8 +35,8 @@ export function App() { if (!tokenboundClient) return const tokenboundAccount = tokenboundClient.getAccount({ - tokenContract: TOKEN_CONTRACT, - tokenId: TOKEN_ID, + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, }) const preparedExecution = await tokenboundClient.prepareExecution({ @@ -44,8 +47,8 @@ export function App() { }) const preparedCreateAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: TOKEN_CONTRACT, - tokenId: TOKEN_ID, + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, }) console.log('getAccount', tokenboundAccount) diff --git a/examples/vite-wagmi-ethers/src/main.tsx b/examples/vite-wagmi-ethers/src/main.tsx index 1239b19..28d5efb 100644 --- a/examples/vite-wagmi-ethers/src/main.tsx +++ b/examples/vite-wagmi-ethers/src/main.tsx @@ -1,35 +1,22 @@ -// import { ConnectKitProvider } from 'connectkit' -// import * as React from 'react' -// import * as ReactDOM from 'react-dom/client' -// import { WagmiConfig } from 'wagmi' - -// import { App } from './App' -// import { wagmiClient } from './wagmi' - -// ReactDOM.createRoot(document.getElementById('root')!).render( -// -// -// -// -// -// -// -// ) - import { ConnectKitProvider } from 'connectkit' import * as React from 'react' import * as ReactDOM from 'react-dom/client' -import { WagmiConfig } from 'wagmi' +import { WagmiProvider } from 'wagmi' import { App } from './App' import { wagmiConfig } from './wagmi' +import { QueryClient, QueryClientProvider } from "@tanstack/react-query" + +const queryClient = new QueryClient() ReactDOM.createRoot(document.getElementById('root')!).render( - - - - - + + + + + + + ) diff --git a/examples/vite-wagmi-ethers/src/wagmi.ts b/examples/vite-wagmi-ethers/src/wagmi.ts index 0d29e50..1b62cd1 100644 --- a/examples/vite-wagmi-ethers/src/wagmi.ts +++ b/examples/vite-wagmi-ethers/src/wagmi.ts @@ -1,8 +1,10 @@ import { getDefaultConfig } from "connectkit"; import { createConfig } from "wagmi"; -import { goerli } from 'wagmi/chains' +import { baseSepolia } from 'wagmi/chains' -const chains = [goerli] +import { Chain } from 'viem' + +const chains: readonly [Chain, ...Chain[]] = [baseSepolia] export const wagmiConfig = createConfig( getDefaultConfig({ diff --git a/examples/vite-wagmi-ethers6/package.json b/examples/vite-wagmi-ethers6/package.json index 2b228c4..87b5ca5 100644 --- a/examples/vite-wagmi-ethers6/package.json +++ b/examples/vite-wagmi-ethers6/package.json @@ -11,14 +11,15 @@ "dependencies": { "@tokenbound/sdk": "workspace:^", "buffer": "^6.0.3", - "connectkit": "^1.5.3", - "ethers": "^6.7.0", + "connectkit": "^1.8.2", + "@tanstack/react-query": "^5.59.15", + "ethers": "^6.13.4", "process": "^0.11.10", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", "util": "^0.12.5", - "viem": "^1.21.4", - "wagmi": "^1.4.7" + "viem": "^2.21.32", + "wagmi": "^2.12.20" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/vite-wagmi-ethers6/src/App.tsx b/examples/vite-wagmi-ethers6/src/App.tsx index 7cfd752..1a6ebca 100644 --- a/examples/vite-wagmi-ethers6/src/App.tsx +++ b/examples/vite-wagmi-ethers6/src/App.tsx @@ -8,8 +8,14 @@ import { parseUnits, getAddress } from 'viem' import { useCallback, useEffect } from 'react' import { useEthers6Signer } from './hooks' -// const sendingTBA = '0x047A2F5c8C97948675786e9a1A12EB172CF802a1' // Sapienz #5 on Goerli w/ V2 contract: https://tokenbound.org/assets/goerli/0x26c55c8d83d657b2fc1df497f0c991e3612bc6b2/5 -const sendingTBA = '0xa2221cc0f5012D60d0bF91B840A4Ef990D44Ae39' // Sapienz #5 on Goerli w/ V3 contract +// Origin NFT: MoonTrees #0 on Base Sepolia +const originNFT = { + tokenContract: getAddress('0xcf7ea35b7421a8ff2ff460a939e294ac13a05342'), + tokenId: '0', +} + +// TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia +const sendingTBA = '0x5F50CAf6244d10C32965354F8c4d84D84503D42D' const recipientAddress = getAddress('0x9FefE8a875E7a9b0574751E191a2AF205828dEA4') const ethAmount = 0.005 const ethAmountWei = parseUnits(`${ethAmount}`, 18) @@ -25,9 +31,9 @@ export function App() { useEffect(() => { async function testTokenboundClass() { - const account = await tokenboundClient.getAccount({ - tokenContract: '0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb', - tokenId: '9', + const account = tokenboundClient.getAccount({ + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, }) const preparedExecution = await tokenboundClient.prepareExecution({ diff --git a/examples/vite-wagmi-ethers6/src/main.tsx b/examples/vite-wagmi-ethers6/src/main.tsx index 397368a..cbc654d 100644 --- a/examples/vite-wagmi-ethers6/src/main.tsx +++ b/examples/vite-wagmi-ethers6/src/main.tsx @@ -1,17 +1,33 @@ import { ConnectKitProvider } from 'connectkit' import * as React from 'react' import * as ReactDOM from 'react-dom/client' -import { WagmiConfig } from 'wagmi' +import { createConfig, WagmiProvider } from 'wagmi'; + +import { baseSepolia } from 'wagmi/chains'; +import { + QueryClientProvider, + QueryClient, +} from "@tanstack/react-query"; +import { http } from 'viem'; import { App } from './App' -import { wagmiConfig } from './wagmi' +const queryClient = new QueryClient(); + +export const config = createConfig({ + chains: [baseSepolia], + transports: { + [baseSepolia.id]: http(), + }, +}) ReactDOM.createRoot(document.getElementById('root')!).render( - + + - + + ) diff --git a/examples/vite-wagmi-ethers6/src/wagmi.ts b/examples/vite-wagmi-ethers6/src/wagmi.ts deleted file mode 100644 index 0d29e50..0000000 --- a/examples/vite-wagmi-ethers6/src/wagmi.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { getDefaultConfig } from "connectkit"; -import { createConfig } from "wagmi"; -import { goerli } from 'wagmi/chains' - -const chains = [goerli] - -export const wagmiConfig = createConfig( - getDefaultConfig({ - walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!, - chains, - appName: 'Vite Tokenbound SDK Example', - appDescription: 'Tokenbound SDK Example', - appUrl: 'https://tokenbound.org', - }) -) \ No newline at end of file diff --git a/examples/vite-wagmi-viem/package.json b/examples/vite-wagmi-viem/package.json index 05982d8..50455b2 100644 --- a/examples/vite-wagmi-viem/package.json +++ b/examples/vite-wagmi-viem/package.json @@ -11,15 +11,15 @@ "dependencies": { "@tokenbound/sdk": "workspace:^", "buffer": "^6.0.3", - "@tanstack/react-query": "^5.17.19", - "@rainbow-me/rainbowkit": "2.0.0-beta.2", + "@tanstack/react-query": "^5.59.15", + "@rainbow-me/rainbowkit": "2.2.0", "ethers": "^5.7.2", "process": "^0.11.10", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", "util": "^0.12.5", - "viem": "^2.10.5", - "wagmi": "^2.3.1" + "viem": "^2.21.32", + "wagmi": "^2.12.20" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/vite-wagmi-viem/src/App.tsx b/examples/vite-wagmi-viem/src/App.tsx index 9985194..074958a 100644 --- a/examples/vite-wagmi-viem/src/App.tsx +++ b/examples/vite-wagmi-viem/src/App.tsx @@ -1,8 +1,6 @@ -// import { ConnectKitButton } from 'connectkit' import { ConnectButton } from '@rainbow-me/rainbowkit' import { useAccount, - // WindowProvider } from 'wagmi' import { Account } from './components' @@ -15,45 +13,40 @@ import { parseUnits, getAddress, } from 'viem' -import { goerli } from 'viem/chains' +import { baseSepolia } from 'viem/chains' import { TokenboundClient } from '@tokenbound/sdk' - import { useCallback, useEffect } from 'react' -// interface WindowProvider { -// request: (...args: any[]) => Promise -// // Add other properties and methods you expect to use -// } - declare global { interface Window { - // ethereum?: WindowProvider ethereum?: any // CoinbaseWalletSDK also defines window.ethereum, so we have to work around that :( } } -// const sendingTBA = '0x047A2F5c8C97948675786e9a1A12EB172CF802a1' // Sapienz #5 on Goerli w/ V2 contract: https://tokenbound.org/assets/goerli/0x26c55c8d83d657b2fc1df497f0c991e3612bc6b2/5 -const sendingTBA = '0xa2221cc0f5012D60d0bF91B840A4Ef990D44Ae39' // Sapienz #5 on Goerli w/ V3 contract +// Origin NFT: MoonTrees #0 on Base Sepolia +const originNFT = { + tokenContract: getAddress('0xcf7ea35b7421a8ff2ff460a939e294ac13a05342'), + tokenId: '0', +} + +// TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia +const sendingTBA = '0x5F50CAf6244d10C32965354F8c4d84D84503D42D' const recipientAddress = getAddress('0x9FefE8a875E7a9b0574751E191a2AF205828dEA4') const ethAmount = 0.005 const ethAmountWei = parseUnits(`${ethAmount}`, 18) -const TOKEN_CONTRACT = `0x26c55c8d83d657b2fc1df497f0c991e3612bc6b2` -const TOKEN_ID = '5' - export function App() { const { isConnected, address } = useAccount() const walletClient: WalletClient = createWalletClient({ - chain: goerli, + chain: baseSepolia, account: address, - // transport: http(), transport: window.ethereum ? custom(window.ethereum) : http(), }) const tokenboundClient = new TokenboundClient({ walletClient, - chainId: goerli.id, + chainId: baseSepolia.id, // implementationAddress: '0x2d25602551487c3f3354dd80d76d54383a243358', }) @@ -62,8 +55,8 @@ export function App() { if (!tokenboundClient) return const tokenboundAccount = tokenboundClient.getAccount({ - tokenContract: TOKEN_CONTRACT, - tokenId: TOKEN_ID, + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, }) const preparedExecution = await tokenboundClient.prepareExecution({ @@ -74,8 +67,8 @@ export function App() { }) const preparedCreateAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: TOKEN_CONTRACT, - tokenId: TOKEN_ID, + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, }) console.log('getAccount', tokenboundAccount) @@ -94,8 +87,8 @@ export function App() { const createAccount = useCallback(async () => { if (!tokenboundClient || !address) return const createdAccount = await tokenboundClient.createAccount({ - tokenContract: TOKEN_CONTRACT, - tokenId: TOKEN_ID, + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, }) console.log(`new account: ${createdAccount}`) alert(`new account: ${createdAccount}`) diff --git a/examples/vite-wagmi-viem/src/main.tsx b/examples/vite-wagmi-viem/src/main.tsx index 8c35e53..b1ffbd4 100644 --- a/examples/vite-wagmi-viem/src/main.tsx +++ b/examples/vite-wagmi-viem/src/main.tsx @@ -1,20 +1,29 @@ import '@rainbow-me/rainbowkit/styles.css' -import { WagmiProvider } from 'wagmi' +import { http } from 'viem'; +import { createConfig, WagmiProvider } from 'wagmi'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { RainbowKitProvider, getDefaultConfig, lightTheme } from '@rainbow-me/rainbowkit' +import { baseSepolia } from 'wagmi/chains'; import * as React from 'react' import * as ReactDOM from 'react-dom/client' import { App } from './App' -import { wagmiConfig } from './wagmi' +// import { wagmiConfig } from './wagmi' const queryClient = new QueryClient() +export const config = createConfig({ + chains: [baseSepolia], + transports: { + [baseSepolia.id]: http(), + }, +}) + ReactDOM.createRoot(document.getElementById('root')!).render( - + diff --git a/examples/vite-wagmi-viem/src/wagmi.ts b/examples/vite-wagmi-viem/src/wagmi.ts deleted file mode 100644 index e2fcb65..0000000 --- a/examples/vite-wagmi-viem/src/wagmi.ts +++ /dev/null @@ -1,15 +0,0 @@ -// import { getDefaultConfig } from 'connectkit' -import { Chain, goerli, mainnet } from 'wagmi/chains' -import { getDefaultConfig } from '@rainbow-me/rainbowkit' - -const chains: [Chain, ...Chain[]] = [goerli] - -export const wagmiConfig = getDefaultConfig({ - appName: 'Vite Tokenbound SDK Example', - appDescription: 'Tokenbound SDK Example', - appUrl: 'https://tokenbound.org', - // projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_ID!, - projectId: 'f8fc7a00d1a59a1aece2454402025e79', - chains: chains, - // walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_ID!, -}) diff --git a/package.json b/package.json index 64e6e38..a6b6288 100644 --- a/package.json +++ b/package.json @@ -14,25 +14,9 @@ "directory": "packages/sdk" }, "devDependencies": { + "@biomejs/biome": "1.9.4", "@changesets/cli": "^2.26.2", - "eslint": "^8.50.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-unused-imports": "^3.0.0", - "prettier": "^2.8.8", - "@ianvs/prettier-plugin-sort-imports": "^4.1.0", "husky": "^8.0.3", - "typescript": "^5.2.2", - "@typescript-eslint/parser": "^6.7.2", - "@typescript-eslint/eslint-plugin": "^6.7.2", - "lint-staged": "^14.0.1" - }, - "lint-staged": { - "./**/*.{js,ts,jsx,tsx}": [ - "eslint --fix", - "prettier --write" - ], - "*.json": [ - "prettier --write" - ] + "typescript": "^5.6.3" } } diff --git a/packages/sdk/abis/ERC1155.ts b/packages/sdk/abis/ERC1155.ts index feda10a..325f836 100644 --- a/packages/sdk/abis/ERC1155.ts +++ b/packages/sdk/abis/ERC1155.ts @@ -1,37 +1,37 @@ -import { Abi } from "viem" +import { Abi } from "viem"; export const erc1155Abi = [ - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'id', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'data', - type: 'bytes', - }, - ], - name: 'safeTransferFrom', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - ] as Abi \ No newline at end of file + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as Abi; diff --git a/packages/sdk/abis/ERC20.ts b/packages/sdk/abis/ERC20.ts index 4de69d5..cc1eb4a 100644 --- a/packages/sdk/abis/ERC20.ts +++ b/packages/sdk/abis/ERC20.ts @@ -1,98 +1,98 @@ -import { Abi } from "viem" +import { Abi } from "viem"; export const erc20Abi = [ - { - type: 'event', - inputs: [ - { name: 'owner', type: 'address', indexed: true }, - { name: 'spender', type: 'address', indexed: true }, - { name: 'value', type: 'uint256', indexed: false }, - ], - name: 'Approval', - }, - { - type: 'event', - inputs: [ - { name: 'from', type: 'address', indexed: true }, - { name: 'to', type: 'address', indexed: true }, - { name: 'value', type: 'uint256', indexed: false }, - ], - name: 'Transfer', - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'owner', type: 'address' }, - { name: 'spender', type: 'address' }, - ], - name: 'allowance', - outputs: [{ name: '', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'spender', type: 'address' }, - { name: 'amount', type: 'uint256' }, - ], - name: 'approve', - outputs: [{ name: '', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'account', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'decimals', - outputs: [{ name: '', type: 'uint8' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'name', - outputs: [{ name: '', type: 'string' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'symbol', - outputs: [{ name: '', type: 'string' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'totalSupply', - outputs: [{ name: '', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'recipient', type: 'address' }, - { name: 'amount', type: 'uint256' }, - ], - name: 'transfer', - outputs: [{ name: '', type: 'bool' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'sender', type: 'address' }, - { name: 'recipient', type: 'address' }, - { name: 'amount', type: 'uint256' }, - ], - name: 'transferFrom', - outputs: [{ name: '', type: 'bool' }], - }, -] as Abi \ No newline at end of file + { + type: "event", + inputs: [ + { name: "owner", type: "address", indexed: true }, + { name: "spender", type: "address", indexed: true }, + { name: "value", type: "uint256", indexed: false }, + ], + name: "Approval", + }, + { + type: "event", + inputs: [ + { name: "from", type: "address", indexed: true }, + { name: "to", type: "address", indexed: true }, + { name: "value", type: "uint256", indexed: false }, + ], + name: "Transfer", + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "owner", type: "address" }, + { name: "spender", type: "address" }, + ], + name: "allowance", + outputs: [{ name: "", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "spender", type: "address" }, + { name: "amount", type: "uint256" }, + ], + name: "approve", + outputs: [{ name: "", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "account", type: "address" }], + name: "balanceOf", + outputs: [{ name: "", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "decimals", + outputs: [{ name: "", type: "uint8" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "name", + outputs: [{ name: "", type: "string" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "symbol", + outputs: [{ name: "", type: "string" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "totalSupply", + outputs: [{ name: "", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "recipient", type: "address" }, + { name: "amount", type: "uint256" }, + ], + name: "transfer", + outputs: [{ name: "", type: "bool" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "sender", type: "address" }, + { name: "recipient", type: "address" }, + { name: "amount", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ name: "", type: "bool" }], + }, +] as Abi; diff --git a/packages/sdk/abis/ERC6551RegistryV2.json b/packages/sdk/abis/ERC6551RegistryV2.json index d2adc27..a34d3fa 100644 --- a/packages/sdk/abis/ERC6551RegistryV2.json +++ b/packages/sdk/abis/ERC6551RegistryV2.json @@ -1,133 +1,133 @@ [ - { - "inputs": [], - "name": "InitializationFailed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "salt", - "type": "uint256" - } - ], - "name": "AccountCreated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "salt", - "type": "uint256" - } - ], - "name": "account", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "salt", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "initData", - "type": "bytes" - } - ], - "name": "createAccount", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } + { + "inputs": [], + "name": "InitializationFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "name": "AccountCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "name": "account", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initData", + "type": "bytes" + } + ], + "name": "createAccount", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } ] diff --git a/packages/sdk/abis/ERC721.ts b/packages/sdk/abis/ERC721.ts index 22d506b..cf97220 100644 --- a/packages/sdk/abis/ERC721.ts +++ b/packages/sdk/abis/ERC721.ts @@ -1,27 +1,27 @@ -import { Abi } from "viem" +import { Abi } from "viem"; export const erc721Abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_from', - type: 'address', - }, - { - internalType: 'address', - name: '_to', - type: 'address', - }, - { - internalType: 'uint256', - name: '_tokenId', - type: 'uint256', - }, - ], - name: 'safeTransferFrom', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as Abi \ No newline at end of file + { + inputs: [ + { + internalType: "address", + name: "_from", + type: "address", + }, + { + internalType: "address", + name: "_to", + type: "address", + }, + { + internalType: "uint256", + name: "_tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as Abi; diff --git a/packages/sdk/abis/IERC6551AccountV2.json b/packages/sdk/abis/IERC6551AccountV2.json index 99406dc..6d97eb4 100644 --- a/packages/sdk/abis/IERC6551AccountV2.json +++ b/packages/sdk/abis/IERC6551AccountV2.json @@ -1,109 +1,109 @@ [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "TransactionExecuted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "executeCall", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "nonce", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "TransactionExecuted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "executeCall", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "nonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } ] diff --git a/packages/sdk/abis/MultiCallAuthenticated.ts b/packages/sdk/abis/MultiCallAuthenticated.ts index 1531208..d42587e 100644 --- a/packages/sdk/abis/MultiCallAuthenticated.ts +++ b/packages/sdk/abis/MultiCallAuthenticated.ts @@ -1,238 +1,240 @@ -import { Abi } from 'viem' +import { Abi } from "viem"; export const multicall3AuthenticatedABI = [ - { - inputs: [ - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Call[]', - name: 'calls', - type: 'tuple[]', - }, - ], - name: 'aggregate', - outputs: [ - { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, - { internalType: 'bytes[]', name: 'returnData', type: 'bytes[]' }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bool', name: 'allowFailure', type: 'bool' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Call3[]', - name: 'calls', - type: 'tuple[]', - }, - ], - name: 'aggregate3', - outputs: [ - { - components: [ - { internalType: 'bool', name: 'success', type: 'bool' }, - { internalType: 'bytes', name: 'returnData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Result[]', - name: 'returnData', - type: 'tuple[]', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bool', name: 'allowFailure', type: 'bool' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Call3Value[]', - name: 'calls', - type: 'tuple[]', - }, - ], - name: 'aggregate3Value', - outputs: [ - { - components: [ - { internalType: 'bool', name: 'success', type: 'bool' }, - { internalType: 'bytes', name: 'returnData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Result[]', - name: 'returnData', - type: 'tuple[]', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Call[]', - name: 'calls', - type: 'tuple[]', - }, - ], - name: 'blockAndAggregate', - outputs: [ - { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, - { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' }, - { - components: [ - { internalType: 'bool', name: 'success', type: 'bool' }, - { internalType: 'bytes', name: 'returnData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Result[]', - name: 'returnData', - type: 'tuple[]', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'getBasefee', - outputs: [{ internalType: 'uint256', name: 'basefee', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' }], - name: 'getBlockHash', - outputs: [{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getBlockNumber', - outputs: [{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getChainId', - outputs: [{ internalType: 'uint256', name: 'chainid', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getCurrentBlockCoinbase', - outputs: [{ internalType: 'address', name: 'coinbase', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getCurrentBlockDifficulty', - outputs: [{ internalType: 'uint256', name: 'difficulty', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getCurrentBlockGasLimit', - outputs: [{ internalType: 'uint256', name: 'gaslimit', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getCurrentBlockTimestamp', - outputs: [{ internalType: 'uint256', name: 'timestamp', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'addr', type: 'address' }], - name: 'getEthBalance', - outputs: [{ internalType: 'uint256', name: 'balance', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getLastBlockHash', - outputs: [{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bool', name: 'requireSuccess', type: 'bool' }, - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Call[]', - name: 'calls', - type: 'tuple[]', - }, - ], - name: 'tryAggregate', - outputs: [ - { - components: [ - { internalType: 'bool', name: 'success', type: 'bool' }, - { internalType: 'bytes', name: 'returnData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Result[]', - name: 'returnData', - type: 'tuple[]', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bool', name: 'requireSuccess', type: 'bool' }, - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Call[]', - name: 'calls', - type: 'tuple[]', - }, - ], - name: 'tryBlockAndAggregate', - outputs: [ - { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, - { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' }, - { - components: [ - { internalType: 'bool', name: 'success', type: 'bool' }, - { internalType: 'bytes', name: 'returnData', type: 'bytes' }, - ], - internalType: 'struct Multicall3.Result[]', - name: 'returnData', - type: 'tuple[]', - }, - ], - stateMutability: 'payable', - type: 'function', - }, -] as Abi + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate", + outputs: [ + { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: "bytes[]", name: "returnData", type: "bytes[]" }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bool", name: "allowFailure", type: "bool" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call3[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate3", + outputs: [ + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bool", name: "allowFailure", type: "bool" }, + { internalType: "uint256", name: "value", type: "uint256" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call3Value[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate3Value", + outputs: [ + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "blockAndAggregate", + outputs: [ + { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: "bytes32", name: "blockHash", type: "bytes32" }, + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "getBasefee", + outputs: [{ internalType: "uint256", name: "basefee", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }], + name: "getBlockHash", + outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getBlockNumber", + outputs: [ + { internalType: "uint256", name: "blockNumber", type: "uint256" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getChainId", + outputs: [{ internalType: "uint256", name: "chainid", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockCoinbase", + outputs: [{ internalType: "address", name: "coinbase", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockDifficulty", + outputs: [{ internalType: "uint256", name: "difficulty", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockGasLimit", + outputs: [{ internalType: "uint256", name: "gaslimit", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockTimestamp", + outputs: [{ internalType: "uint256", name: "timestamp", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "addr", type: "address" }], + name: "getEthBalance", + outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getLastBlockHash", + outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bool", name: "requireSuccess", type: "bool" }, + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "tryAggregate", + outputs: [ + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "bool", name: "requireSuccess", type: "bool" }, + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "tryBlockAndAggregate", + outputs: [ + { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: "bytes32", name: "blockHash", type: "bytes32" }, + { + components: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "returnData", type: "bytes" }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, +] as Abi; diff --git a/packages/sdk/abis/index.ts b/packages/sdk/abis/index.ts index 0fb9595..9189503 100644 --- a/packages/sdk/abis/index.ts +++ b/packages/sdk/abis/index.ts @@ -1,15 +1,15 @@ -import erc6551RegistryAbiV2 from './ERC6551RegistryV2.json' -import erc6551AccountAbiV2 from './IERC6551AccountV2.json' -import { erc1155Abi } from './ERC1155' -import { erc721Abi } from './ERC721' -import { erc20Abi } from './ERC20' -import { multicall3AuthenticatedABI } from './MultiCallAuthenticated' +import erc6551RegistryAbiV2 from "./ERC6551RegistryV2.json"; +import erc6551AccountAbiV2 from "./IERC6551AccountV2.json"; +import { erc1155Abi } from "./ERC1155"; +import { erc721Abi } from "./ERC721"; +import { erc20Abi } from "./ERC20"; +import { multicall3AuthenticatedABI } from "./MultiCallAuthenticated"; export { - erc6551RegistryAbiV2, - erc6551AccountAbiV2, - erc1155Abi, - erc721Abi, - erc20Abi, - multicall3AuthenticatedABI, -} + erc6551RegistryAbiV2, + erc6551AccountAbiV2, + erc1155Abi, + erc721Abi, + erc20Abi, + multicall3AuthenticatedABI, +}; diff --git a/packages/sdk/package.json b/packages/sdk/package.json index de1d4e1..834cdd9 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,66 +1,61 @@ { - "name": "@tokenbound/sdk", - "version": "0.5.4", - "type": "module", - "files": [ - "dist" - ], - "types": "./dist/src/index.d.ts", - "main": "./dist/tokenbound-sdk.umd.cjs", - "module": "./dist/tokenbound-sdk.js", - "exports": { - ".": { - "import": "./dist/tokenbound-sdk.js", - "require": "./dist/tokenbound-sdk.umd.cjs", - "types": "./dist/src/index.d.ts" - } - }, - "scripts": { - "dev": "vite", - "build": "tsc && vite build", - "preview": "vite preview", - "test": "vitest --watch=false", - "coverage": "vitest run --coverage", - "clean": "rm -rf node_modules/ dist/", - "wagmi": "wagmi generate", - "prep": "pnpm clean && pnpm i && pnpm wagmi && pnpm build" - }, - "dependencies": { - "@layerzerolabs/lz-v2-utilities": "^2.3.7", - "viem": "^2.10.5" - }, - "devDependencies": { - "@ianvs/prettier-plugin-sort-imports": "^4.2.1", - "@tanstack/react-query": "4.29.1", - "@testing-library/dom": "^10.1.0", - "@testing-library/jest-dom": "^6.4.2", - "@testing-library/react": "^15.0.4", - "@testing-library/user-event": "^14.5.2", - "@tokenbound/sdk": "workspace:^", - "@types/react": "^18.3.2", - "@types/testing-library__jest-dom": "^5.14.9", - "@typescript-eslint/eslint-plugin": "^7.7.1", - "@typescript-eslint/parser": "^7.9.0", - "@viem/anvil": "^0.0.10", - "@vitest/coverage-c8": "^0.33.0", - "@wagmi/cli": "^1.5.2", - "connectkit": "^1.7.3", - "eslint": "^9.1.1", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-unused-imports": "^3.1.0", - "ethers": "^5.7.2", - "prettier": "^2.8.8", - "forge-std": "1.1.2", - "ethers6": "npm:ethers@^6.12.1", - "jsdom": "^24.0.0", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "typescript": "^5.4.5", - "viem": "^2.10.5", - "wagmi": "^2.8.7", - "vite": "^4.4.9", - "vite-plugin-dts": "^3.9.0", - "vitest": "^1.6.0", - "rollup-plugin-visualizer": "^5.12.0" - } + "name": "@tokenbound/sdk", + "version": "0.5.4", + "type": "module", + "files": ["dist"], + "types": "./dist/src/index.d.ts", + "main": "./dist/tokenbound-sdk.umd.cjs", + "module": "./dist/tokenbound-sdk.js", + "exports": { + ".": { + "import": "./dist/tokenbound-sdk.js", + "require": "./dist/tokenbound-sdk.umd.cjs", + "types": "./dist/src/index.d.ts" + } + }, + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", + "test": "vitest --watch=false", + "coverage": "vitest run --coverage", + "clean": "rm -rf node_modules/ dist/", + "wagmi": "wagmi generate", + "prep": "pnpm clean && pnpm i && pnpm wagmi && pnpm build", + "lint": "biome lint .", + "lint:fix": "biome lint --write --unsafe .", + "format": "biome format .", + "format:fix": "biome format --write ." + }, + "dependencies": { + "@layerzerolabs/lz-v2-utilities": "^2.3.7", + "viem": "^2.21.32" + }, + "devDependencies": { + "@biomejs/biome": "1.9.4", + "@tanstack/react-query": "^5.59.15", + "@testing-library/dom": "^10.1.0", + "@testing-library/jest-dom": "^6.4.2", + "@testing-library/react": "^15.0.4", + "@testing-library/user-event": "^14.5.2", + "@tokenbound/sdk": "workspace:^", + "@types/react": "^18.3.11", + "@types/testing-library__jest-dom": "^5.14.9", + "@viem/anvil": "^0.0.10", + "@vitest/coverage-c8": "^0.33.0", + "@wagmi/cli": "^2.1.16", + "ethers": "^5.7.2", + "forge-std": "1.1.2", + "ethers6": "npm:ethers@^6.12.1", + "jsdom": "^24.0.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "typescript": "^5.4.5", + "viem": "^2.21.32", + "wagmi": "^2.12.20", + "vite": "^4.4.9", + "vite-plugin-dts": "^3.9.0", + "vitest": "^1.6.0", + "rollup-plugin-visualizer": "^5.12.0" + } } diff --git a/packages/sdk/src/TokenboundClient.ts b/packages/sdk/src/TokenboundClient.ts index f27fdd1..efe6470 100644 --- a/packages/sdk/src/TokenboundClient.ts +++ b/packages/sdk/src/TokenboundClient.ts @@ -1,833 +1,897 @@ import { - WalletClient, - PublicClient, - Chain, - createPublicClient, - http, - GetBytecodeReturnType, - hexToNumber, - getAddress, - encodeFunctionData, - parseUnits, - SignableMessage, - isAddressEqual, - numberToHex, - custom, -} from 'viem' -import { erc1155Abi, erc721Abi, erc20Abi, multicall3AuthenticatedABI } from '../abis' + WalletClient, + PublicClient, + Chain, + createPublicClient, + http, + GetBytecodeReturnType, + hexToNumber, + getAddress, + encodeFunctionData, + parseUnits, + SignableMessage, + isAddressEqual, + numberToHex, + custom, +} from "viem"; import { - getAccount, - computeAccount, - createAccount, - getCreationCode, - prepareExecuteCall, - executeCall, - prepareCreateAccount, - getTokenboundV3Account, - prepareCreateTokenboundV3Account, - encodeCrossChainCall, -} from './functions' + erc1155Abi, + erc721Abi, + erc20Abi, + multicall3AuthenticatedABI, +} from "../abis"; import { - AbstractEthersSigner, - AbstractEthersTransactionResponse, - BytecodeParams, - CreateAccountParams, - ERC20TransferParams, - SignMessageParams, - ETHTransferParams, - ExecuteCallParams, - GetAccountParams, - NFTTokenType, - NFTTransferParams, - TBVersion, - PrepareCreateAccountParams, - PrepareExecuteCallParams, - SegmentedERC6551Bytecode, - TokenboundAccountNFT, - TokenboundClientOptions, - EthersSignableMessage, - ExecuteParams, - CALL_OPERATIONS, - PrepareExecutionParams, - ValidSignerParams, - MultiCallTx, - CallData, -} from './types' + getAccount, + computeAccount, + createAccount, + getCreationCode, + prepareExecuteCall, + executeCall, + prepareCreateAccount, + getTokenboundV3Account, + prepareCreateTokenboundV3Account, + encodeCrossChainCall, +} from "./functions"; import { - chainIdToChain, - segmentBytecode, - normalizeMessage, - isEthers5SignableMessage, - isEthers6SignableMessage, - isViemSignableMessage, - resolvePossibleENS, - getImplementationName, -} from './utils' + AbstractEthersSigner, + AbstractEthersTransactionResponse, + BytecodeParams, + CreateAccountParams, + ERC20TransferParams, + SignMessageParams, + ETHTransferParams, + ExecuteCallParams, + GetAccountParams, + NFTTokenType, + NFTTransferParams, + TBVersion, + PrepareCreateAccountParams, + PrepareExecuteCallParams, + SegmentedERC6551Bytecode, + TokenboundAccountNFT, + TokenboundClientOptions, + EthersSignableMessage, + ExecuteParams, + CALL_OPERATIONS, + PrepareExecutionParams, + ValidSignerParams, + MultiCallTx, + CallData, +} from "./types"; import { - ERC_6551_DEFAULT, - ERC_6551_LEGACY_V2, - MULTICALL_AUTHENTICATED_ADDRESS, -} from './constants' -import { version as TB_SDK_VERSION } from '../package.json' + chainIdToChain, + segmentBytecode, + normalizeMessage, + isEthers5SignableMessage, + isEthers6SignableMessage, + isViemSignableMessage, + resolvePossibleENS, + getImplementationName, +} from "./utils"; +import { + ERC_6551_DEFAULT, + ERC_6551_LEGACY_V2, + MULTICALL_AUTHENTICATED_ADDRESS, +} from "./constants"; +import { version as TB_SDK_VERSION } from "../package.json"; declare global { - interface Window { - tokenboundSDK?: string - } + interface Window { + tokenboundSDK?: string; + } } class TokenboundClient { - private chainId: number - private chain: Chain - public isInitialized: boolean = false - public publicClient: PublicClient - private supportsV3: boolean = true // Default to V3 implementation - private signer?: AbstractEthersSigner - private walletClient?: WalletClient - private implementationAddress: `0x${string}` - private registryAddress: `0x${string}` - - constructor(options: TokenboundClientOptions) { - const { - chainId, - chain, - signer, - walletClient, - publicClient, - implementationAddress, - registryAddress, - publicClientRPCUrl, - version, - } = options - - if (!chainId && !chain) { - throw new Error('chain or chainId required.') - } - - if (signer && walletClient) { - throw new Error('Only one of `signer` or `walletClient` should be provided.') - } - - if (publicClient && publicClientRPCUrl) { - throw new Error( - 'Only one of `publicClient` or `publicClientRPCUrl` should be provided.' - ) - } - - this.chainId = chainId ?? chain!.id - this.chain = chain ?? chainIdToChain(this.chainId) - - if (signer) { - this.signer = signer - } else if (walletClient) { - this.walletClient = walletClient - } - - // Use a custom publicClient if provided - // If a walletClient is provided, use its transport so publicClient can share the connection - // Otherwise create a new one, specifying a custom RPC URL if provided but defaulting to the default viem http() RPC URL - this.publicClient = - publicClient ?? - createPublicClient({ - chain: this.chain, - transport: - walletClient && !publicClientRPCUrl - ? custom(walletClient.transport) - : http(publicClientRPCUrl ?? undefined), - }) - - this.registryAddress = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS - this.implementationAddress = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS - - // If legacy V2 implementation is in use, use V2 registry (unless custom registry is provided) - const isV2 = - (version && version === TBVersion.V2) || - (implementationAddress && - isAddressEqual(implementationAddress, ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS)) - - if (isV2) { - this.supportsV3 = false - if (!registryAddress) this.registryAddress = ERC_6551_LEGACY_V2.REGISTRY.ADDRESS - } - - this.isInitialized = true - - if (typeof window !== 'undefined') { - const implementationName = getImplementationName(implementationAddress) - window.tokenboundSDK = `Tokenbound SDK ${TB_SDK_VERSION} - ${implementationName}` - } - } - - /** - * Returns the SDK's package version. - * @returns The version of the SDK. - */ - public getSDKVersion(): string { - return TB_SDK_VERSION - } - - /** - * Returns the tokenbound account address for a given token contract and token ID. - * @param {`0x${string}`} params.tokenContract The address of the token contract. - * @param {string} params.tokenId The token ID. - * @returns The tokenbound account address. - */ - public getAccount(params: GetAccountParams): `0x${string}` { - const { tokenContract, tokenId, salt = 0, chainId = this.chainId } = params - - try { - const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount - return getAcct( - tokenContract, - tokenId, - chainId, - this.implementationAddress, - this.registryAddress, - salt - ) - } catch (error) { - throw error - } - } - - /** - * Returns the prepared transaction to create a tokenbound account for a given token contract and token ID. - * @param {`0x${string}`} params.tokenContract The address of the token contract. - * @param {string} params.tokenId The token ID. - * @returns The prepared transaction to create a tokenbound account. Can be sent via `sendTransaction` on an Ethers signer or viem WalletClient. - */ - public async prepareCreateAccount( - params: PrepareCreateAccountParams - ): Promise { - const { - tokenContract, - tokenId, - salt = 0, - chainId = this.chainId, - appendedCalls = [], - } = params - - const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount - - const computedAcct = getAcct( - tokenContract, - tokenId, - chainId, - this.implementationAddress, - this.registryAddress, - salt - ) - - const isCustomImplementation = ![ - ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS, - ERC_6551_DEFAULT.IMPLEMENTATION.ADDRESS, - ].includes(getAddress(this.implementationAddress)) - - const prepareBasicCreateAccount = this.supportsV3 - ? prepareCreateTokenboundV3Account - : prepareCreateAccount - - const preparedBasicCreateAccount = await prepareBasicCreateAccount( - tokenContract, - tokenId, - chainId, - this.implementationAddress, - this.registryAddress, - salt - ) - - if (appendedCalls.length > 0 && (!this.supportsV3 || isCustomImplementation)) { - throw new Error( - 'Multicall via appendedCalls is not supported using the legacy V2 implementation or custom implementations' - ) - } - - if (isCustomImplementation) { - // Don't initialize for custom implementations. Allow third-party handling of initialization. - return preparedBasicCreateAccount - } else { - // For standard implementations, use the multicall3 aggregate function to create and initialize the account in one transaction - return { - to: MULTICALL_AUTHENTICATED_ADDRESS, - value: BigInt(0), - data: encodeFunctionData({ - abi: multicall3AuthenticatedABI, - functionName: 'aggregate3', - args: [ - [ - { - target: this.registryAddress, - allowFailure: false, - callData: preparedBasicCreateAccount.data, - }, - { - target: computedAcct, - allowFailure: false, - callData: encodeFunctionData({ - abi: ERC_6551_DEFAULT.ACCOUNT_PROXY?.ABI!, - functionName: 'initialize', - args: [ERC_6551_DEFAULT.IMPLEMENTATION!.ADDRESS], - }), - }, - // Append Multicall3 calls, so the newly-created Tokenbound account - // can be used to execute calls immediately after creation - ...appendedCalls, - ], - ], - }), - } as MultiCallTx - } - } - - /** - * Returns the transaction hash of the transaction that created the tokenbound account for a given token contract and token ID. - * @param {`0x${string}`} params.tokenContract The address of the token contract. - * @param {string} params.tokenId The token ID. - * @returns a Promise that resolves to the account address of the created tokenbound account. - */ - public async createAccount( - params: CreateAccountParams - ): Promise<{ account: `0x${string}`; txHash: `0x${string}` }> { - const { - tokenContract, - tokenId, - salt = 0, - chainId = this.chainId, - appendedCalls = [], - } = params - - try { - let txHash: `0x${string}` | undefined - - const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount - - const computedAcct = getAcct( - tokenContract, - tokenId, - chainId, - this.implementationAddress, - this.registryAddress, - salt - ) - - const preparedCreateAccount = await this.prepareCreateAccount({ - tokenContract, - tokenId, - chainId, - salt, - appendedCalls, - }) - - if (this.signer) { - txHash = (await this.signer - .sendTransaction(preparedCreateAccount) - .then((tx: AbstractEthersTransactionResponse) => tx.hash)) as `0x${string}` - } else if (this.walletClient) { - txHash = this.supportsV3 - ? await this.walletClient.sendTransaction({ - ...preparedCreateAccount, - chain: this.chain, - account: this.walletClient?.account?.address!, - }) // @BJ TODO: extract into viemV3? - : await createAccount( - tokenContract, - tokenId, - this.walletClient, - this.implementationAddress, - this.registryAddress, - salt, - chainId - ) - } - - if (txHash) { - return { - account: computedAcct, - txHash, - } - } else { - throw new Error('No wallet client or signer available.') - } - } catch (error) { - throw error - } - } - - /** - * Returns prepared transaction to execute a call on a tokenbound account - * @param {string} params.account The tokenbound account address - * @param {string} params.to The recipient address - * @param {bigint} params.value The value to send, in wei - * @param {string} params.data The data to send - * @returns a Promise with prepared transaction to execute a call on a tokenbound account. Can be sent via `sendTransaction` on a viem WalletClient or Ethers signer. - * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use prepareExecute() instead. - */ - public async prepareExecuteCall(params: PrepareExecuteCallParams): Promise { - if (this.supportsV3) { - throw new Error( - 'prepareExecuteCall() is not supported on V3 implementation deployments, use prepareExecute() instead.' - ) - } - - const { account, to, value, data } = params - return prepareExecuteCall(account, to, value, data) - } - - /** - * Executes a transaction call on a tokenbound account - * @param {string} params.account The tokenbound account address - * @param {string} params.to The recipient contract address - * @param {bigint} params.value The value to send, in wei - * @param {string} params.data The data to send - * @returns a Promise that resolves to the transaction hash of the executed call - * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use execute() instead. - */ - public async executeCall(params: ExecuteCallParams): Promise<`0x${string}`> { - const preparedExecuteCall = await this.prepareExecuteCall(params) - - if (this.supportsV3) { - throw new Error( - 'executeCall() is not supported on V3 implementation deployments, use execute() instead.' - ) - } - try { - if (this.signer) { - return (await this.signer - .sendTransaction(preparedExecuteCall) - .then((tx: AbstractEthersTransactionResponse) => tx.hash)) as `0x${string}` - } else if (this.walletClient) { - return await this.walletClient.sendTransaction({ - // chain and account need to be added explicitly - // because they're optional when instantiating a WalletClient - chain: this.chain, - account: this.walletClient.account!, - ...preparedExecuteCall, - }) - } else { - throw new Error('No wallet client or signer available.') - } - } catch (error) { - throw error - } - } - - /** - * Returns prepared transaction to execute on a tokenbound account - * @param {string} params.account The tokenbound account address - * @param {string} params.to The contract address to execute the call on - * @param {bigint} params.value The value to send, in wei - * @param {string} params.data The encoded operation calldata to send - * @returns a Promise with prepared transaction to execute on a tokenbound account. Can be sent via `sendTransaction` on a viem WalletClient or Ethers signer. - */ - public async prepareExecution(params: PrepareExecutionParams): Promise { - // operation?: CallOperation // The type of operation to perform ( CALL: 0, DELEGATECALL: 1, CREATE: 2, CREATE2: 3) - const { account, to, value, data, chainId = this.chainId } = params - const operation = CALL_OPERATIONS.CALL - - if (!this.supportsV3) { - // const { operation, ...rest } = params - return await this.prepareExecuteCall(params) - } - - let executionArgs = [to, value, data, operation] - let executionValue = 0n - - // Handle cross-chain call encoding - if (this.chainId !== chainId) { - const { - to: crossChainTo, - value: crossChainValue, - data: crossChainData, - } = await encodeCrossChainCall({ - publicClient: this.publicClient, - account, - to, - value, - data: data as `0x${string}`, - originChainId: this.chainId, - destinationChainId: chainId, - }) - - executionArgs = [crossChainTo, crossChainValue, crossChainData, operation] - executionValue = crossChainValue - } - - const executionData = encodeFunctionData({ - abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, - functionName: 'execute', - args: executionArgs, - }) - - return { - to: account, - value: executionValue, - data: executionData, - } - } - - /** - * Executes a transaction call on a tokenbound account - * @param {string} params.account The tokenbound account address - * @param {string} params.to The contract address to execute the call on - * @param {bigint} params.value The value to send, in wei - * @param {string} params.data The encoded operation calldata to send - * @returns a Promise that resolves to the transaction hash of the executed call - */ - public async execute(params: ExecuteParams): Promise<`0x${string}`> { - try { - if (!this.supportsV3) { - // const { operation, ...rest } = params - return await this.executeCall(params) - } - - const preparedExecution = await this.prepareExecution(params) - - if (this.signer) { - return (await this.signer - .sendTransaction(preparedExecution) - .then((tx: AbstractEthersTransactionResponse) => tx.hash)) as `0x${string}` - } else if (this.walletClient) { - return await this.walletClient.sendTransaction({ - // chain and account need to be added explicitly - // because they're optional when instantiating a WalletClient - chain: this.chain, - account: this.walletClient.account!, - ...preparedExecution, - }) - } else { - throw new Error('No wallet client or signer available.') - } - } catch (error) { - throw error - } - } - - /** - * Check if a tokenbound account is a valid signer for a transaction - * @param {string} params.account The tokenbound account address - * @returns a Promise that resolves to true if the account is a valid signer, otherwise false - */ - public async isValidSigner({ account }: ValidSignerParams): Promise { - const { signer, walletClient } = this - const data = numberToHex(0, { size: 32 }) - const VALID_SIGNER_MAGIC_VALUE = '0x523e3260' // isValidSigner MUST return this bytes4 magic value if the given signer is valid - const walletAddress: `0x${string}` = walletClient?.account?.address ?? signer?.address - - try { - if (!signer && !walletClient) { - throw new Error('No signer or wallet client available.') - } - - if (!this.supportsV3) { - throw new Error('isValidSigner is not supported using the V2 implementation') - } - - const validityCheck = await this.publicClient.readContract({ - address: account, - abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, - functionName: 'isValidSigner', - args: [walletAddress, data], - }) - - return validityCheck === VALID_SIGNER_MAGIC_VALUE - } catch (error) { - throw error - } - } - - /** - * Check if a tokenbound account has been deployed - * @param {string} params.accountAddress The tokenbound account address - * @returns a Promise that resolves to true if the account is deployed, otherwise false - */ - public async checkAccountDeployment({ - accountAddress, - }: BytecodeParams): Promise { - try { - return await this.publicClient - .getBytecode({ address: accountAddress }) - .then((bytecode: GetBytecodeReturnType) => { - return !!bytecode ? bytecode.length > 2 : false - }) - } catch (error) { - throw error - } - } - - /** - * Deconstructs the bytecode of a tokenbound account into its constituent parts. - * @param {`0x${string}`} params.accountAddress The address of the tokenbound account. - * @returns a Promise that resolves to a SegmentedERC6551Bytecode object, or null if the account is not deployed - */ - public async deconstructBytecode({ - accountAddress, - }: BytecodeParams): Promise { - try { - const rawBytecode = await this.publicClient.getBytecode({ address: accountAddress }) - const bytecode = rawBytecode?.slice(2) - - if (!bytecode || !rawBytecode || !(rawBytecode.length > 2)) return null - - const [ - erc1167Header, - rawImplementationAddress, - erc1167Footer, - rawSalt, - rawChainId, - rawTokenContract, - rawTokenId, - ] = segmentBytecode(bytecode, 10, 20, 15, 32, 32, 32, 32) - - const chainId = hexToNumber(`0x${rawChainId}`, { size: 32 }) - const implementationAddress: `0x${string}` = getAddress( - `0x${rawImplementationAddress}` - ) - const salt = hexToNumber(`0x${rawSalt}`, { size: 32 }) - const tokenContract: `0x${string}` = getAddress( - `0x${rawTokenContract.slice( - rawTokenContract.length - 40, - rawTokenContract.length - )}` - ) - const tokenId = hexToNumber(`0x${rawTokenId}`, { size: 32 }).toString() - - return { - erc1167Header, - implementationAddress, - erc1167Footer, - salt, - tokenId, - tokenContract, - chainId, - } - } catch (error) { - throw error - } - } - - /** - * Get NFT information from a tokenbound account - * @param {`0x${string}`} params.accountAddress The address of the tokenbound account. - * @returns a Promise that resolves to an object containing the token contract address, token ID, and chain ID - */ - public async getNFT({ accountAddress }: BytecodeParams): Promise { - try { - const deconstructedBytecode = await this.deconstructBytecode({ accountAddress }) - if (!deconstructedBytecode) - throw new Error('The tokenbound account has not been deployed at this address') - - const { chainId, tokenContract, tokenId } = deconstructedBytecode - - return { - tokenContract, - tokenId, - chainId, - } - } catch (error) { - throw error - } - } - - /** - * Executes a transaction call on a tokenbound account - * @param {string} params.account The tokenbound account address - * @param {string} params.tokenType The type of token, either 'ERC721' or 'ERC1155' - * @param {string} params.tokenContract The address of the token contract - * @param {string} params.tokenId The token ID - * @param {string} params.recipientAddress The address to which the token should be transferred - * @param {string} params.amount The amount of tokens to transfer, (eg. 1 NFT = 1). Defaults to 1. 1155 only. - * @returns a Promise that resolves to the transaction hash of the executed call - */ - public async transferNFT(params: NFTTransferParams): Promise<`0x${string}`> { - const { - account: tbAccountAddress, - tokenType, - tokenContract, - tokenId, - amount = 1, - recipientAddress, - chainId, - } = params - - const is1155: boolean = tokenType === NFTTokenType.ERC1155 - - if (!is1155 && amount !== 1) { - throw new Error('ERC721 transfers can only transfer one token at a time.') - } - - try { - const recipient = await resolvePossibleENS(this.publicClient, recipientAddress) - - // Configure required args based on token type - // ERC1155: safeTransferFrom(address,address,uint256,uint256,bytes) - // ERC721: safeTransferFrom(address,address,uint256) - const sharedArgs = [tbAccountAddress, recipient, tokenId] - const transferArgs: unknown[] = is1155 ? [...sharedArgs, amount, '0x'] : sharedArgs - - const transferCallData = encodeFunctionData({ - abi: is1155 ? erc1155Abi : erc721Abi, - functionName: 'safeTransferFrom', - args: transferArgs, - }) - - const execution = { - account: tbAccountAddress, - to: tokenContract, - value: BigInt(0), - data: transferCallData, - } - - if (this.supportsV3) { - return await this.execute({ - ...execution, - chainId, - }) - } - - return await this.executeCall(execution) - } catch (error) { - console.log(error) - throw error - } - } - - /** - * Executes an ETH transfer call on a tokenbound account - * @param {string} params.account The tokenbound account address - * @param {number} params.amount The amount of ETH to transfer, in decimal format (eg. 0.1 ETH = 0.1) - * @param {string} params.recipientAddress The address to which the ETH should be transferred - * @returns a Promise that resolves to the transaction hash of the executed call - */ - public async transferETH(params: ETHTransferParams): Promise<`0x${string}`> { - const { account: tbAccountAddress, amount, recipientAddress, chainId } = params - const weiValue = parseUnits(`${amount}`, 18) // convert ETH to wei - - try { - const recipient = await resolvePossibleENS(this.publicClient, recipientAddress) - - const execution = { - account: tbAccountAddress, - to: recipient, - value: weiValue, - data: '0x', - } - - if (this.supportsV3) { - return await this.execute({ - ...execution, - chainId, - }) - } - return await this.executeCall(execution) - } catch (err) { - console.log(err) - throw err - } - } - - /** - * Executes an ERC-20 transfer call on a tokenbound account - * @param {string} params.account The tokenbound account address - * @param {number} params.amount The amount of ERC-20 to transfer, in decimal format (eg. 0.1 USDC = 0.1) - * @param {string} params.recipientAddress The address to which the ETH should be transferred - * @param {string} params.erc20tokenAddress The address of the ERC-20 token contract - * @param {string} params.erc20tokenDecimals The decimal specification of the ERC-20 token - * @returns a Promise that resolves to the transaction hash of the executed call - */ - public async transferERC20(params: ERC20TransferParams): Promise<`0x${string}`> { - const { - account: tbAccountAddress, - amount, - recipientAddress, - erc20tokenAddress, - erc20tokenDecimals, - chainId, - } = params - - if (erc20tokenDecimals < 0 || erc20tokenDecimals > 18) - throw new Error('Decimal value out of range. Should be between 0 and 18.') - - const amountBaseUnit = parseUnits(`${amount}`, erc20tokenDecimals) - - try { - const recipient = await resolvePossibleENS(this.publicClient, recipientAddress) - - const callData = encodeFunctionData({ - abi: erc20Abi, - functionName: 'transfer', - args: [recipient, amountBaseUnit], - }) - - const execution = { - account: tbAccountAddress, - to: erc20tokenAddress, - value: 0n, - data: callData, - } - - if (this.supportsV3) { - return await this.execute({ - ...execution, - chainId, - }) - } - return await this.executeCall(execution) - } catch (error) { - console.log(error) - throw error - } - } - - /** - * Calculates an Ethereum-specific signature - * @param {string} params.message The message to be signed - * @returns a Promise that resolves to a signed Hex string - */ - public async signMessage(params: SignMessageParams): Promise<`0x${string}`> { - const { message } = params - - try { - if (this.signer) { - // Normalize message for Ethers 5 and 6 compatibility - if (!isEthers5SignableMessage && !isEthers6SignableMessage) { - throw new Error('Message is not a valid Ethers signable message.') - } - const normalizedMessage = normalizeMessage(message as EthersSignableMessage) - return await this.signer.signMessage(normalizedMessage) - } else if (this.walletClient) { - if (!isViemSignableMessage(message)) { - throw new Error('Message is not a valid viem signable message.') - } - return await this.walletClient.signMessage({ - account: this.walletClient.account!, - message: message as SignableMessage, - }) - } - throw new Error('No wallet client or signer available.') - } catch (error) { - console.log(error) - throw error - } - } + private chainId: number; + private chain: Chain; + public isInitialized: boolean = false; + public publicClient: PublicClient; + private supportsV3: boolean = true; // Default to V3 implementation + private signer?: AbstractEthersSigner; + private walletClient?: WalletClient; + private implementationAddress: `0x${string}`; + private registryAddress: `0x${string}`; + + constructor(options: TokenboundClientOptions) { + const { + chainId, + chain, + signer, + walletClient, + publicClient, + implementationAddress, + registryAddress, + publicClientRPCUrl, + version, + } = options; + + if (!chainId && !chain) { + throw new Error("chain or chainId required."); + } + + if (signer && walletClient) { + throw new Error( + "Only one of `signer` or `walletClient` should be provided.", + ); + } + + if (publicClient && publicClientRPCUrl) { + throw new Error( + "Only one of `publicClient` or `publicClientRPCUrl` should be provided.", + ); + } + + this.chainId = chainId ?? chain!.id; + this.chain = chain ?? chainIdToChain(this.chainId); + + if (signer) { + this.signer = signer; + } else if (walletClient) { + this.walletClient = walletClient; + } + + // Use a custom publicClient if provided + // If a walletClient is provided, use its transport so publicClient can share the connection + // Otherwise create a new one, specifying a custom RPC URL if provided but defaulting to the default viem http() RPC URL + this.publicClient = + publicClient ?? + createPublicClient({ + chain: this.chain, + transport: + walletClient && !publicClientRPCUrl + ? custom(walletClient.transport) + : http(publicClientRPCUrl ?? undefined), + }); + + this.registryAddress = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS; + this.implementationAddress = + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS; + + // If legacy V2 implementation is in use, use V2 registry (unless custom registry is provided) + const isV2 = + (version && version === TBVersion.V2) || + (implementationAddress && + isAddressEqual( + implementationAddress, + ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS, + )); + + if (isV2) { + this.supportsV3 = false; + if (!registryAddress) + this.registryAddress = ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; + } + + this.isInitialized = true; + + if (typeof window !== "undefined") { + const implementationName = getImplementationName(implementationAddress); + window.tokenboundSDK = `Tokenbound SDK ${TB_SDK_VERSION} - ${implementationName}`; + } + } + + /** + * Returns the SDK's package version. + * @returns The version of the SDK. + */ + public getSDKVersion(): string { + return TB_SDK_VERSION; + } + + /** + * Returns the tokenbound account address for a given token contract and token ID. + * @param {`0x${string}`} params.tokenContract The address of the token contract. + * @param {string} params.tokenId The token ID. + * @returns The tokenbound account address. + */ + public getAccount(params: GetAccountParams): `0x${string}` { + const { tokenContract, tokenId, salt = 0, chainId = this.chainId } = params; + + try { + const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount; + return getAcct( + tokenContract, + tokenId, + chainId, + this.implementationAddress, + this.registryAddress, + salt, + ); + } catch (error) { + throw error; + } + } + + /** + * Returns the prepared transaction to create a tokenbound account for a given token contract and token ID. + * @param {`0x${string}`} params.tokenContract The address of the token contract. + * @param {string} params.tokenId The token ID. + * @returns The prepared transaction to create a tokenbound account. Can be sent via `sendTransaction` on an Ethers signer or viem WalletClient. + */ + public async prepareCreateAccount( + params: PrepareCreateAccountParams, + ): Promise { + const { + tokenContract, + tokenId, + salt = 0, + chainId = this.chainId, + appendedCalls = [], + } = params; + + const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount; + + const computedAcct = getAcct( + tokenContract, + tokenId, + chainId, + this.implementationAddress, + this.registryAddress, + salt, + ); + + const isCustomImplementation = ![ + ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS, + ERC_6551_DEFAULT.IMPLEMENTATION.ADDRESS, + ].includes(getAddress(this.implementationAddress)); + + const prepareBasicCreateAccount = this.supportsV3 + ? prepareCreateTokenboundV3Account + : prepareCreateAccount; + + const preparedBasicCreateAccount = await prepareBasicCreateAccount( + tokenContract, + tokenId, + chainId, + this.implementationAddress, + this.registryAddress, + salt, + ); + + if ( + appendedCalls.length > 0 && + (!this.supportsV3 || isCustomImplementation) + ) { + throw new Error( + "Multicall via appendedCalls is not supported using the legacy V2 implementation or custom implementations", + ); + } + + if (isCustomImplementation) { + // Don't initialize for custom implementations. Allow third-party handling of initialization. + return preparedBasicCreateAccount; + } else { + // For standard implementations, use the multicall3 aggregate function to create and initialize the account in one transaction + return { + to: MULTICALL_AUTHENTICATED_ADDRESS, + value: BigInt(0), + data: encodeFunctionData({ + abi: multicall3AuthenticatedABI, + functionName: "aggregate3", + args: [ + [ + { + target: this.registryAddress, + allowFailure: false, + callData: preparedBasicCreateAccount.data, + }, + { + target: computedAcct, + allowFailure: false, + callData: encodeFunctionData({ + abi: ERC_6551_DEFAULT.ACCOUNT_PROXY?.ABI!, + functionName: "initialize", + args: [ERC_6551_DEFAULT.IMPLEMENTATION!.ADDRESS], + }), + }, + // Append Multicall3 calls, so the newly-created Tokenbound account + // can be used to execute calls immediately after creation + ...appendedCalls, + ], + ], + }), + } as MultiCallTx; + } + } + + /** + * Returns the transaction hash of the transaction that created the tokenbound account for a given token contract and token ID. + * @param {`0x${string}`} params.tokenContract The address of the token contract. + * @param {string} params.tokenId The token ID. + * @returns a Promise that resolves to the account address of the created tokenbound account. + */ + public async createAccount( + params: CreateAccountParams, + ): Promise<{ account: `0x${string}`; txHash: `0x${string}` }> { + const { + tokenContract, + tokenId, + salt = 0, + chainId = this.chainId, + appendedCalls = [], + } = params; + + try { + let txHash: `0x${string}` | undefined; + + const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount; + + const computedAcct = getAcct( + tokenContract, + tokenId, + chainId, + this.implementationAddress, + this.registryAddress, + salt, + ); + + const preparedCreateAccount = await this.prepareCreateAccount({ + tokenContract, + tokenId, + chainId, + salt, + appendedCalls, + }); + + if (this.signer) { + txHash = (await this.signer + .sendTransaction(preparedCreateAccount) + .then( + (tx: AbstractEthersTransactionResponse) => tx.hash, + )) as `0x${string}`; + } else if (this.walletClient) { + txHash = this.supportsV3 + ? await this.walletClient.sendTransaction({ + ...preparedCreateAccount, + chain: this.chain, + account: this.walletClient?.account?.address!, + }) // @BJ TODO: extract into viemV3? + : await createAccount( + tokenContract, + tokenId, + this.walletClient, + this.implementationAddress, + this.registryAddress, + salt, + chainId, + ); + } + + if (txHash) { + return { + account: computedAcct, + txHash, + }; + } else { + throw new Error("No wallet client or signer available."); + } + } catch (error) { + throw error; + } + } + + /** + * Returns prepared transaction to execute a call on a tokenbound account + * @param {string} params.account The tokenbound account address + * @param {string} params.to The recipient address + * @param {bigint} params.value The value to send, in wei + * @param {string} params.data The data to send + * @returns a Promise with prepared transaction to execute a call on a tokenbound account. Can be sent via `sendTransaction` on a viem WalletClient or Ethers signer. + * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use prepareExecute() instead. + */ + public async prepareExecuteCall( + params: PrepareExecuteCallParams, + ): Promise { + if (this.supportsV3) { + throw new Error( + "prepareExecuteCall() is not supported on V3 implementation deployments, use prepareExecute() instead.", + ); + } + + const { account, to, value, data } = params; + return prepareExecuteCall(account, to, value, data); + } + + /** + * Executes a transaction call on a tokenbound account + * @param {string} params.account The tokenbound account address + * @param {string} params.to The recipient contract address + * @param {bigint} params.value The value to send, in wei + * @param {string} params.data The data to send + * @returns a Promise that resolves to the transaction hash of the executed call + * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use execute() instead. + */ + public async executeCall(params: ExecuteCallParams): Promise<`0x${string}`> { + const preparedExecuteCall = await this.prepareExecuteCall(params); + + if (this.supportsV3) { + throw new Error( + "executeCall() is not supported on V3 implementation deployments, use execute() instead.", + ); + } + try { + if (this.signer) { + return (await this.signer + .sendTransaction(preparedExecuteCall) + .then( + (tx: AbstractEthersTransactionResponse) => tx.hash, + )) as `0x${string}`; + } else if (this.walletClient) { + return await this.walletClient.sendTransaction({ + // chain and account need to be added explicitly + // because they're optional when instantiating a WalletClient + chain: this.chain, + account: this.walletClient.account!, + ...preparedExecuteCall, + }); + } else { + throw new Error("No wallet client or signer available."); + } + } catch (error) { + throw error; + } + } + + /** + * Returns prepared transaction to execute on a tokenbound account + * @param {string} params.account The tokenbound account address + * @param {string} params.to The contract address to execute the call on + * @param {bigint} params.value The value to send, in wei + * @param {string} params.data The encoded operation calldata to send + * @returns a Promise with prepared transaction to execute on a tokenbound account. Can be sent via `sendTransaction` on a viem WalletClient or Ethers signer. + */ + public async prepareExecution( + params: PrepareExecutionParams, + ): Promise { + // operation?: CallOperation // The type of operation to perform ( CALL: 0, DELEGATECALL: 1, CREATE: 2, CREATE2: 3) + const { account, to, value, data, chainId = this.chainId } = params; + const operation = CALL_OPERATIONS.CALL; + + if (!this.supportsV3) { + // const { operation, ...rest } = params + return await this.prepareExecuteCall(params); + } + + let executionArgs = [to, value, data, operation]; + let executionValue = 0n; + + // Handle cross-chain call encoding + if (this.chainId !== chainId) { + const { + to: crossChainTo, + value: crossChainValue, + data: crossChainData, + } = await encodeCrossChainCall({ + publicClient: this.publicClient, + account, + to, + value, + data: data as `0x${string}`, + originChainId: this.chainId, + destinationChainId: chainId, + }); + + executionArgs = [ + crossChainTo, + crossChainValue, + crossChainData, + operation, + ]; + executionValue = crossChainValue; + } + + const executionData = encodeFunctionData({ + abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, + functionName: "execute", + args: executionArgs, + }); + + return { + to: account, + value: executionValue, + data: executionData, + }; + } + + /** + * Executes a transaction call on a tokenbound account + * @param {string} params.account The tokenbound account address + * @param {string} params.to The contract address to execute the call on + * @param {bigint} params.value The value to send, in wei + * @param {string} params.data The encoded operation calldata to send + * @returns a Promise that resolves to the transaction hash of the executed call + */ + public async execute(params: ExecuteParams): Promise<`0x${string}`> { + try { + if (!this.supportsV3) { + // const { operation, ...rest } = params + return await this.executeCall(params); + } + + const preparedExecution = await this.prepareExecution(params); + + if (this.signer) { + return (await this.signer + .sendTransaction(preparedExecution) + .then( + (tx: AbstractEthersTransactionResponse) => tx.hash, + )) as `0x${string}`; + } else if (this.walletClient) { + return await this.walletClient.sendTransaction({ + // chain and account need to be added explicitly + // because they're optional when instantiating a WalletClient + chain: this.chain, + account: this.walletClient.account!, + ...preparedExecution, + }); + } else { + throw new Error("No wallet client or signer available."); + } + } catch (error) { + throw error; + } + } + + /** + * Check if a tokenbound account is a valid signer for a transaction + * @param {string} params.account The tokenbound account address + * @returns a Promise that resolves to true if the account is a valid signer, otherwise false + */ + public async isValidSigner({ account }: ValidSignerParams): Promise { + const { signer, walletClient } = this; + const data = numberToHex(0, { size: 32 }); + const VALID_SIGNER_MAGIC_VALUE = "0x523e3260"; // isValidSigner MUST return this bytes4 magic value if the given signer is valid + const walletAddress: `0x${string}` = + walletClient?.account?.address ?? signer?.address; + + try { + if (!signer && !walletClient) { + throw new Error("No signer or wallet client available."); + } + + if (!this.supportsV3) { + throw new Error( + "isValidSigner is not supported using the V2 implementation", + ); + } + + const validityCheck = await this.publicClient.readContract({ + address: account, + abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, + functionName: "isValidSigner", + args: [walletAddress, data], + }); + + return validityCheck === VALID_SIGNER_MAGIC_VALUE; + } catch (error) { + throw error; + } + } + + /** + * Check if a tokenbound account has been deployed + * @param {string} params.accountAddress The tokenbound account address + * @returns a Promise that resolves to true if the account is deployed, otherwise false + */ + public async checkAccountDeployment({ + accountAddress, + }: BytecodeParams): Promise { + try { + return await this.publicClient + .getBytecode({ address: accountAddress }) + .then((bytecode: GetBytecodeReturnType) => { + return !!bytecode ? bytecode.length > 2 : false; + }); + } catch (error) { + throw error; + } + } + + /** + * Deconstructs the bytecode of a tokenbound account into its constituent parts. + * @param {`0x${string}`} params.accountAddress The address of the tokenbound account. + * @returns a Promise that resolves to a SegmentedERC6551Bytecode object, or null if the account is not deployed + */ + public async deconstructBytecode({ + accountAddress, + }: BytecodeParams): Promise { + try { + const rawBytecode = await this.publicClient.getBytecode({ + address: accountAddress, + }); + const bytecode = rawBytecode?.slice(2); + + if (!bytecode || !rawBytecode || !(rawBytecode.length > 2)) return null; + + const [ + erc1167Header, + rawImplementationAddress, + erc1167Footer, + rawSalt, + rawChainId, + rawTokenContract, + rawTokenId, + ] = segmentBytecode(bytecode, 10, 20, 15, 32, 32, 32, 32); + + const chainId = hexToNumber(`0x${rawChainId}`, { size: 32 }); + const implementationAddress: `0x${string}` = getAddress( + `0x${rawImplementationAddress}`, + ); + const salt = hexToNumber(`0x${rawSalt}`, { size: 32 }); + const tokenContract: `0x${string}` = getAddress( + `0x${rawTokenContract.slice( + rawTokenContract.length - 40, + rawTokenContract.length, + )}`, + ); + const tokenId = hexToNumber(`0x${rawTokenId}`, { size: 32 }).toString(); + + return { + erc1167Header, + implementationAddress, + erc1167Footer, + salt, + tokenId, + tokenContract, + chainId, + }; + } catch (error) { + throw error; + } + } + + /** + * Get NFT information from a tokenbound account + * @param {`0x${string}`} params.accountAddress The address of the tokenbound account. + * @returns a Promise that resolves to an object containing the token contract address, token ID, and chain ID + */ + public async getNFT({ + accountAddress, + }: BytecodeParams): Promise { + try { + const deconstructedBytecode = await this.deconstructBytecode({ + accountAddress, + }); + if (!deconstructedBytecode) + throw new Error( + "The tokenbound account has not been deployed at this address", + ); + + const { chainId, tokenContract, tokenId } = deconstructedBytecode; + + return { + tokenContract, + tokenId, + chainId, + }; + } catch (error) { + throw error; + } + } + + /** + * Executes a transaction call on a tokenbound account + * @param {string} params.account The tokenbound account address + * @param {string} params.tokenType The type of token, either 'ERC721' or 'ERC1155' + * @param {string} params.tokenContract The address of the token contract + * @param {string} params.tokenId The token ID + * @param {string} params.recipientAddress The address to which the token should be transferred + * @param {string} params.amount The amount of tokens to transfer, (eg. 1 NFT = 1). Defaults to 1. 1155 only. + * @returns a Promise that resolves to the transaction hash of the executed call + */ + public async transferNFT(params: NFTTransferParams): Promise<`0x${string}`> { + const { + account: tbAccountAddress, + tokenType, + tokenContract, + tokenId, + amount = 1, + recipientAddress, + chainId, + } = params; + + const is1155: boolean = tokenType === NFTTokenType.ERC1155; + + if (!is1155 && amount !== 1) { + throw new Error( + "ERC721 transfers can only transfer one token at a time.", + ); + } + + try { + const recipient = await resolvePossibleENS( + this.publicClient, + recipientAddress, + ); + + // Configure required args based on token type + // ERC1155: safeTransferFrom(address,address,uint256,uint256,bytes) + // ERC721: safeTransferFrom(address,address,uint256) + const sharedArgs = [tbAccountAddress, recipient, tokenId]; + const transferArgs: unknown[] = is1155 + ? [...sharedArgs, amount, "0x"] + : sharedArgs; + + const transferCallData = encodeFunctionData({ + abi: is1155 ? erc1155Abi : erc721Abi, + functionName: "safeTransferFrom", + args: transferArgs, + }); + + const execution = { + account: tbAccountAddress, + to: tokenContract, + value: BigInt(0), + data: transferCallData, + }; + + if (this.supportsV3) { + return await this.execute({ + ...execution, + chainId, + }); + } + + return await this.executeCall(execution); + } catch (error) { + console.log(error); + throw error; + } + } + + /** + * Executes an ETH transfer call on a tokenbound account + * @param {string} params.account The tokenbound account address + * @param {number} params.amount The amount of ETH to transfer, in decimal format (eg. 0.1 ETH = 0.1) + * @param {string} params.recipientAddress The address to which the ETH should be transferred + * @returns a Promise that resolves to the transaction hash of the executed call + */ + public async transferETH(params: ETHTransferParams): Promise<`0x${string}`> { + const { + account: tbAccountAddress, + amount, + recipientAddress, + chainId, + } = params; + const weiValue = parseUnits(`${amount}`, 18); // convert ETH to wei + + try { + const recipient = await resolvePossibleENS( + this.publicClient, + recipientAddress, + ); + + const execution = { + account: tbAccountAddress, + to: recipient, + value: weiValue, + data: "0x", + }; + + if (this.supportsV3) { + return await this.execute({ + ...execution, + chainId, + }); + } + return await this.executeCall(execution); + } catch (err) { + console.log(err); + throw err; + } + } + + /** + * Executes an ERC-20 transfer call on a tokenbound account + * @param {string} params.account The tokenbound account address + * @param {number} params.amount The amount of ERC-20 to transfer, in decimal format (eg. 0.1 USDC = 0.1) + * @param {string} params.recipientAddress The address to which the ETH should be transferred + * @param {string} params.erc20tokenAddress The address of the ERC-20 token contract + * @param {string} params.erc20tokenDecimals The decimal specification of the ERC-20 token + * @returns a Promise that resolves to the transaction hash of the executed call + */ + public async transferERC20( + params: ERC20TransferParams, + ): Promise<`0x${string}`> { + const { + account: tbAccountAddress, + amount, + recipientAddress, + erc20tokenAddress, + erc20tokenDecimals, + chainId, + } = params; + + if (erc20tokenDecimals < 0 || erc20tokenDecimals > 18) + throw new Error( + "Decimal value out of range. Should be between 0 and 18.", + ); + + const amountBaseUnit = parseUnits(`${amount}`, erc20tokenDecimals); + + try { + const recipient = await resolvePossibleENS( + this.publicClient, + recipientAddress, + ); + + const callData = encodeFunctionData({ + abi: erc20Abi, + functionName: "transfer", + args: [recipient, amountBaseUnit], + }); + + const execution = { + account: tbAccountAddress, + to: erc20tokenAddress, + value: 0n, + data: callData, + }; + + if (this.supportsV3) { + return await this.execute({ + ...execution, + chainId, + }); + } + return await this.executeCall(execution); + } catch (error) { + console.log(error); + throw error; + } + } + + /** + * Calculates an Ethereum-specific signature + * @param {string} params.message The message to be signed + * @returns a Promise that resolves to a signed Hex string + */ + public async signMessage(params: SignMessageParams): Promise<`0x${string}`> { + const { message } = params; + + try { + if (this.signer) { + // Normalize message for Ethers 5 and 6 compatibility + if (!isEthers5SignableMessage && !isEthers6SignableMessage) { + throw new Error("Message is not a valid Ethers signable message."); + } + const normalizedMessage = normalizeMessage( + message as EthersSignableMessage, + ); + return await this.signer.signMessage(normalizedMessage); + } else if (this.walletClient) { + if (!isViemSignableMessage(message)) { + throw new Error("Message is not a valid viem signable message."); + } + return await this.walletClient.signMessage({ + account: this.walletClient.account!, + message: message as SignableMessage, + }); + } + throw new Error("No wallet client or signer available."); + } catch (error) { + console.log(error); + throw error; + } + } } -const erc6551AccountAbiV2 = ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI -const erc6551RegistryAbiV2 = ERC_6551_LEGACY_V2.REGISTRY.ABI -const erc6551AccountAbiV3 = ERC_6551_DEFAULT.IMPLEMENTATION.ABI -const erc6551AccountProxyAbiV3 = ERC_6551_DEFAULT.ACCOUNT_PROXY!.ABI -const erc6551RegistryAbiV3 = ERC_6551_DEFAULT.REGISTRY.ABI +const erc6551AccountAbiV2 = ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI; +const erc6551RegistryAbiV2 = ERC_6551_LEGACY_V2.REGISTRY.ABI; +const erc6551AccountAbiV3 = ERC_6551_DEFAULT.IMPLEMENTATION.ABI; +const erc6551AccountProxyAbiV3 = ERC_6551_DEFAULT.ACCOUNT_PROXY!.ABI; +const erc6551RegistryAbiV3 = ERC_6551_DEFAULT.REGISTRY.ABI; export { - TokenboundClient, - erc6551AccountAbiV2, - erc6551RegistryAbiV2, - erc6551AccountAbiV3, - erc6551AccountProxyAbiV3, - erc6551RegistryAbiV3, - getAccount, - createAccount, - getCreationCode, - computeAccount, - prepareExecuteCall, - executeCall, -} + TokenboundClient, + erc6551AccountAbiV2, + erc6551RegistryAbiV2, + erc6551AccountAbiV3, + erc6551AccountProxyAbiV3, + erc6551RegistryAbiV3, + getAccount, + createAccount, + getCreationCode, + computeAccount, + prepareExecuteCall, + executeCall, +}; diff --git a/packages/sdk/src/constants/crossChain.ts b/packages/sdk/src/constants/crossChain.ts index a4793b6..342aafe 100644 --- a/packages/sdk/src/constants/crossChain.ts +++ b/packages/sdk/src/constants/crossChain.ts @@ -1,72 +1,74 @@ -export const LZ_TESTNET_EXECUTOR = '0xEF7B07Db21d449C50b00De4563FfFe4C9dd33f1f' -export const LZ_MAINNET_EXECUTOR = '0x0F220412Bf22E05EBcC5070D60fd7136A08aF22C' +export const LZ_TESTNET_EXECUTOR = "0xEF7B07Db21d449C50b00De4563FfFe4C9dd33f1f"; +export const LZ_MAINNET_EXECUTOR = "0x0F220412Bf22E05EBcC5070D60fd7136A08aF22C"; -export const LZ_MAINNET_EXECUTORS: { [originChainId: number]: `0x${string}` } = { - // ethereum - 1: LZ_MAINNET_EXECUTOR, - // polygon - 137: LZ_MAINNET_EXECUTOR, - // optimism - 10: LZ_MAINNET_EXECUTOR, - // base - 8453: LZ_MAINNET_EXECUTOR, - // linea - 59144: LZ_MAINNET_EXECUTOR, - // arbitrum - 42161: LZ_MAINNET_EXECUTOR, -} +export const LZ_MAINNET_EXECUTORS: { [originChainId: number]: `0x${string}` } = + { + // ethereum + 1: LZ_MAINNET_EXECUTOR, + // polygon + 137: LZ_MAINNET_EXECUTOR, + // optimism + 10: LZ_MAINNET_EXECUTOR, + // base + 8453: LZ_MAINNET_EXECUTOR, + // linea + 59144: LZ_MAINNET_EXECUTOR, + // arbitrum + 42161: LZ_MAINNET_EXECUTOR, + }; -export const LZ_TESTNET_EXECUTORS: { [originChainId: number]: `0x${string}` } = { - // sepolia - 11155111: LZ_TESTNET_EXECUTOR, - // mumbai - 80001: LZ_TESTNET_EXECUTOR, - // op sepolia - 11155420: LZ_TESTNET_EXECUTOR, - // base sepolia - 84532: LZ_TESTNET_EXECUTOR, - // linea testnet - 59140: LZ_TESTNET_EXECUTOR, - // arbitrum sepolia - 421614: LZ_TESTNET_EXECUTOR, -} +export const LZ_TESTNET_EXECUTORS: { [originChainId: number]: `0x${string}` } = + { + // sepolia + 11155111: LZ_TESTNET_EXECUTOR, + // mumbai + 80001: LZ_TESTNET_EXECUTOR, + // op sepolia + 11155420: LZ_TESTNET_EXECUTOR, + // base sepolia + 84532: LZ_TESTNET_EXECUTOR, + // linea testnet + 59140: LZ_TESTNET_EXECUTOR, + // arbitrum sepolia + 421614: LZ_TESTNET_EXECUTOR, + }; export const LZ_EXECUTORS: { [originChainId: number]: `0x${string}` } = { - ...LZ_TESTNET_EXECUTORS, - ...LZ_MAINNET_EXECUTORS, -} + ...LZ_TESTNET_EXECUTORS, + ...LZ_MAINNET_EXECUTORS, +}; export const LZ_MAINNET_EIDS: { [chainId: number]: number } = { - // ethereum - 1: 30101, - // polygon - 137: 30109, - // optimism - 10: 30111, - // base - 8453: 30184, - // linea - 59144: 30183, - // arbitrum - 42161: 30110, -} + // ethereum + 1: 30101, + // polygon + 137: 30109, + // optimism + 10: 30111, + // base + 8453: 30184, + // linea + 59144: 30183, + // arbitrum + 42161: 30110, +}; export const LZ_TESTNET_EIDS: { [chainId: number]: number } = { - // sepolia - 11155111: 40161, - // mumbai - 80001: 40109, - // op sepolia - 11155420: 40232, - // base sepolia - 84532: 40245, - // linea testnet - 59140: 40157, - // arbitrum sepolia - 421614: 40231, -} + // sepolia + 11155111: 40161, + // mumbai + 80001: 40109, + // op sepolia + 11155420: 40232, + // base sepolia + 84532: 40245, + // linea testnet + 59140: 40157, + // arbitrum sepolia + 421614: 40231, +}; export const LZ_EIDS: { [chainId: number]: number } = { - ...LZ_TESTNET_EIDS, - ...LZ_MAINNET_EIDS, -} + ...LZ_TESTNET_EIDS, + ...LZ_MAINNET_EIDS, +}; diff --git a/packages/sdk/src/constants/eip1167Implementation.ts b/packages/sdk/src/constants/eip1167Implementation.ts index 3179cfc..4aee7dd 100644 --- a/packages/sdk/src/constants/eip1167Implementation.ts +++ b/packages/sdk/src/constants/eip1167Implementation.ts @@ -1 +1,2 @@ -export const STANDARD_EIP_1167_IMPLEMENTATION = '0x5af43d82803e903d91602b57fd5bf3' +export const STANDARD_EIP_1167_IMPLEMENTATION = + "0x5af43d82803e903d91602b57fd5bf3"; diff --git a/packages/sdk/src/constants/index.ts b/packages/sdk/src/constants/index.ts index 6748253..cdd5925 100644 --- a/packages/sdk/src/constants/index.ts +++ b/packages/sdk/src/constants/index.ts @@ -1,5 +1,5 @@ -export * from './tokenboundAddresses' -export * from './interfaces' -export * from './eip1167Implementation' -export * from './multicall' -export * from './crossChain' +export * from "./tokenboundAddresses"; +export * from "./interfaces"; +export * from "./eip1167Implementation"; +export * from "./multicall"; +export * from "./crossChain"; diff --git a/packages/sdk/src/constants/interfaces.ts b/packages/sdk/src/constants/interfaces.ts index e83640c..7be8a25 100644 --- a/packages/sdk/src/constants/interfaces.ts +++ b/packages/sdk/src/constants/interfaces.ts @@ -1 +1 @@ -export const IERC_6551_ACCOUNT_INTERFACE = '0x6faff5f1' +export const IERC_6551_ACCOUNT_INTERFACE = "0x6faff5f1"; diff --git a/packages/sdk/src/constants/multicall.ts b/packages/sdk/src/constants/multicall.ts index a7010ba..e82bbca 100644 --- a/packages/sdk/src/constants/multicall.ts +++ b/packages/sdk/src/constants/multicall.ts @@ -1,5 +1,5 @@ -import { getAddress } from 'viem' +import { getAddress } from "viem"; export const MULTICALL_AUTHENTICATED_ADDRESS: `0x${string}` = getAddress( - '0xcA1167915584462449EE5b4Ea51c37fE81eCDCCD' -) + "0xcA1167915584462449EE5b4Ea51c37fE81eCDCCD", +); diff --git a/packages/sdk/src/constants/tokenboundAddresses.ts b/packages/sdk/src/constants/tokenboundAddresses.ts index 78ca8a7..70becf9 100644 --- a/packages/sdk/src/constants/tokenboundAddresses.ts +++ b/packages/sdk/src/constants/tokenboundAddresses.ts @@ -1,43 +1,43 @@ -import { Abi, getAddress } from 'viem' +import { Abi, getAddress } from "viem"; -import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from '../../abis' +import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../../abis"; import { - erc6551AccountV3ABI, - erc6551AccountProxyV3ABI, - erc6551RegistryV3ABI, -} from '../../src/test/wagmi-cli-hooks/generated' + erc6551AccountV3ABI, + erc6551AccountProxyV3ABI, + erc6551RegistryV3ABI, +} from "../../src/test/wagmi-cli-hooks/generated"; -import { ContractABIPair } from '../types' +import { ContractABIPair } from "../types"; type Standard6551Deployment = { - IMPLEMENTATION: ContractABIPair - REGISTRY: ContractABIPair - ACCOUNT_PROXY?: ContractABIPair -} + IMPLEMENTATION: ContractABIPair; + REGISTRY: ContractABIPair; + ACCOUNT_PROXY?: ContractABIPair; +}; export const ERC_6551_LEGACY_V2: Standard6551Deployment = { - IMPLEMENTATION: { - ADDRESS: getAddress('0x2d25602551487c3f3354dd80d76d54383a243358'), - ABI: erc6551AccountAbiV2 as Abi, - }, - REGISTRY: { - ADDRESS: getAddress('0x02101dfB77FDE026414827Fdc604ddAF224F0921'), - ABI: erc6551RegistryAbiV2 as Abi, - }, -} + IMPLEMENTATION: { + ADDRESS: getAddress("0x2d25602551487c3f3354dd80d76d54383a243358"), + ABI: erc6551AccountAbiV2 as Abi, + }, + REGISTRY: { + ADDRESS: getAddress("0x02101dfB77FDE026414827Fdc604ddAF224F0921"), + ABI: erc6551RegistryAbiV2 as Abi, + }, +}; export const ERC_6551_DEFAULT: Standard6551Deployment = { - ACCOUNT_PROXY: { - ADDRESS: getAddress('0x55266d75D1a14E4572138116aF39863Ed6596E7F'), // Proxy for the upgradeable implementation, initialization lives here - ABI: erc6551AccountProxyV3ABI, - }, - IMPLEMENTATION: { - ADDRESS: getAddress('0x41C8f39463A868d3A88af00cd0fe7102F30E44eC'), // Upgradeable - ABI: erc6551AccountV3ABI, - }, - REGISTRY: { - ADDRESS: getAddress('0x000000006551c19487814612e58FE06813775758'), - ABI: erc6551RegistryV3ABI, - }, -} + ACCOUNT_PROXY: { + ADDRESS: getAddress("0x55266d75D1a14E4572138116aF39863Ed6596E7F"), // Proxy for the upgradeable implementation, initialization lives here + ABI: erc6551AccountProxyV3ABI, + }, + IMPLEMENTATION: { + ADDRESS: getAddress("0x41C8f39463A868d3A88af00cd0fe7102F30E44eC"), // Upgradeable + ABI: erc6551AccountV3ABI, + }, + REGISTRY: { + ADDRESS: getAddress("0x000000006551c19487814612e58FE06813775758"), + ABI: erc6551RegistryV3ABI, + }, +}; diff --git a/packages/sdk/src/functions/crossChain.ts b/packages/sdk/src/functions/crossChain.ts index 9ad0db2..c37e63f 100644 --- a/packages/sdk/src/functions/crossChain.ts +++ b/packages/sdk/src/functions/crossChain.ts @@ -1,57 +1,64 @@ -import { PublicClient, encodeFunctionData, parseAbi } from 'viem' -import { ERC_6551_DEFAULT, LZ_EXECUTORS, LZ_EIDS } from '../constants' -import { Options } from '@layerzerolabs/lz-v2-utilities' -import { CallData } from '../types' +import { PublicClient, encodeFunctionData, parseAbi } from "viem"; +import { ERC_6551_DEFAULT, LZ_EXECUTORS, LZ_EIDS } from "../constants"; +import { Options } from "@layerzerolabs/lz-v2-utilities"; +import { CallData } from "../types"; type CrossChainCallParams = { - publicClient: PublicClient - account: `0x${string}` - originChainId: number - destinationChainId: number -} & CallData + publicClient: PublicClient; + account: `0x${string}`; + originChainId: number; + destinationChainId: number; +} & CallData; export async function encodeCrossChainCall( - params: CrossChainCallParams + params: CrossChainCallParams, ): Promise { - const { originChainId, destinationChainId, to, value, data, account, publicClient } = - params - - const lzExecutorAbi = parseAbi([ - 'function quote(uint32 eid, address sender, bytes calldata payload, bytes calldata options) external view returns (uint256 nativeFee, uint256 lzTokenFee)', - 'function execute(uint32 eid, bytes calldata payload, bytes calldata options) external payable', - ]) - - const lzExecutor = LZ_EXECUTORS[originChainId] - const lzEid = LZ_EIDS[destinationChainId] - - const destinationExecutionData = encodeFunctionData({ - abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, - functionName: 'execute', - args: [to, value, data, 0], - }) - - const txOptions = Options.newOptions().addExecutorLzReceiveOption(200000, 0) - - const txOptionsHex = txOptions.toHex() as `0x${string}` - - const quoteData = await publicClient.readContract({ - address: lzExecutor, - abi: lzExecutorAbi, - functionName: 'quote', - args: [lzEid, account, destinationExecutionData, txOptionsHex], - }) - - const txValue = quoteData.at(0) || 0n - - const encodedLzCall = encodeFunctionData({ - abi: lzExecutorAbi, - functionName: 'execute', - args: [lzEid, destinationExecutionData, txOptionsHex], - }) - - return { - to: lzExecutor, - value: txValue + 10n, - data: encodedLzCall, - } + const { + originChainId, + destinationChainId, + to, + value, + data, + account, + publicClient, + } = params; + + const lzExecutorAbi = parseAbi([ + "function quote(uint32 eid, address sender, bytes calldata payload, bytes calldata options) external view returns (uint256 nativeFee, uint256 lzTokenFee)", + "function execute(uint32 eid, bytes calldata payload, bytes calldata options) external payable", + ]); + + const lzExecutor = LZ_EXECUTORS[originChainId]; + const lzEid = LZ_EIDS[destinationChainId]; + + const destinationExecutionData = encodeFunctionData({ + abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, + functionName: "execute", + args: [to, value, data, 0], + }); + + const txOptions = Options.newOptions().addExecutorLzReceiveOption(200000, 0); + + const txOptionsHex = txOptions.toHex() as `0x${string}`; + + const quoteData = await publicClient.readContract({ + address: lzExecutor, + abi: lzExecutorAbi, + functionName: "quote", + args: [lzEid, account, destinationExecutionData, txOptionsHex], + }); + + const txValue = quoteData.at(0) || 0n; + + const encodedLzCall = encodeFunctionData({ + abi: lzExecutorAbi, + functionName: "execute", + args: [lzEid, destinationExecutionData, txOptionsHex], + }); + + return { + to: lzExecutor, + value: txValue + 10n, + data: encodedLzCall, + }; } diff --git a/packages/sdk/src/functions/index.ts b/packages/sdk/src/functions/index.ts index ce83971..290a3e6 100644 --- a/packages/sdk/src/functions/index.ts +++ b/packages/sdk/src/functions/index.ts @@ -1,3 +1,3 @@ -export * from './viemV2' -export * from './viemV3' -export * from './crossChain' +export * from "./viemV2"; +export * from "./viemV3"; +export * from "./crossChain"; diff --git a/packages/sdk/src/functions/viemV2.ts b/packages/sdk/src/functions/viemV2.ts index 3085275..3dbc1cb 100644 --- a/packages/sdk/src/functions/viemV2.ts +++ b/packages/sdk/src/functions/viemV2.ts @@ -1,69 +1,69 @@ import { - getContract, - getContractAddress, - concat, - PublicClient, - WalletClient, - encodeFunctionData, - encodeAbiParameters, - pad, - getAddress, -} from 'viem' + getContract, + getContractAddress, + concat, + PublicClient, + WalletClient, + encodeFunctionData, + encodeAbiParameters, + pad, + getAddress, +} from "viem"; -import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from '../../abis' +import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../../abis"; import { - erc6551AccountProxyV3ABI, - erc6551AccountV3ABI, - erc6551RegistryV3ABI, -} from '../../src/test/wagmi-cli-hooks/generated' -import { addressToUint8Array } from '../utils' -import { ERC_6551_LEGACY_V2 } from '../constants' -import { CallData } from '../types' + erc6551AccountProxyV3ABI, + erc6551AccountV3ABI, + erc6551RegistryV3ABI, +} from "../../src/test/wagmi-cli-hooks/generated"; +import { addressToUint8Array } from "../utils"; +import { ERC_6551_LEGACY_V2 } from "../constants"; +import { CallData } from "../types"; export { - erc6551AccountAbiV2, - erc6551RegistryAbiV2, - erc6551AccountProxyV3ABI, - erc6551AccountV3ABI, - erc6551RegistryV3ABI, -} + erc6551AccountAbiV2, + erc6551RegistryAbiV2, + erc6551AccountProxyV3ABI, + erc6551AccountV3ABI, + erc6551RegistryV3ABI, +}; /** * @deprecated Direct consumption of this function is deprecated. Consume via TokenboundClient instead. * @internal */ export async function getAccount( - tokenContract: string, - tokenId: string, - client: PublicClient, - implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}` + tokenContract: string, + tokenId: string, + client: PublicClient, + implementationAddress?: `0x${string}`, + registryAddress?: `0x${string}`, ): Promise<`0x${string}`> { - const erc6551registry = registryAddress - ? getAddress(registryAddress) - : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS + const erc6551registry = registryAddress + ? getAddress(registryAddress) + : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; - const registry = getContract({ - address: erc6551registry, - abi: ERC_6551_LEGACY_V2.REGISTRY.ABI, - client: { - public: client as PublicClient, - }, - }) + const registry = getContract({ + address: erc6551registry, + abi: ERC_6551_LEGACY_V2.REGISTRY.ABI, + client: { + public: client as PublicClient, + }, + }); - const chainId = await client.getChainId() + const chainId = await client.getChainId(); - const account = await registry.read.account([ - implementationAddress - ? getAddress(implementationAddress) - : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS, - chainId, - tokenContract, - tokenId, - 0, - ]) + const account = await registry.read.account([ + implementationAddress + ? getAddress(implementationAddress) + : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS, + chainId, + tokenContract, + tokenId, + 0, + ]); - return account as `0x${string}` + return account as `0x${string}`; } /** @@ -71,43 +71,43 @@ export async function getAccount( * @internal */ export async function prepareCreateAccount( - tokenContract: string, - tokenId: string, - chainId: number, - implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, - salt?: number + tokenContract: string, + tokenId: string, + chainId: number, + implementationAddress?: `0x${string}`, + registryAddress?: `0x${string}`, + salt?: number, ): Promise { - salt = salt ?? 0 - const implementation = implementationAddress - ? getAddress(implementationAddress) - : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS - const erc6551registry = registryAddress - ? getAddress(registryAddress) - : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS + salt = salt ?? 0; + const implementation = implementationAddress + ? getAddress(implementationAddress) + : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS; + const erc6551registry = registryAddress + ? getAddress(registryAddress) + : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; - const initData = encodeFunctionData({ - abi: [ - { - inputs: [], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - ], - functionName: 'initialize', - }) + const initData = encodeFunctionData({ + abi: [ + { + inputs: [], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + ], + functionName: "initialize", + }); - return { - to: erc6551registry, - value: BigInt(0), - data: encodeFunctionData({ - abi: ERC_6551_LEGACY_V2.REGISTRY.ABI, - functionName: 'createAccount', - args: [implementation, chainId, tokenContract, tokenId, salt, initData], - }), - } + return { + to: erc6551registry, + value: BigInt(0), + data: encodeFunctionData({ + abi: ERC_6551_LEGACY_V2.REGISTRY.ABI, + functionName: "createAccount", + args: [implementation, chainId, tokenContract, tokenId, salt, initData], + }), + }; } /** @@ -115,53 +115,53 @@ export async function prepareCreateAccount( * @internal */ export async function createAccount( - tokenContract: string, - tokenId: string, - client: WalletClient, - implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, - salt?: number, - chainId?: number + tokenContract: string, + tokenId: string, + client: WalletClient, + implementationAddress?: `0x${string}`, + registryAddress?: `0x${string}`, + salt?: number, + chainId?: number, ): Promise<`0x${string}`> { - salt = salt ?? 0 - const implementation = implementationAddress - ? getAddress(implementationAddress) - : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS - const erc6551registry = registryAddress - ? getAddress(registryAddress) - : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS + salt = salt ?? 0; + const implementation = implementationAddress + ? getAddress(implementationAddress) + : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS; + const erc6551registry = registryAddress + ? getAddress(registryAddress) + : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; - const registry = getContract({ - address: erc6551registry, - abi: ERC_6551_LEGACY_V2.REGISTRY.ABI, - client: { - wallet: client, - }, - }) + const registry = getContract({ + address: erc6551registry, + abi: ERC_6551_LEGACY_V2.REGISTRY.ABI, + client: { + wallet: client, + }, + }); - const _chainId = chainId || (await client.getChainId()) + const _chainId = chainId || (await client.getChainId()); - const initData = encodeFunctionData({ - abi: [ - { - inputs: [], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - ], - functionName: 'initialize', - }) + const initData = encodeFunctionData({ + abi: [ + { + inputs: [], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + ], + functionName: "initialize", + }); - return registry.write.createAccount([ - implementation, - _chainId, - tokenContract, - tokenId, - salt, - initData, - ]) + return registry.write.createAccount([ + implementation, + _chainId, + tokenContract, + tokenId, + salt, + initData, + ]); } /** @@ -169,20 +169,20 @@ export async function createAccount( * @internal */ export async function prepareExecuteCall( - account: string, - to: string, - value: bigint, - data: string + account: string, + to: string, + value: bigint, + data: string, ): Promise { - return { - to: account as `0x${string}`, - value: 0n, - data: encodeFunctionData({ - abi: ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI, - functionName: 'executeCall', - args: [to as `0x${string}`, value, data as `0x${string}`], - }), - } + return { + to: account as `0x${string}`, + value: 0n, + data: encodeFunctionData({ + abi: ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI, + functionName: "executeCall", + args: [to as `0x${string}`, value, data as `0x${string}`], + }), + }; } /** @@ -190,21 +190,25 @@ export async function prepareExecuteCall( * @internal */ export async function executeCall( - account: string, - to: string, - value: bigint, - data: string, - client: WalletClient + account: string, + to: string, + value: bigint, + data: string, + client: WalletClient, ) { - const registry = getContract({ - address: account as `0x${string}`, - abi: ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI, - client: { - wallet: client, - }, - }) + const registry = getContract({ + address: account as `0x${string}`, + abi: ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI, + client: { + wallet: client, + }, + }); - return registry.write.executeCall([to as `0x${string}`, value, data as `0x${string}`]) + return registry.write.executeCall([ + to as `0x${string}`, + value, + data as `0x${string}`, + ]); } /** @@ -212,38 +216,38 @@ export async function executeCall( * @internal */ export function computeAccount( - tokenContract: string, - tokenId: string, - chainId: number, - implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, - salt?: number + tokenContract: string, + tokenId: string, + chainId: number, + implementationAddress?: `0x${string}`, + registryAddress?: `0x${string}`, + salt?: number, ): `0x${string}` { - salt = salt ?? 0 - const implementation = implementationAddress - ? getAddress(implementationAddress) - : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS - const erc6551registry = registryAddress - ? getAddress(registryAddress) - : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS + salt = salt ?? 0; + const implementation = implementationAddress + ? getAddress(implementationAddress) + : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS; + const erc6551registry = registryAddress + ? getAddress(registryAddress) + : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; - const code = getCreationCode( - implementation, - chainId, - tokenContract, - tokenId, - salt.toString() - ) + const code = getCreationCode( + implementation, + chainId, + tokenContract, + tokenId, + salt.toString(), + ); - const bigIntSalt = BigInt(salt).toString(16) as `0x${string}` - const saltHex = pad(bigIntSalt, { size: 32 }) + const bigIntSalt = BigInt(salt).toString(16) as `0x${string}`; + const saltHex = pad(bigIntSalt, { size: 32 }); - return getContractAddress({ - bytecode: code, - from: erc6551registry, - opcode: 'CREATE2', - salt: saltHex, - }) + return getContractAddress({ + bytecode: code, + from: erc6551registry, + opcode: "CREATE2", + salt: saltHex, + }); } /** @@ -251,30 +255,35 @@ export function computeAccount( * @internal */ export function getCreationCode( - implementation_: `0x${string}`, - chainId_: number, - tokenContract_: string, - tokenId_: string, - salt_: string + implementation_: `0x${string}`, + chainId_: number, + tokenContract_: string, + tokenId_: string, + salt_: string, ): Uint8Array { - const types = [ - { type: 'uint256' }, - { type: 'uint256' }, - { type: 'address' }, - { type: 'uint256' }, - ] - const values: (string | bigint)[] = [salt_, BigInt(chainId_), tokenContract_, tokenId_] - const encodedABI = encodeAbiParameters(types, values) - const hexImplementation = implementation_ as `0x${string}` + const types = [ + { type: "uint256" }, + { type: "uint256" }, + { type: "address" }, + { type: "uint256" }, + ]; + const values: (string | bigint)[] = [ + salt_, + BigInt(chainId_), + tokenContract_, + tokenId_, + ]; + const encodedABI = encodeAbiParameters(types, values); + const hexImplementation = implementation_ as `0x${string}`; - const hexCreationCode = concat([ - '0x3d60ad80600a3d3981f3363d3d373d3d3d363d73', - hexImplementation, - '0x5af43d82803e903d91602b57fd5bf3', - encodedABI, - ]) + const hexCreationCode = concat([ + "0x3d60ad80600a3d3981f3363d3d373d3d3d363d73", + hexImplementation, + "0x5af43d82803e903d91602b57fd5bf3", + encodedABI, + ]); - const creationCode = addressToUint8Array(hexCreationCode) + const creationCode = addressToUint8Array(hexCreationCode); - return creationCode + return creationCode; } diff --git a/packages/sdk/src/functions/viemV3.ts b/packages/sdk/src/functions/viemV3.ts index 769e378..c4ea1f8 100644 --- a/packages/sdk/src/functions/viemV3.ts +++ b/packages/sdk/src/functions/viemV3.ts @@ -1,61 +1,64 @@ import { - getContract, - getContractAddress, - concat, - WalletClient, - encodeFunctionData, - encodeAbiParameters, - pad, - parseAbiParameters, - numberToHex, - getAddress, - numberToBytes, - bytesToHex, -} from 'viem' + getContract, + getContractAddress, + concat, + WalletClient, + encodeFunctionData, + encodeAbiParameters, + pad, + parseAbiParameters, + numberToHex, + getAddress, + numberToBytes, + bytesToHex, +} from "viem"; import { - erc6551AccountProxyV3ABI, - erc6551AccountV3ABI, - erc6551RegistryV3ABI, -} from '../../src/test/wagmi-cli-hooks/generated' -import { addressToUint8Array } from '../utils' + erc6551AccountProxyV3ABI, + erc6551AccountV3ABI, + erc6551RegistryV3ABI, +} from "../../src/test/wagmi-cli-hooks/generated"; +import { addressToUint8Array } from "../utils"; -import { ERC_6551_DEFAULT, STANDARD_EIP_1167_IMPLEMENTATION } from '../constants' -import { CallData } from '../types' -export { erc6551AccountProxyV3ABI, erc6551AccountV3ABI, erc6551RegistryV3ABI } +import { + ERC_6551_DEFAULT, + STANDARD_EIP_1167_IMPLEMENTATION, +} from "../constants"; +import { CallData } from "../types"; +export { erc6551AccountProxyV3ABI, erc6551AccountV3ABI, erc6551RegistryV3ABI }; /** * @deprecated Direct consumption of this function is deprecated. Consume via TokenboundClient instead. * @internal */ export async function prepareCreateTokenboundV3Account( - tokenContract: string, - tokenId: string, - chainId: number, - implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, - salt?: number + tokenContract: string, + tokenId: string, + chainId: number, + implementationAddress?: `0x${string}`, + registryAddress?: `0x${string}`, + salt?: number, ): Promise { - salt = salt ?? 0 - const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS - const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS - - return { - to: getAddress(erc6551registry), - value: BigInt(0), - data: encodeFunctionData({ - abi: ERC_6551_DEFAULT.REGISTRY.ABI, - functionName: 'createAccount', - args: [ - getAddress(erc6551implementation), - bytesToHex(numberToBytes(salt, { size: 32 })), - chainId, - tokenContract, - tokenId, - ], - }), - } + salt = salt ?? 0; + const erc6551implementation = + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS; + const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS; + + return { + to: getAddress(erc6551registry), + value: BigInt(0), + data: encodeFunctionData({ + abi: ERC_6551_DEFAULT.REGISTRY.ABI, + functionName: "createAccount", + args: [ + getAddress(erc6551implementation), + bytesToHex(numberToBytes(salt, { size: 32 })), + chainId, + tokenContract, + tokenId, + ], + }), + }; } /** @@ -63,37 +66,37 @@ export async function prepareCreateTokenboundV3Account( * @internal */ export async function createTokenboundV3Account( - tokenContract: string, - tokenId: string, - client: WalletClient, - implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, - salt?: number + tokenContract: string, + tokenId: string, + client: WalletClient, + implementationAddress?: `0x${string}`, + registryAddress?: `0x${string}`, + salt?: number, ): Promise<`0x${string}`> { - salt = salt ?? 0 - const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS - const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS - - const registry = getContract({ - address: erc6551registry, - abi: ERC_6551_DEFAULT.REGISTRY.ABI, - client: { - wallet: client, - }, - }) - - const chainId = await client.getChainId() - - return await registry.write.createAccount([ - erc6551implementation, - encodeAbiParameters(parseAbiParameters(['bytes32']), [ - numberToHex(salt, { size: 32 }), - ]), - chainId, - tokenContract, - tokenId, - ]) + salt = salt ?? 0; + const erc6551implementation = + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS; + const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS; + + const registry = getContract({ + address: erc6551registry, + abi: ERC_6551_DEFAULT.REGISTRY.ABI, + client: { + wallet: client, + }, + }); + + const chainId = await client.getChainId(); + + return await registry.write.createAccount([ + erc6551implementation, + encodeAbiParameters(parseAbiParameters(["bytes32"]), [ + numberToHex(salt, { size: 32 }), + ]), + chainId, + tokenContract, + tokenId, + ]); } /** @@ -101,20 +104,20 @@ export async function createTokenboundV3Account( * @internal */ export async function prepareTokenboundV3Execute( - account: string, - to: string, - value: bigint, - data: string + account: string, + to: string, + value: bigint, + data: string, ): Promise { - return { - to: account as `0x${string}`, - value: 0n, - data: encodeFunctionData({ - abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, - functionName: 'execute', - args: [to as `0x${string}`, value, data as `0x${string}`], - }), - } + return { + to: account as `0x${string}`, + value: 0n, + data: encodeFunctionData({ + abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, + functionName: "execute", + args: [to as `0x${string}`, value, data as `0x${string}`], + }), + }; } /** @@ -122,21 +125,25 @@ export async function prepareTokenboundV3Execute( * @internal */ export async function tokenboundV3Execute( - account: string, - to: string, - value: bigint, - data: string, - client: WalletClient + account: string, + to: string, + value: bigint, + data: string, + client: WalletClient, ) { - const registry = getContract({ - address: account as `0x${string}`, - abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, - client: { - wallet: client, - }, - }) - - return await registry.write.execute([to as `0x${string}`, value, data as `0x${string}`]) + const registry = getContract({ + address: account as `0x${string}`, + abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, + client: { + wallet: client, + }, + }); + + return await registry.write.execute([ + to as `0x${string}`, + value, + data as `0x${string}`, + ]); } /** @@ -144,47 +151,47 @@ export async function tokenboundV3Execute( * @internal */ export function getTokenboundV3Account( - tokenContract: string, - tokenId: string, - chainId: number, - implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, - salt?: number + tokenContract: string, + tokenId: string, + chainId: number, + implementationAddress?: `0x${string}`, + registryAddress?: `0x${string}`, + salt?: number, ): `0x${string}` { - salt = salt ?? 0 - const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS - const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS - const types = [ - { type: 'uint256' }, // salt - { type: 'uint256' }, // chainId - { type: 'address' }, // tokenContract - { type: 'uint256' }, // tokenId - ] - - const values: (string | bigint)[] = [ - salt.toString(), - BigInt(chainId), - tokenContract, - tokenId, - ] - const encodedABI = encodeAbiParameters(types, values) - - const hexCreationCode = concat([ - '0x3d60ad80600a3d3981f3363d3d373d3d3d363d73', - getAddress(erc6551implementation), - STANDARD_EIP_1167_IMPLEMENTATION, - encodedABI, - ]) - - const creationCode = addressToUint8Array(hexCreationCode) - const bigIntSalt = BigInt(salt).toString(16) as `0x${string}` - const saltHex = pad(bigIntSalt, { size: 32 }) - - return getContractAddress({ - bytecode: creationCode, - from: getAddress(erc6551registry), - opcode: 'CREATE2', - salt: saltHex, - }) + salt = salt ?? 0; + const erc6551implementation = + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS; + const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS; + const types = [ + { type: "uint256" }, // salt + { type: "uint256" }, // chainId + { type: "address" }, // tokenContract + { type: "uint256" }, // tokenId + ]; + + const values: (string | bigint)[] = [ + salt.toString(), + BigInt(chainId), + tokenContract, + tokenId, + ]; + const encodedABI = encodeAbiParameters(types, values); + + const hexCreationCode = concat([ + "0x3d60ad80600a3d3981f3363d3d373d3d3d363d73", + getAddress(erc6551implementation), + STANDARD_EIP_1167_IMPLEMENTATION, + encodedABI, + ]); + + const creationCode = addressToUint8Array(hexCreationCode); + const bigIntSalt = BigInt(salt).toString(16) as `0x${string}`; + const saltHex = pad(bigIntSalt, { size: 32 }); + + return getContractAddress({ + bytecode: creationCode, + from: getAddress(erc6551registry), + opcode: "CREATE2", + salt: saltHex, + }); } diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index b698496..9587740 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -1,84 +1,84 @@ -import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from '../abis' +import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../abis"; import { - getAccount, - computeAccount, - createAccount, - getCreationCode, - prepareExecuteCall, - executeCall, - prepareCreateAccount, -} from './functions' + getAccount, + computeAccount, + createAccount, + getCreationCode, + prepareExecuteCall, + executeCall, + prepareCreateAccount, +} from "./functions"; import { - TokenboundAccountNFT, - TokenboundClientOptions, - GetAccountParams, - TBAccountParams, - PrepareCreateAccountParams, - CreateAccountParams, - PrepareExecuteCallParams, - ExecuteCallParams, - SignMessageParams, - ComputeAccountParams, - GetCreationCodeParams, - ERC20TransferParams, - ETHTransferParams, - NFTTransferParams, - BytecodeParams, - TBImplementationVersion, - TBVersion, - MultiCallTx, - Call3, - CALL_OPERATIONS, - SegmentedERC6551Bytecode, - CallData -} from './types' + TokenboundAccountNFT, + TokenboundClientOptions, + GetAccountParams, + TBAccountParams, + PrepareCreateAccountParams, + CreateAccountParams, + PrepareExecuteCallParams, + ExecuteCallParams, + SignMessageParams, + ComputeAccountParams, + GetCreationCodeParams, + ERC20TransferParams, + ETHTransferParams, + NFTTransferParams, + BytecodeParams, + TBImplementationVersion, + TBVersion, + MultiCallTx, + Call3, + CALL_OPERATIONS, + SegmentedERC6551Bytecode, + CallData, +} from "./types"; import { - TokenboundClient, - erc6551AccountAbiV3, - erc6551AccountProxyAbiV3, - erc6551RegistryAbiV3, -} from './TokenboundClient' + TokenboundClient, + erc6551AccountAbiV3, + erc6551AccountProxyAbiV3, + erc6551RegistryAbiV3, +} from "./TokenboundClient"; export { - TokenboundClient, - TBVersion, - erc6551AccountAbiV2, - erc6551RegistryAbiV2, - erc6551AccountAbiV3, - erc6551AccountProxyAbiV3, - erc6551RegistryAbiV3, - getAccount, - computeAccount, - prepareCreateAccount, - createAccount, - getCreationCode, - prepareExecuteCall, - executeCall, - CALL_OPERATIONS, -} + TokenboundClient, + TBVersion, + erc6551AccountAbiV2, + erc6551RegistryAbiV2, + erc6551AccountAbiV3, + erc6551AccountProxyAbiV3, + erc6551RegistryAbiV3, + getAccount, + computeAccount, + prepareCreateAccount, + createAccount, + getCreationCode, + prepareExecuteCall, + executeCall, + CALL_OPERATIONS, +}; export type { - TokenboundClientOptions, - TokenboundAccountNFT, - GetAccountParams, - TBAccountParams, - PrepareCreateAccountParams, - CreateAccountParams, - PrepareExecuteCallParams, - ExecuteCallParams, - ComputeAccountParams, - GetCreationCodeParams, - BytecodeParams, - SignMessageParams, - ERC20TransferParams, - ETHTransferParams, - NFTTransferParams, - TBImplementationVersion, - MultiCallTx, - Call3, - CallData, - SegmentedERC6551Bytecode -} + TokenboundClientOptions, + TokenboundAccountNFT, + GetAccountParams, + TBAccountParams, + PrepareCreateAccountParams, + CreateAccountParams, + PrepareExecuteCallParams, + ExecuteCallParams, + ComputeAccountParams, + GetCreationCodeParams, + BytecodeParams, + SignMessageParams, + ERC20TransferParams, + ETHTransferParams, + NFTTransferParams, + TBImplementationVersion, + MultiCallTx, + Call3, + CallData, + SegmentedERC6551Bytecode, +}; diff --git a/packages/sdk/src/test/TestAll.test.ts b/packages/sdk/src/test/TestAll.test.ts index 4be6373..ee36030 100644 --- a/packages/sdk/src/test/TestAll.test.ts +++ b/packages/sdk/src/test/TestAll.test.ts @@ -1,1152 +1,1194 @@ // This suite tests Tokenbound SDK methods with // viem walletClient + publicClient and Ethers 5/6. -import { zora, mainnet } from 'viem/chains' -import { describe, beforeAll, afterAll, expect, it, vi } from 'vitest' -import { ethers, providers } from 'ethers' -import { createAnvil } from '@viem/anvil' +import { zora, mainnet } from "viem/chains"; +import { describe, beforeAll, afterAll, expect, it, vi } from "vitest"; +import { ethers, providers } from "ethers"; +import { createAnvil } from "@viem/anvil"; import { - WalletClient, - PublicClient, - createWalletClient, - http, - getAddress, - encodeFunctionData, - Log, - parseUnits, - formatEther, - getContract, - encodeAbiParameters, - parseAbiParameters, - isAddress, - isHex, -} from 'viem' -import { privateKeyToAccount } from 'viem/accounts' + WalletClient, + PublicClient, + createWalletClient, + http, + getAddress, + encodeFunctionData, + Log, + parseUnits, + formatEther, + getContract, + encodeAbiParameters, + parseAbiParameters, + isAddress, + isHex, +} from "viem"; +import { privateKeyToAccount } from "viem/accounts"; import { - ADDRESS_REGEX, - ANVIL_ACCOUNTS, - ANVIL_RPC_URL, - WETH_CONTRACT_ADDRESS, -} from './constants' -import { resolvePossibleENS } from '../utils' + ADDRESS_REGEX, + ANVIL_ACCOUNTS, + ANVIL_RPC_URL, + WETH_CONTRACT_ADDRESS, +} from "./constants"; +import { resolvePossibleENS } from "../utils"; import { - ethToWei, - getPublicClient, - getWETHBalance, - // debugTransaction, - getZora1155Balance, - getZora721Balance, -} from './utils' + ethToWei, + getPublicClient, + getWETHBalance, + // debugTransaction, + getZora1155Balance, + getZora721Balance, +} from "./utils"; import { - ANVIL_CONFIG, - CREATE_ANVIL_OPTIONS, - zora721, - zora1155, - TEST_CONFIG, -} from './config' -import { wethABI } from './wagmi-cli-hooks/generated' -import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from '../constants' -import { Call3, TBImplementationVersion, TBVersion } from '../types' -import { JsonRpcSigner, JsonRpcProvider } from 'ethers6' -import { erc20Abi } from 'viem' -import { CreateAccountParams, TokenboundClient } from '../' - -export const pool = Number(process.env.VITEST_POOL_ID ?? 1) - -const TIMEOUT = 60000 // default 10000 -const ANVIL_USER_0 = getAddress(ANVIL_ACCOUNTS[0].address) -const ANVIL_USER_1 = getAddress(ANVIL_ACCOUNTS[1].address) + ANVIL_CONFIG, + CREATE_ANVIL_OPTIONS, + zora721, + zora1155, + TEST_CONFIG, +} from "./config"; +import { wethABI } from "./wagmi-cli-hooks/generated"; +import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "../constants"; +import { Call3, TBImplementationVersion, TBVersion } from "../types"; +import { JsonRpcSigner, JsonRpcProvider } from "ethers6"; +import { erc20Abi } from "viem"; +import { CreateAccountParams, TokenboundClient } from "../"; + +export const pool = Number(process.env.VITEST_POOL_ID ?? 1); + +const TIMEOUT = 60000; // default 10000 +const ANVIL_USER_0 = getAddress(ANVIL_ACCOUNTS[0].address); +const ANVIL_USER_1 = getAddress(ANVIL_ACCOUNTS[1].address); const walletClient = createWalletClient({ - transport: http(ANVIL_RPC_URL), - chain: ANVIL_CONFIG.ACTIVE_CHAIN, - account: privateKeyToAccount(ANVIL_ACCOUNTS[0].privateKey), -}) + transport: http(ANVIL_RPC_URL), + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + account: privateKeyToAccount(ANVIL_ACCOUNTS[0].privateKey), +}); -const ethers5Provider = new ethers.providers.JsonRpcProvider(ANVIL_RPC_URL) -const ethers5Signer = new ethers.Wallet(ANVIL_ACCOUNTS[0].privateKey, ethers5Provider) +const ethers5Provider = new ethers.providers.JsonRpcProvider(ANVIL_RPC_URL); +const ethers5Signer = new ethers.Wallet( + ANVIL_ACCOUNTS[0].privateKey, + ethers5Provider, +); -const ethers6Provider = new JsonRpcProvider(ANVIL_RPC_URL) -const ethers6Signer = new JsonRpcSigner(ethers6Provider, ANVIL_USER_0) +const ethers6Provider = new JsonRpcProvider(ANVIL_RPC_URL); +const ethers6Signer = new JsonRpcSigner(ethers6Provider, ANVIL_USER_0); type TestConfig = { - testName: string - walletClient?: WalletClient - signer?: any - version?: TBImplementationVersion -} + testName: string; + walletClient?: WalletClient; + signer?: any; + version?: TBImplementationVersion; +}; export const ENABLED_TESTS: Array = [ - { - testName: 'viem v2', - walletClient, - version: TBVersion.V2, - }, - { - testName: 'ethers@5 v2', - signer: ethers5Signer, - version: TBVersion.V2, - }, - { - testName: 'ethers@6 v2', - signer: ethers6Signer, - version: TBVersion.V2, - }, - { - testName: 'viem v3', - walletClient, - }, - { - testName: 'ethers@5 v3', - signer: ethers5Signer, - }, - { - testName: 'ethers@6 v3', - signer: ethers6Signer, - }, -] + { + testName: "viem v2", + walletClient, + version: TBVersion.V2, + }, + { + testName: "ethers@5 v2", + signer: ethers5Signer, + version: TBVersion.V2, + }, + { + testName: "ethers@6 v2", + signer: ethers6Signer, + version: TBVersion.V2, + }, + { + testName: "viem v3", + walletClient, + }, + { + testName: "ethers@5 v3", + signer: ethers5Signer, + }, + { + testName: "ethers@6 v3", + signer: ethers6Signer, + }, +]; describe.each(ENABLED_TESTS)( - '$testName', - ({ testName, walletClient, signer, version }) => { - const isV2 = version === TBVersion.V2 - const isV3 = isV2 === false - const viemOnlyIt = walletClient ? it : it.skip // Skip tests that are non-functional in Ethers - const v3OnlyIt = isV3 ? it : it.skip - // Set up Anvil instance + clients - const anvil = createAnvil({ ...CREATE_ANVIL_OPTIONS }) - const CUSTOM_SALT = 6551 - let tokenboundClient: TokenboundClient - let publicClient: PublicClient - let NFT_IN_EOA: CreateAccountParams - let NFT_FOR_MULTICALL_CREATE: CreateAccountParams - let TOKENID_IN_EOA: string - let TOKENID_FOR_MULTICALL_CREATE: string - let TOKENID1_IN_TBA: string - let TOKENID2_IN_TBA: string - let ZORA721_TBA_ADDRESS: `0x${string}` - let ZORA721_TBA_ADDRESS_CUSTOM_SALT: `0x${string}` - let ZORA721_TBA_ADDRESS_MULTICALL: `0x${string}` - - const ERC6551_DEPLOYMENT = isV2 ? ERC_6551_LEGACY_V2 : ERC_6551_DEFAULT - - // Spin up a fresh anvil instance each time we run the test suite against a different signer - beforeAll(async () => { - try { - // publicClient = getPublicClient({ chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id }) - publicClient = getPublicClient({ chain: ANVIL_CONFIG.ACTIVE_CHAIN }) - - // Pass in the Anvil test walletClient + publicClient - tokenboundClient = new TokenboundClient({ - // chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, - chain: ANVIL_CONFIG.ACTIVE_CHAIN, - walletClient, - signer, - publicClient, - implementationAddress: isV3 - ? undefined - : ERC6551_DEPLOYMENT.IMPLEMENTATION.ADDRESS, - registryAddress: isV3 ? undefined : ERC6551_DEPLOYMENT.REGISTRY.ADDRESS, - }) - - await anvil.start() - console.log(`START → \x1b[94m ${testName} \x1b[0m`) - } catch (err) { - console.error('Error during setup:', err) - } - }, TIMEOUT) - - afterAll(async () => { - await anvil.stop() - console.log(`END → \x1b[94m ${testName} \x1b[0m`) - }) - - it('can get the SDK version', () => { - const sdkVersion: string = tokenboundClient.getSDKVersion() - console.log(`SDK Version → \x1b[94m ${sdkVersion} \x1b[0m`) - // console.log('SDK Version:', sdkVersion) - expect(sdkVersion).toBeDefined() - }) - - // To test the SDK methods, we need to mint some NFTs into the Anvil wallet - // so that we can transfer them to the TBA and test the TBA methods. - it( - 'can mint 2 Zora 721 NFTs into Anvil wallet #0', - async () => { - let mintLogs: Log[] = [] - - // Set up observer for mint event so we can get the tokenId - const unwatch = publicClient.watchContractEvent({ - address: zora721.proxyContractAddress, - abi: zora721.abi, - eventName: 'Transfer', - args: { - to: ANVIL_USER_0, - }, - onLogs: (logs) => { - mintLogs = logs - const { tokenId: eoaTokenId } = logs[0].args - const { tokenId: tbaToken1Id } = logs[1].args - const { tokenId: tbaToken2Id } = logs[2].args - const { tokenId: multicallTokenId } = logs[3].args - - if (eoaTokenId && tbaToken1Id && tbaToken2Id && multicallTokenId) { - TOKENID_IN_EOA = eoaTokenId.toString() - TOKENID_FOR_MULTICALL_CREATE = multicallTokenId.toString() - TOKENID1_IN_TBA = tbaToken1Id.toString() - TOKENID2_IN_TBA = tbaToken2Id.toString() - - NFT_IN_EOA = { - tokenContract: zora721.proxyContractAddress, - tokenId: TOKENID_IN_EOA, - } - NFT_FOR_MULTICALL_CREATE = { - tokenContract: zora721.proxyContractAddress, - tokenId: TOKENID_FOR_MULTICALL_CREATE, - } - } - }, - }) - - // Prepare mint transaction - const encodedMintFunctionData = encodeFunctionData({ - abi: zora721.abi, - functionName: 'purchase', - args: [BigInt(zora721.quantity)], - }) - - const prepared721Mint = { - to: zora721.proxyContractAddress, - value: zora721.mintPrice * BigInt(zora721.quantity), - data: encodedMintFunctionData, - } - - let mintTxHash: `0x${string}` - - if (walletClient) { - mintTxHash = await walletClient.sendTransaction({ - chain: ANVIL_CONFIG.ACTIVE_CHAIN, - account: ANVIL_USER_0, - ...prepared721Mint, - }) - } else if (signer) { - mintTxHash = await signer - .sendTransaction({ - chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, - ...prepared721Mint, - }) - .then((tx: providers.TransactionResponse) => tx.hash) - } - - const zoraBalanceInAnvilWallet = await getZora721Balance({ - publicClient, - walletAddress: ANVIL_USER_0, - }) - - await vi.waitFor(() => { - expect(mintLogs.length).toBe(zora721.quantity) - expect(mintTxHash).toMatch(ADDRESS_REGEX) - expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA) - expect(NFT_FOR_MULTICALL_CREATE.tokenId).toBe(TOKENID_FOR_MULTICALL_CREATE) - expect(zoraBalanceInAnvilWallet).toBe(4n) - unwatch() - }) - }, - TIMEOUT - ) - - it( - 'can prepareCreateAccount', - async () => { - const preparedAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: zora721.proxyContractAddress, - tokenId: '1', - }) - - if (!preparedAccount.to) return false - - expect(isAddress(preparedAccount.to)).toEqual(true) - expect(typeof preparedAccount.value).toEqual('bigint') - expect(isHex(preparedAccount.data)).toEqual(true) - }, - TIMEOUT - ) - - // We create the account using an NFT in the EOA wallet so we can test the EOA methods and use the TBA address for tests - it( - 'can createAccount', - async () => { - const { account, txHash } = await tokenboundClient.createAccount(NFT_IN_EOA) - console.log('CREATED ACCT', account) - - const createdAccountTxReceipt = await publicClient.waitForTransactionReceipt({ - hash: txHash, - }) - - ZORA721_TBA_ADDRESS = account - await vi.waitFor(() => { - expect(account).toMatch(ADDRESS_REGEX) - expect(createdAccountTxReceipt.status).toBe('success') - }) - }, - TIMEOUT - ) - - it( - 'can createAccount with a custom salt', - async () => { - const { account, txHash } = await tokenboundClient.createAccount({ - ...NFT_IN_EOA, - salt: CUSTOM_SALT, - }) - console.log('CREATED ACCT WITH CUSTOM SALT', account) - - const createdAccountTxReceipt = await publicClient.waitForTransactionReceipt({ - hash: txHash, - }) - - ZORA721_TBA_ADDRESS_CUSTOM_SALT = account - await vi.waitFor(() => { - expect(account).toMatch(ADDRESS_REGEX) - expect(createdAccountTxReceipt.status).toBe('success') - }) - }, - TIMEOUT - ) - - it( - 'can createAccount with a custom chainId', - async () => { - const HARDHAT_CHAIN_ID = 31337 - - const { account, txHash } = await tokenboundClient.createAccount({ - ...NFT_IN_EOA, - chainId: HARDHAT_CHAIN_ID, - }) - console.log('CREATED ACCT WITH CUSTOM CHAIN ID', account) - - const createdAccountTxReceipt = await publicClient.waitForTransactionReceipt({ - hash: txHash, - }) - - const bytecode = await tokenboundClient.deconstructBytecode({ - accountAddress: account, - }) - - if (!bytecode) return false - - const { chainId } = bytecode - - console.log('CHAINID OF CREATED ACCT', chainId) - - expect(isAddress(account)).toEqual(true) - expect(createdAccountTxReceipt.status).toBe('success') - expect(chainId).toBe(HARDHAT_CHAIN_ID) - }, - TIMEOUT - ) - - v3OnlyIt( - 'can createAccount and append multicall transaction(s) that use the deployed TBA', - async () => { - const multicallTBAAddress = tokenboundClient.getAccount(NFT_FOR_MULTICALL_CREATE) - - // Perform a simple ERC20 balanceOf call to test the appended multicall transaction - const encodedBalanceOfFunctionData = encodeFunctionData({ - abi: erc20Abi, - functionName: 'balanceOf', - args: [multicallTBAAddress], - }) - - const preparedBalanceOfByTBA = await tokenboundClient.prepareExecution({ - account: multicallTBAAddress, - to: WETH_CONTRACT_ADDRESS, - value: 0n, - data: encodedBalanceOfFunctionData, - }) - - const appendedCall: Call3 = { - target: multicallTBAAddress, // Execute with TBA - allowFailure: false, - callData: preparedBalanceOfByTBA.data, - } - - const { account, txHash } = await tokenboundClient.createAccount({ - ...NFT_FOR_MULTICALL_CREATE, - appendedCalls: [appendedCall], - }) - console.log('CREATED ACCT WITH MULTICALL', account) - - const createdAccountTxReceipt = await publicClient.waitForTransactionReceipt({ - hash: txHash, - }) - - ZORA721_TBA_ADDRESS_MULTICALL = account - await vi.waitFor(() => { - expect(account).toMatch(ADDRESS_REGEX) - expect(createdAccountTxReceipt.status).toBe('success') - }) - }, - TIMEOUT - ) - - it('can checkAccountDeployment for the created account', async () => { - const isAccountDeployed = await tokenboundClient.checkAccountDeployment({ - accountAddress: ZORA721_TBA_ADDRESS, - }) - - console.log(`isAccountDeployed ${testName}`, isAccountDeployed) - - expect(isAccountDeployed).toEqual(true) - }) - - it('can getNFT for the created account', async () => { - const nft = await tokenboundClient.getNFT({ - accountAddress: ZORA721_TBA_ADDRESS, - }) - - if (!nft) throw new Error('Bytecode is undefined') - - const { chainId, tokenContract, tokenId } = nft - - expect(chainId).toEqual(ANVIL_CONFIG.ACTIVE_CHAIN.id) - expect(tokenContract).toEqual(NFT_IN_EOA.tokenContract) - expect(tokenId).toEqual(NFT_IN_EOA.tokenId) - }) - - it('can deconstructBytecode for the created account', async () => { - const bytecode = await tokenboundClient.deconstructBytecode({ - accountAddress: ZORA721_TBA_ADDRESS, - }) - - if (!bytecode) throw new Error('Bytecode is undefined') - - const { - chainId, - implementationAddress, - tokenContract, - tokenId, - salt, - erc1167Header, - erc1167Footer, - } = bytecode - - expect(chainId).toEqual(ANVIL_CONFIG.ACTIVE_CHAIN.id) - expect(erc1167Header).toEqual(TEST_CONFIG.ERC1167_HEADER) - // expect(implementationAddress).toEqual(ERC6551_DEPLOYMENT.IMPLEMENTATION.ADDRESS) - - if (isV2) { - expect(implementationAddress).toEqual(ERC6551_DEPLOYMENT.IMPLEMENTATION.ADDRESS) - } - if (isV3) { - expect(implementationAddress).toEqual(ERC6551_DEPLOYMENT.ACCOUNT_PROXY?.ADDRESS) - } - - expect(erc1167Footer).toEqual(TEST_CONFIG.ERC1167_FOOTER) - expect(tokenContract).toEqual(NFT_IN_EOA.tokenContract) - expect(tokenId).toEqual(NFT_IN_EOA.tokenId) - expect(salt).toEqual(0) - }) - - it('can getAccount', async () => { - const getAccount = tokenboundClient.getAccount(NFT_IN_EOA) - await vi.waitFor(() => { - expect(getAccount).toMatch(ADDRESS_REGEX) - expect(getAccount).toEqual(ZORA721_TBA_ADDRESS) - }) - }) - - it('can getAccount with a custom salt', async () => { - const getAccount = tokenboundClient.getAccount({ ...NFT_IN_EOA, salt: CUSTOM_SALT }) - await vi.waitFor(() => { - expect(getAccount).toMatch(ADDRESS_REGEX) - expect(getAccount).toEqual(ZORA721_TBA_ADDRESS_CUSTOM_SALT) - }) - }) - - // We transfer an NFT to the TBA so that we can test the TBA methods. - it( - 'can transfer one of the minted NFTs to the TBA', - async () => { - console.log('SAFE_TRANSFER', ZORA721_TBA_ADDRESS, 'tokenId', TOKENID1_IN_TBA) - - const transferCallData = encodeFunctionData({ - abi: zora721.abi, - functionName: 'safeTransferFrom', - args: [ - ANVIL_USER_0, // from - ZORA721_TBA_ADDRESS, // to - BigInt(TOKENID1_IN_TBA), // tokenId - ], - }) - - const preparedNFTTransfer = { - to: zora721.proxyContractAddress, - value: 0n, - data: transferCallData, - } - - let transferHash: `0x${string}` - - if (walletClient) { - transferHash = await walletClient.sendTransaction({ - chain: ANVIL_CONFIG.ACTIVE_CHAIN, - account: walletClient.account!.address, - ...preparedNFTTransfer, - }) - } else { - const tx = await signer.sendTransaction({ - chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, - ...preparedNFTTransfer, - }) - - transferHash = tx.hash - } - - const transactionReceipt = await publicClient.waitForTransactionReceipt({ - hash: transferHash, - }) - - const tbaNFTBalance = await getZora721Balance({ - publicClient, - walletAddress: ZORA721_TBA_ADDRESS, - }) - console.log('# of NFTs in TBA: ', tbaNFTBalance.toString()) - - await vi.waitFor(() => { - expect(transferHash).toMatch(ADDRESS_REGEX) - expect(transactionReceipt.status).toBe('success') - expect(tbaNFTBalance).toBe(1n) - }) - }, - TIMEOUT - ) - - it( - 'can transfer another minted NFT to the TBA', - async () => { - const transferCallData = encodeFunctionData({ - abi: zora721.abi, - functionName: 'safeTransferFrom', - args: [ - ANVIL_USER_0, // from - ZORA721_TBA_ADDRESS, // to - BigInt(TOKENID2_IN_TBA), // tokenId - ], - }) - - const preparedNFTTransfer = { - to: zora721.proxyContractAddress, - value: 0n, - data: transferCallData, - } - - let transferHash: `0x${string}` - - if (walletClient) { - transferHash = await walletClient.sendTransaction({ - chain: ANVIL_CONFIG.ACTIVE_CHAIN, - account: walletClient.account!.address, - ...preparedNFTTransfer, - }) - } else { - const tx = await signer.sendTransaction({ - chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, - ...preparedNFTTransfer, - }) - transferHash = tx.hash - } - - const transactionReceipt = await publicClient.waitForTransactionReceipt({ - hash: transferHash, - }) - - const tbaNFTBalance = await getZora721Balance({ - publicClient, - walletAddress: ZORA721_TBA_ADDRESS, - }) - console.log('# of NFTs in TBA: ', tbaNFTBalance.toString()) - - await vi.waitFor(() => { - expect(transferHash).toMatch(ADDRESS_REGEX) - expect(transactionReceipt.status).toBe('success') - expect(tbaNFTBalance).toBe(2n) - }) - }, - TIMEOUT - ) - - // To perform transactions using the SDK, we need to transfer some ETH into the TBA. - it( - 'can transfer ETH to the TBA', - async () => { - const ethAmount = 1 - const ethAmountWei = parseUnits(`${ethAmount}`, 18) - - const preparedETHTransfer = { - to: ZORA721_TBA_ADDRESS, - value: ethAmountWei, - // data is optional if nil - } - - let transferHash: `0x${string}` - if (walletClient) { - transferHash = await walletClient.sendTransaction({ - chain: ANVIL_CONFIG.ACTIVE_CHAIN, - account: walletClient.account!.address, - ...preparedETHTransfer, - }) - } else { - transferHash = await signer - .sendTransaction({ - chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, - ...preparedETHTransfer, - }) - .then((tx: providers.TransactionResponse) => tx.hash) - } - - const balanceAfter = await publicClient.getBalance({ - address: ZORA721_TBA_ADDRESS, - }) - - await vi.waitFor(() => { - expect(transferHash).toMatch(ADDRESS_REGEX) - expect(balanceAfter).toBe(ethAmountWei) - }) - }, - TIMEOUT - ) - - it(isV2 ? 'can prepareExecuteCall' : 'can prepareExecution', async () => { - const execution = { - account: ZORA721_TBA_ADDRESS, - to: TEST_CONFIG.RECIPIENT_ADDRESS, - value: 0n, - data: '', - } - - const preparedCall = isV3 - ? await tokenboundClient.prepareExecution(execution) - : await tokenboundClient.prepareExecuteCall(execution) - - expect(isAddress(preparedCall.to)).toEqual(true) - expect(typeof preparedCall.value).toEqual('bigint') - expect(isHex(preparedCall.data)).toEqual(true) - }) - - // Execute a basic call with no value with the TBA to see if it works. - it( - isV2 ? `can executeCall with the TBA` : `can execute with the TBA`, - async () => { - const execution = { - account: ZORA721_TBA_ADDRESS, - to: zora721.proxyContractAddress, - value: 0n, - data: '', - } - - const executedCallTxHash = isV3 - ? await tokenboundClient.execute(execution) - : await tokenboundClient.executeCall(execution) - - const transactionReceipt = await publicClient.getTransactionReceipt({ - hash: executedCallTxHash, - }) - - await vi.waitFor(() => { - expect(executedCallTxHash).toMatch(ADDRESS_REGEX) - expect(transactionReceipt.status).toBe('success') - }) - }, - TIMEOUT - ) - - it( - `can fall back to executeCall from execute for V2`, - async () => { - const execution = { - account: ZORA721_TBA_ADDRESS, - to: zora721.proxyContractAddress, - value: 0n, - data: '', - } - - const executedCallTxHash = await tokenboundClient.execute(execution) - - const transactionReceipt = await publicClient.getTransactionReceipt({ - hash: executedCallTxHash, - }) - - await vi.waitFor(() => { - expect(executedCallTxHash).toMatch(ADDRESS_REGEX) - expect(transactionReceipt.status).toBe('success') - }) - }, - TIMEOUT - ) - - // Other methods in the SDK implement executeCall, like transferETH, transferNFT, etc. - // so they provide further assurance that executeCall is working as expected: - - it('can transferETH with the TBA', async () => { - const EXPECTED_BALANCE_BEFORE = parseUnits('1', 18) - const EXPECTED_BALANCE_AFTER = parseUnits('0.75', 18) - - const balanceBefore = await publicClient.getBalance({ - address: ZORA721_TBA_ADDRESS, - }) - const ethTransferHash = await tokenboundClient.transferETH({ - account: ZORA721_TBA_ADDRESS, - amount: 0.25, - recipientAddress: ANVIL_USER_1, - }) - - const transactionReceipt = await publicClient.getTransactionReceipt({ - hash: ethTransferHash, - }) - - const balanceAfter = await publicClient.getBalance({ - address: ZORA721_TBA_ADDRESS, - }) - - console.log( - 'BEFORE: ', - formatEther(balanceBefore), - 'AFTER: ', - formatEther(balanceAfter) - ) - - await vi.waitFor(() => { - expect(ethTransferHash).toMatch(ADDRESS_REGEX) - expect(transactionReceipt.status).toBe('success') - expect(balanceBefore).toBe(EXPECTED_BALANCE_BEFORE) - expect(balanceAfter).toBe(EXPECTED_BALANCE_AFTER) - }) - }) - - it('can transferETH to an ENS with the TBA', async () => { - const EXPECTED_BALANCE_BEFORE = parseUnits('0.75', 18) - const EXPECTED_BALANCE_AFTER = parseUnits('0.5', 18) - - const balanceBefore = await publicClient.getBalance({ - address: ZORA721_TBA_ADDRESS, - }) - const ethTransferHash = await tokenboundClient.transferETH({ - account: ZORA721_TBA_ADDRESS, - amount: 0.25, - recipientAddress: 'jeebay.eth', - }) - const balanceAfter = await publicClient.getBalance({ - address: ZORA721_TBA_ADDRESS, - }) - - console.log( - 'BEFORE: ', - formatEther(balanceBefore), - 'AFTER: ', - formatEther(balanceAfter) - ) - - await vi.waitFor(() => { - expect(ethTransferHash).toMatch(ADDRESS_REGEX) - expect(balanceBefore).toBe(EXPECTED_BALANCE_BEFORE) - expect(balanceAfter).toBe(EXPECTED_BALANCE_AFTER) - }) - }) - - it('will not allow transferNFT 721 with an amount other than 1', async () => { - vi.spyOn(console, 'error') - - await expect(() => - tokenboundClient.transferNFT({ - account: ZORA721_TBA_ADDRESS, - tokenType: 'ERC721', - tokenContract: zora721.proxyContractAddress, - tokenId: TOKENID1_IN_TBA, - recipientAddress: ANVIL_USER_1, - amount: 2, - }) - ).rejects.toThrowError() - }) - - it('can transferNFT a 721 with the TBA', async () => { - const transferNFTHash = await tokenboundClient.transferNFT({ - account: ZORA721_TBA_ADDRESS, - tokenType: 'ERC721', - tokenContract: zora721.proxyContractAddress, - tokenId: TOKENID1_IN_TBA, - recipientAddress: ANVIL_USER_1, - }) - - const anvilAccount1NFTBalance = await getZora721Balance({ - publicClient, - walletAddress: ANVIL_USER_1, - }) - - await vi.waitFor(() => { - expect(transferNFTHash).toMatch(ADDRESS_REGEX) - expect(anvilAccount1NFTBalance).toBe(1n) - }) - }) - - it('can transferNFT to an ENS with the TBA', async () => { - const transferNFTHash = await tokenboundClient.transferNFT({ - account: ZORA721_TBA_ADDRESS, - tokenType: 'ERC721', - tokenContract: zora721.proxyContractAddress, - tokenId: TOKENID2_IN_TBA, - recipientAddress: 'jeebay.eth', - }) - - const addr = await resolvePossibleENS(publicClient, 'jeebay.eth') - - const anvilAccount1NFTBalance = await getZora721Balance({ - publicClient, - walletAddress: addr, - }) - - await vi.waitFor(() => { - expect(transferNFTHash).toMatch(ADDRESS_REGEX) - expect(anvilAccount1NFTBalance).toBe(1n) - }) - }) - - it('can mint 4 Zora 721 NFTs with the TBA', async () => { - const encodedMintFunctionData = encodeFunctionData({ - abi: zora721.abi, - functionName: 'purchase', - args: [BigInt(zora721.quantity)], - }) - - const execution = { - account: ZORA721_TBA_ADDRESS, - to: zora721.proxyContractAddress, - value: zora721.mintPrice * BigInt(zora721.quantity), - data: encodedMintFunctionData, - } - - const mintToTBATxHash = isV3 - ? await tokenboundClient.execute(execution) - : await tokenboundClient.executeCall(execution) - - const zoraBalanceInTBA = await getZora721Balance({ - publicClient, - walletAddress: ZORA721_TBA_ADDRESS, - }) - - console.log('721s MINTED TO TBA: ', zoraBalanceInTBA.toString()) - - await vi.waitFor(() => { - expect(mintToTBATxHash).toMatch(ADDRESS_REGEX) - expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA) - expect(zoraBalanceInTBA).toBe(4n) - }) - }) - - it('can mint an 1155 with the TBA', async () => { - const mintingAccount: `0x${string}` = ZORA721_TBA_ADDRESS - - const minterArguments: `0x${string}` = encodeAbiParameters( - parseAbiParameters('address'), - [mintingAccount] - ) - - const data = encodeFunctionData({ - abi: zora1155.abi, - functionName: 'mint', - args: [ - zora1155.fixedPriceSalesStrategy, // IMinter1155 - zora1155.tokenId, // uint256 - zora1155.quantity, // uint256 - minterArguments, // bytes - ], - }) - - const execution = { - account: mintingAccount, - to: zora1155.proxyContractAddress, - value: zora1155.mintFee * zora1155.quantity, - data, - } - - const mint1155TxHash = isV3 - ? await tokenboundClient.execute(execution) - : await tokenboundClient.executeCall(execution) - - const zora1155BalanceInTBA = await getZora1155Balance({ - publicClient, - walletAddress: mintingAccount, - }) - - console.log('1155 Balance', zora1155BalanceInTBA) - - await vi.waitFor(() => { - expect(mint1155TxHash).toMatch(ADDRESS_REGEX) - expect(zora1155BalanceInTBA).toBe(5n) - }) - }) - - it('can transferNFT an 1155 with the TBA', async () => { - const transferAmount = 2 - - const transferNFTHash = await tokenboundClient.transferNFT({ - account: ZORA721_TBA_ADDRESS, - tokenType: 'ERC1155', - tokenContract: zora1155.proxyContractAddress, - tokenId: zora1155.tokenId.toString(), - recipientAddress: ANVIL_USER_1, - amount: transferAmount, - }) - - const anvilAccount1_1155Balance = await getZora1155Balance({ - publicClient, - walletAddress: ANVIL_USER_1, - }) - - console.log('1155 Balance', anvilAccount1_1155Balance) - - await vi.waitFor(() => { - expect(transferNFTHash).toMatch(ADDRESS_REGEX) - expect(anvilAccount1_1155Balance).toBe(BigInt(transferAmount)) - }) - }) - - v3OnlyIt('can verify if a wallet isValidSigner for an owned NFT', async () => { - console.log('ZORA721_TBA_ADDRESS in isValidSigner', ZORA721_TBA_ADDRESS) - const isValidSigner = await tokenboundClient.isValidSigner({ - account: ZORA721_TBA_ADDRESS, - }) - - console.log('isValidSigner?', isValidSigner) - - await vi.waitFor(() => { - expect(isValidSigner).toBe(true) - }) - }) - - // Test signing in viem only. - // Ethers 5/6 don't appear to support signing messages via personal_sign with this testing configuration. - viemOnlyIt('can sign a message', async () => { - const signedMessageHash = await tokenboundClient.signMessage({ - message: 'Sign me', - }) - - console.log('SIGNED MESSAGE: ', signedMessageHash) - - await vi.waitFor(() => { - expect(signedMessageHash).toMatch(ADDRESS_REGEX) - }) - }) - - // Test signing hex message in viem only. - viemOnlyIt('can sign a hexified message', async () => { - const hexSignedMessageHash = await tokenboundClient.signMessage({ - message: { raw: '0x68656c6c6f20776f726c64' }, - }) - - console.log('HEX SIGNED MESSAGE: ', hexSignedMessageHash) - - await vi.waitFor(() => { - expect(hexSignedMessageHash).toMatch(ADDRESS_REGEX) - }) - }) - - // Test signing Uint8Array message as raw in viem only. - viemOnlyIt('can sign a Uint8Array message as raw', async () => { - const uint8ArrayMessage: Uint8Array = new Uint8Array([72, 101, 108, 108, 111]) // "Hello" in ASCII - - const rawUint8Hash = await tokenboundClient.signMessage({ - message: { raw: uint8ArrayMessage }, - }) - - await vi.waitFor(() => { - expect(rawUint8Hash).toMatch(ADDRESS_REGEX) - }) - }) - - // Test signing ArrayLike message in viem only. - viemOnlyIt( - 'throws when viem incorrectly receives an ArrayLike message for signing', - async () => { - vi.spyOn(console, 'error') - const arrayMessage: ArrayLike = [72, 101, 108, 108, 111] // "Hello" in ASCII - - await expect(() => - tokenboundClient.signMessage({ - message: arrayMessage, - }) - ).rejects.toThrowError() - } - ) - - // Test signing Uint8Array message in viem only. - viemOnlyIt( - 'throws when viem incorrectly receives an Uint8Array message for signing', - async () => { - const uint8ArrayMessage: Uint8Array = new Uint8Array([72, 101, 108, 108, 111]) // "Hello" in ASCII - - await expect(() => - tokenboundClient.signMessage({ - message: uint8ArrayMessage, - }) - ).rejects.toThrowError() - } - ) - - it( - 'can transferERC20 with the TBA', - async () => { - const depositEthValue = 0.2 - const depositWeiValue = ethToWei(depositEthValue) - const transferEthValue = 0.1 - const transferWeiValue = ethToWei(transferEthValue) - let wethDepositHash: `0x${string}` - let wethTransferHash: `0x${string}` - - const tbaWETHInitial = await getWETHBalance({ - publicClient, - walletAddress: ZORA721_TBA_ADDRESS, - }) - - // Prepare encoded WETH transfer to TBA - const wethTransferCallData = encodeFunctionData({ - abi: wethABI, - functionName: 'transfer', - args: [ZORA721_TBA_ADDRESS, depositWeiValue], - }) - - if (walletClient) { - const wethContract = getContract({ - address: WETH_CONTRACT_ADDRESS, - abi: wethABI, - client: { - wallet: walletClient, - }, - }) - - // Convert ETH to WETH in ANVIL_USER_0 wallet - wethDepositHash = await wethContract.write.deposit({ - account: ANVIL_USER_0, - chain: ANVIL_CONFIG.ACTIVE_CHAIN, - value: depositWeiValue, - }) - - // Transfer WETH from ANVIL_USER_0 to TBA - wethTransferHash = await walletClient.sendTransaction({ - account: walletClient.account!, - chain: ANVIL_CONFIG.ACTIVE_CHAIN, - to: WETH_CONTRACT_ADDRESS, - value: 0n, - data: wethTransferCallData, - }) - } else if (signer) { - // Convert ETH to WETH in ANVIL_USER_0 wallet - wethDepositHash = await signer - .sendTransaction({ - to: WETH_CONTRACT_ADDRESS, - value: depositWeiValue, - }) - .then((tx: providers.TransactionResponse) => tx.hash) - - // Transfer WETH from ANVIL_USER_0 to TBA - wethTransferHash = await signer - .sendTransaction({ - to: WETH_CONTRACT_ADDRESS, - value: BigInt(0), - data: wethTransferCallData, - }) - .then((tx: providers.TransactionResponse) => tx.hash) - } - - const tbaWETHReceived = await getWETHBalance({ - publicClient, - walletAddress: ZORA721_TBA_ADDRESS, - }) - - // Transfer WETH from TBA to ANVIL_USER_1 - const transferredERC20Hash = await tokenboundClient.transferERC20({ - account: ZORA721_TBA_ADDRESS, - amount: transferEthValue, - recipientAddress: ANVIL_USER_1, - erc20tokenAddress: WETH_CONTRACT_ADDRESS, - erc20tokenDecimals: 18, - }) - - // Transfer WETH from TBA to jeebay.eth - const ensTransferredERC20Hash = await tokenboundClient.transferERC20({ - account: ZORA721_TBA_ADDRESS, - amount: transferEthValue, - recipientAddress: 'jeebay.eth', - erc20tokenAddress: WETH_CONTRACT_ADDRESS, - erc20tokenDecimals: 18, - }) - - const tbaWETHFinal = await getWETHBalance({ - publicClient, - walletAddress: ZORA721_TBA_ADDRESS, - }) - - const anvilUser1WETHBalance = await getWETHBalance({ - publicClient, - walletAddress: ANVIL_USER_1, - }) - - const ensWETHBalance = await getWETHBalance({ - publicClient, - walletAddress: 'jeebay.eth', - }) - - console.log( - 'TBA WETH INITIAL: ', - formatEther(tbaWETHInitial), - 'TBA RECEIVED: ', - formatEther(tbaWETHReceived), - 'AFTER: ', - formatEther(tbaWETHFinal), - 'ANVIL USER 1 BALANCE: ', - formatEther(anvilUser1WETHBalance), - 'ENS BALANCE: ', - formatEther(ensWETHBalance) - ) - - await vi.waitFor(() => { - expect(wethDepositHash).toMatch(ADDRESS_REGEX) - expect(wethTransferHash).toMatch(ADDRESS_REGEX) - expect(transferredERC20Hash).toMatch(ADDRESS_REGEX) - expect(ensTransferredERC20Hash).toMatch(ADDRESS_REGEX) - expect(tbaWETHReceived).toBe(depositWeiValue) - expect(anvilUser1WETHBalance).toBe(transferWeiValue) - expect(ensWETHBalance).toBe(transferWeiValue) - }) - }, - TIMEOUT - ) - } -) - -describe('Custom client configurations', () => { - it('can use a custom publicClient RPC URL', async () => { - const customPublicClientRPCUrl = 'https://cloudflare-eth.com' - const tokenboundClient = new TokenboundClient({ - chain: mainnet, - walletClient, - publicClientRPCUrl: customPublicClientRPCUrl, - }) - - await vi.waitFor(() => { - expect(tokenboundClient.publicClient?.transport?.url).toBe(customPublicClientRPCUrl) - }) - }) - it('can use a custom chain as parameter', async () => { - const ZORA_CHAIN_ID = 7777777 - - const tokenboundClient = new TokenboundClient({ - walletClient, - chain: zora, - }) - - await vi.waitFor(() => { - expect(tokenboundClient.publicClient?.chain?.id).toBe(ZORA_CHAIN_ID) - }) - }) -}) + "$testName", + ({ testName, walletClient, signer, version }) => { + const isV2 = version === TBVersion.V2; + const isV3 = isV2 === false; + const viemOnlyIt = walletClient ? it : it.skip; // Skip tests that are non-functional in Ethers + const v3OnlyIt = isV3 ? it : it.skip; + // Set up Anvil instance + clients + const anvil = createAnvil({ ...CREATE_ANVIL_OPTIONS }); + const CUSTOM_SALT = 6551; + let tokenboundClient: TokenboundClient; + let publicClient: PublicClient; + let NFT_IN_EOA: CreateAccountParams; + let NFT_FOR_MULTICALL_CREATE: CreateAccountParams; + let TOKENID_IN_EOA: string; + let TOKENID_FOR_MULTICALL_CREATE: string; + let TOKENID1_IN_TBA: string; + let TOKENID2_IN_TBA: string; + let ZORA721_TBA_ADDRESS: `0x${string}`; + let ZORA721_TBA_ADDRESS_CUSTOM_SALT: `0x${string}`; + let ZORA721_TBA_ADDRESS_MULTICALL: `0x${string}`; + + const ERC6551_DEPLOYMENT = isV2 ? ERC_6551_LEGACY_V2 : ERC_6551_DEFAULT; + + // Spin up a fresh anvil instance each time we run the test suite against a different signer + beforeAll(async () => { + try { + // publicClient = getPublicClient({ chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id }) + publicClient = getPublicClient({ chain: ANVIL_CONFIG.ACTIVE_CHAIN }); + + // Pass in the Anvil test walletClient + publicClient + tokenboundClient = new TokenboundClient({ + // chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + walletClient, + signer, + publicClient, + implementationAddress: isV3 + ? undefined + : ERC6551_DEPLOYMENT.IMPLEMENTATION.ADDRESS, + registryAddress: isV3 + ? undefined + : ERC6551_DEPLOYMENT.REGISTRY.ADDRESS, + }); + + await anvil.start(); + console.log(`START → \x1b[94m ${testName} \x1b[0m`); + } catch (err) { + console.error("Error during setup:", err); + } + }, TIMEOUT); + + afterAll(async () => { + await anvil.stop(); + console.log(`END → \x1b[94m ${testName} \x1b[0m`); + }); + + it("can get the SDK version", () => { + const sdkVersion: string = tokenboundClient.getSDKVersion(); + console.log(`SDK Version → \x1b[94m ${sdkVersion} \x1b[0m`); + // console.log('SDK Version:', sdkVersion) + expect(sdkVersion).toBeDefined(); + }); + + // To test the SDK methods, we need to mint some NFTs into the Anvil wallet + // so that we can transfer them to the TBA and test the TBA methods. + it( + "can mint 2 Zora 721 NFTs into Anvil wallet #0", + async () => { + let mintLogs: Log[] = []; + + // Set up observer for mint event so we can get the tokenId + const unwatch = publicClient.watchContractEvent({ + address: zora721.proxyContractAddress, + abi: zora721.abi, + eventName: "Transfer", + args: { + to: ANVIL_USER_0, + }, + onLogs: (logs) => { + mintLogs = logs; + const { tokenId: eoaTokenId } = logs[0].args; + const { tokenId: tbaToken1Id } = logs[1].args; + const { tokenId: tbaToken2Id } = logs[2].args; + const { tokenId: multicallTokenId } = logs[3].args; + + if (eoaTokenId && tbaToken1Id && tbaToken2Id && multicallTokenId) { + TOKENID_IN_EOA = eoaTokenId.toString(); + TOKENID_FOR_MULTICALL_CREATE = multicallTokenId.toString(); + TOKENID1_IN_TBA = tbaToken1Id.toString(); + TOKENID2_IN_TBA = tbaToken2Id.toString(); + + NFT_IN_EOA = { + tokenContract: zora721.proxyContractAddress, + tokenId: TOKENID_IN_EOA, + }; + NFT_FOR_MULTICALL_CREATE = { + tokenContract: zora721.proxyContractAddress, + tokenId: TOKENID_FOR_MULTICALL_CREATE, + }; + } + }, + }); + + // Prepare mint transaction + const encodedMintFunctionData = encodeFunctionData({ + abi: zora721.abi, + functionName: "purchase", + args: [BigInt(zora721.quantity)], + }); + + const prepared721Mint = { + to: zora721.proxyContractAddress, + value: zora721.mintPrice * BigInt(zora721.quantity), + data: encodedMintFunctionData, + }; + + let mintTxHash: `0x${string}`; + + if (walletClient) { + mintTxHash = await walletClient.sendTransaction({ + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + account: ANVIL_USER_0, + ...prepared721Mint, + }); + } else if (signer) { + mintTxHash = await signer + .sendTransaction({ + chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, + ...prepared721Mint, + }) + .then((tx: providers.TransactionResponse) => tx.hash); + } + + const zoraBalanceInAnvilWallet = await getZora721Balance({ + publicClient, + walletAddress: ANVIL_USER_0, + }); + + await vi.waitFor(() => { + expect(mintLogs.length).toBe(zora721.quantity); + expect(mintTxHash).toMatch(ADDRESS_REGEX); + expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA); + expect(NFT_FOR_MULTICALL_CREATE.tokenId).toBe( + TOKENID_FOR_MULTICALL_CREATE, + ); + expect(zoraBalanceInAnvilWallet).toBe(4n); + unwatch(); + }); + }, + TIMEOUT, + ); + + it( + "can prepareCreateAccount", + async () => { + const preparedAccount = await tokenboundClient.prepareCreateAccount({ + tokenContract: zora721.proxyContractAddress, + tokenId: "1", + }); + + if (!preparedAccount.to) return false; + + expect(isAddress(preparedAccount.to)).toEqual(true); + expect(typeof preparedAccount.value).toEqual("bigint"); + expect(isHex(preparedAccount.data)).toEqual(true); + }, + TIMEOUT, + ); + + // We create the account using an NFT in the EOA wallet so we can test the EOA methods and use the TBA address for tests + it( + "can createAccount", + async () => { + const { account, txHash } = + await tokenboundClient.createAccount(NFT_IN_EOA); + console.log("CREATED ACCT", account); + + const createdAccountTxReceipt = + await publicClient.waitForTransactionReceipt({ + hash: txHash, + }); + + ZORA721_TBA_ADDRESS = account; + await vi.waitFor(() => { + expect(account).toMatch(ADDRESS_REGEX); + expect(createdAccountTxReceipt.status).toBe("success"); + }); + }, + TIMEOUT, + ); + + it( + "can createAccount with a custom salt", + async () => { + const { account, txHash } = await tokenboundClient.createAccount({ + ...NFT_IN_EOA, + salt: CUSTOM_SALT, + }); + console.log("CREATED ACCT WITH CUSTOM SALT", account); + + const createdAccountTxReceipt = + await publicClient.waitForTransactionReceipt({ + hash: txHash, + }); + + ZORA721_TBA_ADDRESS_CUSTOM_SALT = account; + await vi.waitFor(() => { + expect(account).toMatch(ADDRESS_REGEX); + expect(createdAccountTxReceipt.status).toBe("success"); + }); + }, + TIMEOUT, + ); + + it( + "can createAccount with a custom chainId", + async () => { + const HARDHAT_CHAIN_ID = 31337; + + const { account, txHash } = await tokenboundClient.createAccount({ + ...NFT_IN_EOA, + chainId: HARDHAT_CHAIN_ID, + }); + console.log("CREATED ACCT WITH CUSTOM CHAIN ID", account); + + const createdAccountTxReceipt = + await publicClient.waitForTransactionReceipt({ + hash: txHash, + }); + + const bytecode = await tokenboundClient.deconstructBytecode({ + accountAddress: account, + }); + + if (!bytecode) return false; + + const { chainId } = bytecode; + + console.log("CHAINID OF CREATED ACCT", chainId); + + expect(isAddress(account)).toEqual(true); + expect(createdAccountTxReceipt.status).toBe("success"); + expect(chainId).toBe(HARDHAT_CHAIN_ID); + }, + TIMEOUT, + ); + + v3OnlyIt( + "can createAccount and append multicall transaction(s) that use the deployed TBA", + async () => { + const multicallTBAAddress = tokenboundClient.getAccount( + NFT_FOR_MULTICALL_CREATE, + ); + + // Perform a simple ERC20 balanceOf call to test the appended multicall transaction + const encodedBalanceOfFunctionData = encodeFunctionData({ + abi: erc20Abi, + functionName: "balanceOf", + args: [multicallTBAAddress], + }); + + const preparedBalanceOfByTBA = await tokenboundClient.prepareExecution({ + account: multicallTBAAddress, + to: WETH_CONTRACT_ADDRESS, + value: 0n, + data: encodedBalanceOfFunctionData, + }); + + const appendedCall: Call3 = { + target: multicallTBAAddress, // Execute with TBA + allowFailure: false, + callData: preparedBalanceOfByTBA.data, + }; + + const { account, txHash } = await tokenboundClient.createAccount({ + ...NFT_FOR_MULTICALL_CREATE, + appendedCalls: [appendedCall], + }); + console.log("CREATED ACCT WITH MULTICALL", account); + + const createdAccountTxReceipt = + await publicClient.waitForTransactionReceipt({ + hash: txHash, + }); + + ZORA721_TBA_ADDRESS_MULTICALL = account; + await vi.waitFor(() => { + expect(account).toMatch(ADDRESS_REGEX); + expect(createdAccountTxReceipt.status).toBe("success"); + }); + }, + TIMEOUT, + ); + + it("can checkAccountDeployment for the created account", async () => { + const isAccountDeployed = await tokenboundClient.checkAccountDeployment({ + accountAddress: ZORA721_TBA_ADDRESS, + }); + + console.log(`isAccountDeployed ${testName}`, isAccountDeployed); + + expect(isAccountDeployed).toEqual(true); + }); + + it("can getNFT for the created account", async () => { + const nft = await tokenboundClient.getNFT({ + accountAddress: ZORA721_TBA_ADDRESS, + }); + + if (!nft) throw new Error("Bytecode is undefined"); + + const { chainId, tokenContract, tokenId } = nft; + + expect(chainId).toEqual(ANVIL_CONFIG.ACTIVE_CHAIN.id); + expect(tokenContract).toEqual(NFT_IN_EOA.tokenContract); + expect(tokenId).toEqual(NFT_IN_EOA.tokenId); + }); + + it("can deconstructBytecode for the created account", async () => { + const bytecode = await tokenboundClient.deconstructBytecode({ + accountAddress: ZORA721_TBA_ADDRESS, + }); + + if (!bytecode) throw new Error("Bytecode is undefined"); + + const { + chainId, + implementationAddress, + tokenContract, + tokenId, + salt, + erc1167Header, + erc1167Footer, + } = bytecode; + + expect(chainId).toEqual(ANVIL_CONFIG.ACTIVE_CHAIN.id); + expect(erc1167Header).toEqual(TEST_CONFIG.ERC1167_HEADER); + // expect(implementationAddress).toEqual(ERC6551_DEPLOYMENT.IMPLEMENTATION.ADDRESS) + + if (isV2) { + expect(implementationAddress).toEqual( + ERC6551_DEPLOYMENT.IMPLEMENTATION.ADDRESS, + ); + } + if (isV3) { + expect(implementationAddress).toEqual( + ERC6551_DEPLOYMENT.ACCOUNT_PROXY?.ADDRESS, + ); + } + + expect(erc1167Footer).toEqual(TEST_CONFIG.ERC1167_FOOTER); + expect(tokenContract).toEqual(NFT_IN_EOA.tokenContract); + expect(tokenId).toEqual(NFT_IN_EOA.tokenId); + expect(salt).toEqual(0); + }); + + it("can getAccount", async () => { + const getAccount = tokenboundClient.getAccount(NFT_IN_EOA); + await vi.waitFor(() => { + expect(getAccount).toMatch(ADDRESS_REGEX); + expect(getAccount).toEqual(ZORA721_TBA_ADDRESS); + }); + }); + + it("can getAccount with a custom salt", async () => { + const getAccount = tokenboundClient.getAccount({ + ...NFT_IN_EOA, + salt: CUSTOM_SALT, + }); + await vi.waitFor(() => { + expect(getAccount).toMatch(ADDRESS_REGEX); + expect(getAccount).toEqual(ZORA721_TBA_ADDRESS_CUSTOM_SALT); + }); + }); + + // We transfer an NFT to the TBA so that we can test the TBA methods. + it( + "can transfer one of the minted NFTs to the TBA", + async () => { + console.log( + "SAFE_TRANSFER", + ZORA721_TBA_ADDRESS, + "tokenId", + TOKENID1_IN_TBA, + ); + + const transferCallData = encodeFunctionData({ + abi: zora721.abi, + functionName: "safeTransferFrom", + args: [ + ANVIL_USER_0, // from + ZORA721_TBA_ADDRESS, // to + BigInt(TOKENID1_IN_TBA), // tokenId + ], + }); + + const preparedNFTTransfer = { + to: zora721.proxyContractAddress, + value: 0n, + data: transferCallData, + }; + + let transferHash: `0x${string}`; + + if (walletClient) { + transferHash = await walletClient.sendTransaction({ + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + account: walletClient.account!.address, + ...preparedNFTTransfer, + }); + } else { + const tx = await signer.sendTransaction({ + chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, + ...preparedNFTTransfer, + }); + + transferHash = tx.hash; + } + + const transactionReceipt = await publicClient.waitForTransactionReceipt( + { + hash: transferHash, + }, + ); + + const tbaNFTBalance = await getZora721Balance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }); + console.log("# of NFTs in TBA: ", tbaNFTBalance.toString()); + + await vi.waitFor(() => { + expect(transferHash).toMatch(ADDRESS_REGEX); + expect(transactionReceipt.status).toBe("success"); + expect(tbaNFTBalance).toBe(1n); + }); + }, + TIMEOUT, + ); + + it( + "can transfer another minted NFT to the TBA", + async () => { + const transferCallData = encodeFunctionData({ + abi: zora721.abi, + functionName: "safeTransferFrom", + args: [ + ANVIL_USER_0, // from + ZORA721_TBA_ADDRESS, // to + BigInt(TOKENID2_IN_TBA), // tokenId + ], + }); + + const preparedNFTTransfer = { + to: zora721.proxyContractAddress, + value: 0n, + data: transferCallData, + }; + + let transferHash: `0x${string}`; + + if (walletClient) { + transferHash = await walletClient.sendTransaction({ + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + account: walletClient.account!.address, + ...preparedNFTTransfer, + }); + } else { + const tx = await signer.sendTransaction({ + chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, + ...preparedNFTTransfer, + }); + transferHash = tx.hash; + } + + const transactionReceipt = await publicClient.waitForTransactionReceipt( + { + hash: transferHash, + }, + ); + + const tbaNFTBalance = await getZora721Balance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }); + console.log("# of NFTs in TBA: ", tbaNFTBalance.toString()); + + await vi.waitFor(() => { + expect(transferHash).toMatch(ADDRESS_REGEX); + expect(transactionReceipt.status).toBe("success"); + expect(tbaNFTBalance).toBe(2n); + }); + }, + TIMEOUT, + ); + + // To perform transactions using the SDK, we need to transfer some ETH into the TBA. + it( + "can transfer ETH to the TBA", + async () => { + const ethAmount = 1; + const ethAmountWei = parseUnits(`${ethAmount}`, 18); + + const preparedETHTransfer = { + to: ZORA721_TBA_ADDRESS, + value: ethAmountWei, + // data is optional if nil + }; + + let transferHash: `0x${string}`; + if (walletClient) { + transferHash = await walletClient.sendTransaction({ + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + account: walletClient.account!.address, + ...preparedETHTransfer, + }); + } else { + transferHash = await signer + .sendTransaction({ + chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, + ...preparedETHTransfer, + }) + .then((tx: providers.TransactionResponse) => tx.hash); + } + + const balanceAfter = await publicClient.getBalance({ + address: ZORA721_TBA_ADDRESS, + }); + + await vi.waitFor(() => { + expect(transferHash).toMatch(ADDRESS_REGEX); + expect(balanceAfter).toBe(ethAmountWei); + }); + }, + TIMEOUT, + ); + + it(isV2 ? "can prepareExecuteCall" : "can prepareExecution", async () => { + const execution = { + account: ZORA721_TBA_ADDRESS, + to: TEST_CONFIG.RECIPIENT_ADDRESS, + value: 0n, + data: "", + }; + + const preparedCall = isV3 + ? await tokenboundClient.prepareExecution(execution) + : await tokenboundClient.prepareExecuteCall(execution); + + expect(isAddress(preparedCall.to)).toEqual(true); + expect(typeof preparedCall.value).toEqual("bigint"); + expect(isHex(preparedCall.data)).toEqual(true); + }); + + // Execute a basic call with no value with the TBA to see if it works. + it( + isV2 ? `can executeCall with the TBA` : `can execute with the TBA`, + async () => { + const execution = { + account: ZORA721_TBA_ADDRESS, + to: zora721.proxyContractAddress, + value: 0n, + data: "", + }; + + const executedCallTxHash = isV3 + ? await tokenboundClient.execute(execution) + : await tokenboundClient.executeCall(execution); + + const transactionReceipt = await publicClient.getTransactionReceipt({ + hash: executedCallTxHash, + }); + + await vi.waitFor(() => { + expect(executedCallTxHash).toMatch(ADDRESS_REGEX); + expect(transactionReceipt.status).toBe("success"); + }); + }, + TIMEOUT, + ); + + it( + `can fall back to executeCall from execute for V2`, + async () => { + const execution = { + account: ZORA721_TBA_ADDRESS, + to: zora721.proxyContractAddress, + value: 0n, + data: "", + }; + + const executedCallTxHash = await tokenboundClient.execute(execution); + + const transactionReceipt = await publicClient.getTransactionReceipt({ + hash: executedCallTxHash, + }); + + await vi.waitFor(() => { + expect(executedCallTxHash).toMatch(ADDRESS_REGEX); + expect(transactionReceipt.status).toBe("success"); + }); + }, + TIMEOUT, + ); + + // Other methods in the SDK implement executeCall, like transferETH, transferNFT, etc. + // so they provide further assurance that executeCall is working as expected: + + it("can transferETH with the TBA", async () => { + const EXPECTED_BALANCE_BEFORE = parseUnits("1", 18); + const EXPECTED_BALANCE_AFTER = parseUnits("0.75", 18); + + const balanceBefore = await publicClient.getBalance({ + address: ZORA721_TBA_ADDRESS, + }); + const ethTransferHash = await tokenboundClient.transferETH({ + account: ZORA721_TBA_ADDRESS, + amount: 0.25, + recipientAddress: ANVIL_USER_1, + }); + + const transactionReceipt = await publicClient.getTransactionReceipt({ + hash: ethTransferHash, + }); + + const balanceAfter = await publicClient.getBalance({ + address: ZORA721_TBA_ADDRESS, + }); + + console.log( + "BEFORE: ", + formatEther(balanceBefore), + "AFTER: ", + formatEther(balanceAfter), + ); + + await vi.waitFor(() => { + expect(ethTransferHash).toMatch(ADDRESS_REGEX); + expect(transactionReceipt.status).toBe("success"); + expect(balanceBefore).toBe(EXPECTED_BALANCE_BEFORE); + expect(balanceAfter).toBe(EXPECTED_BALANCE_AFTER); + }); + }); + + it("can transferETH to an ENS with the TBA", async () => { + const EXPECTED_BALANCE_BEFORE = parseUnits("0.75", 18); + const EXPECTED_BALANCE_AFTER = parseUnits("0.5", 18); + + const balanceBefore = await publicClient.getBalance({ + address: ZORA721_TBA_ADDRESS, + }); + const ethTransferHash = await tokenboundClient.transferETH({ + account: ZORA721_TBA_ADDRESS, + amount: 0.25, + recipientAddress: "jeebay.eth", + }); + const balanceAfter = await publicClient.getBalance({ + address: ZORA721_TBA_ADDRESS, + }); + + console.log( + "BEFORE: ", + formatEther(balanceBefore), + "AFTER: ", + formatEther(balanceAfter), + ); + + await vi.waitFor(() => { + expect(ethTransferHash).toMatch(ADDRESS_REGEX); + expect(balanceBefore).toBe(EXPECTED_BALANCE_BEFORE); + expect(balanceAfter).toBe(EXPECTED_BALANCE_AFTER); + }); + }); + + it("will not allow transferNFT 721 with an amount other than 1", async () => { + vi.spyOn(console, "error"); + + await expect(() => + tokenboundClient.transferNFT({ + account: ZORA721_TBA_ADDRESS, + tokenType: "ERC721", + tokenContract: zora721.proxyContractAddress, + tokenId: TOKENID1_IN_TBA, + recipientAddress: ANVIL_USER_1, + amount: 2, + }), + ).rejects.toThrowError(); + }); + + it("can transferNFT a 721 with the TBA", async () => { + const transferNFTHash = await tokenboundClient.transferNFT({ + account: ZORA721_TBA_ADDRESS, + tokenType: "ERC721", + tokenContract: zora721.proxyContractAddress, + tokenId: TOKENID1_IN_TBA, + recipientAddress: ANVIL_USER_1, + }); + + const anvilAccount1NFTBalance = await getZora721Balance({ + publicClient, + walletAddress: ANVIL_USER_1, + }); + + await vi.waitFor(() => { + expect(transferNFTHash).toMatch(ADDRESS_REGEX); + expect(anvilAccount1NFTBalance).toBe(1n); + }); + }); + + it("can transferNFT to an ENS with the TBA", async () => { + const transferNFTHash = await tokenboundClient.transferNFT({ + account: ZORA721_TBA_ADDRESS, + tokenType: "ERC721", + tokenContract: zora721.proxyContractAddress, + tokenId: TOKENID2_IN_TBA, + recipientAddress: "jeebay.eth", + }); + + const addr = await resolvePossibleENS(publicClient, "jeebay.eth"); + + const anvilAccount1NFTBalance = await getZora721Balance({ + publicClient, + walletAddress: addr, + }); + + await vi.waitFor(() => { + expect(transferNFTHash).toMatch(ADDRESS_REGEX); + expect(anvilAccount1NFTBalance).toBe(1n); + }); + }); + + it("can mint 4 Zora 721 NFTs with the TBA", async () => { + const encodedMintFunctionData = encodeFunctionData({ + abi: zora721.abi, + functionName: "purchase", + args: [BigInt(zora721.quantity)], + }); + + const execution = { + account: ZORA721_TBA_ADDRESS, + to: zora721.proxyContractAddress, + value: zora721.mintPrice * BigInt(zora721.quantity), + data: encodedMintFunctionData, + }; + + const mintToTBATxHash = isV3 + ? await tokenboundClient.execute(execution) + : await tokenboundClient.executeCall(execution); + + const zoraBalanceInTBA = await getZora721Balance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }); + + console.log("721s MINTED TO TBA: ", zoraBalanceInTBA.toString()); + + await vi.waitFor(() => { + expect(mintToTBATxHash).toMatch(ADDRESS_REGEX); + expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA); + expect(zoraBalanceInTBA).toBe(4n); + }); + }); + + it("can mint an 1155 with the TBA", async () => { + const mintingAccount: `0x${string}` = ZORA721_TBA_ADDRESS; + + const minterArguments: `0x${string}` = encodeAbiParameters( + parseAbiParameters("address"), + [mintingAccount], + ); + + const data = encodeFunctionData({ + abi: zora1155.abi, + functionName: "mint", + args: [ + zora1155.fixedPriceSalesStrategy, // IMinter1155 + zora1155.tokenId, // uint256 + zora1155.quantity, // uint256 + minterArguments, // bytes + ], + }); + + const execution = { + account: mintingAccount, + to: zora1155.proxyContractAddress, + value: zora1155.mintFee * zora1155.quantity, + data, + }; + + const mint1155TxHash = isV3 + ? await tokenboundClient.execute(execution) + : await tokenboundClient.executeCall(execution); + + const zora1155BalanceInTBA = await getZora1155Balance({ + publicClient, + walletAddress: mintingAccount, + }); + + console.log("1155 Balance", zora1155BalanceInTBA); + + await vi.waitFor(() => { + expect(mint1155TxHash).toMatch(ADDRESS_REGEX); + expect(zora1155BalanceInTBA).toBe(5n); + }); + }); + + it("can transferNFT an 1155 with the TBA", async () => { + const transferAmount = 2; + + const transferNFTHash = await tokenboundClient.transferNFT({ + account: ZORA721_TBA_ADDRESS, + tokenType: "ERC1155", + tokenContract: zora1155.proxyContractAddress, + tokenId: zora1155.tokenId.toString(), + recipientAddress: ANVIL_USER_1, + amount: transferAmount, + }); + + const anvilAccount1_1155Balance = await getZora1155Balance({ + publicClient, + walletAddress: ANVIL_USER_1, + }); + + console.log("1155 Balance", anvilAccount1_1155Balance); + + await vi.waitFor(() => { + expect(transferNFTHash).toMatch(ADDRESS_REGEX); + expect(anvilAccount1_1155Balance).toBe(BigInt(transferAmount)); + }); + }); + + v3OnlyIt( + "can verify if a wallet isValidSigner for an owned NFT", + async () => { + console.log( + "ZORA721_TBA_ADDRESS in isValidSigner", + ZORA721_TBA_ADDRESS, + ); + const isValidSigner = await tokenboundClient.isValidSigner({ + account: ZORA721_TBA_ADDRESS, + }); + + console.log("isValidSigner?", isValidSigner); + + await vi.waitFor(() => { + expect(isValidSigner).toBe(true); + }); + }, + ); + + // Test signing in viem only. + // Ethers 5/6 don't appear to support signing messages via personal_sign with this testing configuration. + viemOnlyIt("can sign a message", async () => { + const signedMessageHash = await tokenboundClient.signMessage({ + message: "Sign me", + }); + + console.log("SIGNED MESSAGE: ", signedMessageHash); + + await vi.waitFor(() => { + expect(signedMessageHash).toMatch(ADDRESS_REGEX); + }); + }); + + // Test signing hex message in viem only. + viemOnlyIt("can sign a hexified message", async () => { + const hexSignedMessageHash = await tokenboundClient.signMessage({ + message: { raw: "0x68656c6c6f20776f726c64" }, + }); + + console.log("HEX SIGNED MESSAGE: ", hexSignedMessageHash); + + await vi.waitFor(() => { + expect(hexSignedMessageHash).toMatch(ADDRESS_REGEX); + }); + }); + + // Test signing Uint8Array message as raw in viem only. + viemOnlyIt("can sign a Uint8Array message as raw", async () => { + const uint8ArrayMessage: Uint8Array = new Uint8Array([ + 72, 101, 108, 108, 111, + ]); // "Hello" in ASCII + + const rawUint8Hash = await tokenboundClient.signMessage({ + message: { raw: uint8ArrayMessage }, + }); + + await vi.waitFor(() => { + expect(rawUint8Hash).toMatch(ADDRESS_REGEX); + }); + }); + + // Test signing ArrayLike message in viem only. + viemOnlyIt( + "throws when viem incorrectly receives an ArrayLike message for signing", + async () => { + vi.spyOn(console, "error"); + const arrayMessage: ArrayLike = [72, 101, 108, 108, 111]; // "Hello" in ASCII + + await expect(() => + tokenboundClient.signMessage({ + message: arrayMessage, + }), + ).rejects.toThrowError(); + }, + ); + + // Test signing Uint8Array message in viem only. + viemOnlyIt( + "throws when viem incorrectly receives an Uint8Array message for signing", + async () => { + const uint8ArrayMessage: Uint8Array = new Uint8Array([ + 72, 101, 108, 108, 111, + ]); // "Hello" in ASCII + + await expect(() => + tokenboundClient.signMessage({ + message: uint8ArrayMessage, + }), + ).rejects.toThrowError(); + }, + ); + + it( + "can transferERC20 with the TBA", + async () => { + const depositEthValue = 0.2; + const depositWeiValue = ethToWei(depositEthValue); + const transferEthValue = 0.1; + const transferWeiValue = ethToWei(transferEthValue); + let wethDepositHash: `0x${string}`; + let wethTransferHash: `0x${string}`; + + const tbaWETHInitial = await getWETHBalance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }); + + // Prepare encoded WETH transfer to TBA + const wethTransferCallData = encodeFunctionData({ + abi: wethABI, + functionName: "transfer", + args: [ZORA721_TBA_ADDRESS, depositWeiValue], + }); + + if (walletClient) { + const wethContract = getContract({ + address: WETH_CONTRACT_ADDRESS, + abi: wethABI, + client: { + wallet: walletClient, + }, + }); + + // Convert ETH to WETH in ANVIL_USER_0 wallet + wethDepositHash = await wethContract.write.deposit({ + account: ANVIL_USER_0, + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + value: depositWeiValue, + }); + + // Transfer WETH from ANVIL_USER_0 to TBA + wethTransferHash = await walletClient.sendTransaction({ + account: walletClient.account!, + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + to: WETH_CONTRACT_ADDRESS, + value: 0n, + data: wethTransferCallData, + }); + } else if (signer) { + // Convert ETH to WETH in ANVIL_USER_0 wallet + wethDepositHash = await signer + .sendTransaction({ + to: WETH_CONTRACT_ADDRESS, + value: depositWeiValue, + }) + .then((tx: providers.TransactionResponse) => tx.hash); + + // Transfer WETH from ANVIL_USER_0 to TBA + wethTransferHash = await signer + .sendTransaction({ + to: WETH_CONTRACT_ADDRESS, + value: BigInt(0), + data: wethTransferCallData, + }) + .then((tx: providers.TransactionResponse) => tx.hash); + } + + const tbaWETHReceived = await getWETHBalance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }); + + // Transfer WETH from TBA to ANVIL_USER_1 + const transferredERC20Hash = await tokenboundClient.transferERC20({ + account: ZORA721_TBA_ADDRESS, + amount: transferEthValue, + recipientAddress: ANVIL_USER_1, + erc20tokenAddress: WETH_CONTRACT_ADDRESS, + erc20tokenDecimals: 18, + }); + + // Transfer WETH from TBA to jeebay.eth + const ensTransferredERC20Hash = await tokenboundClient.transferERC20({ + account: ZORA721_TBA_ADDRESS, + amount: transferEthValue, + recipientAddress: "jeebay.eth", + erc20tokenAddress: WETH_CONTRACT_ADDRESS, + erc20tokenDecimals: 18, + }); + + const tbaWETHFinal = await getWETHBalance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }); + + const anvilUser1WETHBalance = await getWETHBalance({ + publicClient, + walletAddress: ANVIL_USER_1, + }); + + const ensWETHBalance = await getWETHBalance({ + publicClient, + walletAddress: "jeebay.eth", + }); + + console.log( + "TBA WETH INITIAL: ", + formatEther(tbaWETHInitial), + "TBA RECEIVED: ", + formatEther(tbaWETHReceived), + "AFTER: ", + formatEther(tbaWETHFinal), + "ANVIL USER 1 BALANCE: ", + formatEther(anvilUser1WETHBalance), + "ENS BALANCE: ", + formatEther(ensWETHBalance), + ); + + await vi.waitFor(() => { + expect(wethDepositHash).toMatch(ADDRESS_REGEX); + expect(wethTransferHash).toMatch(ADDRESS_REGEX); + expect(transferredERC20Hash).toMatch(ADDRESS_REGEX); + expect(ensTransferredERC20Hash).toMatch(ADDRESS_REGEX); + expect(tbaWETHReceived).toBe(depositWeiValue); + expect(anvilUser1WETHBalance).toBe(transferWeiValue); + expect(ensWETHBalance).toBe(transferWeiValue); + }); + }, + TIMEOUT, + ); + }, +); + +describe("Custom client configurations", () => { + it("can use a custom publicClient RPC URL", async () => { + const customPublicClientRPCUrl = "https://cloudflare-eth.com"; + const tokenboundClient = new TokenboundClient({ + chain: mainnet, + walletClient, + publicClientRPCUrl: customPublicClientRPCUrl, + }); + + await vi.waitFor(() => { + expect(tokenboundClient.publicClient?.transport?.url).toBe( + customPublicClientRPCUrl, + ); + }); + }); + it("can use a custom chain as parameter", async () => { + const ZORA_CHAIN_ID = 7777777; + + const tokenboundClient = new TokenboundClient({ + walletClient, + chain: zora, + }); + + await vi.waitFor(() => { + expect(tokenboundClient.publicClient?.chain?.id).toBe(ZORA_CHAIN_ID); + }); + }); +}); diff --git a/packages/sdk/src/test/config/anvil.ts b/packages/sdk/src/test/config/anvil.ts index 651c9f0..209117a 100644 --- a/packages/sdk/src/test/config/anvil.ts +++ b/packages/sdk/src/test/config/anvil.ts @@ -1,15 +1,15 @@ /// -import { CreateAnvilOptions } from '@viem/anvil' -import { mainnet } from 'viem/chains' +import { CreateAnvilOptions } from "@viem/anvil"; +import { mainnet } from "viem/chains"; -const ACTIVE_CHAIN = mainnet +const ACTIVE_CHAIN = mainnet; export const ANVIL_CONFIG = { - TIMEOUT: 60000, // default 10000 - ACTIVE_CHAIN: ACTIVE_CHAIN, -} + TIMEOUT: 60000, // default 10000 + ACTIVE_CHAIN: ACTIVE_CHAIN, +}; export const CREATE_ANVIL_OPTIONS: CreateAnvilOptions = { - forkUrl: import.meta.env.VITE_ANVIL_MAINNET_FORK_ENDPOINT, -} + forkUrl: import.meta.env.VITE_ANVIL_MAINNET_FORK_ENDPOINT, +}; diff --git a/packages/sdk/src/test/config/base.ts b/packages/sdk/src/test/config/base.ts index bad5d8b..d74eb39 100644 --- a/packages/sdk/src/test/config/base.ts +++ b/packages/sdk/src/test/config/base.ts @@ -1,6 +1,7 @@ - export const TEST_CONFIG = { - RECIPIENT_ADDRESS: <`0x${string}`>`0x02101dfb77fde026414827fdc604ddaf224f0921`, - ERC1167_HEADER: '363d3d373d3d3d363d73', - ERC1167_FOOTER: '5af43d82803e903d91602b57fd5bf3', -} \ No newline at end of file + RECIPIENT_ADDRESS: <`0x${string}`>( + `0x02101dfb77fde026414827fdc604ddaf224f0921` + ), + ERC1167_HEADER: "363d3d373d3d3d363d73", + ERC1167_FOOTER: "5af43d82803e903d91602b57fd5bf3", +}; diff --git a/packages/sdk/src/test/config/index.ts b/packages/sdk/src/test/config/index.ts index e67f313..1790f1c 100644 --- a/packages/sdk/src/test/config/index.ts +++ b/packages/sdk/src/test/config/index.ts @@ -1,3 +1,3 @@ -export * from './anvil' -export * from './base' -export * from './mints' +export * from "./anvil"; +export * from "./base"; +export * from "./mints"; diff --git a/packages/sdk/src/test/config/mints.ts b/packages/sdk/src/test/config/mints.ts index e23370c..fcdf1d3 100644 --- a/packages/sdk/src/test/config/mints.ts +++ b/packages/sdk/src/test/config/mints.ts @@ -1,21 +1,27 @@ -import { getAddress } from 'viem' -import { ethToWei } from '../utils' -import { zora721DropABI, zora1155ABI } from '../wagmi-cli-hooks/generated' +import { getAddress } from "viem"; +import { ethToWei } from "../utils"; +import { zora721DropABI, zora1155ABI } from "../wagmi-cli-hooks/generated"; // Zora Webb's First Deep Field: https://zora.co/collect/eth:0x28ee638f2fcb66b4106acab7efd225aeb2bd7e8d export const zora721 = { - abi: zora721DropABI, - proxyContractAddress: getAddress('0x28ee638f2fcb66b4106acab7efd225aeb2bd7e8d'), - mintPrice: BigInt(0), - quantity: 4, -} + abi: zora721DropABI, + proxyContractAddress: getAddress( + "0x28ee638f2fcb66b4106acab7efd225aeb2bd7e8d", + ), + mintPrice: BigInt(0), + quantity: 4, +}; // https://zora.co/collect/eth:0x373075bab7d668ed2473d8233ebdebcf49eb758e/1 export const zora1155 = { - abi: zora1155ABI, - fixedPriceSalesStrategy: getAddress('0x5Ff5a77dD2214d863aCA809C0168941052d9b180'), // Zora IMinter1155 from https://etherscan.io/address/0x5Ff5a77dD2214d863aCA809C0168941052d9b180 - proxyContractAddress: getAddress('0x373075bab7d668ed2473d8233ebdebcf49eb758e'), // proxied Zora 1155 contract - tokenId: BigInt(1), - mintFee: ethToWei(0.000777), - quantity: BigInt(5), -} + abi: zora1155ABI, + fixedPriceSalesStrategy: getAddress( + "0x5Ff5a77dD2214d863aCA809C0168941052d9b180", + ), // Zora IMinter1155 from https://etherscan.io/address/0x5Ff5a77dD2214d863aCA809C0168941052d9b180 + proxyContractAddress: getAddress( + "0x373075bab7d668ed2473d8233ebdebcf49eb758e", + ), // proxied Zora 1155 contract + tokenId: BigInt(1), + mintFee: ethToWei(0.000777), + quantity: BigInt(5), +}; diff --git a/packages/sdk/src/test/config/setup.ts b/packages/sdk/src/test/config/setup.ts index c44951a..d0de870 100644 --- a/packages/sdk/src/test/config/setup.ts +++ b/packages/sdk/src/test/config/setup.ts @@ -1 +1 @@ -import '@testing-library/jest-dom' +import "@testing-library/jest-dom"; diff --git a/packages/sdk/src/test/config/shell.ts b/packages/sdk/src/test/config/shell.ts index 3796a69..0e8d17f 100644 --- a/packages/sdk/src/test/config/shell.ts +++ b/packages/sdk/src/test/config/shell.ts @@ -1,8 +1,7 @@ - export const SHELL_COMMANDS = { - // SET_ADDRESS_BYTECODE: 'cast rpc anvil_setCode 0x4e59b44847b379578588920ca78fbf26c0b4956c 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3', - // SET_ADDRESS_BYTECODE: `cast rpc anvil_setCode ${ANVIL_ACCOUNTS[0].address} 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3`, - // DEPLOY_REGISTRY: - // 'forge script --fork-url http://127.0.0.1:8545 6551contracts/script/DeployRegistry.s.sol --broadcast', - // DEPLOY_ACCOUNT_IMPLEMENTATION: `forge create 6551contracts/src/examples/simple/SimpleERC6551Account.sol:SimpleERC6551Account --rpc-url=$RPC_URL --private-key=$PRIVATE_KEY`, -} + // SET_ADDRESS_BYTECODE: 'cast rpc anvil_setCode 0x4e59b44847b379578588920ca78fbf26c0b4956c 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3', + // SET_ADDRESS_BYTECODE: `cast rpc anvil_setCode ${ANVIL_ACCOUNTS[0].address} 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3`, + // DEPLOY_REGISTRY: + // 'forge script --fork-url http://127.0.0.1:8545 6551contracts/script/DeployRegistry.s.sol --broadcast', + // DEPLOY_ACCOUNT_IMPLEMENTATION: `forge create 6551contracts/src/examples/simple/SimpleERC6551Account.sol:SimpleERC6551Account --rpc-url=$RPC_URL --private-key=$PRIVATE_KEY`, +}; diff --git a/packages/sdk/src/test/constants/addresses.ts b/packages/sdk/src/test/constants/addresses.ts index 2d8dd73..1dd4690 100644 --- a/packages/sdk/src/test/constants/addresses.ts +++ b/packages/sdk/src/test/constants/addresses.ts @@ -1,5 +1,5 @@ -import { getAddress } from 'viem' +import { getAddress } from "viem"; export const WETH_CONTRACT_ADDRESS = getAddress( - '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -) + "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", +); diff --git a/packages/sdk/src/test/constants/anvil.ts b/packages/sdk/src/test/constants/anvil.ts index ca0db7c..0c53b4d 100644 --- a/packages/sdk/src/test/constants/anvil.ts +++ b/packages/sdk/src/test/constants/anvil.ts @@ -1,50 +1,53 @@ -import { foundry } from 'viem/chains' -import { AnvilAccount } from '../../types' -import { getAddress } from 'viem' +import { foundry } from "viem/chains"; +import { AnvilAccount } from "../../types"; +import { getAddress } from "viem"; -export const ANVIL_RPC_URL = foundry.rpcUrls.default.http[0] +export const ANVIL_RPC_URL = foundry.rpcUrls.default.http[0]; // Anvil Accounts for local testing export const ANVIL_ACCOUNTS: AnvilAccount[] = [ - { - name: 'BJ', - address: getAddress('0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'), - privateKey: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', - }, - { - name: 'Jayden', - address: getAddress('0x70997970c51812dc3a010c7d01b50e0d17dc79c8'), - privateKey: '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', - }, - { - name: 'Alanah', - address: getAddress('0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc'), - privateKey: '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a', - }, + { + name: "BJ", + address: getAddress("0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"), + privateKey: + "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", + }, + { + name: "Jayden", + address: getAddress("0x70997970c51812dc3a010c7d01b50e0d17dc79c8"), + privateKey: + "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d", + }, + { + name: "Alanah", + address: getAddress("0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"), + privateKey: + "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a", + }, - // Available Accounts - // ================== - // (0) 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 (10000 ETH) - // (1) 0x70997970c51812dc3a010c7d01b50e0d17dc79c8 (10000 ETH) - // (2) 0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc (10000 ETH) - // (3) 0x90f79bf6eb2c4f870365e785982e1f101e93b906 (10000 ETH) - // (4) 0x15d34aaf54267db7d7c367839aaf71a00a2c6a65 (10000 ETH) - // (5) 0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc (10000 ETH) - // (6) 0x976ea74026e726554db657fa54763abd0c3a0aa9 (10000 ETH) - // (7) 0x14dc79964da2c08b23698b3d3cc7ca32193d9955 (10000 ETH) - // (8) 0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f (10000 ETH) - // (9) 0xa0ee7a142d267c1f36714e4a8f75612f20a79720 (10000 ETH) + // Available Accounts + // ================== + // (0) 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 (10000 ETH) + // (1) 0x70997970c51812dc3a010c7d01b50e0d17dc79c8 (10000 ETH) + // (2) 0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc (10000 ETH) + // (3) 0x90f79bf6eb2c4f870365e785982e1f101e93b906 (10000 ETH) + // (4) 0x15d34aaf54267db7d7c367839aaf71a00a2c6a65 (10000 ETH) + // (5) 0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc (10000 ETH) + // (6) 0x976ea74026e726554db657fa54763abd0c3a0aa9 (10000 ETH) + // (7) 0x14dc79964da2c08b23698b3d3cc7ca32193d9955 (10000 ETH) + // (8) 0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f (10000 ETH) + // (9) 0xa0ee7a142d267c1f36714e4a8f75612f20a79720 (10000 ETH) - // Private Keys - // ================== - // (0) 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - // (1) 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d - // (2) 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a - // (3) 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6 - // (4) 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a - // (5) 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba - // (6) 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e - // (7) 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356 - // (8) 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 - // (9) 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 -] + // Private Keys + // ================== + // (0) 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + // (1) 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d + // (2) 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a + // (3) 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6 + // (4) 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a + // (5) 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba + // (6) 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e + // (7) 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356 + // (8) 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 + // (9) 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 +]; diff --git a/packages/sdk/src/test/constants/index.ts b/packages/sdk/src/test/constants/index.ts index 9547428..2eb1f15 100644 --- a/packages/sdk/src/test/constants/index.ts +++ b/packages/sdk/src/test/constants/index.ts @@ -1,3 +1,3 @@ -export * from './addresses' -export * from './anvil' -export * from './regexes' +export * from "./addresses"; +export * from "./anvil"; +export * from "./regexes"; diff --git a/packages/sdk/src/test/constants/regexes.ts b/packages/sdk/src/test/constants/regexes.ts index 2c81da0..ef2df20 100644 --- a/packages/sdk/src/test/constants/regexes.ts +++ b/packages/sdk/src/test/constants/regexes.ts @@ -1 +1 @@ -export const ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}/ +export const ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}/; diff --git a/packages/sdk/src/test/mockWallet.tsx b/packages/sdk/src/test/mockWallet.tsx index 6df8a3b..14cf085 100644 --- a/packages/sdk/src/test/mockWallet.tsx +++ b/packages/sdk/src/test/mockWallet.tsx @@ -1,17 +1,17 @@ -import { RenderOptions, RenderResult, render } from '@testing-library/react' -import { default as userEvent } from '@testing-library/user-event' -import * as React from 'react' +import { RenderOptions, RenderResult, render } from "@testing-library/react"; +import { default as userEvent } from "@testing-library/user-event"; +import * as React from "react"; -import { WalletClient, PublicClient } from 'viem' +import { WalletClient, PublicClient } from "viem"; import { - CreateConfigParameters, - // WagmiConfig, - // WagmiConfigProps, - // WalletClient, - // PublicClient, - createConfig, -} from 'wagmi' + CreateConfigParameters, + // WagmiConfig, + // WagmiConfigProps, + // WalletClient, + // PublicClient, + createConfig, +} from "wagmi"; // import { createPublicClient, WalletClient, PublicClient, createWalletClient, http } from 'viem' // import { MockConnector } from 'wagmi/connectors/mock' @@ -48,11 +48,11 @@ import { // options?: RenderOptions // ): RenderResult => render(ui, { wrapper: Providers, ...options }) -export * from '@testing-library/react' +export * from "@testing-library/react"; // export { renderWithWagmiConfig } -export type UserEvent = ReturnType -export { default as userEvent } from '@testing-library/user-event' +export type UserEvent = ReturnType; +export { default as userEvent } from "@testing-library/user-event"; -export { getMockWalletClient } from './utils' -export { ADDRESS_REGEX } from './constants' +export { getMockWalletClient } from "./utils"; +export { ADDRESS_REGEX } from "./constants"; diff --git a/packages/sdk/src/test/types/index.ts b/packages/sdk/src/test/types/index.ts index 85363ce..65cd856 100644 --- a/packages/sdk/src/test/types/index.ts +++ b/packages/sdk/src/test/types/index.ts @@ -1 +1 @@ -export * from './testers' \ No newline at end of file +export * from "./testers"; diff --git a/packages/sdk/src/test/types/testers.ts b/packages/sdk/src/test/types/testers.ts index dde1bae..4b8b0cd 100644 --- a/packages/sdk/src/test/types/testers.ts +++ b/packages/sdk/src/test/types/testers.ts @@ -1,7 +1,7 @@ export const Tester = { - ETHERS: 'ETHERS', - ETHERS_6: 'ETHERS_6', - VIEM_WALLETCLIENT: 'VIEM_WALLETCLIENT', - } as const - -export type TesterType = (typeof Tester)[keyof typeof Tester] \ No newline at end of file + ETHERS: "ETHERS", + ETHERS_6: "ETHERS_6", + VIEM_WALLETCLIENT: "VIEM_WALLETCLIENT", +} as const; + +export type TesterType = (typeof Tester)[keyof typeof Tester]; diff --git a/packages/sdk/src/test/utils/clients.ts b/packages/sdk/src/test/utils/clients.ts index 64d972a..2be8742 100644 --- a/packages/sdk/src/test/utils/clients.ts +++ b/packages/sdk/src/test/utils/clients.ts @@ -1,29 +1,29 @@ import { - createPublicClient, - WalletClient, - PublicClient, - createWalletClient, - http, - Chain, -} from 'viem' -import { foundry } from 'viem/chains' + createPublicClient, + WalletClient, + PublicClient, + createWalletClient, + http, + Chain, +} from "viem"; +import { foundry } from "viem/chains"; // import { chainIdToChain } from '../../utils' -import { ANVIL_RPC_URL, ANVIL_ACCOUNTS } from '../constants' +import { ANVIL_RPC_URL, ANVIL_ACCOUNTS } from "../constants"; export const getPublicClient = ({ - // chainId = foundry.id, - chain, + // chainId = foundry.id, + chain, }: { - // chainId?: number - chain: Chain + // chainId?: number + chain: Chain; }): PublicClient => { - // const chain = chainIdToChain(chainId) + // const chain = chainIdToChain(chainId) - // if (!chain) throw new Error(`Chain ${chain.name} not found`) + // if (!chain) throw new Error(`Chain ${chain.name} not found`) - return createPublicClient({ - transport: http(ANVIL_RPC_URL), - chain, - pollingInterval: 100, - }) -} + return createPublicClient({ + transport: http(ANVIL_RPC_URL), + chain, + pollingInterval: 100, + }); +}; diff --git a/packages/sdk/src/test/utils/debug.ts b/packages/sdk/src/test/utils/debug.ts index a9de0e7..c5b7056 100644 --- a/packages/sdk/src/test/utils/debug.ts +++ b/packages/sdk/src/test/utils/debug.ts @@ -1,22 +1,24 @@ -import { PublicClient } from 'viem' +import { PublicClient } from "viem"; /** * Emits console output related to the given transaction hash for debugging purposes. - * + * * @param publicClient - The viem public client instance. * @param hash - The transaction hash to debug. * @returns void */ -export async function debugTransaction({publicClient, hash}:{publicClient: PublicClient, hash: `0x${string}`}) { +export async function debugTransaction({ + publicClient, + hash, +}: { publicClient: PublicClient; hash: `0x${string}` }) { + console.log("DEBUGGING TRANSACTION: ", hash); + const transactionReceipt = await publicClient.getTransactionReceipt({ + hash, + }); + console.log("transactionReceipt", transactionReceipt); - console.log('DEBUGGING TRANSACTION: ', hash) - const transactionReceipt = await publicClient.getTransactionReceipt({ - hash - }) - console.log('transactionReceipt', transactionReceipt) - - const transaction = await publicClient.getTransaction({ - hash - }) - console.log('transaction', transaction) - } \ No newline at end of file + const transaction = await publicClient.getTransaction({ + hash, + }); + console.log("transaction", transaction); +} diff --git a/packages/sdk/src/test/utils/ethToWei.ts b/packages/sdk/src/test/utils/ethToWei.ts index faf4b31..00ab545 100644 --- a/packages/sdk/src/test/utils/ethToWei.ts +++ b/packages/sdk/src/test/utils/ethToWei.ts @@ -1,5 +1,5 @@ -import { parseUnits } from 'viem' +import { parseUnits } from "viem"; export function ethToWei(eth: number) { - return parseUnits(eth.toString(), 18) + return parseUnits(eth.toString(), 18); } diff --git a/packages/sdk/src/test/utils/getAnvilLogs.ts b/packages/sdk/src/test/utils/getAnvilLogs.ts index 5534e44..fad9aab 100644 --- a/packages/sdk/src/test/utils/getAnvilLogs.ts +++ b/packages/sdk/src/test/utils/getAnvilLogs.ts @@ -1,10 +1,10 @@ export async function getAnvilLogs(url: string, id: number): Promise { - const response = await fetch(new URL(`${id}/logs`, url), { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - }) + const response = await fetch(new URL(`${id}/logs`, url), { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }); - return response.json() + return response.json(); } diff --git a/packages/sdk/src/test/utils/getWETHBalance.ts b/packages/sdk/src/test/utils/getWETHBalance.ts index 91d1940..18bcc76 100644 --- a/packages/sdk/src/test/utils/getWETHBalance.ts +++ b/packages/sdk/src/test/utils/getWETHBalance.ts @@ -1,20 +1,20 @@ -import { PublicClient, erc20Abi } from 'viem' -import { WETH_CONTRACT_ADDRESS } from '../constants' -import { resolvePossibleENS } from '../../utils' -import { PossibleENSAddress } from '../../types' +import { PublicClient, erc20Abi } from "viem"; +import { WETH_CONTRACT_ADDRESS } from "../constants"; +import { resolvePossibleENS } from "../../utils"; +import { PossibleENSAddress } from "../../types"; export async function getWETHBalance({ - publicClient, - walletAddress, + publicClient, + walletAddress, }: { - publicClient: PublicClient - walletAddress: PossibleENSAddress + publicClient: PublicClient; + walletAddress: PossibleENSAddress; }) { - const address = await resolvePossibleENS(publicClient, walletAddress) - return await publicClient.readContract({ - address: WETH_CONTRACT_ADDRESS, - abi: erc20Abi, - functionName: 'balanceOf', - args: [address], - }) + const address = await resolvePossibleENS(publicClient, walletAddress); + return await publicClient.readContract({ + address: WETH_CONTRACT_ADDRESS, + abi: erc20Abi, + functionName: "balanceOf", + args: [address], + }); } diff --git a/packages/sdk/src/test/utils/getZora1155Balance.ts b/packages/sdk/src/test/utils/getZora1155Balance.ts index 77145db..d8af383 100644 --- a/packages/sdk/src/test/utils/getZora1155Balance.ts +++ b/packages/sdk/src/test/utils/getZora1155Balance.ts @@ -1,21 +1,21 @@ -import { PublicClient } from 'viem' -import { zora1155 } from '../config' -import { zora1155ABI } from '../wagmi-cli-hooks/generated' -import { resolvePossibleENS } from '../../utils' -import { PossibleENSAddress } from '../../types' +import { PublicClient } from "viem"; +import { zora1155 } from "../config"; +import { zora1155ABI } from "../wagmi-cli-hooks/generated"; +import { resolvePossibleENS } from "../../utils"; +import { PossibleENSAddress } from "../../types"; export async function getZora1155Balance({ - publicClient, - walletAddress, + publicClient, + walletAddress, }: { - publicClient: PublicClient - walletAddress: PossibleENSAddress + publicClient: PublicClient; + walletAddress: PossibleENSAddress; }) { - const address = await resolvePossibleENS(publicClient, walletAddress) - return await publicClient.readContract({ - address: zora1155.proxyContractAddress, - abi: zora1155ABI, - functionName: 'balanceOf', - args: [address, zora1155.tokenId], - }) + const address = await resolvePossibleENS(publicClient, walletAddress); + return await publicClient.readContract({ + address: zora1155.proxyContractAddress, + abi: zora1155ABI, + functionName: "balanceOf", + args: [address, zora1155.tokenId], + }); } diff --git a/packages/sdk/src/test/utils/getZora721Balance.ts b/packages/sdk/src/test/utils/getZora721Balance.ts index 0c0c9e4..0a064be 100644 --- a/packages/sdk/src/test/utils/getZora721Balance.ts +++ b/packages/sdk/src/test/utils/getZora721Balance.ts @@ -1,22 +1,22 @@ -import { PublicClient, getAddress } from 'viem' -import { zora721 } from '../config' -import { zora721DropABI } from '../wagmi-cli-hooks/generated' -import { resolvePossibleENS } from '../../utils' -import { PossibleENSAddress } from '../../types' +import { PublicClient, getAddress } from "viem"; +import { zora721 } from "../config"; +import { zora721DropABI } from "../wagmi-cli-hooks/generated"; +import { resolvePossibleENS } from "../../utils"; +import { PossibleENSAddress } from "../../types"; export async function getZora721Balance({ - publicClient, - walletAddress, + publicClient, + walletAddress, }: { - publicClient: PublicClient - walletAddress: PossibleENSAddress + publicClient: PublicClient; + walletAddress: PossibleENSAddress; }) { - const address = await resolvePossibleENS(publicClient, walletAddress) + const address = await resolvePossibleENS(publicClient, walletAddress); - return await publicClient.readContract({ - address: zora721.proxyContractAddress, - abi: zora721DropABI, - functionName: 'balanceOf', - args: [address], - }) + return await publicClient.readContract({ + address: zora721.proxyContractAddress, + abi: zora721DropABI, + functionName: "balanceOf", + args: [address], + }); } diff --git a/packages/sdk/src/test/utils/index.ts b/packages/sdk/src/test/utils/index.ts index 6952f40..796a5c2 100644 --- a/packages/sdk/src/test/utils/index.ts +++ b/packages/sdk/src/test/utils/index.ts @@ -1,8 +1,8 @@ -export * from './clients' -export * from './debug' -export * from './shellCommand' -export * from './ethToWei' -export * from './getAnvilLogs' -export * from './getWETHBalance' -export * from './getZora1155Balance' -export * from './getZora721Balance' +export * from "./clients"; +export * from "./debug"; +export * from "./shellCommand"; +export * from "./ethToWei"; +export * from "./getAnvilLogs"; +export * from "./getWETHBalance"; +export * from "./getZora1155Balance"; +export * from "./getZora721Balance"; diff --git a/packages/sdk/src/test/utils/shellCommand.ts b/packages/sdk/src/test/utils/shellCommand.ts index dae6c0d..0ad5a82 100644 --- a/packages/sdk/src/test/utils/shellCommand.ts +++ b/packages/sdk/src/test/utils/shellCommand.ts @@ -1,26 +1,26 @@ -import { exec } from 'child_process' // Node.js child_process module +import { exec } from "child_process"; // Node.js child_process module /** * Executes a shell command and returns the output as a promise. - * + * * @param cmd - The shell command to be executed. * @returns A promise that resolves with the command output (stdout or stderr). * @throws Will reject the promise with an error if the command execution fails. - * + * * @example * ```typescript * shellCommand('ls -l').then(console.log); * ``` */ export function shellCommand(cmd: string): Promise { - return new Promise((resolve, reject) => { - exec(cmd, (error, stdout, stderr) => { - if (error) { - console.warn(`Error executing command: ${cmd}`); - reject(error); - return; - } - resolve(stdout || stderr); - }); - }); -} \ No newline at end of file + return new Promise((resolve, reject) => { + exec(cmd, (error, stdout, stderr) => { + if (error) { + console.warn(`Error executing command: ${cmd}`); + reject(error); + return; + } + resolve(stdout || stderr); + }); + }); +} diff --git a/packages/sdk/src/test/wagmi-cli-hooks/generated.ts b/packages/sdk/src/test/wagmi-cli-hooks/generated.ts index 750c314..ad5ad23 100644 --- a/packages/sdk/src/test/wagmi-cli-hooks/generated.ts +++ b/packages/sdk/src/test/wagmi-cli-hooks/generated.ts @@ -7,67 +7,95 @@ * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F) */ export const erc6551AccountProxyV3ABI = [ - { - stateMutability: 'nonpayable', - type: 'constructor', - inputs: [ - { name: '_guardian', internalType: 'address', type: 'address' }, - { name: '_initialImplementation', internalType: 'address', type: 'address' }, - ], - }, - { type: 'error', inputs: [], name: 'AlreadyInitialized' }, - { type: 'error', inputs: [], name: 'InvalidImplementation' }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'previousAdmin', internalType: 'address', type: 'address', indexed: false }, - { name: 'newAdmin', internalType: 'address', type: 'address', indexed: false }, - ], - name: 'AdminChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'beacon', internalType: 'address', type: 'address', indexed: true }], - name: 'BeaconUpgraded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'Upgraded', - }, - { stateMutability: 'payable', type: 'fallback' }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'implementation', internalType: 'address', type: 'address' }], - name: 'initialize', - outputs: [], - }, - { stateMutability: 'payable', type: 'receive' }, -] as const + { + stateMutability: "nonpayable", + type: "constructor", + inputs: [ + { name: "_guardian", internalType: "address", type: "address" }, + { + name: "_initialImplementation", + internalType: "address", + type: "address", + }, + ], + }, + { type: "error", inputs: [], name: "AlreadyInitialized" }, + { type: "error", inputs: [], name: "InvalidImplementation" }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "previousAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "newAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "AdminChanged", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "beacon", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "BeaconUpgraded", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "implementation", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "Upgraded", + }, + { stateMutability: "payable", type: "fallback" }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "implementation", internalType: "address", type: "address" }, + ], + name: "initialize", + outputs: [], + }, + { stateMutability: "payable", type: "receive" }, +] as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F) */ export const erc6551AccountProxyV3Address = { - 1: '0x55266d75D1a14E4572138116aF39863Ed6596E7F', - 5: '0x55266d75D1a14E4572138116aF39863Ed6596E7F', -} as const + 1: "0x55266d75D1a14E4572138116aF39863Ed6596E7F", + 5: "0x55266d75D1a14E4572138116aF39863Ed6596E7F", +} as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F) */ export const erc6551AccountProxyV3Config = { - address: erc6551AccountProxyV3Address, - abi: erc6551AccountProxyV3ABI, -} as const + address: erc6551AccountProxyV3Address, + abi: erc6551AccountProxyV3ABI, +} as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC6551Account_V2_ @@ -78,64 +106,90 @@ export const erc6551AccountProxyV3Config = { * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2D25602551487C3f3354dD80D76D54383A243358) */ export const erc6551AccountV2ABI = [ - { - stateMutability: 'nonpayable', - type: 'constructor', - inputs: [ - { name: '_defaultImplementation', internalType: 'address', type: 'address' }, - ], - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'previousAdmin', internalType: 'address', type: 'address', indexed: false }, - { name: 'newAdmin', internalType: 'address', type: 'address', indexed: false }, - ], - name: 'AdminChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'beacon', internalType: 'address', type: 'address', indexed: true }], - name: 'BeaconUpgraded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'Upgraded', - }, - { stateMutability: 'payable', type: 'fallback' }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [], - name: 'initialize', - outputs: [], - }, - { stateMutability: 'payable', type: 'receive' }, -] as const + { + stateMutability: "nonpayable", + type: "constructor", + inputs: [ + { + name: "_defaultImplementation", + internalType: "address", + type: "address", + }, + ], + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "previousAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "newAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "AdminChanged", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "beacon", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "BeaconUpgraded", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "implementation", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "Upgraded", + }, + { stateMutability: "payable", type: "fallback" }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [], + name: "initialize", + outputs: [], + }, + { stateMutability: "payable", type: "receive" }, +] as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x2D25602551487C3f3354dD80D76D54383A243358) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2D25602551487C3f3354dD80D76D54383A243358) */ export const erc6551AccountV2Address = { - 1: '0x2D25602551487C3f3354dD80D76D54383A243358', - 5: '0x2D25602551487C3f3354dD80D76D54383A243358', -} as const + 1: "0x2D25602551487C3f3354dD80D76D54383A243358", + 5: "0x2D25602551487C3f3354dD80D76D54383A243358", +} as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x2D25602551487C3f3354dD80D76D54383A243358) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2D25602551487C3f3354dD80D76D54383A243358) */ export const erc6551AccountV2Config = { - address: erc6551AccountV2Address, - abi: erc6551AccountV2ABI, -} as const + address: erc6551AccountV2Address, + abi: erc6551AccountV2ABI, +} as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC6551Account_V3_ @@ -146,428 +200,500 @@ export const erc6551AccountV2Config = { * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC) */ export const erc6551AccountV3ABI = [ - { - stateMutability: 'nonpayable', - type: 'constructor', - inputs: [ - { name: 'entryPoint_', internalType: 'address', type: 'address' }, - { name: 'multicallForwarder', internalType: 'address', type: 'address' }, - { name: 'erc6551Registry', internalType: 'address', type: 'address' }, - { name: 'guardian', internalType: 'address', type: 'address' }, - ], - }, - { type: 'error', inputs: [], name: 'AccountLocked' }, - { type: 'error', inputs: [], name: 'ContractCreationFailed' }, - { type: 'error', inputs: [], name: 'ExceedsMaxLockTime' }, - { type: 'error', inputs: [], name: 'InvalidAccountProof' }, - { type: 'error', inputs: [], name: 'InvalidERC6551Registry' }, - { type: 'error', inputs: [], name: 'InvalidEntryPoint' }, - { type: 'error', inputs: [], name: 'InvalidImplementation' }, - { type: 'error', inputs: [], name: 'InvalidInput' }, - { type: 'error', inputs: [], name: 'InvalidMulticallForwarder' }, - { type: 'error', inputs: [], name: 'InvalidOperation' }, - { type: 'error', inputs: [], name: 'NotAuthorized' }, - { type: 'error', inputs: [], name: 'OwnershipCycle' }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'previousAdmin', internalType: 'address', type: 'address', indexed: false }, - { name: 'newAdmin', internalType: 'address', type: 'address', indexed: false }, - ], - name: 'AdminChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'beacon', internalType: 'address', type: 'address', indexed: true }], - name: 'BeaconUpgraded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'lockedUntil', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'LockUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'owner', internalType: 'address', type: 'address', indexed: false }, - { name: 'selector', internalType: 'bytes4', type: 'bytes4', indexed: false }, - { - name: 'implementation', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'OverrideUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'owner', internalType: 'address', type: 'address', indexed: false }, - { name: 'caller', internalType: 'address', type: 'address', indexed: false }, - { name: 'hasPermission', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'PermissionUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'Upgraded', - }, - { stateMutability: 'payable', type: 'fallback' }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'entryPoint', - outputs: [{ name: '', internalType: 'contract IEntryPoint', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'erc6551Registry', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'operation', internalType: 'uint8', type: 'uint8' }, - ], - name: 'execute', - outputs: [{ name: '', internalType: 'bytes', type: 'bytes' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { - name: 'operations', - internalType: 'struct BatchExecutor.Operation[]', - type: 'tuple[]', - components: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'operation', internalType: 'uint8', type: 'uint8' }, - ], - }, - ], - name: 'executeBatch', - outputs: [{ name: '', internalType: 'bytes[]', type: 'bytes[]' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'operation', internalType: 'uint8', type: 'uint8' }, - { - name: 'proof', - internalType: 'struct NestedAccountExecutor.ERC6551AccountInfo[]', - type: 'tuple[]', - components: [ - { name: 'salt', internalType: 'bytes32', type: 'bytes32' }, - { name: 'tokenContract', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'executeNested', - outputs: [{ name: '', internalType: 'bytes', type: 'bytes' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'extcall', - outputs: [{ name: 'result', internalType: 'bytes', type: 'bytes' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'bytecode', internalType: 'bytes', type: 'bytes' }, - ], - name: 'extcreate', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'salt', internalType: 'bytes32', type: 'bytes32' }, - { name: 'bytecode', internalType: 'bytes', type: 'bytes' }, - ], - name: 'extcreate2', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'slot', internalType: 'bytes32', type: 'bytes32' }], - name: 'extsload', - outputs: [{ name: 'value', internalType: 'bytes32', type: 'bytes32' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'getNonce', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'isLocked', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'hash', internalType: 'bytes32', type: 'bytes32' }, - { name: 'signature', internalType: 'bytes', type: 'bytes' }, - ], - name: 'isValidSignature', - outputs: [{ name: 'magicValue', internalType: 'bytes4', type: 'bytes4' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'signer', internalType: 'address', type: 'address' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'isValidSigner', - outputs: [{ name: 'magicValue', internalType: 'bytes4', type: 'bytes4' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: '_lockedUntil', internalType: 'uint256', type: 'uint256' }], - name: 'lock', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'lockedUntil', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'uint256[]', type: 'uint256[]' }, - { name: '', internalType: 'uint256[]', type: 'uint256[]' }, - { name: '', internalType: 'bytes', type: 'bytes' }, - ], - name: 'onERC1155BatchReceived', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'bytes', type: 'bytes' }, - ], - name: 'onERC1155Received', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'bytes', type: 'bytes' }, - ], - name: 'onERC721Received', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'bytes4', type: 'bytes4' }, - ], - name: 'overrides', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, - ], - name: 'permissions', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'proxiableUUID', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'selectors', internalType: 'bytes4[]', type: 'bytes4[]' }, - { name: 'implementations', internalType: 'address[]', type: 'address[]' }, - ], - name: 'setOverrides', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'callers', internalType: 'address[]', type: 'address[]' }, - { name: '_permissions', internalType: 'bool[]', type: 'bool[]' }, - ], - name: 'setPermissions', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'state', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'interfaceId', internalType: 'bytes4', type: 'bytes4' }], - name: 'supportsInterface', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'token', - outputs: [ - { name: 'chainId', internalType: 'uint256', type: 'uint256' }, - { name: 'tokenContract', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - ], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'newImplementation', internalType: 'address', type: 'address' }], - name: 'upgradeTo', - outputs: [], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'newImplementation', internalType: 'address', type: 'address' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'upgradeToAndCall', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'userOp', - internalType: 'struct UserOperation', - type: 'tuple', - components: [ - { name: 'sender', internalType: 'address', type: 'address' }, - { name: 'nonce', internalType: 'uint256', type: 'uint256' }, - { name: 'initCode', internalType: 'bytes', type: 'bytes' }, - { name: 'callData', internalType: 'bytes', type: 'bytes' }, - { name: 'callGasLimit', internalType: 'uint256', type: 'uint256' }, - { name: 'verificationGasLimit', internalType: 'uint256', type: 'uint256' }, - { name: 'preVerificationGas', internalType: 'uint256', type: 'uint256' }, - { name: 'maxFeePerGas', internalType: 'uint256', type: 'uint256' }, - { name: 'maxPriorityFeePerGas', internalType: 'uint256', type: 'uint256' }, - { name: 'paymasterAndData', internalType: 'bytes', type: 'bytes' }, - { name: 'signature', internalType: 'bytes', type: 'bytes' }, - ], - }, - { name: 'userOpHash', internalType: 'bytes32', type: 'bytes32' }, - { name: 'missingAccountFunds', internalType: 'uint256', type: 'uint256' }, - ], - name: 'validateUserOp', - outputs: [{ name: 'validationData', internalType: 'uint256', type: 'uint256' }], - }, - { stateMutability: 'payable', type: 'receive' }, -] as const + { + stateMutability: "nonpayable", + type: "constructor", + inputs: [ + { name: "entryPoint_", internalType: "address", type: "address" }, + { name: "multicallForwarder", internalType: "address", type: "address" }, + { name: "erc6551Registry", internalType: "address", type: "address" }, + { name: "guardian", internalType: "address", type: "address" }, + ], + }, + { type: "error", inputs: [], name: "AccountLocked" }, + { type: "error", inputs: [], name: "ContractCreationFailed" }, + { type: "error", inputs: [], name: "ExceedsMaxLockTime" }, + { type: "error", inputs: [], name: "InvalidAccountProof" }, + { type: "error", inputs: [], name: "InvalidERC6551Registry" }, + { type: "error", inputs: [], name: "InvalidEntryPoint" }, + { type: "error", inputs: [], name: "InvalidImplementation" }, + { type: "error", inputs: [], name: "InvalidInput" }, + { type: "error", inputs: [], name: "InvalidMulticallForwarder" }, + { type: "error", inputs: [], name: "InvalidOperation" }, + { type: "error", inputs: [], name: "NotAuthorized" }, + { type: "error", inputs: [], name: "OwnershipCycle" }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "previousAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "newAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "AdminChanged", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "beacon", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "BeaconUpgraded", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "lockedUntil", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "LockUpdated", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "owner", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "selector", + internalType: "bytes4", + type: "bytes4", + indexed: false, + }, + { + name: "implementation", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "OverrideUpdated", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "owner", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "caller", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "hasPermission", + internalType: "bool", + type: "bool", + indexed: false, + }, + ], + name: "PermissionUpdated", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "implementation", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "Upgraded", + }, + { stateMutability: "payable", type: "fallback" }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "entryPoint", + outputs: [ + { name: "", internalType: "contract IEntryPoint", type: "address" }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "erc6551Registry", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "to", internalType: "address", type: "address" }, + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + { name: "operation", internalType: "uint8", type: "uint8" }, + ], + name: "execute", + outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { + name: "operations", + internalType: "struct BatchExecutor.Operation[]", + type: "tuple[]", + components: [ + { name: "to", internalType: "address", type: "address" }, + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + { name: "operation", internalType: "uint8", type: "uint8" }, + ], + }, + ], + name: "executeBatch", + outputs: [{ name: "", internalType: "bytes[]", type: "bytes[]" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "to", internalType: "address", type: "address" }, + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + { name: "operation", internalType: "uint8", type: "uint8" }, + { + name: "proof", + internalType: "struct NestedAccountExecutor.ERC6551AccountInfo[]", + type: "tuple[]", + components: [ + { name: "salt", internalType: "bytes32", type: "bytes32" }, + { name: "tokenContract", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + ], + }, + ], + name: "executeNested", + outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "to", internalType: "address", type: "address" }, + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "extcall", + outputs: [{ name: "result", internalType: "bytes", type: "bytes" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "bytecode", internalType: "bytes", type: "bytes" }, + ], + name: "extcreate", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "salt", internalType: "bytes32", type: "bytes32" }, + { name: "bytecode", internalType: "bytes", type: "bytes" }, + ], + name: "extcreate2", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "slot", internalType: "bytes32", type: "bytes32" }], + name: "extsload", + outputs: [{ name: "value", internalType: "bytes32", type: "bytes32" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "getNonce", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "isLocked", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "forwarder", internalType: "address", type: "address" }], + name: "isTrustedForwarder", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "hash", internalType: "bytes32", type: "bytes32" }, + { name: "signature", internalType: "bytes", type: "bytes" }, + ], + name: "isValidSignature", + outputs: [{ name: "magicValue", internalType: "bytes4", type: "bytes4" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "signer", internalType: "address", type: "address" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "isValidSigner", + outputs: [{ name: "magicValue", internalType: "bytes4", type: "bytes4" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "_lockedUntil", internalType: "uint256", type: "uint256" }, + ], + name: "lock", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "lockedUntil", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "uint256[]", type: "uint256[]" }, + { name: "", internalType: "uint256[]", type: "uint256[]" }, + { name: "", internalType: "bytes", type: "bytes" }, + ], + name: "onERC1155BatchReceived", + outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "uint256", type: "uint256" }, + { name: "", internalType: "uint256", type: "uint256" }, + { name: "", internalType: "bytes", type: "bytes" }, + ], + name: "onERC1155Received", + outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "", internalType: "bytes", type: "bytes" }, + ], + name: "onERC721Received", + outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "bytes4", type: "bytes4" }, + ], + name: "overrides", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "owner", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "address", type: "address" }, + ], + name: "permissions", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "proxiableUUID", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "selectors", internalType: "bytes4[]", type: "bytes4[]" }, + { name: "implementations", internalType: "address[]", type: "address[]" }, + ], + name: "setOverrides", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "callers", internalType: "address[]", type: "address[]" }, + { name: "_permissions", internalType: "bool[]", type: "bool[]" }, + ], + name: "setPermissions", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "state", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "token", + outputs: [ + { name: "chainId", internalType: "uint256", type: "uint256" }, + { name: "tokenContract", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "newImplementation", internalType: "address", type: "address" }, + ], + name: "upgradeTo", + outputs: [], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "newImplementation", internalType: "address", type: "address" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "upgradeToAndCall", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { + name: "userOp", + internalType: "struct UserOperation", + type: "tuple", + components: [ + { name: "sender", internalType: "address", type: "address" }, + { name: "nonce", internalType: "uint256", type: "uint256" }, + { name: "initCode", internalType: "bytes", type: "bytes" }, + { name: "callData", internalType: "bytes", type: "bytes" }, + { name: "callGasLimit", internalType: "uint256", type: "uint256" }, + { + name: "verificationGasLimit", + internalType: "uint256", + type: "uint256", + }, + { + name: "preVerificationGas", + internalType: "uint256", + type: "uint256", + }, + { name: "maxFeePerGas", internalType: "uint256", type: "uint256" }, + { + name: "maxPriorityFeePerGas", + internalType: "uint256", + type: "uint256", + }, + { name: "paymasterAndData", internalType: "bytes", type: "bytes" }, + { name: "signature", internalType: "bytes", type: "bytes" }, + ], + }, + { name: "userOpHash", internalType: "bytes32", type: "bytes32" }, + { name: "missingAccountFunds", internalType: "uint256", type: "uint256" }, + ], + name: "validateUserOp", + outputs: [ + { name: "validationData", internalType: "uint256", type: "uint256" }, + ], + }, + { stateMutability: "payable", type: "receive" }, +] as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC) */ export const erc6551AccountV3Address = { - 1: '0x41C8f39463A868d3A88af00cd0fe7102F30E44eC', - 5: '0x41C8f39463A868d3A88af00cd0fe7102F30E44eC', -} as const + 1: "0x41C8f39463A868d3A88af00cd0fe7102F30E44eC", + 5: "0x41C8f39463A868d3A88af00cd0fe7102F30E44eC", +} as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC) */ export const erc6551AccountV3Config = { - address: erc6551AccountV3Address, - abi: erc6551AccountV3ABI, -} as const + address: erc6551AccountV3Address, + abi: erc6551AccountV3ABI, +} as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC6551Registry_V2_ @@ -578,71 +704,96 @@ export const erc6551AccountV3Config = { * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x02101dfB77FDE026414827Fdc604ddAF224F0921) */ export const erc6551RegistryV2ABI = [ - { type: 'error', inputs: [], name: 'InitializationFailed' }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'account', internalType: 'address', type: 'address', indexed: false }, - { - name: 'implementation', - internalType: 'address', - type: 'address', - indexed: false, - }, - { name: 'chainId', internalType: 'uint256', type: 'uint256', indexed: false }, - { name: 'tokenContract', internalType: 'address', type: 'address', indexed: false }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: false }, - { name: 'salt', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'AccountCreated', - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address' }, - { name: 'chainId', internalType: 'uint256', type: 'uint256' }, - { name: 'tokenContract', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'salt', internalType: 'uint256', type: 'uint256' }, - ], - name: 'account', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address' }, - { name: 'chainId', internalType: 'uint256', type: 'uint256' }, - { name: 'tokenContract', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'salt', internalType: 'uint256', type: 'uint256' }, - { name: 'initData', internalType: 'bytes', type: 'bytes' }, - ], - name: 'createAccount', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, -] as const + { type: "error", inputs: [], name: "InitializationFailed" }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "account", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "implementation", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "chainId", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + { + name: "tokenContract", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + { + name: "salt", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "AccountCreated", + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "implementation", internalType: "address", type: "address" }, + { name: "chainId", internalType: "uint256", type: "uint256" }, + { name: "tokenContract", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "salt", internalType: "uint256", type: "uint256" }, + ], + name: "account", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "implementation", internalType: "address", type: "address" }, + { name: "chainId", internalType: "uint256", type: "uint256" }, + { name: "tokenContract", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "salt", internalType: "uint256", type: "uint256" }, + { name: "initData", internalType: "bytes", type: "bytes" }, + ], + name: "createAccount", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, +] as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x02101dfB77FDE026414827Fdc604ddAF224F0921) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x02101dfB77FDE026414827Fdc604ddAF224F0921) */ export const erc6551RegistryV2Address = { - 1: '0x02101dfB77FDE026414827Fdc604ddAF224F0921', - 5: '0x02101dfB77FDE026414827Fdc604ddAF224F0921', -} as const + 1: "0x02101dfB77FDE026414827Fdc604ddAF224F0921", + 5: "0x02101dfB77FDE026414827Fdc604ddAF224F0921", +} as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x02101dfB77FDE026414827Fdc604ddAF224F0921) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x02101dfB77FDE026414827Fdc604ddAF224F0921) */ export const erc6551RegistryV2Config = { - address: erc6551RegistryV2Address, - abi: erc6551RegistryV2ABI, -} as const + address: erc6551RegistryV2Address, + abi: erc6551RegistryV2ABI, +} as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC6551Registry_V3_ @@ -653,65 +804,95 @@ export const erc6551RegistryV2Config = { * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x000000006551c19487814612e58FE06813775758) */ export const erc6551RegistryV3ABI = [ - { type: 'error', inputs: [], name: 'AccountCreationFailed' }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'account', internalType: 'address', type: 'address', indexed: false }, - { name: 'implementation', internalType: 'address', type: 'address', indexed: true }, - { name: 'salt', internalType: 'bytes32', type: 'bytes32', indexed: false }, - { name: 'chainId', internalType: 'uint256', type: 'uint256', indexed: false }, - { name: 'tokenContract', internalType: 'address', type: 'address', indexed: true }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - ], - name: 'ERC6551AccountCreated', - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address' }, - { name: 'salt', internalType: 'bytes32', type: 'bytes32' }, - { name: 'chainId', internalType: 'uint256', type: 'uint256' }, - { name: 'tokenContract', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'account', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address' }, - { name: 'salt', internalType: 'bytes32', type: 'bytes32' }, - { name: 'chainId', internalType: 'uint256', type: 'uint256' }, - { name: 'tokenContract', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'createAccount', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, -] as const + { type: "error", inputs: [], name: "AccountCreationFailed" }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "account", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "implementation", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "salt", + internalType: "bytes32", + type: "bytes32", + indexed: false, + }, + { + name: "chainId", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + { + name: "tokenContract", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + ], + name: "ERC6551AccountCreated", + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "implementation", internalType: "address", type: "address" }, + { name: "salt", internalType: "bytes32", type: "bytes32" }, + { name: "chainId", internalType: "uint256", type: "uint256" }, + { name: "tokenContract", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + ], + name: "account", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "implementation", internalType: "address", type: "address" }, + { name: "salt", internalType: "bytes32", type: "bytes32" }, + { name: "chainId", internalType: "uint256", type: "uint256" }, + { name: "tokenContract", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + ], + name: "createAccount", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, +] as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x000000006551c19487814612e58FE06813775758) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x000000006551c19487814612e58FE06813775758) */ export const erc6551RegistryV3Address = { - 1: '0x000000006551c19487814612e58FE06813775758', - 5: '0x000000006551c19487814612e58FE06813775758', -} as const + 1: "0x000000006551c19487814612e58FE06813775758", + 5: "0x000000006551c19487814612e58FE06813775758", +} as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x000000006551c19487814612e58FE06813775758) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x000000006551c19487814612e58FE06813775758) */ export const erc6551RegistryV3Config = { - address: erc6551RegistryV3Address, - abi: erc6551RegistryV3ABI, -} as const + address: erc6551RegistryV3Address, + abi: erc6551RegistryV3ABI, +} as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // WETH_ @@ -722,173 +903,173 @@ export const erc6551RegistryV3Config = { * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6) */ export const wethABI = [ - { - constant: true, - payable: false, - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'name', - outputs: [{ name: '', type: 'string' }], - }, - { - constant: false, - payable: false, - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'guy', type: 'address' }, - { name: 'wad', type: 'uint256' }, - ], - name: 'approve', - outputs: [{ name: '', type: 'bool' }], - }, - { - constant: true, - payable: false, - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'totalSupply', - outputs: [{ name: '', type: 'uint256' }], - }, - { - constant: false, - payable: false, - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'src', type: 'address' }, - { name: 'dst', type: 'address' }, - { name: 'wad', type: 'uint256' }, - ], - name: 'transferFrom', - outputs: [{ name: '', type: 'bool' }], - }, - { - constant: false, - payable: false, - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'wad', type: 'uint256' }], - name: 'withdraw', - outputs: [], - }, - { - constant: true, - payable: false, - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'decimals', - outputs: [{ name: '', type: 'uint8' }], - }, - { - constant: true, - payable: false, - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', type: 'uint256' }], - }, - { - constant: true, - payable: false, - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'symbol', - outputs: [{ name: '', type: 'string' }], - }, - { - constant: false, - payable: false, - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'dst', type: 'address' }, - { name: 'wad', type: 'uint256' }, - ], - name: 'transfer', - outputs: [{ name: '', type: 'bool' }], - }, - { - constant: false, - payable: true, - stateMutability: 'payable', - type: 'function', - inputs: [], - name: 'deposit', - outputs: [], - }, - { - constant: true, - payable: false, - stateMutability: 'view', - type: 'function', - inputs: [ - { name: '', type: 'address' }, - { name: '', type: 'address' }, - ], - name: 'allowance', - outputs: [{ name: '', type: 'uint256' }], - }, - { payable: true, stateMutability: 'payable', type: 'fallback' }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'src', type: 'address', indexed: true }, - { name: 'guy', type: 'address', indexed: true }, - { name: 'wad', type: 'uint256', indexed: false }, - ], - name: 'Approval', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'src', type: 'address', indexed: true }, - { name: 'dst', type: 'address', indexed: true }, - { name: 'wad', type: 'uint256', indexed: false }, - ], - name: 'Transfer', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'dst', type: 'address', indexed: true }, - { name: 'wad', type: 'uint256', indexed: false }, - ], - name: 'Deposit', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'src', type: 'address', indexed: true }, - { name: 'wad', type: 'uint256', indexed: false }, - ], - name: 'Withdrawal', - }, -] as const + { + constant: true, + payable: false, + stateMutability: "view", + type: "function", + inputs: [], + name: "name", + outputs: [{ name: "", type: "string" }], + }, + { + constant: false, + payable: false, + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "guy", type: "address" }, + { name: "wad", type: "uint256" }, + ], + name: "approve", + outputs: [{ name: "", type: "bool" }], + }, + { + constant: true, + payable: false, + stateMutability: "view", + type: "function", + inputs: [], + name: "totalSupply", + outputs: [{ name: "", type: "uint256" }], + }, + { + constant: false, + payable: false, + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "src", type: "address" }, + { name: "dst", type: "address" }, + { name: "wad", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ name: "", type: "bool" }], + }, + { + constant: false, + payable: false, + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "wad", type: "uint256" }], + name: "withdraw", + outputs: [], + }, + { + constant: true, + payable: false, + stateMutability: "view", + type: "function", + inputs: [], + name: "decimals", + outputs: [{ name: "", type: "uint8" }], + }, + { + constant: true, + payable: false, + stateMutability: "view", + type: "function", + inputs: [{ name: "", type: "address" }], + name: "balanceOf", + outputs: [{ name: "", type: "uint256" }], + }, + { + constant: true, + payable: false, + stateMutability: "view", + type: "function", + inputs: [], + name: "symbol", + outputs: [{ name: "", type: "string" }], + }, + { + constant: false, + payable: false, + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "dst", type: "address" }, + { name: "wad", type: "uint256" }, + ], + name: "transfer", + outputs: [{ name: "", type: "bool" }], + }, + { + constant: false, + payable: true, + stateMutability: "payable", + type: "function", + inputs: [], + name: "deposit", + outputs: [], + }, + { + constant: true, + payable: false, + stateMutability: "view", + type: "function", + inputs: [ + { name: "", type: "address" }, + { name: "", type: "address" }, + ], + name: "allowance", + outputs: [{ name: "", type: "uint256" }], + }, + { payable: true, stateMutability: "payable", type: "fallback" }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "src", type: "address", indexed: true }, + { name: "guy", type: "address", indexed: true }, + { name: "wad", type: "uint256", indexed: false }, + ], + name: "Approval", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "src", type: "address", indexed: true }, + { name: "dst", type: "address", indexed: true }, + { name: "wad", type: "uint256", indexed: false }, + ], + name: "Transfer", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "dst", type: "address", indexed: true }, + { name: "wad", type: "uint256", indexed: false }, + ], + name: "Deposit", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "src", type: "address", indexed: true }, + { name: "wad", type: "uint256", indexed: false }, + ], + name: "Withdrawal", + }, +] as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6) */ export const wethAddress = { - 1: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - 5: '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', -} as const + 1: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + 5: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", +} as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6) */ -export const wethConfig = { address: wethAddress, abi: wethABI } as const +export const wethConfig = { address: wethAddress, abi: wethABI } as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Zora1155_ @@ -899,1092 +1080,1424 @@ export const wethConfig = { address: wethAddress, abi: wethABI } as const * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA) */ export const zora1155ABI = [ - { - stateMutability: 'nonpayable', - type: 'constructor', - inputs: [ - { name: '_mintFeeRecipient', internalType: 'address', type: 'address' }, - { name: '_upgradeGate', internalType: 'address', type: 'address' }, - { name: '_protocolRewards', internalType: 'address', type: 'address' }, - ], - }, - { type: 'error', inputs: [], name: 'ADDRESS_DELEGATECALL_TO_NON_CONTRACT' }, - { type: 'error', inputs: [], name: 'ADDRESS_LOW_LEVEL_CALL_FAILED' }, - { - type: 'error', - inputs: [ - { name: 'operator', internalType: 'address', type: 'address' }, - { name: 'user', internalType: 'address', type: 'address' }, - ], - name: 'Burn_NotOwnerOrApproved', - }, - { type: 'error', inputs: [], name: 'CREATOR_FUNDS_RECIPIENT_NOT_SET' }, - { - type: 'error', - inputs: [{ name: 'reason', internalType: 'bytes', type: 'bytes' }], - name: 'CallFailed', - }, - { type: 'error', inputs: [], name: 'Call_TokenIdMismatch' }, - { - type: 'error', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'totalMinted', internalType: 'uint256', type: 'uint256' }, - { name: 'maxSupply', internalType: 'uint256', type: 'uint256' }, - ], - name: 'CannotMintMoreTokens', - }, - { - type: 'error', - inputs: [{ name: 'proposedAddress', internalType: 'address', type: 'address' }], - name: 'Config_TransferHookNotSupported', - }, - { type: 'error', inputs: [], name: 'ERC1155_ACCOUNTS_AND_IDS_LENGTH_MISMATCH' }, - { type: 'error', inputs: [], name: 'ERC1155_ADDRESS_ZERO_IS_NOT_A_VALID_OWNER' }, - { type: 'error', inputs: [], name: 'ERC1155_BURN_AMOUNT_EXCEEDS_BALANCE' }, - { type: 'error', inputs: [], name: 'ERC1155_BURN_FROM_ZERO_ADDRESS' }, - { type: 'error', inputs: [], name: 'ERC1155_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED' }, - { type: 'error', inputs: [], name: 'ERC1155_ERC1155RECEIVER_REJECTED_TOKENS' }, - { type: 'error', inputs: [], name: 'ERC1155_IDS_AND_AMOUNTS_LENGTH_MISMATCH' }, - { type: 'error', inputs: [], name: 'ERC1155_INSUFFICIENT_BALANCE_FOR_TRANSFER' }, - { type: 'error', inputs: [], name: 'ERC1155_MINT_TO_ZERO_ADDRESS' }, - { type: 'error', inputs: [], name: 'ERC1155_SETTING_APPROVAL_FOR_SELF' }, - { - type: 'error', - inputs: [], - name: 'ERC1155_TRANSFER_TO_NON_ERC1155RECEIVER_IMPLEMENTER', - }, - { type: 'error', inputs: [], name: 'ERC1155_TRANSFER_TO_ZERO_ADDRESS' }, - { type: 'error', inputs: [], name: 'ERC1967_NEW_IMPL_NOT_CONTRACT' }, - { type: 'error', inputs: [], name: 'ERC1967_NEW_IMPL_NOT_UUPS' }, - { type: 'error', inputs: [], name: 'ERC1967_UNSUPPORTED_PROXIABLEUUID' }, - { - type: 'error', - inputs: [ - { name: 'recipient', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'ETHWithdrawFailed', - }, - { type: 'error', inputs: [], name: 'FUNCTION_MUST_BE_CALLED_THROUGH_ACTIVE_PROXY' }, - { type: 'error', inputs: [], name: 'FUNCTION_MUST_BE_CALLED_THROUGH_DELEGATECALL' }, - { - type: 'error', - inputs: [ - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - { name: 'contractValue', internalType: 'uint256', type: 'uint256' }, - ], - name: 'FundsWithdrawInsolvent', - }, - { type: 'error', inputs: [], name: 'INITIALIZABLE_CONTRACT_ALREADY_INITIALIZED' }, - { type: 'error', inputs: [], name: 'INITIALIZABLE_CONTRACT_IS_NOT_INITIALIZING' }, - { type: 'error', inputs: [], name: 'INVALID_ADDRESS_ZERO' }, - { type: 'error', inputs: [], name: 'INVALID_ETH_AMOUNT' }, - { type: 'error', inputs: [], name: 'InvalidMintSchedule' }, - { type: 'error', inputs: [], name: 'MintNotYetStarted' }, - { type: 'error', inputs: [], name: 'Mint_InsolventSaleTransfer' }, - { type: 'error', inputs: [], name: 'Mint_TokenIDMintNotAllowed' }, - { type: 'error', inputs: [], name: 'Mint_UnknownCommand' }, - { type: 'error', inputs: [], name: 'Mint_ValueTransferFail' }, - { type: 'error', inputs: [], name: 'NewOwnerNeedsToBeAdmin' }, - { - type: 'error', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'NoRendererForToken', - }, - { type: 'error', inputs: [], name: 'ONLY_CREATE_REFERRAL' }, - { type: 'error', inputs: [], name: 'PremintDeleted' }, - { - type: 'error', - inputs: [ - { name: 'caller', internalType: 'address', type: 'address' }, - { name: 'recipient', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'ProtocolRewardsWithdrawFailed', - }, - { - type: 'error', - inputs: [{ name: 'renderer', internalType: 'address', type: 'address' }], - name: 'RendererNotValid', - }, - { type: 'error', inputs: [], name: 'Renderer_NotValidRendererContract' }, - { - type: 'error', - inputs: [{ name: 'targetContract', internalType: 'address', type: 'address' }], - name: 'Sale_CannotCallNonSalesContract', - }, - { - type: 'error', - inputs: [ - { name: 'expected', internalType: 'uint256', type: 'uint256' }, - { name: 'actual', internalType: 'uint256', type: 'uint256' }, - ], - name: 'TokenIdMismatch', - }, - { - type: 'error', - inputs: [], - name: 'UUPS_UPGRADEABLE_MUST_NOT_BE_CALLED_THROUGH_DELEGATECALL', - }, - { - type: 'error', - inputs: [ - { name: 'user', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'role', internalType: 'uint256', type: 'uint256' }, - ], - name: 'UserMissingRoleForToken', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'previousAdmin', internalType: 'address', type: 'address', indexed: false }, - { name: 'newAdmin', internalType: 'address', type: 'address', indexed: false }, - ], - name: 'AdminChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'account', internalType: 'address', type: 'address', indexed: true }, - { name: 'operator', internalType: 'address', type: 'address', indexed: true }, - { name: 'approved', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'ApprovalForAll', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'beacon', internalType: 'address', type: 'address', indexed: true }], - name: 'BeaconUpgraded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'updater', internalType: 'address', type: 'address', indexed: true }, - { - name: 'updateType', - internalType: 'enum IZoraCreator1155.ConfigUpdate', - type: 'uint8', - indexed: true, - }, - { - name: 'newConfig', - internalType: 'struct IZoraCreator1155TypesV1.ContractConfig', - type: 'tuple', - components: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: '__gap1', internalType: 'uint96', type: 'uint96' }, - { name: 'fundsRecipient', internalType: 'address payable', type: 'address' }, - { name: '__gap2', internalType: 'uint96', type: 'uint96' }, - { - name: 'transferHook', - internalType: 'contract ITransferHookReceiver', - type: 'address', - }, - { name: '__gap3', internalType: 'uint96', type: 'uint96' }, - ], - indexed: false, - }, - ], - name: 'ConfigUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'updater', internalType: 'address', type: 'address', indexed: true }, - { name: 'uri', internalType: 'string', type: 'string', indexed: false }, - { name: 'name', internalType: 'string', type: 'string', indexed: false }, - ], - name: 'ContractMetadataUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'renderer', - internalType: 'contract IRenderer1155', - type: 'address', - indexed: false, - }, - ], - name: 'ContractRendererUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'structHash', internalType: 'bytes32', type: 'bytes32', indexed: false }, - { name: 'domainName', internalType: 'string', type: 'string', indexed: false }, - { name: 'version', internalType: 'string', type: 'string', indexed: false }, - { name: 'creator', internalType: 'address', type: 'address', indexed: false }, - { name: 'signature', internalType: 'bytes', type: 'bytes', indexed: false }, - ], - name: 'CreatorAttribution', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'version', internalType: 'uint8', type: 'uint8', indexed: false }], - name: 'Initialized', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'lastOwner', internalType: 'address', type: 'address', indexed: false }, - { name: 'newOwner', internalType: 'address', type: 'address', indexed: false }, - ], - name: 'OwnershipTransferred', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'sender', internalType: 'address', type: 'address', indexed: true }, - { name: 'minter', internalType: 'address', type: 'address', indexed: true }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - { name: 'quantity', internalType: 'uint256', type: 'uint256', indexed: false }, - { name: 'value', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'Purchased', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - { name: 'renderer', internalType: 'address', type: 'address', indexed: true }, - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'RendererUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - { name: 'sender', internalType: 'address', type: 'address', indexed: true }, - { name: 'newURI', internalType: 'string', type: 'string', indexed: false }, - { name: 'maxSupply', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'SetupNewToken', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'operator', internalType: 'address', type: 'address', indexed: true }, - { name: 'from', internalType: 'address', type: 'address', indexed: true }, - { name: 'to', internalType: 'address', type: 'address', indexed: true }, - { name: 'ids', internalType: 'uint256[]', type: 'uint256[]', indexed: false }, - { name: 'values', internalType: 'uint256[]', type: 'uint256[]', indexed: false }, - ], - name: 'TransferBatch', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'operator', internalType: 'address', type: 'address', indexed: true }, - { name: 'from', internalType: 'address', type: 'address', indexed: true }, - { name: 'to', internalType: 'address', type: 'address', indexed: true }, - { name: 'id', internalType: 'uint256', type: 'uint256', indexed: false }, - { name: 'value', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'TransferSingle', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'value', internalType: 'string', type: 'string', indexed: false }, - { name: 'id', internalType: 'uint256', type: 'uint256', indexed: true }, - ], - name: 'URI', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { name: 'permissions', internalType: 'uint256', type: 'uint256', indexed: true }, - ], - name: 'UpdatedPermissions', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'configuration', - internalType: 'struct ICreatorRoyaltiesControl.RoyaltyConfiguration', - type: 'tuple', - components: [ - { name: 'royaltyMintSchedule', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyBPS', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyRecipient', internalType: 'address', type: 'address' }, - ], - indexed: false, - }, - ], - name: 'UpdatedRoyalties', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'from', internalType: 'address', type: 'address', indexed: true }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - { - name: 'tokenData', - internalType: 'struct IZoraCreator1155TypesV1.TokenData', - type: 'tuple', - components: [ - { name: 'uri', internalType: 'string', type: 'string' }, - { name: 'maxSupply', internalType: 'uint256', type: 'uint256' }, - { name: 'totalMinted', internalType: 'uint256', type: 'uint256' }, - ], - indexed: false, - }, - ], - name: 'UpdatedToken', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'Upgraded', - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'CONTRACT_BASE_ID', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'PERMISSION_BIT_ADMIN', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'PERMISSION_BIT_FUNDS_MANAGER', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'PERMISSION_BIT_METADATA', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'PERMISSION_BIT_MINTER', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'PERMISSION_BIT_SALES', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'user', internalType: 'address', type: 'address' }, - { name: 'permissionBits', internalType: 'uint256', type: 'uint256' }, - ], - name: 'addPermission', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'recipient', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'adminMint', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'recipient', internalType: 'address', type: 'address' }, - { name: 'tokenIds', internalType: 'uint256[]', type: 'uint256[]' }, - { name: 'quantities', internalType: 'uint256[]', type: 'uint256[]' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'adminMintBatch', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'lastTokenId', internalType: 'uint256', type: 'uint256' }], - name: 'assumeLastTokenIdMatches', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'account', internalType: 'address', type: 'address' }, - { name: 'id', internalType: 'uint256', type: 'uint256' }, - ], - name: 'balanceOf', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'accounts', internalType: 'address[]', type: 'address[]' }, - { name: 'ids', internalType: 'uint256[]', type: 'uint256[]' }, - ], - name: 'balanceOfBatch', - outputs: [{ name: 'batchBalances', internalType: 'uint256[]', type: 'uint256[]' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'tokenIds', internalType: 'uint256[]', type: 'uint256[]' }, - { name: 'amounts', internalType: 'uint256[]', type: 'uint256[]' }, - ], - name: 'burnBatch', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'callRenderer', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'salesConfig', internalType: 'contract IMinter1155', type: 'address' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'callSale', - outputs: [], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [{ name: 'numTokens', internalType: 'uint256', type: 'uint256' }], - name: 'computeFreeMintRewards', - outputs: [ - { - name: '', - internalType: 'struct RewardsSettings', - type: 'tuple', - components: [ - { name: 'creatorReward', internalType: 'uint256', type: 'uint256' }, - { name: 'createReferralReward', internalType: 'uint256', type: 'uint256' }, - { name: 'mintReferralReward', internalType: 'uint256', type: 'uint256' }, - { name: 'firstMinterReward', internalType: 'uint256', type: 'uint256' }, - { name: 'zoraReward', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [{ name: 'numTokens', internalType: 'uint256', type: 'uint256' }], - name: 'computePaidMintRewards', - outputs: [ - { - name: '', - internalType: 'struct RewardsSettings', - type: 'tuple', - components: [ - { name: 'creatorReward', internalType: 'uint256', type: 'uint256' }, - { name: 'createReferralReward', internalType: 'uint256', type: 'uint256' }, - { name: 'mintReferralReward', internalType: 'uint256', type: 'uint256' }, - { name: 'firstMinterReward', internalType: 'uint256', type: 'uint256' }, - { name: 'zoraReward', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [{ name: 'numTokens', internalType: 'uint256', type: 'uint256' }], - name: 'computeTotalReward', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'config', - outputs: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: '__gap1', internalType: 'uint96', type: 'uint96' }, - { name: 'fundsRecipient', internalType: 'address payable', type: 'address' }, - { name: '__gap2', internalType: 'uint96', type: 'uint96' }, - { - name: 'transferHook', - internalType: 'contract ITransferHookReceiver', - type: 'address', - }, - { name: '__gap3', internalType: 'uint96', type: 'uint96' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'contractURI', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [], - name: 'contractVersion', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'createReferrals', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'customRenderers', - outputs: [{ name: '', internalType: 'contract IRenderer1155', type: 'address' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'premintConfig', - internalType: 'struct PremintConfig', - type: 'tuple', - components: [ - { - name: 'tokenConfig', - internalType: 'struct TokenCreationConfig', - type: 'tuple', - components: [ - { name: 'tokenURI', internalType: 'string', type: 'string' }, - { name: 'maxSupply', internalType: 'uint256', type: 'uint256' }, - { name: 'maxTokensPerAddress', internalType: 'uint64', type: 'uint64' }, - { name: 'pricePerToken', internalType: 'uint96', type: 'uint96' }, - { name: 'mintStart', internalType: 'uint64', type: 'uint64' }, - { name: 'mintDuration', internalType: 'uint64', type: 'uint64' }, - { name: 'royaltyMintSchedule', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyBPS', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyRecipient', internalType: 'address', type: 'address' }, - { name: 'fixedPriceMinter', internalType: 'address', type: 'address' }, - ], - }, - { name: 'uid', internalType: 'uint32', type: 'uint32' }, - { name: 'version', internalType: 'uint32', type: 'uint32' }, - { name: 'deleted', internalType: 'bool', type: 'bool' }, - ], - }, - { name: 'signature', internalType: 'bytes', type: 'bytes' }, - { name: 'sender', internalType: 'address', type: 'address' }, - ], - name: 'delegateSetupNewToken', - outputs: [{ name: 'newTokenId', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], - name: 'delegatedTokenId', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'firstMinters', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'getCreatorRewardRecipient', - outputs: [{ name: '', internalType: 'address payable', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'getCustomRenderer', - outputs: [ - { name: 'customRenderer', internalType: 'contract IRenderer1155', type: 'address' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'getRoyalties', - outputs: [ - { - name: '', - internalType: 'struct ICreatorRoyaltiesControl.RoyaltyConfiguration', - type: 'tuple', - components: [ - { name: 'royaltyMintSchedule', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyBPS', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyRecipient', internalType: 'address', type: 'address' }, - ], - }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'getTokenInfo', - outputs: [ - { - name: '', - internalType: 'struct IZoraCreator1155TypesV1.TokenData', - type: 'tuple', - components: [ - { name: 'uri', internalType: 'string', type: 'string' }, - { name: 'maxSupply', internalType: 'uint256', type: 'uint256' }, - { name: 'totalMinted', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'implementation', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'contractName', internalType: 'string', type: 'string' }, - { name: 'newContractURI', internalType: 'string', type: 'string' }, - { - name: 'defaultRoyaltyConfiguration', - internalType: 'struct ICreatorRoyaltiesControl.RoyaltyConfiguration', - type: 'tuple', - components: [ - { name: 'royaltyMintSchedule', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyBPS', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyRecipient', internalType: 'address', type: 'address' }, - ], - }, - { name: 'defaultAdmin', internalType: 'address payable', type: 'address' }, - { name: 'setupActions', internalType: 'bytes[]', type: 'bytes[]' }, - ], - name: 'initialize', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'user', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'role', internalType: 'uint256', type: 'uint256' }, - ], - name: 'isAdminOrRole', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'account', internalType: 'address', type: 'address' }, - { name: 'operator', internalType: 'address', type: 'address' }, - ], - name: 'isApprovedForAll', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'metadataRendererContract', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'minter', internalType: 'contract IMinter1155', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'minterArguments', internalType: 'bytes', type: 'bytes' }, - ], - name: 'mint', - outputs: [], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [], - name: 'mintFee', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'minter', internalType: 'contract IMinter1155', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'minterArguments', internalType: 'bytes', type: 'bytes' }, - { name: 'mintReferral', internalType: 'address', type: 'address' }, - ], - name: 'mintWithRewards', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'data', internalType: 'bytes[]', type: 'bytes[]' }], - name: 'multicall', - outputs: [{ name: 'results', internalType: 'bytes[]', type: 'bytes[]' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'name', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'nextTokenId', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'address', type: 'address' }, - ], - name: 'permissions', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'proxiableUUID', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'user', internalType: 'address', type: 'address' }, - { name: 'permissionBits', internalType: 'uint256', type: 'uint256' }, - ], - name: 'removePermission', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'royalties', - outputs: [ - { name: 'royaltyMintSchedule', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyBPS', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyRecipient', internalType: 'address', type: 'address' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'salePrice', internalType: 'uint256', type: 'uint256' }, - ], - name: 'royaltyInfo', - outputs: [ - { name: 'receiver', internalType: 'address', type: 'address' }, - { name: 'royaltyAmount', internalType: 'uint256', type: 'uint256' }, - ], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'ids', internalType: 'uint256[]', type: 'uint256[]' }, - { name: 'amounts', internalType: 'uint256[]', type: 'uint256[]' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'safeBatchTransferFrom', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'id', internalType: 'uint256', type: 'uint256' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'safeTransferFrom', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'operator', internalType: 'address', type: 'address' }, - { name: 'approved', internalType: 'bool', type: 'bool' }, - ], - name: 'setApprovalForAll', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'fundsRecipient', internalType: 'address payable', type: 'address' }, - ], - name: 'setFundsRecipient', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'renderer', internalType: 'contract IRenderer1155', type: 'address' }, - ], - name: 'setTokenMetadataRenderer', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'transferHook', - internalType: 'contract ITransferHookReceiver', - type: 'address', - }, - ], - name: 'setTransferHook', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'newURI', internalType: 'string', type: 'string' }, - { name: 'maxSupply', internalType: 'uint256', type: 'uint256' }, - ], - name: 'setupNewToken', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'newURI', internalType: 'string', type: 'string' }, - { name: 'maxSupply', internalType: 'uint256', type: 'uint256' }, - { name: 'createReferral', internalType: 'address', type: 'address' }, - ], - name: 'setupNewTokenWithCreateReferral', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'interfaceId', internalType: 'bytes4', type: 'bytes4' }], - name: 'supportsInterface', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [], - name: 'symbol', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: '_newURI', internalType: 'string', type: 'string' }, - { name: '_newName', internalType: 'string', type: 'string' }, - ], - name: 'updateContractMetadata', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: 'recipient', internalType: 'address', type: 'address' }, - ], - name: 'updateCreateReferral', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { - name: 'newConfiguration', - internalType: 'struct ICreatorRoyaltiesControl.RoyaltyConfiguration', - type: 'tuple', - components: [ - { name: 'royaltyMintSchedule', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyBPS', internalType: 'uint32', type: 'uint32' }, - { name: 'royaltyRecipient', internalType: 'address', type: 'address' }, - ], - }, - ], - name: 'updateRoyaltiesForToken', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: '_newURI', internalType: 'string', type: 'string' }, - ], - name: 'updateTokenURI', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'newImplementation', internalType: 'address', type: 'address' }], - name: 'upgradeTo', - outputs: [], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'newImplementation', internalType: 'address', type: 'address' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'upgradeToAndCall', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'uri', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [], - name: 'withdraw', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'withdrawRewards', - outputs: [], - }, -] as const + { + stateMutability: "nonpayable", + type: "constructor", + inputs: [ + { name: "_mintFeeRecipient", internalType: "address", type: "address" }, + { name: "_upgradeGate", internalType: "address", type: "address" }, + { name: "_protocolRewards", internalType: "address", type: "address" }, + ], + }, + { type: "error", inputs: [], name: "ADDRESS_DELEGATECALL_TO_NON_CONTRACT" }, + { type: "error", inputs: [], name: "ADDRESS_LOW_LEVEL_CALL_FAILED" }, + { + type: "error", + inputs: [ + { name: "operator", internalType: "address", type: "address" }, + { name: "user", internalType: "address", type: "address" }, + ], + name: "Burn_NotOwnerOrApproved", + }, + { type: "error", inputs: [], name: "CREATOR_FUNDS_RECIPIENT_NOT_SET" }, + { + type: "error", + inputs: [{ name: "reason", internalType: "bytes", type: "bytes" }], + name: "CallFailed", + }, + { type: "error", inputs: [], name: "Call_TokenIdMismatch" }, + { + type: "error", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "totalMinted", internalType: "uint256", type: "uint256" }, + { name: "maxSupply", internalType: "uint256", type: "uint256" }, + ], + name: "CannotMintMoreTokens", + }, + { + type: "error", + inputs: [ + { name: "proposedAddress", internalType: "address", type: "address" }, + ], + name: "Config_TransferHookNotSupported", + }, + { + type: "error", + inputs: [], + name: "ERC1155_ACCOUNTS_AND_IDS_LENGTH_MISMATCH", + }, + { + type: "error", + inputs: [], + name: "ERC1155_ADDRESS_ZERO_IS_NOT_A_VALID_OWNER", + }, + { type: "error", inputs: [], name: "ERC1155_BURN_AMOUNT_EXCEEDS_BALANCE" }, + { type: "error", inputs: [], name: "ERC1155_BURN_FROM_ZERO_ADDRESS" }, + { + type: "error", + inputs: [], + name: "ERC1155_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED", + }, + { + type: "error", + inputs: [], + name: "ERC1155_ERC1155RECEIVER_REJECTED_TOKENS", + }, + { + type: "error", + inputs: [], + name: "ERC1155_IDS_AND_AMOUNTS_LENGTH_MISMATCH", + }, + { + type: "error", + inputs: [], + name: "ERC1155_INSUFFICIENT_BALANCE_FOR_TRANSFER", + }, + { type: "error", inputs: [], name: "ERC1155_MINT_TO_ZERO_ADDRESS" }, + { type: "error", inputs: [], name: "ERC1155_SETTING_APPROVAL_FOR_SELF" }, + { + type: "error", + inputs: [], + name: "ERC1155_TRANSFER_TO_NON_ERC1155RECEIVER_IMPLEMENTER", + }, + { type: "error", inputs: [], name: "ERC1155_TRANSFER_TO_ZERO_ADDRESS" }, + { type: "error", inputs: [], name: "ERC1967_NEW_IMPL_NOT_CONTRACT" }, + { type: "error", inputs: [], name: "ERC1967_NEW_IMPL_NOT_UUPS" }, + { type: "error", inputs: [], name: "ERC1967_UNSUPPORTED_PROXIABLEUUID" }, + { + type: "error", + inputs: [ + { name: "recipient", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, + ], + name: "ETHWithdrawFailed", + }, + { + type: "error", + inputs: [], + name: "FUNCTION_MUST_BE_CALLED_THROUGH_ACTIVE_PROXY", + }, + { + type: "error", + inputs: [], + name: "FUNCTION_MUST_BE_CALLED_THROUGH_DELEGATECALL", + }, + { + type: "error", + inputs: [ + { name: "amount", internalType: "uint256", type: "uint256" }, + { name: "contractValue", internalType: "uint256", type: "uint256" }, + ], + name: "FundsWithdrawInsolvent", + }, + { + type: "error", + inputs: [], + name: "INITIALIZABLE_CONTRACT_ALREADY_INITIALIZED", + }, + { + type: "error", + inputs: [], + name: "INITIALIZABLE_CONTRACT_IS_NOT_INITIALIZING", + }, + { type: "error", inputs: [], name: "INVALID_ADDRESS_ZERO" }, + { type: "error", inputs: [], name: "INVALID_ETH_AMOUNT" }, + { type: "error", inputs: [], name: "InvalidMintSchedule" }, + { type: "error", inputs: [], name: "MintNotYetStarted" }, + { type: "error", inputs: [], name: "Mint_InsolventSaleTransfer" }, + { type: "error", inputs: [], name: "Mint_TokenIDMintNotAllowed" }, + { type: "error", inputs: [], name: "Mint_UnknownCommand" }, + { type: "error", inputs: [], name: "Mint_ValueTransferFail" }, + { type: "error", inputs: [], name: "NewOwnerNeedsToBeAdmin" }, + { + type: "error", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "NoRendererForToken", + }, + { type: "error", inputs: [], name: "ONLY_CREATE_REFERRAL" }, + { type: "error", inputs: [], name: "PremintDeleted" }, + { + type: "error", + inputs: [ + { name: "caller", internalType: "address", type: "address" }, + { name: "recipient", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, + ], + name: "ProtocolRewardsWithdrawFailed", + }, + { + type: "error", + inputs: [{ name: "renderer", internalType: "address", type: "address" }], + name: "RendererNotValid", + }, + { type: "error", inputs: [], name: "Renderer_NotValidRendererContract" }, + { + type: "error", + inputs: [ + { name: "targetContract", internalType: "address", type: "address" }, + ], + name: "Sale_CannotCallNonSalesContract", + }, + { + type: "error", + inputs: [ + { name: "expected", internalType: "uint256", type: "uint256" }, + { name: "actual", internalType: "uint256", type: "uint256" }, + ], + name: "TokenIdMismatch", + }, + { + type: "error", + inputs: [], + name: "UUPS_UPGRADEABLE_MUST_NOT_BE_CALLED_THROUGH_DELEGATECALL", + }, + { + type: "error", + inputs: [ + { name: "user", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "role", internalType: "uint256", type: "uint256" }, + ], + name: "UserMissingRoleForToken", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "previousAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "newAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "AdminChanged", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "account", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "operator", + internalType: "address", + type: "address", + indexed: true, + }, + { name: "approved", internalType: "bool", type: "bool", indexed: false }, + ], + name: "ApprovalForAll", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "beacon", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "BeaconUpgraded", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "updater", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "updateType", + internalType: "enum IZoraCreator1155.ConfigUpdate", + type: "uint8", + indexed: true, + }, + { + name: "newConfig", + internalType: "struct IZoraCreator1155TypesV1.ContractConfig", + type: "tuple", + components: [ + { name: "owner", internalType: "address", type: "address" }, + { name: "__gap1", internalType: "uint96", type: "uint96" }, + { + name: "fundsRecipient", + internalType: "address payable", + type: "address", + }, + { name: "__gap2", internalType: "uint96", type: "uint96" }, + { + name: "transferHook", + internalType: "contract ITransferHookReceiver", + type: "address", + }, + { name: "__gap3", internalType: "uint96", type: "uint96" }, + ], + indexed: false, + }, + ], + name: "ConfigUpdated", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "updater", + internalType: "address", + type: "address", + indexed: true, + }, + { name: "uri", internalType: "string", type: "string", indexed: false }, + { name: "name", internalType: "string", type: "string", indexed: false }, + ], + name: "ContractMetadataUpdated", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "renderer", + internalType: "contract IRenderer1155", + type: "address", + indexed: false, + }, + ], + name: "ContractRendererUpdated", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "structHash", + internalType: "bytes32", + type: "bytes32", + indexed: false, + }, + { + name: "domainName", + internalType: "string", + type: "string", + indexed: false, + }, + { + name: "version", + internalType: "string", + type: "string", + indexed: false, + }, + { + name: "creator", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "signature", + internalType: "bytes", + type: "bytes", + indexed: false, + }, + ], + name: "CreatorAttribution", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "version", internalType: "uint8", type: "uint8", indexed: false }, + ], + name: "Initialized", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "lastOwner", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "newOwner", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "OwnershipTransferred", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "sender", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "minter", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { + name: "quantity", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + { + name: "value", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "Purchased", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { + name: "renderer", + internalType: "address", + type: "address", + indexed: true, + }, + { name: "user", internalType: "address", type: "address", indexed: true }, + ], + name: "RendererUpdated", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { + name: "sender", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "newURI", + internalType: "string", + type: "string", + indexed: false, + }, + { + name: "maxSupply", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "SetupNewToken", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "operator", + internalType: "address", + type: "address", + indexed: true, + }, + { name: "from", internalType: "address", type: "address", indexed: true }, + { name: "to", internalType: "address", type: "address", indexed: true }, + { + name: "ids", + internalType: "uint256[]", + type: "uint256[]", + indexed: false, + }, + { + name: "values", + internalType: "uint256[]", + type: "uint256[]", + indexed: false, + }, + ], + name: "TransferBatch", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "operator", + internalType: "address", + type: "address", + indexed: true, + }, + { name: "from", internalType: "address", type: "address", indexed: true }, + { name: "to", internalType: "address", type: "address", indexed: true }, + { name: "id", internalType: "uint256", type: "uint256", indexed: false }, + { + name: "value", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "TransferSingle", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "value", internalType: "string", type: "string", indexed: false }, + { name: "id", internalType: "uint256", type: "uint256", indexed: true }, + ], + name: "URI", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { name: "user", internalType: "address", type: "address", indexed: true }, + { + name: "permissions", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + ], + name: "UpdatedPermissions", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { name: "user", internalType: "address", type: "address", indexed: true }, + { + name: "configuration", + internalType: "struct ICreatorRoyaltiesControl.RoyaltyConfiguration", + type: "tuple", + components: [ + { + name: "royaltyMintSchedule", + internalType: "uint32", + type: "uint32", + }, + { name: "royaltyBPS", internalType: "uint32", type: "uint32" }, + { + name: "royaltyRecipient", + internalType: "address", + type: "address", + }, + ], + indexed: false, + }, + ], + name: "UpdatedRoyalties", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "from", internalType: "address", type: "address", indexed: true }, + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { + name: "tokenData", + internalType: "struct IZoraCreator1155TypesV1.TokenData", + type: "tuple", + components: [ + { name: "uri", internalType: "string", type: "string" }, + { name: "maxSupply", internalType: "uint256", type: "uint256" }, + { name: "totalMinted", internalType: "uint256", type: "uint256" }, + ], + indexed: false, + }, + ], + name: "UpdatedToken", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "implementation", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "Upgraded", + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "CONTRACT_BASE_ID", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "PERMISSION_BIT_ADMIN", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "PERMISSION_BIT_FUNDS_MANAGER", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "PERMISSION_BIT_METADATA", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "PERMISSION_BIT_MINTER", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "PERMISSION_BIT_SALES", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "user", internalType: "address", type: "address" }, + { name: "permissionBits", internalType: "uint256", type: "uint256" }, + ], + name: "addPermission", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "recipient", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "adminMint", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "recipient", internalType: "address", type: "address" }, + { name: "tokenIds", internalType: "uint256[]", type: "uint256[]" }, + { name: "quantities", internalType: "uint256[]", type: "uint256[]" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "adminMintBatch", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "lastTokenId", internalType: "uint256", type: "uint256" }], + name: "assumeLastTokenIdMatches", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "account", internalType: "address", type: "address" }, + { name: "id", internalType: "uint256", type: "uint256" }, + ], + name: "balanceOf", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "accounts", internalType: "address[]", type: "address[]" }, + { name: "ids", internalType: "uint256[]", type: "uint256[]" }, + ], + name: "balanceOfBatch", + outputs: [ + { name: "batchBalances", internalType: "uint256[]", type: "uint256[]" }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "from", internalType: "address", type: "address" }, + { name: "tokenIds", internalType: "uint256[]", type: "uint256[]" }, + { name: "amounts", internalType: "uint256[]", type: "uint256[]" }, + ], + name: "burnBatch", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "callRenderer", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { + name: "salesConfig", + internalType: "contract IMinter1155", + type: "address", + }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "callSale", + outputs: [], + }, + { + stateMutability: "pure", + type: "function", + inputs: [{ name: "numTokens", internalType: "uint256", type: "uint256" }], + name: "computeFreeMintRewards", + outputs: [ + { + name: "", + internalType: "struct RewardsSettings", + type: "tuple", + components: [ + { name: "creatorReward", internalType: "uint256", type: "uint256" }, + { + name: "createReferralReward", + internalType: "uint256", + type: "uint256", + }, + { + name: "mintReferralReward", + internalType: "uint256", + type: "uint256", + }, + { + name: "firstMinterReward", + internalType: "uint256", + type: "uint256", + }, + { name: "zoraReward", internalType: "uint256", type: "uint256" }, + ], + }, + ], + }, + { + stateMutability: "pure", + type: "function", + inputs: [{ name: "numTokens", internalType: "uint256", type: "uint256" }], + name: "computePaidMintRewards", + outputs: [ + { + name: "", + internalType: "struct RewardsSettings", + type: "tuple", + components: [ + { name: "creatorReward", internalType: "uint256", type: "uint256" }, + { + name: "createReferralReward", + internalType: "uint256", + type: "uint256", + }, + { + name: "mintReferralReward", + internalType: "uint256", + type: "uint256", + }, + { + name: "firstMinterReward", + internalType: "uint256", + type: "uint256", + }, + { name: "zoraReward", internalType: "uint256", type: "uint256" }, + ], + }, + ], + }, + { + stateMutability: "pure", + type: "function", + inputs: [{ name: "numTokens", internalType: "uint256", type: "uint256" }], + name: "computeTotalReward", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "config", + outputs: [ + { name: "owner", internalType: "address", type: "address" }, + { name: "__gap1", internalType: "uint96", type: "uint96" }, + { + name: "fundsRecipient", + internalType: "address payable", + type: "address", + }, + { name: "__gap2", internalType: "uint96", type: "uint96" }, + { + name: "transferHook", + internalType: "contract ITransferHookReceiver", + type: "address", + }, + { name: "__gap3", internalType: "uint96", type: "uint96" }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "contractURI", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "pure", + type: "function", + inputs: [], + name: "contractVersion", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "", internalType: "uint256", type: "uint256" }], + name: "createReferrals", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "", internalType: "uint256", type: "uint256" }], + name: "customRenderers", + outputs: [ + { name: "", internalType: "contract IRenderer1155", type: "address" }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { + name: "premintConfig", + internalType: "struct PremintConfig", + type: "tuple", + components: [ + { + name: "tokenConfig", + internalType: "struct TokenCreationConfig", + type: "tuple", + components: [ + { name: "tokenURI", internalType: "string", type: "string" }, + { name: "maxSupply", internalType: "uint256", type: "uint256" }, + { + name: "maxTokensPerAddress", + internalType: "uint64", + type: "uint64", + }, + { name: "pricePerToken", internalType: "uint96", type: "uint96" }, + { name: "mintStart", internalType: "uint64", type: "uint64" }, + { name: "mintDuration", internalType: "uint64", type: "uint64" }, + { + name: "royaltyMintSchedule", + internalType: "uint32", + type: "uint32", + }, + { name: "royaltyBPS", internalType: "uint32", type: "uint32" }, + { + name: "royaltyRecipient", + internalType: "address", + type: "address", + }, + { + name: "fixedPriceMinter", + internalType: "address", + type: "address", + }, + ], + }, + { name: "uid", internalType: "uint32", type: "uint32" }, + { name: "version", internalType: "uint32", type: "uint32" }, + { name: "deleted", internalType: "bool", type: "bool" }, + ], + }, + { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "sender", internalType: "address", type: "address" }, + ], + name: "delegateSetupNewToken", + outputs: [{ name: "newTokenId", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "", internalType: "uint32", type: "uint32" }], + name: "delegatedTokenId", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "", internalType: "uint256", type: "uint256" }], + name: "firstMinters", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "getCreatorRewardRecipient", + outputs: [{ name: "", internalType: "address payable", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "getCustomRenderer", + outputs: [ + { + name: "customRenderer", + internalType: "contract IRenderer1155", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "getRoyalties", + outputs: [ + { + name: "", + internalType: "struct ICreatorRoyaltiesControl.RoyaltyConfiguration", + type: "tuple", + components: [ + { + name: "royaltyMintSchedule", + internalType: "uint32", + type: "uint32", + }, + { name: "royaltyBPS", internalType: "uint32", type: "uint32" }, + { + name: "royaltyRecipient", + internalType: "address", + type: "address", + }, + ], + }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "getTokenInfo", + outputs: [ + { + name: "", + internalType: "struct IZoraCreator1155TypesV1.TokenData", + type: "tuple", + components: [ + { name: "uri", internalType: "string", type: "string" }, + { name: "maxSupply", internalType: "uint256", type: "uint256" }, + { name: "totalMinted", internalType: "uint256", type: "uint256" }, + ], + }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "implementation", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "contractName", internalType: "string", type: "string" }, + { name: "newContractURI", internalType: "string", type: "string" }, + { + name: "defaultRoyaltyConfiguration", + internalType: "struct ICreatorRoyaltiesControl.RoyaltyConfiguration", + type: "tuple", + components: [ + { + name: "royaltyMintSchedule", + internalType: "uint32", + type: "uint32", + }, + { name: "royaltyBPS", internalType: "uint32", type: "uint32" }, + { + name: "royaltyRecipient", + internalType: "address", + type: "address", + }, + ], + }, + { + name: "defaultAdmin", + internalType: "address payable", + type: "address", + }, + { name: "setupActions", internalType: "bytes[]", type: "bytes[]" }, + ], + name: "initialize", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "user", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "role", internalType: "uint256", type: "uint256" }, + ], + name: "isAdminOrRole", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "account", internalType: "address", type: "address" }, + { name: "operator", internalType: "address", type: "address" }, + ], + name: "isApprovedForAll", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "", internalType: "uint256", type: "uint256" }], + name: "metadataRendererContract", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "minter", internalType: "contract IMinter1155", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "minterArguments", internalType: "bytes", type: "bytes" }, + ], + name: "mint", + outputs: [], + }, + { + stateMutability: "pure", + type: "function", + inputs: [], + name: "mintFee", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "minter", internalType: "contract IMinter1155", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "minterArguments", internalType: "bytes", type: "bytes" }, + { name: "mintReferral", internalType: "address", type: "address" }, + ], + name: "mintWithRewards", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "data", internalType: "bytes[]", type: "bytes[]" }], + name: "multicall", + outputs: [{ name: "results", internalType: "bytes[]", type: "bytes[]" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "name", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "nextTokenId", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "owner", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "", internalType: "uint256", type: "uint256" }, + { name: "", internalType: "address", type: "address" }, + ], + name: "permissions", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "proxiableUUID", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "user", internalType: "address", type: "address" }, + { name: "permissionBits", internalType: "uint256", type: "uint256" }, + ], + name: "removePermission", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "", internalType: "uint256", type: "uint256" }], + name: "royalties", + outputs: [ + { name: "royaltyMintSchedule", internalType: "uint32", type: "uint32" }, + { name: "royaltyBPS", internalType: "uint32", type: "uint32" }, + { name: "royaltyRecipient", internalType: "address", type: "address" }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "salePrice", internalType: "uint256", type: "uint256" }, + ], + name: "royaltyInfo", + outputs: [ + { name: "receiver", internalType: "address", type: "address" }, + { name: "royaltyAmount", internalType: "uint256", type: "uint256" }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "from", internalType: "address", type: "address" }, + { name: "to", internalType: "address", type: "address" }, + { name: "ids", internalType: "uint256[]", type: "uint256[]" }, + { name: "amounts", internalType: "uint256[]", type: "uint256[]" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "safeBatchTransferFrom", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "from", internalType: "address", type: "address" }, + { name: "to", internalType: "address", type: "address" }, + { name: "id", internalType: "uint256", type: "uint256" }, + { name: "amount", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "safeTransferFrom", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "operator", internalType: "address", type: "address" }, + { name: "approved", internalType: "bool", type: "bool" }, + ], + name: "setApprovalForAll", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { + name: "fundsRecipient", + internalType: "address payable", + type: "address", + }, + ], + name: "setFundsRecipient", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "newOwner", internalType: "address", type: "address" }], + name: "setOwner", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { + name: "renderer", + internalType: "contract IRenderer1155", + type: "address", + }, + ], + name: "setTokenMetadataRenderer", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { + name: "transferHook", + internalType: "contract ITransferHookReceiver", + type: "address", + }, + ], + name: "setTransferHook", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "newURI", internalType: "string", type: "string" }, + { name: "maxSupply", internalType: "uint256", type: "uint256" }, + ], + name: "setupNewToken", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "newURI", internalType: "string", type: "string" }, + { name: "maxSupply", internalType: "uint256", type: "uint256" }, + { name: "createReferral", internalType: "address", type: "address" }, + ], + name: "setupNewTokenWithCreateReferral", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "pure", + type: "function", + inputs: [], + name: "symbol", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "_newURI", internalType: "string", type: "string" }, + { name: "_newName", internalType: "string", type: "string" }, + ], + name: "updateContractMetadata", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "recipient", internalType: "address", type: "address" }, + ], + name: "updateCreateReferral", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { + name: "newConfiguration", + internalType: "struct ICreatorRoyaltiesControl.RoyaltyConfiguration", + type: "tuple", + components: [ + { + name: "royaltyMintSchedule", + internalType: "uint32", + type: "uint32", + }, + { name: "royaltyBPS", internalType: "uint32", type: "uint32" }, + { + name: "royaltyRecipient", + internalType: "address", + type: "address", + }, + ], + }, + ], + name: "updateRoyaltiesForToken", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "_newURI", internalType: "string", type: "string" }, + ], + name: "updateTokenURI", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "newImplementation", internalType: "address", type: "address" }, + ], + name: "upgradeTo", + outputs: [], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "newImplementation", internalType: "address", type: "address" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "upgradeToAndCall", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "uri", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [], + name: "withdraw", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "to", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, + ], + name: "withdrawRewards", + outputs: [], + }, +] as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA) */ export const zora1155Address = { - 1: '0x4482c5929618b848a46E3DA830A3D71085A5DE07', - 5: '0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA', -} as const + 1: "0x4482c5929618b848a46E3DA830A3D71085A5DE07", + 5: "0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA", +} as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA) */ -export const zora1155Config = { address: zora1155Address, abi: zora1155ABI } as const +export const zora1155Config = { + address: zora1155Address, + abi: zora1155ABI, +} as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Zora721Drop_ @@ -1995,1017 +2508,1316 @@ export const zora1155Config = { address: zora1155Address, abi: zora1155ABI } as * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xe4c17055048aEe01D0d122804816fEe5E6ac4A67) */ export const zora721DropABI = [ - { - stateMutability: 'nonpayable', - type: 'constructor', - inputs: [ - { name: '_zoraERC721TransferHelper', internalType: 'address', type: 'address' }, - { - name: '_factoryUpgradeGate', - internalType: 'contract IFactoryUpgradeGate', - type: 'address', - }, - { name: '_marketFilterDAOAddress', internalType: 'address', type: 'address' }, - { name: '_mintFeeAmount', internalType: 'uint256', type: 'uint256' }, - { name: '_mintFeeRecipient', internalType: 'address payable', type: 'address' }, - { name: '_protocolRewards', internalType: 'address', type: 'address' }, - ], - }, - { - type: 'error', - inputs: [{ name: 'role', internalType: 'bytes32', type: 'bytes32' }], - name: 'Access_MissingRoleOrAdmin', - }, - { type: 'error', inputs: [], name: 'Access_OnlyAdmin' }, - { type: 'error', inputs: [], name: 'Access_WithdrawNotAllowed' }, - { - type: 'error', - inputs: [{ name: 'proposedAddress', internalType: 'address', type: 'address' }], - name: 'Admin_InvalidUpgradeAddress', - }, - { type: 'error', inputs: [], name: 'Admin_UnableToFinalizeNotOpenEdition' }, - { type: 'error', inputs: [], name: 'ApprovalCallerNotOwnerNorApproved' }, - { type: 'error', inputs: [], name: 'ApprovalQueryForNonexistentToken' }, - { type: 'error', inputs: [], name: 'ApprovalToCurrentOwner' }, - { type: 'error', inputs: [], name: 'ApproveToCaller' }, - { type: 'error', inputs: [], name: 'BalanceQueryForZeroAddress' }, - { type: 'error', inputs: [], name: 'CREATOR_FUNDS_RECIPIENT_NOT_SET' }, - { type: 'error', inputs: [], name: 'ExternalMetadataRenderer_CallFailed' }, - { type: 'error', inputs: [], name: 'INVALID_ADDRESS_ZERO' }, - { type: 'error', inputs: [], name: 'INVALID_ETH_AMOUNT' }, - { type: 'error', inputs: [], name: 'InvalidMintSchedule' }, - { type: 'error', inputs: [], name: 'MarketFilterDAOAddressNotSupportedForChain' }, - { type: 'error', inputs: [], name: 'MintFee_FundsSendFailure' }, - { type: 'error', inputs: [], name: 'MintToZeroAddress' }, - { type: 'error', inputs: [], name: 'MintZeroQuantity' }, - { type: 'error', inputs: [], name: 'Mint_SoldOut' }, - { type: 'error', inputs: [], name: 'ONLY_CREATE_REFERRAL' }, - { type: 'error', inputs: [], name: 'ONLY_OWNER' }, - { type: 'error', inputs: [], name: 'ONLY_PENDING_OWNER' }, - { - type: 'error', - inputs: [{ name: 'operator', internalType: 'address', type: 'address' }], - name: 'OperatorNotAllowed', - }, - { type: 'error', inputs: [], name: 'OwnerQueryForNonexistentToken' }, - { type: 'error', inputs: [], name: 'Presale_Inactive' }, - { type: 'error', inputs: [], name: 'Presale_MerkleNotApproved' }, - { type: 'error', inputs: [], name: 'Presale_TooManyForAddress' }, - { type: 'error', inputs: [], name: 'ProtocolRewards_WithdrawSendFailure' }, - { type: 'error', inputs: [], name: 'Purchase_TooManyForAddress' }, - { - type: 'error', - inputs: [{ name: 'correctPrice', internalType: 'uint256', type: 'uint256' }], - name: 'Purchase_WrongPrice', - }, - { type: 'error', inputs: [], name: 'RemoteOperatorFilterRegistryCallFailed' }, - { type: 'error', inputs: [], name: 'Sale_Inactive' }, - { - type: 'error', - inputs: [{ name: 'maxRoyaltyBPS', internalType: 'uint16', type: 'uint16' }], - name: 'Setup_RoyaltyPercentageTooHigh', - }, - { type: 'error', inputs: [], name: 'TransferCallerNotOwnerNorApproved' }, - { type: 'error', inputs: [], name: 'TransferFromIncorrectOwner' }, - { type: 'error', inputs: [], name: 'TransferToNonERC721ReceiverImplementer' }, - { type: 'error', inputs: [], name: 'TransferToZeroAddress' }, - { type: 'error', inputs: [], name: 'URIQueryForNonexistentToken' }, - { type: 'error', inputs: [], name: 'Withdraw_FundsSendFailure' }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'previousAdmin', internalType: 'address', type: 'address', indexed: false }, - { name: 'newAdmin', internalType: 'address', type: 'address', indexed: false }, - ], - name: 'AdminChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'owner', internalType: 'address', type: 'address', indexed: true }, - { name: 'approved', internalType: 'address', type: 'address', indexed: true }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - ], - name: 'Approval', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'owner', internalType: 'address', type: 'address', indexed: true }, - { name: 'operator', internalType: 'address', type: 'address', indexed: true }, - { name: 'approved', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'ApprovalForAll', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: '_fromTokenId', internalType: 'uint256', type: 'uint256', indexed: false }, - { name: '_toTokenId', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'BatchMetadataUpdate', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'beacon', internalType: 'address', type: 'address', indexed: true }], - name: 'BeaconUpgraded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'source', internalType: 'address', type: 'address', indexed: true }, - { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'FundsReceived', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'newAddress', internalType: 'address', type: 'address', indexed: true }, - { name: 'changedBy', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'FundsRecipientChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'withdrawnBy', internalType: 'address', type: 'address', indexed: true }, - { name: 'withdrawnTo', internalType: 'address', type: 'address', indexed: true }, - { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false }, - { name: 'feeRecipient', internalType: 'address', type: 'address', indexed: false }, - { name: 'feeAmount', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'FundsWithdrawn', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: '_tokenId', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'MetadataUpdate', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'sender', internalType: 'address', type: 'address', indexed: true }, - { name: 'tokenContract', internalType: 'address', type: 'address', indexed: true }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - { name: 'quantity', internalType: 'uint256', type: 'uint256', indexed: false }, - { name: 'comment', internalType: 'string', type: 'string', indexed: false }, - ], - name: 'MintComment', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'mintFeeAmount', internalType: 'uint256', type: 'uint256', indexed: false }, - { - name: 'mintFeeRecipient', - internalType: 'address', - type: 'address', - indexed: false, - }, - { name: 'success', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'MintFeePayout', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'sender', internalType: 'address', type: 'address', indexed: true }, - { name: 'numberOfMints', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'OpenMintFinalized', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'previousOwner', internalType: 'address', type: 'address', indexed: true }, - { - name: 'potentialNewOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnerCanceled', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'previousOwner', internalType: 'address', type: 'address', indexed: true }, - { - name: 'potentialNewOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnerPending', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'previousOwner', internalType: 'address', type: 'address', indexed: true }, - { name: 'newOwner', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'OwnershipTransferred', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true }, - { - name: 'previousAdminRole', - internalType: 'bytes32', - type: 'bytes32', - indexed: true, - }, - { name: 'newAdminRole', internalType: 'bytes32', type: 'bytes32', indexed: true }, - ], - name: 'RoleAdminChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true }, - { name: 'account', internalType: 'address', type: 'address', indexed: true }, - { name: 'sender', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'RoleGranted', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true }, - { name: 'account', internalType: 'address', type: 'address', indexed: true }, - { name: 'sender', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'RoleRevoked', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'to', internalType: 'address', type: 'address', indexed: true }, - { name: 'quantity', internalType: 'uint256', type: 'uint256', indexed: true }, - { name: 'pricePerToken', internalType: 'uint256', type: 'uint256', indexed: true }, - { - name: 'firstPurchasedTokenId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Sale', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'changedBy', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'SalesConfigChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'from', internalType: 'address', type: 'address', indexed: true }, - { name: 'to', internalType: 'address', type: 'address', indexed: true }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }, - ], - name: 'Transfer', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'sender', internalType: 'address', type: 'address', indexed: false }, - { - name: 'renderer', - internalType: 'contract IMetadataRenderer', - type: 'address', - indexed: false, - }, - ], - name: 'UpdatedMetadataRenderer', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'implementation', internalType: 'address', type: 'address', indexed: true }, - ], - name: 'Upgraded', - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'MINTER_ROLE', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'SALES_MANAGER_ROLE', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'recipient', internalType: 'address', type: 'address' }, - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - ], - name: 'adminMint', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'recipients', internalType: 'address[]', type: 'address[]' }], - name: 'adminMintAirdrop', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'approve', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'owner', internalType: 'address', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'burn', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'data', internalType: 'bytes', type: 'bytes' }], - name: 'callMetadataRenderer', - outputs: [{ name: '', internalType: 'bytes', type: 'bytes' }], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [{ name: 'numTokens', internalType: 'uint256', type: 'uint256' }], - name: 'computeFreeMintRewards', - outputs: [ - { - name: '', - internalType: 'struct RewardsSettings', - type: 'tuple', - components: [ - { name: 'creatorReward', internalType: 'uint256', type: 'uint256' }, - { name: 'createReferralReward', internalType: 'uint256', type: 'uint256' }, - { name: 'mintReferralReward', internalType: 'uint256', type: 'uint256' }, - { name: 'firstMinterReward', internalType: 'uint256', type: 'uint256' }, - { name: 'zoraReward', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [{ name: 'numTokens', internalType: 'uint256', type: 'uint256' }], - name: 'computePaidMintRewards', - outputs: [ - { - name: '', - internalType: 'struct RewardsSettings', - type: 'tuple', - components: [ - { name: 'creatorReward', internalType: 'uint256', type: 'uint256' }, - { name: 'createReferralReward', internalType: 'uint256', type: 'uint256' }, - { name: 'mintReferralReward', internalType: 'uint256', type: 'uint256' }, - { name: 'firstMinterReward', internalType: 'uint256', type: 'uint256' }, - { name: 'zoraReward', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - { - stateMutability: 'pure', - type: 'function', - inputs: [{ name: 'numTokens', internalType: 'uint256', type: 'uint256' }], - name: 'computeTotalReward', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'config', - outputs: [ - { - name: 'metadataRenderer', - internalType: 'contract IMetadataRenderer', - type: 'address', - }, - { name: 'editionSize', internalType: 'uint64', type: 'uint64' }, - { name: 'royaltyBPS', internalType: 'uint16', type: 'uint16' }, - { name: 'fundsRecipient', internalType: 'address payable', type: 'address' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'contractURI', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'contractVersion', - outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'createReferral', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'factoryUpgradeGate', - outputs: [ - { name: '', internalType: 'contract IFactoryUpgradeGate', type: 'address' }, - ], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [], - name: 'finalizeOpenEdition', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'getApproved', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'role', internalType: 'bytes32', type: 'bytes32' }], - name: 'getRoleAdmin', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'role', internalType: 'bytes32', type: 'bytes32' }, - { name: 'account', internalType: 'address', type: 'address' }, - ], - name: 'grantRole', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'role', internalType: 'bytes32', type: 'bytes32' }, - { name: 'account', internalType: 'address', type: 'address' }, - ], - name: 'hasRole', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: '_contractName', internalType: 'string', type: 'string' }, - { name: '_contractSymbol', internalType: 'string', type: 'string' }, - { name: '_initialOwner', internalType: 'address', type: 'address' }, - { name: '_fundsRecipient', internalType: 'address payable', type: 'address' }, - { name: '_editionSize', internalType: 'uint64', type: 'uint64' }, - { name: '_royaltyBPS', internalType: 'uint16', type: 'uint16' }, - { name: '_setupCalls', internalType: 'bytes[]', type: 'bytes[]' }, - { - name: '_metadataRenderer', - internalType: 'contract IMetadataRenderer', - type: 'address', - }, - { name: '_metadataRendererInit', internalType: 'bytes', type: 'bytes' }, - { name: '_createReferral', internalType: 'address', type: 'address' }, - ], - name: 'initialize', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'user', internalType: 'address', type: 'address' }], - name: 'isAdmin', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'nftOwner', internalType: 'address', type: 'address' }, - { name: 'operator', internalType: 'address', type: 'address' }, - ], - name: 'isApprovedForAll', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'enable', internalType: 'bool', type: 'bool' }], - name: 'manageMarketFilterDAOSubscription', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'marketFilterDAOAddress', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'metadataRenderer', - outputs: [{ name: '', internalType: 'contract IMetadataRenderer', type: 'address' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'recipient', internalType: 'address', type: 'address' }, - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'comment', internalType: 'string', type: 'string' }, - { name: 'mintReferral', internalType: 'address', type: 'address' }, - ], - name: 'mintWithRewards', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'minter', internalType: 'address', type: 'address' }], - name: 'mintedPerAddress', - outputs: [ - { - name: '', - internalType: 'struct IERC721Drop.AddressMintDetails', - type: 'tuple', - components: [ - { name: 'totalMints', internalType: 'uint256', type: 'uint256' }, - { name: 'presaleMints', internalType: 'uint256', type: 'uint256' }, - { name: 'publicMints', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'data', internalType: 'bytes[]', type: 'bytes[]' }], - name: 'multicall', - outputs: [{ name: 'results', internalType: 'bytes[]', type: 'bytes[]' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'name', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'ownerOf', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'presaleMintsByAddress', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'proxiableUUID', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [{ name: 'quantity', internalType: 'uint256', type: 'uint256' }], - name: 'purchase', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'maxQuantity', internalType: 'uint256', type: 'uint256' }, - { name: 'pricePerToken', internalType: 'uint256', type: 'uint256' }, - { name: 'merkleProof', internalType: 'bytes32[]', type: 'bytes32[]' }, - ], - name: 'purchasePresale', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'maxQuantity', internalType: 'uint256', type: 'uint256' }, - { name: 'pricePerToken', internalType: 'uint256', type: 'uint256' }, - { name: 'merkleProof', internalType: 'bytes32[]', type: 'bytes32[]' }, - { name: 'comment', internalType: 'string', type: 'string' }, - ], - name: 'purchasePresaleWithComment', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'maxQuantity', internalType: 'uint256', type: 'uint256' }, - { name: 'pricePerToken', internalType: 'uint256', type: 'uint256' }, - { name: 'merkleProof', internalType: 'bytes32[]', type: 'bytes32[]' }, - { name: 'comment', internalType: 'string', type: 'string' }, - { name: 'mintReferral', internalType: 'address', type: 'address' }, - ], - name: 'purchasePresaleWithRewards', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'comment', internalType: 'string', type: 'string' }, - ], - name: 'purchaseWithComment', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'recipient', internalType: 'address', type: 'address' }, - { name: 'quantity', internalType: 'uint256', type: 'uint256' }, - { name: 'comment', internalType: 'string', type: 'string' }, - ], - name: 'purchaseWithRecipient', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'role', internalType: 'bytes32', type: 'bytes32' }, - { name: 'account', internalType: 'address', type: 'address' }, - ], - name: 'renounceRole', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'role', internalType: 'bytes32', type: 'bytes32' }, - { name: 'account', internalType: 'address', type: 'address' }, - ], - name: 'revokeRole', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '_salePrice', internalType: 'uint256', type: 'uint256' }, - ], - name: 'royaltyInfo', - outputs: [ - { name: 'receiver', internalType: 'address', type: 'address' }, - { name: 'royaltyAmount', internalType: 'uint256', type: 'uint256' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'royaltyMintSchedule', - outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'safeTransferFrom', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - { name: '_data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'safeTransferFrom', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'saleDetails', - outputs: [ - { - name: '', - internalType: 'struct IERC721Drop.SaleDetails', - type: 'tuple', - components: [ - { name: 'publicSaleActive', internalType: 'bool', type: 'bool' }, - { name: 'presaleActive', internalType: 'bool', type: 'bool' }, - { name: 'publicSalePrice', internalType: 'uint256', type: 'uint256' }, - { name: 'publicSaleStart', internalType: 'uint64', type: 'uint64' }, - { name: 'publicSaleEnd', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleStart', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleEnd', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleMerkleRoot', internalType: 'bytes32', type: 'bytes32' }, - { name: 'maxSalePurchasePerAddress', internalType: 'uint256', type: 'uint256' }, - { name: 'totalMinted', internalType: 'uint256', type: 'uint256' }, - { name: 'maxSupply', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'salesConfig', - outputs: [ - { name: 'publicSalePrice', internalType: 'uint104', type: 'uint104' }, - { name: 'maxSalePurchasePerAddress', internalType: 'uint32', type: 'uint32' }, - { name: 'publicSaleStart', internalType: 'uint64', type: 'uint64' }, - { name: 'publicSaleEnd', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleStart', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleEnd', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleMerkleRoot', internalType: 'bytes32', type: 'bytes32' }, - ], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'operator', internalType: 'address', type: 'address' }, - { name: 'approved', internalType: 'bool', type: 'bool' }, - ], - name: 'setApprovalForAll', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'newRecipientAddress', internalType: 'address payable', type: 'address' }, - ], - name: 'setFundsRecipient', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'newRenderer', - internalType: 'contract IMetadataRenderer', - type: 'address', - }, - { name: 'setupRenderer', internalType: 'bytes', type: 'bytes' }, - ], - name: 'setMetadataRenderer', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'publicSalePrice', internalType: 'uint104', type: 'uint104' }, - { name: 'maxSalePurchasePerAddress', internalType: 'uint32', type: 'uint32' }, - { name: 'publicSaleStart', internalType: 'uint64', type: 'uint64' }, - { name: 'publicSaleEnd', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleStart', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleEnd', internalType: 'uint64', type: 'uint64' }, - { name: 'presaleMerkleRoot', internalType: 'bytes32', type: 'bytes32' }, - ], - name: 'setSaleConfiguration', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'interfaceId', internalType: 'bytes4', type: 'bytes4' }], - name: 'supportsInterface', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'symbol', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], - name: 'tokenURI', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'totalSupply', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'transferFrom', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'recipient', internalType: 'address', type: 'address' }], - name: 'updateCreateReferral', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'args', internalType: 'bytes', type: 'bytes' }], - name: 'updateMarketFilterSettings', - outputs: [{ name: '', internalType: 'bytes', type: 'bytes' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'newSchedule', internalType: 'uint32', type: 'uint32' }], - name: 'updateRoyaltyMintSchedule', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: 'newImplementation', internalType: 'address', type: 'address' }], - name: 'upgradeTo', - outputs: [], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { name: 'newImplementation', internalType: 'address', type: 'address' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'upgradeToAndCall', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [], - name: 'withdraw', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - ], - name: 'withdrawRewards', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'zoraERC721TransferHelper', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'quantity', internalType: 'uint256', type: 'uint256' }], - name: 'zoraFeeForAmount', - outputs: [ - { name: 'recipient', internalType: 'address payable', type: 'address' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - ], - }, - { stateMutability: 'payable', type: 'receive' }, -] as const + { + stateMutability: "nonpayable", + type: "constructor", + inputs: [ + { + name: "_zoraERC721TransferHelper", + internalType: "address", + type: "address", + }, + { + name: "_factoryUpgradeGate", + internalType: "contract IFactoryUpgradeGate", + type: "address", + }, + { + name: "_marketFilterDAOAddress", + internalType: "address", + type: "address", + }, + { name: "_mintFeeAmount", internalType: "uint256", type: "uint256" }, + { + name: "_mintFeeRecipient", + internalType: "address payable", + type: "address", + }, + { name: "_protocolRewards", internalType: "address", type: "address" }, + ], + }, + { + type: "error", + inputs: [{ name: "role", internalType: "bytes32", type: "bytes32" }], + name: "Access_MissingRoleOrAdmin", + }, + { type: "error", inputs: [], name: "Access_OnlyAdmin" }, + { type: "error", inputs: [], name: "Access_WithdrawNotAllowed" }, + { + type: "error", + inputs: [ + { name: "proposedAddress", internalType: "address", type: "address" }, + ], + name: "Admin_InvalidUpgradeAddress", + }, + { type: "error", inputs: [], name: "Admin_UnableToFinalizeNotOpenEdition" }, + { type: "error", inputs: [], name: "ApprovalCallerNotOwnerNorApproved" }, + { type: "error", inputs: [], name: "ApprovalQueryForNonexistentToken" }, + { type: "error", inputs: [], name: "ApprovalToCurrentOwner" }, + { type: "error", inputs: [], name: "ApproveToCaller" }, + { type: "error", inputs: [], name: "BalanceQueryForZeroAddress" }, + { type: "error", inputs: [], name: "CREATOR_FUNDS_RECIPIENT_NOT_SET" }, + { type: "error", inputs: [], name: "ExternalMetadataRenderer_CallFailed" }, + { type: "error", inputs: [], name: "INVALID_ADDRESS_ZERO" }, + { type: "error", inputs: [], name: "INVALID_ETH_AMOUNT" }, + { type: "error", inputs: [], name: "InvalidMintSchedule" }, + { + type: "error", + inputs: [], + name: "MarketFilterDAOAddressNotSupportedForChain", + }, + { type: "error", inputs: [], name: "MintFee_FundsSendFailure" }, + { type: "error", inputs: [], name: "MintToZeroAddress" }, + { type: "error", inputs: [], name: "MintZeroQuantity" }, + { type: "error", inputs: [], name: "Mint_SoldOut" }, + { type: "error", inputs: [], name: "ONLY_CREATE_REFERRAL" }, + { type: "error", inputs: [], name: "ONLY_OWNER" }, + { type: "error", inputs: [], name: "ONLY_PENDING_OWNER" }, + { + type: "error", + inputs: [{ name: "operator", internalType: "address", type: "address" }], + name: "OperatorNotAllowed", + }, + { type: "error", inputs: [], name: "OwnerQueryForNonexistentToken" }, + { type: "error", inputs: [], name: "Presale_Inactive" }, + { type: "error", inputs: [], name: "Presale_MerkleNotApproved" }, + { type: "error", inputs: [], name: "Presale_TooManyForAddress" }, + { type: "error", inputs: [], name: "ProtocolRewards_WithdrawSendFailure" }, + { type: "error", inputs: [], name: "Purchase_TooManyForAddress" }, + { + type: "error", + inputs: [ + { name: "correctPrice", internalType: "uint256", type: "uint256" }, + ], + name: "Purchase_WrongPrice", + }, + { type: "error", inputs: [], name: "RemoteOperatorFilterRegistryCallFailed" }, + { type: "error", inputs: [], name: "Sale_Inactive" }, + { + type: "error", + inputs: [{ name: "maxRoyaltyBPS", internalType: "uint16", type: "uint16" }], + name: "Setup_RoyaltyPercentageTooHigh", + }, + { type: "error", inputs: [], name: "TransferCallerNotOwnerNorApproved" }, + { type: "error", inputs: [], name: "TransferFromIncorrectOwner" }, + { type: "error", inputs: [], name: "TransferToNonERC721ReceiverImplementer" }, + { type: "error", inputs: [], name: "TransferToZeroAddress" }, + { type: "error", inputs: [], name: "URIQueryForNonexistentToken" }, + { type: "error", inputs: [], name: "Withdraw_FundsSendFailure" }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "previousAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "newAdmin", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "AdminChanged", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "owner", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "approved", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + ], + name: "Approval", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "owner", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "operator", + internalType: "address", + type: "address", + indexed: true, + }, + { name: "approved", internalType: "bool", type: "bool", indexed: false }, + ], + name: "ApprovalForAll", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "_fromTokenId", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + { + name: "_toTokenId", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "BatchMetadataUpdate", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "beacon", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "BeaconUpgraded", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "source", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "amount", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "FundsReceived", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "newAddress", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "changedBy", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "FundsRecipientChanged", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "withdrawnBy", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "withdrawnTo", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "amount", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + { + name: "feeRecipient", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "feeAmount", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "FundsWithdrawn", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "_tokenId", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "MetadataUpdate", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "sender", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "tokenContract", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { + name: "quantity", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + { + name: "comment", + internalType: "string", + type: "string", + indexed: false, + }, + ], + name: "MintComment", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "mintFeeAmount", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + { + name: "mintFeeRecipient", + internalType: "address", + type: "address", + indexed: false, + }, + { name: "success", internalType: "bool", type: "bool", indexed: false }, + ], + name: "MintFeePayout", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "sender", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "numberOfMints", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "OpenMintFinalized", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "previousOwner", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "potentialNewOwner", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "OwnerCanceled", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "previousOwner", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "potentialNewOwner", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "OwnerPending", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "previousOwner", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "newOwner", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "OwnershipTransferred", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "role", internalType: "bytes32", type: "bytes32", indexed: true }, + { + name: "previousAdminRole", + internalType: "bytes32", + type: "bytes32", + indexed: true, + }, + { + name: "newAdminRole", + internalType: "bytes32", + type: "bytes32", + indexed: true, + }, + ], + name: "RoleAdminChanged", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "role", internalType: "bytes32", type: "bytes32", indexed: true }, + { + name: "account", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "sender", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "RoleGranted", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "role", internalType: "bytes32", type: "bytes32", indexed: true }, + { + name: "account", + internalType: "address", + type: "address", + indexed: true, + }, + { + name: "sender", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "RoleRevoked", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "to", internalType: "address", type: "address", indexed: true }, + { + name: "quantity", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { + name: "pricePerToken", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + { + name: "firstPurchasedTokenId", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "Sale", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "changedBy", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "SalesConfigChanged", + }, + { + type: "event", + anonymous: false, + inputs: [ + { name: "from", internalType: "address", type: "address", indexed: true }, + { name: "to", internalType: "address", type: "address", indexed: true }, + { + name: "tokenId", + internalType: "uint256", + type: "uint256", + indexed: true, + }, + ], + name: "Transfer", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "sender", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "renderer", + internalType: "contract IMetadataRenderer", + type: "address", + indexed: false, + }, + ], + name: "UpdatedMetadataRenderer", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "implementation", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "Upgraded", + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "DEFAULT_ADMIN_ROLE", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "MINTER_ROLE", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "SALES_MANAGER_ROLE", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "recipient", internalType: "address", type: "address" }, + { name: "quantity", internalType: "uint256", type: "uint256" }, + ], + name: "adminMint", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "recipients", internalType: "address[]", type: "address[]" }, + ], + name: "adminMintAirdrop", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "to", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + ], + name: "approve", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "owner", internalType: "address", type: "address" }], + name: "balanceOf", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "burn", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "data", internalType: "bytes", type: "bytes" }], + name: "callMetadataRenderer", + outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + }, + { + stateMutability: "pure", + type: "function", + inputs: [{ name: "numTokens", internalType: "uint256", type: "uint256" }], + name: "computeFreeMintRewards", + outputs: [ + { + name: "", + internalType: "struct RewardsSettings", + type: "tuple", + components: [ + { name: "creatorReward", internalType: "uint256", type: "uint256" }, + { + name: "createReferralReward", + internalType: "uint256", + type: "uint256", + }, + { + name: "mintReferralReward", + internalType: "uint256", + type: "uint256", + }, + { + name: "firstMinterReward", + internalType: "uint256", + type: "uint256", + }, + { name: "zoraReward", internalType: "uint256", type: "uint256" }, + ], + }, + ], + }, + { + stateMutability: "pure", + type: "function", + inputs: [{ name: "numTokens", internalType: "uint256", type: "uint256" }], + name: "computePaidMintRewards", + outputs: [ + { + name: "", + internalType: "struct RewardsSettings", + type: "tuple", + components: [ + { name: "creatorReward", internalType: "uint256", type: "uint256" }, + { + name: "createReferralReward", + internalType: "uint256", + type: "uint256", + }, + { + name: "mintReferralReward", + internalType: "uint256", + type: "uint256", + }, + { + name: "firstMinterReward", + internalType: "uint256", + type: "uint256", + }, + { name: "zoraReward", internalType: "uint256", type: "uint256" }, + ], + }, + ], + }, + { + stateMutability: "pure", + type: "function", + inputs: [{ name: "numTokens", internalType: "uint256", type: "uint256" }], + name: "computeTotalReward", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "config", + outputs: [ + { + name: "metadataRenderer", + internalType: "contract IMetadataRenderer", + type: "address", + }, + { name: "editionSize", internalType: "uint64", type: "uint64" }, + { name: "royaltyBPS", internalType: "uint16", type: "uint16" }, + { + name: "fundsRecipient", + internalType: "address payable", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "contractURI", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "contractVersion", + outputs: [{ name: "", internalType: "uint32", type: "uint32" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "createReferral", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "factoryUpgradeGate", + outputs: [ + { + name: "", + internalType: "contract IFactoryUpgradeGate", + type: "address", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [], + name: "finalizeOpenEdition", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "getApproved", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "role", internalType: "bytes32", type: "bytes32" }], + name: "getRoleAdmin", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "role", internalType: "bytes32", type: "bytes32" }, + { name: "account", internalType: "address", type: "address" }, + ], + name: "grantRole", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "role", internalType: "bytes32", type: "bytes32" }, + { name: "account", internalType: "address", type: "address" }, + ], + name: "hasRole", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "_contractName", internalType: "string", type: "string" }, + { name: "_contractSymbol", internalType: "string", type: "string" }, + { name: "_initialOwner", internalType: "address", type: "address" }, + { + name: "_fundsRecipient", + internalType: "address payable", + type: "address", + }, + { name: "_editionSize", internalType: "uint64", type: "uint64" }, + { name: "_royaltyBPS", internalType: "uint16", type: "uint16" }, + { name: "_setupCalls", internalType: "bytes[]", type: "bytes[]" }, + { + name: "_metadataRenderer", + internalType: "contract IMetadataRenderer", + type: "address", + }, + { name: "_metadataRendererInit", internalType: "bytes", type: "bytes" }, + { name: "_createReferral", internalType: "address", type: "address" }, + ], + name: "initialize", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "user", internalType: "address", type: "address" }], + name: "isAdmin", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "nftOwner", internalType: "address", type: "address" }, + { name: "operator", internalType: "address", type: "address" }, + ], + name: "isApprovedForAll", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "enable", internalType: "bool", type: "bool" }], + name: "manageMarketFilterDAOSubscription", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "marketFilterDAOAddress", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "metadataRenderer", + outputs: [ + { name: "", internalType: "contract IMetadataRenderer", type: "address" }, + ], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "recipient", internalType: "address", type: "address" }, + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "comment", internalType: "string", type: "string" }, + { name: "mintReferral", internalType: "address", type: "address" }, + ], + name: "mintWithRewards", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "minter", internalType: "address", type: "address" }], + name: "mintedPerAddress", + outputs: [ + { + name: "", + internalType: "struct IERC721Drop.AddressMintDetails", + type: "tuple", + components: [ + { name: "totalMints", internalType: "uint256", type: "uint256" }, + { name: "presaleMints", internalType: "uint256", type: "uint256" }, + { name: "publicMints", internalType: "uint256", type: "uint256" }, + ], + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "data", internalType: "bytes[]", type: "bytes[]" }], + name: "multicall", + outputs: [{ name: "results", internalType: "bytes[]", type: "bytes[]" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "name", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "owner", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "ownerOf", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "presaleMintsByAddress", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "proxiableUUID", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [{ name: "quantity", internalType: "uint256", type: "uint256" }], + name: "purchase", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "maxQuantity", internalType: "uint256", type: "uint256" }, + { name: "pricePerToken", internalType: "uint256", type: "uint256" }, + { name: "merkleProof", internalType: "bytes32[]", type: "bytes32[]" }, + ], + name: "purchasePresale", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "maxQuantity", internalType: "uint256", type: "uint256" }, + { name: "pricePerToken", internalType: "uint256", type: "uint256" }, + { name: "merkleProof", internalType: "bytes32[]", type: "bytes32[]" }, + { name: "comment", internalType: "string", type: "string" }, + ], + name: "purchasePresaleWithComment", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "maxQuantity", internalType: "uint256", type: "uint256" }, + { name: "pricePerToken", internalType: "uint256", type: "uint256" }, + { name: "merkleProof", internalType: "bytes32[]", type: "bytes32[]" }, + { name: "comment", internalType: "string", type: "string" }, + { name: "mintReferral", internalType: "address", type: "address" }, + ], + name: "purchasePresaleWithRewards", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "comment", internalType: "string", type: "string" }, + ], + name: "purchaseWithComment", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "recipient", internalType: "address", type: "address" }, + { name: "quantity", internalType: "uint256", type: "uint256" }, + { name: "comment", internalType: "string", type: "string" }, + ], + name: "purchaseWithRecipient", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "role", internalType: "bytes32", type: "bytes32" }, + { name: "account", internalType: "address", type: "address" }, + ], + name: "renounceRole", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "role", internalType: "bytes32", type: "bytes32" }, + { name: "account", internalType: "address", type: "address" }, + ], + name: "revokeRole", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [ + { name: "", internalType: "uint256", type: "uint256" }, + { name: "_salePrice", internalType: "uint256", type: "uint256" }, + ], + name: "royaltyInfo", + outputs: [ + { name: "receiver", internalType: "address", type: "address" }, + { name: "royaltyAmount", internalType: "uint256", type: "uint256" }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "royaltyMintSchedule", + outputs: [{ name: "", internalType: "uint32", type: "uint32" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "from", internalType: "address", type: "address" }, + { name: "to", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + ], + name: "safeTransferFrom", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "from", internalType: "address", type: "address" }, + { name: "to", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + { name: "_data", internalType: "bytes", type: "bytes" }, + ], + name: "safeTransferFrom", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "saleDetails", + outputs: [ + { + name: "", + internalType: "struct IERC721Drop.SaleDetails", + type: "tuple", + components: [ + { name: "publicSaleActive", internalType: "bool", type: "bool" }, + { name: "presaleActive", internalType: "bool", type: "bool" }, + { name: "publicSalePrice", internalType: "uint256", type: "uint256" }, + { name: "publicSaleStart", internalType: "uint64", type: "uint64" }, + { name: "publicSaleEnd", internalType: "uint64", type: "uint64" }, + { name: "presaleStart", internalType: "uint64", type: "uint64" }, + { name: "presaleEnd", internalType: "uint64", type: "uint64" }, + { + name: "presaleMerkleRoot", + internalType: "bytes32", + type: "bytes32", + }, + { + name: "maxSalePurchasePerAddress", + internalType: "uint256", + type: "uint256", + }, + { name: "totalMinted", internalType: "uint256", type: "uint256" }, + { name: "maxSupply", internalType: "uint256", type: "uint256" }, + ], + }, + ], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "salesConfig", + outputs: [ + { name: "publicSalePrice", internalType: "uint104", type: "uint104" }, + { + name: "maxSalePurchasePerAddress", + internalType: "uint32", + type: "uint32", + }, + { name: "publicSaleStart", internalType: "uint64", type: "uint64" }, + { name: "publicSaleEnd", internalType: "uint64", type: "uint64" }, + { name: "presaleStart", internalType: "uint64", type: "uint64" }, + { name: "presaleEnd", internalType: "uint64", type: "uint64" }, + { name: "presaleMerkleRoot", internalType: "bytes32", type: "bytes32" }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "operator", internalType: "address", type: "address" }, + { name: "approved", internalType: "bool", type: "bool" }, + ], + name: "setApprovalForAll", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { + name: "newRecipientAddress", + internalType: "address payable", + type: "address", + }, + ], + name: "setFundsRecipient", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { + name: "newRenderer", + internalType: "contract IMetadataRenderer", + type: "address", + }, + { name: "setupRenderer", internalType: "bytes", type: "bytes" }, + ], + name: "setMetadataRenderer", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "newOwner", internalType: "address", type: "address" }], + name: "setOwner", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "publicSalePrice", internalType: "uint104", type: "uint104" }, + { + name: "maxSalePurchasePerAddress", + internalType: "uint32", + type: "uint32", + }, + { name: "publicSaleStart", internalType: "uint64", type: "uint64" }, + { name: "publicSaleEnd", internalType: "uint64", type: "uint64" }, + { name: "presaleStart", internalType: "uint64", type: "uint64" }, + { name: "presaleEnd", internalType: "uint64", type: "uint64" }, + { name: "presaleMerkleRoot", internalType: "bytes32", type: "bytes32" }, + ], + name: "setSaleConfiguration", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "symbol", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }], + name: "tokenURI", + outputs: [{ name: "", internalType: "string", type: "string" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "totalSupply", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "from", internalType: "address", type: "address" }, + { name: "to", internalType: "address", type: "address" }, + { name: "tokenId", internalType: "uint256", type: "uint256" }, + ], + name: "transferFrom", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "recipient", internalType: "address", type: "address" }], + name: "updateCreateReferral", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "args", internalType: "bytes", type: "bytes" }], + name: "updateMarketFilterSettings", + outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [{ name: "newSchedule", internalType: "uint32", type: "uint32" }], + name: "updateRoyaltyMintSchedule", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "newImplementation", internalType: "address", type: "address" }, + ], + name: "upgradeTo", + outputs: [], + }, + { + stateMutability: "payable", + type: "function", + inputs: [ + { name: "newImplementation", internalType: "address", type: "address" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "upgradeToAndCall", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [], + name: "withdraw", + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + inputs: [ + { name: "to", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, + ], + name: "withdrawRewards", + outputs: [], + }, + { + stateMutability: "view", + type: "function", + inputs: [], + name: "zoraERC721TransferHelper", + outputs: [{ name: "", internalType: "address", type: "address" }], + }, + { + stateMutability: "view", + type: "function", + inputs: [{ name: "quantity", internalType: "uint256", type: "uint256" }], + name: "zoraFeeForAmount", + outputs: [ + { name: "recipient", internalType: "address payable", type: "address" }, + { name: "fee", internalType: "uint256", type: "uint256" }, + ], + }, + { stateMutability: "payable", type: "receive" }, +] as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x7c74dfe39976dc395529c14e54a597809980e01c) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xe4c17055048aEe01D0d122804816fEe5E6ac4A67) */ export const zora721DropAddress = { - 1: '0x7C74dfe39976dc395529c14e54a597809980e01C', - 5: '0xe4c17055048aEe01D0d122804816fEe5E6ac4A67', -} as const + 1: "0x7C74dfe39976dc395529c14e54a597809980e01C", + 5: "0xe4c17055048aEe01D0d122804816fEe5E6ac4A67", +} as const; /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x7c74dfe39976dc395529c14e54a597809980e01c) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xe4c17055048aEe01D0d122804816fEe5E6ac4A67) */ export const zora721DropConfig = { - address: zora721DropAddress, - abi: zora721DropABI, -} as const + address: zora721DropAddress, + abi: zora721DropABI, +} as const; diff --git a/packages/sdk/src/types/abstractEthersSigner.ts b/packages/sdk/src/types/abstractEthersSigner.ts index 4bd713a..6967c01 100644 --- a/packages/sdk/src/types/abstractEthersSigner.ts +++ b/packages/sdk/src/types/abstractEthersSigner.ts @@ -3,5 +3,5 @@ // This type assures that there is at least some degree of type safety on the Ethers implementation of the TokenboundClient. export type AbstractEthersSigner = { - readonly _isSigner: boolean -} & Record + readonly _isSigner: boolean; +} & Record; diff --git a/packages/sdk/src/types/abstractEthersTransactionResponse.ts b/packages/sdk/src/types/abstractEthersTransactionResponse.ts index 81d9243..75d4c1f 100644 --- a/packages/sdk/src/types/abstractEthersTransactionResponse.ts +++ b/packages/sdk/src/types/abstractEthersTransactionResponse.ts @@ -3,5 +3,5 @@ // This type assures that there is at least some degree of type safety on the Ethers implementation of the TokenboundClient. export type AbstractEthersTransactionResponse = { - hash: string -} & Record + hash: string; +} & Record; diff --git a/packages/sdk/src/types/addresses.ts b/packages/sdk/src/types/addresses.ts index f80091b..754b964 100644 --- a/packages/sdk/src/types/addresses.ts +++ b/packages/sdk/src/types/addresses.ts @@ -1 +1 @@ -export type PossibleENSAddress = `0x${string}` | `${string}.eth` +export type PossibleENSAddress = `0x${string}` | `${string}.eth`; diff --git a/packages/sdk/src/types/anvilAccount.ts b/packages/sdk/src/types/anvilAccount.ts index 4585409..95ab158 100644 --- a/packages/sdk/src/types/anvilAccount.ts +++ b/packages/sdk/src/types/anvilAccount.ts @@ -1,5 +1,5 @@ export type AnvilAccount = { - name: string - address: `0x${string}` - privateKey: `0x${string}` -} \ No newline at end of file + name: string; + address: `0x${string}`; + privateKey: `0x${string}`; +}; diff --git a/packages/sdk/src/types/callData.ts b/packages/sdk/src/types/callData.ts index bf536b7..769a4ce 100644 --- a/packages/sdk/src/types/callData.ts +++ b/packages/sdk/src/types/callData.ts @@ -1,5 +1,5 @@ export type CallData = { - to: `0x${string}` - value: bigint - data: `0x${string}` -} + to: `0x${string}`; + value: bigint; + data: `0x${string}`; +}; diff --git a/packages/sdk/src/types/contractABIPair.ts b/packages/sdk/src/types/contractABIPair.ts index d3400c3..bc98e9d 100644 --- a/packages/sdk/src/types/contractABIPair.ts +++ b/packages/sdk/src/types/contractABIPair.ts @@ -1,6 +1,6 @@ -import { Abi } from 'viem' +import { Abi } from "viem"; export type ContractABIPair = { - ADDRESS: `0x${string}` - ABI: Abi -} + ADDRESS: `0x${string}`; + ABI: Abi; +}; diff --git a/packages/sdk/src/types/erc6551Bytecode.ts b/packages/sdk/src/types/erc6551Bytecode.ts index 9bf8555..922881c 100644 --- a/packages/sdk/src/types/erc6551Bytecode.ts +++ b/packages/sdk/src/types/erc6551Bytecode.ts @@ -1,11 +1,11 @@ // Segmented ERC6551 bytecode export type SegmentedERC6551Bytecode = { - erc1167Header: string, // 10 bytes - implementationAddress: `0x${string}`, // 20 bytes - erc1167Footer: string, // 15 bytes - salt: number, // 32 bytes - tokenId: string, // 32 bytes - tokenContract: `0x${string}`, // 32 bytes - chainId: number, // 32 bytes - } \ No newline at end of file + erc1167Header: string; // 10 bytes + implementationAddress: `0x${string}`; // 20 bytes + erc1167Footer: string; // 15 bytes + salt: number; // 32 bytes + tokenId: string; // 32 bytes + tokenContract: `0x${string}`; // 32 bytes + chainId: number; // 32 bytes +}; diff --git a/packages/sdk/src/types/index.ts b/packages/sdk/src/types/index.ts index fc52070..80fc6e0 100644 --- a/packages/sdk/src/types/index.ts +++ b/packages/sdk/src/types/index.ts @@ -1,12 +1,12 @@ -export * from './abstractEthersSigner' -export * from './abstractEthersTransactionResponse' -export * from './addresses' -export * from './anvilAccount' -export * from './callData' -export * from './contractABIPair' -export * from './operations' -export * from './erc6551Bytecode' -export * from './messages' -export * from './multicall' -export * from './params' -export * from './prettify' +export * from "./abstractEthersSigner"; +export * from "./abstractEthersTransactionResponse"; +export * from "./addresses"; +export * from "./anvilAccount"; +export * from "./callData"; +export * from "./contractABIPair"; +export * from "./operations"; +export * from "./erc6551Bytecode"; +export * from "./messages"; +export * from "./multicall"; +export * from "./params"; +export * from "./prettify"; diff --git a/packages/sdk/src/types/messages.ts b/packages/sdk/src/types/messages.ts index 8407f3b..315bafa 100644 --- a/packages/sdk/src/types/messages.ts +++ b/packages/sdk/src/types/messages.ts @@ -1,10 +1,14 @@ -import { SignableMessage } from 'viem' -import { Prettify } from './prettify' +import { SignableMessage } from "viem"; +import { Prettify } from "./prettify"; -export type Bytes = ArrayLike -export type Ethers5SignableMessage = Bytes | string -export type Ethers6SignableMessage = string | Uint8Array +export type Bytes = ArrayLike; +export type Ethers5SignableMessage = Bytes | string; +export type Ethers6SignableMessage = string | Uint8Array; -export type EthersSignableMessage = Ethers5SignableMessage | Ethers6SignableMessage +export type EthersSignableMessage = + | Ethers5SignableMessage + | Ethers6SignableMessage; -export type UniversalSignableMessage = Prettify // SignableMessage is string | { raw: Hex | ByteArray } // where ByteArray = Uint8Array +export type UniversalSignableMessage = Prettify< + EthersSignableMessage | SignableMessage +>; // SignableMessage is string | { raw: Hex | ByteArray } // where ByteArray = Uint8Array diff --git a/packages/sdk/src/types/multicall.ts b/packages/sdk/src/types/multicall.ts index c46f1c9..c315aae 100644 --- a/packages/sdk/src/types/multicall.ts +++ b/packages/sdk/src/types/multicall.ts @@ -1,12 +1,12 @@ -import { TransactionRequestEIP1559 } from 'viem' +import { TransactionRequestEIP1559 } from "viem"; export type Call3 = { - target: `0x${string}` // The target contract - allowFailure: boolean // If false, the entire call will revert if the call fails. - callData: `0x${string}` // Encoded function data to call on the target contract. -} + target: `0x${string}`; // The target contract + allowFailure: boolean; // If false, the entire call will revert if the call fails. + callData: `0x${string}`; // Encoded function data to call on the target contract. +}; export type MultiCallTx = Omit< - TransactionRequestEIP1559, - 'from' | 'account' -> + TransactionRequestEIP1559, + "from" | "account" +>; diff --git a/packages/sdk/src/types/operations.ts b/packages/sdk/src/types/operations.ts index 340a5c0..47009fd 100644 --- a/packages/sdk/src/types/operations.ts +++ b/packages/sdk/src/types/operations.ts @@ -1,8 +1,9 @@ export const CALL_OPERATIONS = { - CALL: 0, - DELEGATECALL: 1, - CREATE: 2, - CREATE2: 3, -} as const + CALL: 0, + DELEGATECALL: 1, + CREATE: 2, + CREATE2: 3, +} as const; -export type CallOperation = (typeof CALL_OPERATIONS)[keyof typeof CALL_OPERATIONS] +export type CallOperation = + (typeof CALL_OPERATIONS)[keyof typeof CALL_OPERATIONS]; diff --git a/packages/sdk/src/types/params.ts b/packages/sdk/src/types/params.ts index 84a451c..726ac97 100644 --- a/packages/sdk/src/types/params.ts +++ b/packages/sdk/src/types/params.ts @@ -1,141 +1,142 @@ -import { WalletClient, PublicClient, Chain } from 'viem' -import { Prettify } from './prettify' -import { UniversalSignableMessage, CallOperation, Call3 } from '.' -import { PossibleENSAddress } from './addresses' -import { ERC_6551_LEGACY_V2 } from '../constants' +import { WalletClient, PublicClient, Chain } from "viem"; +import { Prettify } from "./prettify"; +import { UniversalSignableMessage, CallOperation, Call3 } from "."; +import { PossibleENSAddress } from "./addresses"; +import { ERC_6551_LEGACY_V2 } from "../constants"; export const NFTTokenType = { - ERC721: 'ERC721', - ERC1155: 'ERC1155', -} as const + ERC721: "ERC721", + ERC1155: "ERC1155", +} as const; export const TBVersion = { - V2: 2, - V3: 3, -} as const + V2: 2, + V3: 3, +} as const; -export type TBImplementationVersion = (typeof TBVersion)[keyof typeof TBVersion] +export type TBImplementationVersion = + (typeof TBVersion)[keyof typeof TBVersion]; -type TokenType = (typeof NFTTokenType)[keyof typeof NFTTokenType] +type TokenType = (typeof NFTTokenType)[keyof typeof NFTTokenType]; type NFTParams = Prettify<{ - tokenContract: `0x${string}` - tokenId: string -}> + tokenContract: `0x${string}`; + tokenId: string; +}>; export type TokenboundAccountNFT = Prettify< - NFTParams & { - chainId: number - } -> + NFTParams & { + chainId: number; + } +>; interface TokenTypeParams { - tokenType: TokenType + tokenType: TokenType; } export type NFTTransferParams = Prettify< - TokenTypeParams & - NFTParams & { - recipientAddress: PossibleENSAddress - account: `0x${string}` - amount?: number - chainId?: number - } -> + TokenTypeParams & + NFTParams & { + recipientAddress: PossibleENSAddress; + account: `0x${string}`; + amount?: number; + chainId?: number; + } +>; export type ETHTransferParams = Prettify<{ - account: `0x${string}` - recipientAddress: PossibleENSAddress - amount: number - chainId?: number -}> + account: `0x${string}`; + recipientAddress: PossibleENSAddress; + amount: number; + chainId?: number; +}>; export type ERC20TransferParams = Prettify<{ - account: `0x${string}` - recipientAddress: PossibleENSAddress - amount: number - erc20tokenAddress: `0x${string}` - erc20tokenDecimals: number - chainId?: number -}> + account: `0x${string}`; + recipientAddress: PossibleENSAddress; + amount: number; + erc20tokenAddress: `0x${string}`; + erc20tokenDecimals: number; + chainId?: number; +}>; type ImplementationAddress = - | `0x${string}` - | typeof ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS + | `0x${string}` + | typeof ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS; export type TokenboundClientOptions = Prettify<{ - chainId?: number - chain?: Chain - signer?: any - walletClient?: WalletClient - publicClient?: PublicClient - publicClientRPCUrl?: string - implementationAddress?: ImplementationAddress - registryAddress?: `0x${string}` - version?: TBImplementationVersion -}> + chainId?: number; + chain?: Chain; + signer?: any; + walletClient?: WalletClient; + publicClient?: PublicClient; + publicClientRPCUrl?: string; + implementationAddress?: ImplementationAddress; + registryAddress?: `0x${string}`; + version?: TBImplementationVersion; +}>; type Custom6551Implementation = Prettify<{ - salt?: number -}> + salt?: number; +}>; export type TBAccountParams = Prettify< - NFTParams & { - chainId?: number - } -> + NFTParams & { + chainId?: number; + } +>; export type GetAccountParams = Prettify< - TBAccountParams & Partial -> + TBAccountParams & Partial +>; export type MultiCallParams = Prettify<{ - appendedCalls?: Call3[] -}> + appendedCalls?: Call3[]; +}>; export type PrepareCreateAccountParams = Prettify< - TBAccountParams & MultiCallParams & Partial -> + TBAccountParams & MultiCallParams & Partial +>; export type CreateAccountParams = Prettify< - TBAccountParams & MultiCallParams & Partial -> + TBAccountParams & MultiCallParams & Partial +>; export type ExecuteCallParams = Prettify<{ - account: `0x${string}` - to: `0x${string}` - value: bigint - data: string -}> -export type PrepareExecuteCallParams = ExecuteCallParams + account: `0x${string}`; + to: `0x${string}`; + value: bigint; + data: string; +}>; +export type PrepareExecuteCallParams = ExecuteCallParams; export type ExecuteParams = Prettify< - ExecuteCallParams & { operation?: CallOperation; chainId?: number } -> -export type PrepareExecutionParams = ExecuteParams + ExecuteCallParams & { operation?: CallOperation; chainId?: number } +>; +export type PrepareExecutionParams = ExecuteParams; export type ValidSignerParams = Prettify<{ - account: `0x${string}` - data?: string -}> + account: `0x${string}`; + data?: string; +}>; export type ComputeAccountParams = Prettify< - TBAccountParams & { - chainId: number - } & Partial -> + TBAccountParams & { + chainId: number; + } & Partial +>; export type GetCreationCodeParams = Prettify<{ - implementation_: `0x${string}` - chainId_: number - tokenContract_: string - tokenId_: string - salt_: string -}> + implementation_: `0x${string}`; + chainId_: number; + tokenContract_: string; + tokenId_: string; + salt_: string; +}>; export type BytecodeParams = Prettify<{ - accountAddress: `0x${string}` -}> + accountAddress: `0x${string}`; +}>; export type SignMessageParams = Prettify<{ - message: UniversalSignableMessage -}> + message: UniversalSignableMessage; +}>; diff --git a/packages/sdk/src/types/prettify.ts b/packages/sdk/src/types/prettify.ts index 7ebc71e..259e8fb 100644 --- a/packages/sdk/src/types/prettify.ts +++ b/packages/sdk/src/types/prettify.ts @@ -1,3 +1,3 @@ export type Prettify = { - [K in keyof T]: T[K] -} & {} + [K in keyof T]: T[K]; +} & {}; diff --git a/packages/sdk/src/utils/addressToUint8Array.ts b/packages/sdk/src/utils/addressToUint8Array.ts index d38eca2..686a882 100644 --- a/packages/sdk/src/utils/addressToUint8Array.ts +++ b/packages/sdk/src/utils/addressToUint8Array.ts @@ -1,13 +1,13 @@ export function addressToUint8Array(address: `0x${string}`): Uint8Array { - // Remove '0x' prefix - const cleanAddress = address.slice(2) + // Remove '0x' prefix + const cleanAddress = address.slice(2); - // Convert hex string to Uint8Array - const array = new Uint8Array(cleanAddress.length / 2) + // Convert hex string to Uint8Array + const array = new Uint8Array(cleanAddress.length / 2); - for (let i = 0; i < cleanAddress.length; i += 2) { - array[i / 2] = parseInt(cleanAddress.substr(i, 2), 16) - } + for (let i = 0; i < cleanAddress.length; i += 2) { + array[i / 2] = parseInt(cleanAddress.substr(i, 2), 16); + } - return array + return array; } diff --git a/packages/sdk/src/utils/chainIdToChain.testDISABLED.ts b/packages/sdk/src/utils/chainIdToChain.testDISABLED.ts index 3b57380..cda4b77 100644 --- a/packages/sdk/src/utils/chainIdToChain.testDISABLED.ts +++ b/packages/sdk/src/utils/chainIdToChain.testDISABLED.ts @@ -2,7 +2,7 @@ // import { test, expect } from "vitest" // test("chainIdToChain", () => { - + // const mainnetChain = chainIdToChain(1) // const goerliChain = chainIdToChain(5) // const polygonChain = chainIdToChain(137) @@ -14,5 +14,5 @@ // expect(polygonChain.id).toEqual(137) // expect(mumbaiChain.id).toEqual(80001) // expect(sepoliaChain.id).toEqual(11155111) - -// }) \ No newline at end of file + +// }) diff --git a/packages/sdk/src/utils/chainIdToChain.ts b/packages/sdk/src/utils/chainIdToChain.ts index f4dfe16..9cbc6a1 100644 --- a/packages/sdk/src/utils/chainIdToChain.ts +++ b/packages/sdk/src/utils/chainIdToChain.ts @@ -1,41 +1,41 @@ -import { Chain } from 'viem' +import { Chain } from "viem"; import { - mainnet, - goerli, - polygon, - polygonMumbai, - sepolia, - optimism, - arbitrum, - optimismGoerli, - base, - baseGoerli, - baseSepolia, - lineaTestnet, - linea, - gnosis, - zora, - zoraTestnet, -} from 'viem/chains' + mainnet, + goerli, + polygon, + polygonMumbai, + sepolia, + optimism, + arbitrum, + optimismGoerli, + base, + baseGoerli, + baseSepolia, + lineaTestnet, + linea, + gnosis, + zora, + zoraTestnet, +} from "viem/chains"; const enabledChains = { - mainnet, - goerli, - optimismGoerli, - polygon, - polygonMumbai, - sepolia, - optimism, - arbitrum, - base, - gnosis, - baseGoerli, - baseSepolia, - lineaTestnet, - linea, - zora, - zoraTestnet, -} + mainnet, + goerli, + optimismGoerli, + polygon, + polygonMumbai, + sepolia, + optimism, + arbitrum, + base, + gnosis, + baseGoerli, + baseSepolia, + lineaTestnet, + linea, + zora, + zoraTestnet, +}; /** * Gets the chain object for the given chain id. @@ -44,11 +44,11 @@ const enabledChains = { */ export function chainIdToChain(chainId: number): Chain { - for (const chain of Object.values(enabledChains)) { - if (chain.id === chainId) { - return chain - } - } + for (const chain of Object.values(enabledChains)) { + if (chain.id === chainId) { + return chain; + } + } - throw new Error(`Chain with id ${chainId} not found`) + throw new Error(`Chain with id ${chainId} not found`); } diff --git a/packages/sdk/src/utils/getImplementationName.ts b/packages/sdk/src/utils/getImplementationName.ts index 9d5545f..203f989 100644 --- a/packages/sdk/src/utils/getImplementationName.ts +++ b/packages/sdk/src/utils/getImplementationName.ts @@ -1,13 +1,15 @@ -import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from '../constants' +import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "../constants"; -export function getImplementationName(implementationAddress?: `0x${string}`): string { - switch (implementationAddress) { - case ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS: - return 'Implementation: Default V1' - case ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS: - case undefined: - return 'Implementation: Default V3' - default: - return `Custom Implementation: ${implementationAddress}` - } +export function getImplementationName( + implementationAddress?: `0x${string}`, +): string { + switch (implementationAddress) { + case ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS: + return "Implementation: Default V1"; + case ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS: + case undefined: + return "Implementation: Default V3"; + default: + return `Custom Implementation: ${implementationAddress}`; + } } diff --git a/packages/sdk/src/utils/index.ts b/packages/sdk/src/utils/index.ts index e23a535..add044c 100644 --- a/packages/sdk/src/utils/index.ts +++ b/packages/sdk/src/utils/index.ts @@ -1,7 +1,7 @@ -export * from './addressToUint8Array' -export * from './chainIdToChain' -export * from './getImplementationName' -export * from './messageTypeguards' -export * from './normalizeEthersMessage' -export * from './resolvePossibleENS' -export * from './segmentBytecode' +export * from "./addressToUint8Array"; +export * from "./chainIdToChain"; +export * from "./getImplementationName"; +export * from "./messageTypeguards"; +export * from "./normalizeEthersMessage"; +export * from "./resolvePossibleENS"; +export * from "./segmentBytecode"; diff --git a/packages/sdk/src/utils/messageTypeguards.ts b/packages/sdk/src/utils/messageTypeguards.ts index 7cf3b28..485acc2 100644 --- a/packages/sdk/src/utils/messageTypeguards.ts +++ b/packages/sdk/src/utils/messageTypeguards.ts @@ -1,28 +1,28 @@ -import { SignableMessage } from 'viem' +import { SignableMessage } from "viem"; import { - Ethers5SignableMessage, - Ethers6SignableMessage, - UniversalSignableMessage, -} from '../types' + Ethers5SignableMessage, + Ethers6SignableMessage, + UniversalSignableMessage, +} from "../types"; export function isEthers5SignableMessage( - message: UniversalSignableMessage + message: UniversalSignableMessage, ): message is Ethers5SignableMessage { - return ( - Array.isArray(message) || - typeof message === 'string' || - ('length' in message && 'byteLength' in message === false) - ) + return ( + Array.isArray(message) || + typeof message === "string" || + ("length" in message && "byteLength" in message === false) + ); } export function isEthers6SignableMessage( - message: UniversalSignableMessage + message: UniversalSignableMessage, ): message is Ethers6SignableMessage { - return typeof message === 'string' || message instanceof Uint8Array + return typeof message === "string" || message instanceof Uint8Array; } export function isViemSignableMessage( - message: UniversalSignableMessage + message: UniversalSignableMessage, ): message is SignableMessage { - return typeof message === 'string' || 'raw' in message + return typeof message === "string" || "raw" in message; } diff --git a/packages/sdk/src/utils/normalizeEthersMessage.ts b/packages/sdk/src/utils/normalizeEthersMessage.ts index 4905c2e..6ae0e30 100644 --- a/packages/sdk/src/utils/normalizeEthersMessage.ts +++ b/packages/sdk/src/utils/normalizeEthersMessage.ts @@ -1,19 +1,19 @@ -import { Bytes } from '../types' +import { Bytes } from "../types"; // The types Bytes | string in Ethers 5 and string | Uint8Array in Ethers 6 are somewhat compatible but not entirely. // This function normalizes the message type to Uint8Array so we can sign using the AbstractEthersSigner without knowing the Ethers version. export function normalizeMessage( - message: Bytes | string | Uint8Array + message: Bytes | string | Uint8Array, ): string | Uint8Array { - if (typeof message === 'string') { - return message - } + if (typeof message === "string") { + return message; + } - if (message instanceof Uint8Array) { - return message - } + if (message instanceof Uint8Array) { + return message; + } - // Convert ArrayLike to Uint8Array - return new Uint8Array(Array.from(message)) + // Convert ArrayLike to Uint8Array + return new Uint8Array(Array.from(message)); } diff --git a/packages/sdk/src/utils/resolvePossibleENS.ts b/packages/sdk/src/utils/resolvePossibleENS.ts index 8b0b57b..efdfe26 100644 --- a/packages/sdk/src/utils/resolvePossibleENS.ts +++ b/packages/sdk/src/utils/resolvePossibleENS.ts @@ -1,21 +1,21 @@ -import { normalize } from 'viem/ens' -import { PossibleENSAddress } from '../types' -import { PublicClient, getAddress } from 'viem' +import { normalize } from "viem/ens"; +import { PossibleENSAddress } from "../types"; +import { PublicClient, getAddress } from "viem"; export async function resolvePossibleENS( - publicClient: PublicClient, - possibleENSAddress: PossibleENSAddress + publicClient: PublicClient, + possibleENSAddress: PossibleENSAddress, ): Promise<`0x${string}`> { - const isENS = possibleENSAddress.endsWith('.eth') - const address = isENS - ? await publicClient.getEnsAddress({ - name: normalize(possibleENSAddress), - }) - : getAddress(possibleENSAddress) + const isENS = possibleENSAddress.endsWith(".eth"); + const address = isENS + ? await publicClient.getEnsAddress({ + name: normalize(possibleENSAddress), + }) + : getAddress(possibleENSAddress); - if (!address) { - throw new Error('Failed to resolve ENS address') - } + if (!address) { + throw new Error("Failed to resolve ENS address"); + } - return address + return address; } diff --git a/packages/sdk/src/utils/segmentBytecode.ts b/packages/sdk/src/utils/segmentBytecode.ts index d5d59c2..0b5b5da 100644 --- a/packages/sdk/src/utils/segmentBytecode.ts +++ b/packages/sdk/src/utils/segmentBytecode.ts @@ -11,14 +11,14 @@ * console.log(segments); // ["0x", "1234", "567890ab"] */ export function segmentBytecode(input: string, ...lengths: number[]): string[] { - let position = 0 - const segments: string[] = [] - const cleanInput = input.startsWith('0x') ? input.substring(2) : input // Remove "0x" prefix if present + let position = 0; + const segments: string[] = []; + const cleanInput = input.startsWith("0x") ? input.substring(2) : input; // Remove "0x" prefix if present - for (const length of lengths) { - segments.push(cleanInput.substr(position, length * 2)) - position += length * 2 - } + for (const length of lengths) { + segments.push(cleanInput.substr(position, length * 2)); + position += length * 2; + } - return segments + return segments; } diff --git a/packages/sdk/tsconfig.json b/packages/sdk/tsconfig.json index ac03663..3d7a21a 100644 --- a/packages/sdk/tsconfig.json +++ b/packages/sdk/tsconfig.json @@ -1,21 +1,21 @@ { - "compilerOptions": { - "target": "ESNext", - "useDefineForClassFields": true, - "module": "ESNext", - "lib": ["ESNext", "DOM"], - "moduleResolution": "Node", - "strict": true, - "jsx": "preserve", - "resolveJsonModule": true, - "isolatedModules": true, - "esModuleInterop": true, - "noEmit": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "skipLibCheck": true - }, - "include": ["src"], - "exclude": ["src/test"] + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ESNext", "DOM"], + "moduleResolution": "Node", + "strict": true, + "jsx": "preserve", + "resolveJsonModule": true, + "isolatedModules": true, + "esModuleInterop": true, + "noEmit": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "skipLibCheck": true + }, + "include": ["src"], + "exclude": ["src/test"] } diff --git a/packages/sdk/vite.config.ts b/packages/sdk/vite.config.ts index 954347f..eeb0259 100644 --- a/packages/sdk/vite.config.ts +++ b/packages/sdk/vite.config.ts @@ -1,44 +1,44 @@ -import { resolve } from 'path' -import { PluginOption, defineConfig } from 'vite' -import { visualizer } from 'rollup-plugin-visualizer' -import dts from 'vite-plugin-dts' +import { resolve } from "path"; +import { PluginOption, defineConfig } from "vite"; +import { visualizer } from "rollup-plugin-visualizer"; +import dts from "vite-plugin-dts"; // https://vitejs.dev/config/ export default defineConfig({ - build: { - lib: { - // Could also be a dictionary or array of multiple entry points - entry: resolve(__dirname, 'src/index.ts'), - name: 'tokenbound-sdk', - // the proper extensions will be added - fileName: 'tokenbound-sdk', - }, - rollupOptions: { - // make sure to externalize deps that shouldn't be bundled - // into your library - external: ['viem'], - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - viem: 'viem', - }, - }, - }, - }, - plugins: [ - dts(), - visualizer({ - // Run 'pnpm build' to generate a stats.html file, which will automatically open - // in your default browser. This lets us visualize bundle sizes and dependencies. - open: true, - template: 'treemap', - filename: './dist/stats.html', - gzipSize: true, - brotliSize: true, - }) as PluginOption, - ], - optimizeDeps: { - exclude: ['**/__test__/**', '**/*.test.ts', '**/*.spec.ts', './test/**/'], - }, -}) + build: { + lib: { + // Could also be a dictionary or array of multiple entry points + entry: resolve(__dirname, "src/index.ts"), + name: "tokenbound-sdk", + // the proper extensions will be added + fileName: "tokenbound-sdk", + }, + rollupOptions: { + // make sure to externalize deps that shouldn't be bundled + // into your library + external: ["viem"], + output: { + // Provide global variables to use in the UMD build + // for externalized deps + globals: { + viem: "viem", + }, + }, + }, + }, + plugins: [ + dts(), + visualizer({ + // Run 'pnpm build' to generate a stats.html file, which will automatically open + // in your default browser. This lets us visualize bundle sizes and dependencies. + open: true, + template: "treemap", + filename: "./dist/stats.html", + gzipSize: true, + brotliSize: true, + }) as PluginOption, + ], + optimizeDeps: { + exclude: ["**/__test__/**", "**/*.test.ts", "**/*.spec.ts", "./test/**/"], + }, +}); diff --git a/packages/sdk/vitest.config.ts b/packages/sdk/vitest.config.ts index 65df58c..6b23de7 100644 --- a/packages/sdk/vitest.config.ts +++ b/packages/sdk/vitest.config.ts @@ -1,22 +1,22 @@ /// -import { defineConfig } from 'vitest/config' +import { defineConfig } from "vitest/config"; export default defineConfig({ - test: { - coverage: { - reporter: ['text', 'json', 'html'], - }, - // environment: 'jsdom', - environment: 'node', - exclude: [ - '**/.{idea,git,cache,output,temp}/**', - '**/cypress/**', - '**/dist/**', - '**/node_modules/**', - '**/6551contracts/**', - './test/pages/**', - ], - globals: true, - setupFiles: './src/test/config/setup.ts', - }, -}) + test: { + coverage: { + reporter: ["text", "json", "html"], + }, + // environment: 'jsdom', + environment: "node", + exclude: [ + "**/.{idea,git,cache,output,temp}/**", + "**/cypress/**", + "**/dist/**", + "**/node_modules/**", + "**/6551contracts/**", + "./test/pages/**", + ], + globals: true, + setupFiles: "./src/test/config/setup.ts", + }, +}); diff --git a/packages/sdk/wagmi.config.ts b/packages/sdk/wagmi.config.ts index 67727c3..6bc73f2 100644 --- a/packages/sdk/wagmi.config.ts +++ b/packages/sdk/wagmi.config.ts @@ -1,75 +1,75 @@ -import { defineConfig } from '@wagmi/cli' -import { etherscan } from '@wagmi/cli/plugins' -import { mainnet, goerli } from 'viem/chains' -import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from './src/constants' +import { defineConfig } from "@wagmi/cli"; +import { etherscan } from "@wagmi/cli/plugins"; +import { mainnet, goerli } from "viem/chains"; +import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "./src/constants"; export default defineConfig({ - out: 'src/test/wagmi-cli-hooks/generated.ts', - contracts: [], - plugins: [ - etherscan({ - apiKey: process.env.ETHERSCAN_API_KEY!, // Tokenbound SDK, user bjfutureprimitive - chainId: mainnet.id, - // chainId: goerli.id, + out: "src/test/wagmi-cli-hooks/generated.ts", + contracts: [], + plugins: [ + etherscan({ + apiKey: process.env.ETHERSCAN_API_KEY!, // Tokenbound SDK, user bjfutureprimitive + chainId: mainnet.id, + // chainId: goerli.id, - contracts: [ - { - name: 'ERC6551Account_V2_', - address: { - [mainnet.id]: ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS, - [goerli.id]: ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS, - }, - }, - { - name: 'ERC6551Registry_V2_', - address: { - [mainnet.id]: ERC_6551_LEGACY_V2.REGISTRY.ADDRESS, - [goerli.id]: ERC_6551_LEGACY_V2.REGISTRY.ADDRESS, - }, - }, - { - name: 'ERC6551Account_V3_', - address: { - [mainnet.id]: ERC_6551_DEFAULT.IMPLEMENTATION.ADDRESS, - [goerli.id]: ERC_6551_DEFAULT.IMPLEMENTATION.ADDRESS, - }, - }, - { - name: 'ERC6551AccountProxy_V3_', - address: { - [mainnet.id]: ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS!, - [goerli.id]: ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS!, - }, - }, - { - name: 'ERC6551Registry_V3_', - address: { - [mainnet.id]: ERC_6551_DEFAULT.REGISTRY.ADDRESS, - [goerli.id]: ERC_6551_DEFAULT.REGISTRY.ADDRESS, - }, - }, - { - name: 'Zora1155_', // https://github.com/ourzora/zora-protocol/blob/003efca081ddc0da8753aec707706cd0efff3e7e/packages/protocol-deployments/src/addresses.ts#L134 - address: { - [mainnet.id]: '0x4482c5929618b848a46e3da830a3d71085a5de07', // ZoraCreator1155Impl - [goerli.id]: '0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA', // ZoraCreator1155Impl - }, - }, - { - name: 'Zora721Drop_', - address: { - [mainnet.id]: '0x7c74dfe39976dc395529c14e54a597809980e01c', - [goerli.id]: '0xe4c17055048aEe01D0d122804816fEe5E6ac4A67', - }, - }, - { - name: 'WETH_', - address: { - [mainnet.id]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', - [goerli.id]: '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6', - }, - }, - ], - }), - ], -}) + contracts: [ + { + name: "ERC6551Account_V2_", + address: { + [mainnet.id]: ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS, + [goerli.id]: ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS, + }, + }, + { + name: "ERC6551Registry_V2_", + address: { + [mainnet.id]: ERC_6551_LEGACY_V2.REGISTRY.ADDRESS, + [goerli.id]: ERC_6551_LEGACY_V2.REGISTRY.ADDRESS, + }, + }, + { + name: "ERC6551Account_V3_", + address: { + [mainnet.id]: ERC_6551_DEFAULT.IMPLEMENTATION.ADDRESS, + [goerli.id]: ERC_6551_DEFAULT.IMPLEMENTATION.ADDRESS, + }, + }, + { + name: "ERC6551AccountProxy_V3_", + address: { + [mainnet.id]: ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS!, + [goerli.id]: ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS!, + }, + }, + { + name: "ERC6551Registry_V3_", + address: { + [mainnet.id]: ERC_6551_DEFAULT.REGISTRY.ADDRESS, + [goerli.id]: ERC_6551_DEFAULT.REGISTRY.ADDRESS, + }, + }, + { + name: "Zora1155_", // https://github.com/ourzora/zora-protocol/blob/003efca081ddc0da8753aec707706cd0efff3e7e/packages/protocol-deployments/src/addresses.ts#L134 + address: { + [mainnet.id]: "0x4482c5929618b848a46e3da830a3d71085a5de07", // ZoraCreator1155Impl + [goerli.id]: "0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA", // ZoraCreator1155Impl + }, + }, + { + name: "Zora721Drop_", + address: { + [mainnet.id]: "0x7c74dfe39976dc395529c14e54a597809980e01c", + [goerli.id]: "0xe4c17055048aEe01D0d122804816fEe5E6ac4A67", + }, + }, + { + name: "WETH_", + address: { + [mainnet.id]: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + [goerli.id]: "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6", + }, + }, + ], + }), + ], +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b15ef4..4bdd7f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,54 +8,36 @@ importers: .: devDependencies: + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 '@changesets/cli': specifier: ^2.26.2 version: 2.27.1 - '@ianvs/prettier-plugin-sort-imports': - specifier: ^4.1.0 - version: 4.2.1(prettier@2.8.8) - '@typescript-eslint/eslint-plugin': - specifier: ^6.7.2 - version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': - specifier: ^6.7.2 - version: 6.21.0(eslint@8.57.0)(typescript@5.4.5) - eslint: - specifier: ^8.50.0 - version: 8.57.0 - eslint-config-prettier: - specifier: ^9.0.0 - version: 9.1.0(eslint@8.57.0) - eslint-plugin-unused-imports: - specifier: ^3.0.0 - version: 3.2.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint@8.57.0) husky: specifier: ^8.0.3 version: 8.0.3 - lint-staged: - specifier: ^14.0.1 - version: 14.0.1 - prettier: - specifier: ^2.8.8 - version: 2.8.8 typescript: - specifier: ^5.2.2 - version: 5.4.5 + specifier: ^5.6.3 + version: 5.6.3 examples/vite-wagmi-ethers: dependencies: '@rainbow-me/rainbowkit': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.10.5)(wagmi@2.8.7) + specifier: 2.2.0 + version: 2.2.0(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.21.32)(wagmi@2.12.20) '@tanstack/react-query': - specifier: ^5.17.19 - version: 5.36.0(react@18.3.1) + specifier: ^5.59.15 + version: 5.59.15(react@18.3.1) '@tokenbound/sdk': specifier: workspace:^ version: link:../../packages/sdk buffer: specifier: ^6.0.3 version: 6.0.3 + connectkit: + specifier: 1.8.2 + version: 1.8.2(@babel/core@7.24.5)(@tanstack/react-query@5.59.15)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)(viem@2.21.32)(wagmi@2.12.20) ethers: specifier: ^5.7.2 version: 5.7.2 @@ -63,20 +45,20 @@ importers: specifier: ^0.11.10 version: 0.11.10 react: - specifier: ^18.2.0 + specifier: ^18.3.1 version: 18.3.1 react-dom: - specifier: ^18.2.0 + specifier: ^18.3.1 version: 18.3.1(react@18.3.1) util: specifier: ^0.12.5 version: 0.12.5 viem: - specifier: ^2.10.5 - version: 2.10.5(typescript@5.4.5) + specifier: ^2.21.32 + version: 2.21.32(typescript@5.4.5)(zod@3.23.8) wagmi: - specifier: ^2.3.1 - version: 2.8.7(@tanstack/react-query@5.36.0)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) + specifier: ^2.12.20 + version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) devDependencies: '@types/react': specifier: ^18.2.21 @@ -97,11 +79,17 @@ importers: examples/vite-wagmi-ethers-rainbowkit: dependencies: '@rainbow-me/rainbowkit': - specifier: ^1.0.11 - version: 1.3.7(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.10.5)(wagmi@2.8.7) + specifier: ^2.2.0 + version: 2.2.0(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.21.32)(wagmi@2.12.20) + '@tanstack/react-query': + specifier: ^5.59.15 + version: 5.59.15(react@18.3.1) '@tokenbound/sdk': specifier: workspace:^ version: link:../../packages/sdk + '@wagmi/core': + specifier: ^2.13.9 + version: 2.13.9(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) buffer: specifier: ^6.0.3 version: 6.0.3 @@ -112,20 +100,20 @@ importers: specifier: ^0.11.10 version: 0.11.10 react: - specifier: ^18.2.0 + specifier: ^18.3.1 version: 18.3.1 react-dom: - specifier: ^18.2.0 + specifier: ^18.3.1 version: 18.3.1(react@18.3.1) util: specifier: ^0.12.5 version: 0.12.5 viem: - specifier: ^2.10.5 - version: 2.10.5(typescript@5.4.5) + specifier: ^2.21.32 + version: 2.21.32(typescript@5.4.5)(zod@3.23.8) wagmi: - specifier: ^2.3.1 - version: 2.8.7(@tanstack/react-query@5.36.0)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) + specifier: ^2.12.20 + version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) devDependencies: '@types/react': specifier: ^18.2.21 @@ -145,6 +133,9 @@ importers: examples/vite-wagmi-ethers6: dependencies: + '@tanstack/react-query': + specifier: ^5.59.15 + version: 5.59.15(react@18.3.1) '@tokenbound/sdk': specifier: workspace:^ version: link:../../packages/sdk @@ -152,29 +143,29 @@ importers: specifier: ^6.0.3 version: 6.0.3 connectkit: - specifier: ^1.5.3 - version: 1.7.3(@babel/core@7.24.5)(@tanstack/react-query@5.36.0)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)(viem@1.21.4)(wagmi@1.4.13) + specifier: ^1.8.2 + version: 1.8.2(@babel/core@7.24.5)(@tanstack/react-query@5.59.15)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)(viem@2.21.32)(wagmi@2.12.20) ethers: - specifier: ^6.7.0 - version: 6.12.1 + specifier: ^6.13.4 + version: 6.13.4 process: specifier: ^0.11.10 version: 0.11.10 react: - specifier: ^18.2.0 + specifier: ^18.3.1 version: 18.3.1 react-dom: - specifier: ^18.2.0 + specifier: ^18.3.1 version: 18.3.1(react@18.3.1) util: specifier: ^0.12.5 version: 0.12.5 viem: - specifier: ^1.21.4 - version: 1.21.4(typescript@5.4.5)(zod@3.23.8) + specifier: ^2.21.32 + version: 2.21.32(typescript@5.4.5)(zod@3.23.8) wagmi: - specifier: ^1.4.7 - version: 1.4.13(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(typescript@5.4.5)(viem@1.21.4) + specifier: ^2.12.20 + version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) devDependencies: '@types/react': specifier: ^18.2.21 @@ -195,11 +186,11 @@ importers: examples/vite-wagmi-viem: dependencies: '@rainbow-me/rainbowkit': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.10.5)(wagmi@2.8.7) + specifier: 2.2.0 + version: 2.2.0(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.21.32)(wagmi@2.12.20) '@tanstack/react-query': - specifier: ^5.17.19 - version: 5.36.0(react@18.3.1) + specifier: ^5.59.15 + version: 5.59.15(react@18.3.1) '@tokenbound/sdk': specifier: workspace:^ version: link:../../packages/sdk @@ -213,20 +204,20 @@ importers: specifier: ^0.11.10 version: 0.11.10 react: - specifier: ^18.2.0 + specifier: ^18.3.1 version: 18.3.1 react-dom: - specifier: ^18.2.0 + specifier: ^18.3.1 version: 18.3.1(react@18.3.1) util: specifier: ^0.12.5 version: 0.12.5 viem: - specifier: ^2.10.5 - version: 2.10.5(typescript@5.4.5) + specifier: ^2.21.32 + version: 2.21.32(typescript@5.4.5)(zod@3.23.8) wagmi: - specifier: ^2.3.1 - version: 2.8.7(@tanstack/react-query@5.36.0)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) + specifier: ^2.12.20 + version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) devDependencies: '@types/react': specifier: ^18.2.21 @@ -250,15 +241,15 @@ importers: specifier: ^2.3.7 version: 2.3.7 viem: - specifier: ^2.10.5 - version: 2.10.5(typescript@5.4.5) + specifier: ^2.21.32 + version: 2.21.32(typescript@5.4.5)(zod@3.23.8) devDependencies: - '@ianvs/prettier-plugin-sort-imports': - specifier: ^4.2.1 - version: 4.2.1(prettier@2.8.8) + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 '@tanstack/react-query': - specifier: 4.29.1 - version: 4.29.1(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) + specifier: ^5.59.15 + version: 5.59.15(react@18.3.1) '@testing-library/dom': specifier: ^10.1.0 version: 10.1.0 @@ -267,7 +258,7 @@ importers: version: 6.4.5(vitest@1.6.0) '@testing-library/react': specifier: ^15.0.4 - version: 15.0.7(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1) + version: 15.0.7(@types/react@18.3.11)(react-dom@18.3.1)(react@18.3.1) '@testing-library/user-event': specifier: ^14.5.2 version: 14.5.2(@testing-library/dom@10.1.0) @@ -275,17 +266,11 @@ importers: specifier: workspace:^ version: 'link:' '@types/react': - specifier: ^18.3.2 - version: 18.3.2 + specifier: ^18.3.11 + version: 18.3.11 '@types/testing-library__jest-dom': specifier: ^5.14.9 version: 5.14.9 - '@typescript-eslint/eslint-plugin': - specifier: ^7.7.1 - version: 7.9.0(@typescript-eslint/parser@7.9.0)(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/parser': - specifier: ^7.9.0 - version: 7.9.0(eslint@9.2.0)(typescript@5.4.5) '@viem/anvil': specifier: ^0.0.10 version: 0.0.10 @@ -293,20 +278,8 @@ importers: specifier: ^0.33.0 version: 0.33.0(vitest@1.6.0) '@wagmi/cli': - specifier: ^1.5.2 - version: 1.5.2(@wagmi/core@2.9.7)(typescript@5.4.5)(wagmi@2.8.7) - connectkit: - specifier: ^1.7.3 - version: 1.7.3(@babel/core@7.24.5)(@tanstack/react-query@4.29.1)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)(viem@2.10.5)(wagmi@2.8.7) - eslint: - specifier: ^9.1.1 - version: 9.2.0 - eslint-config-prettier: - specifier: ^9.1.0 - version: 9.1.0(eslint@9.2.0) - eslint-plugin-unused-imports: - specifier: ^3.1.0 - version: 3.2.0(@typescript-eslint/eslint-plugin@7.9.0)(eslint@9.2.0) + specifier: ^2.1.16 + version: 2.1.16(typescript@5.4.5) ethers: specifier: ^5.7.2 version: 5.7.2 @@ -319,9 +292,6 @@ importers: jsdom: specifier: ^24.0.0 version: 24.0.0 - prettier: - specifier: ^2.8.8 - version: 2.8.8 react: specifier: ^18.3.1 version: 18.3.1 @@ -344,8 +314,8 @@ importers: specifier: ^1.6.0 version: 1.6.0(jsdom@24.0.0) wagmi: - specifier: ^2.8.7 - version: 2.8.7(@tanstack/react-query@4.29.1)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) + specifier: ^2.12.20 + version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.11)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) packages: @@ -353,12 +323,12 @@ packages: resolution: {integrity: sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==} dev: true - /@adraffy/ens-normalize@1.10.0: - resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} - /@adraffy/ens-normalize@1.10.1: resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + /@adraffy/ens-normalize@1.11.0: + resolution: {integrity: sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==} + /@ampproject/remapping@2.3.0: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} @@ -1694,6 +1664,94 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@biomejs/biome@1.9.4: + resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==} + engines: {node: '>=14.21.3'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.9.4 + '@biomejs/cli-darwin-x64': 1.9.4 + '@biomejs/cli-linux-arm64': 1.9.4 + '@biomejs/cli-linux-arm64-musl': 1.9.4 + '@biomejs/cli-linux-x64': 1.9.4 + '@biomejs/cli-linux-x64-musl': 1.9.4 + '@biomejs/cli-win32-arm64': 1.9.4 + '@biomejs/cli-win32-x64': 1.9.4 + dev: true + + /@biomejs/cli-darwin-arm64@1.9.4: + resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-darwin-x64@1.9.4: + resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64-musl@1.9.4: + resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64@1.9.4: + resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64-musl@1.9.4: + resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64@1.9.4: + resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-arm64@1.9.4: + resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-x64@1.9.4: + resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@changesets/apply-release-plan@7.0.0: resolution: {integrity: sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==} dependencies: @@ -1877,8 +1935,8 @@ packages: prettier: 2.8.8 dev: true - /@coinbase/wallet-sdk@3.9.1: - resolution: {integrity: sha512-cGUE8wm1/cMI8irRMVOqbFWYcnNugqCtuy2lnnHfgloBg+GRLs9RsrkOUDMdv/StfUeeKhCDyYudsXXvcL1xIA==} + /@coinbase/wallet-sdk@3.9.3: + resolution: {integrity: sha512-N/A2DRIf0Y3PHc1XAMvbBUu4zisna6qAdqABMZwBMNEfWrXpAwx16pZGkYCLGE+Rvv1edbcB2LYDRnACNcmCiw==} dependencies: bn.js: 5.2.1 buffer: 6.0.3 @@ -1892,21 +1950,15 @@ packages: transitivePeerDependencies: - supports-color - /@coinbase/wallet-sdk@3.9.3: - resolution: {integrity: sha512-N/A2DRIf0Y3PHc1XAMvbBUu4zisna6qAdqABMZwBMNEfWrXpAwx16pZGkYCLGE+Rvv1edbcB2LYDRnACNcmCiw==} + /@coinbase/wallet-sdk@4.0.4: + resolution: {integrity: sha512-74c040CRnGhfRjr3ArnkAgud86erIqdkPHNt5HR1k9u97uTIZCJww9eGYT67Qf7gHPpGS/xW8Be1D4dvRm63FA==} dependencies: - bn.js: 5.2.1 buffer: 6.0.3 clsx: 1.2.1 - eth-block-tracker: 7.1.0 - eth-json-rpc-filters: 6.0.1 eventemitter3: 5.0.1 keccak: 3.0.4 preact: 10.21.0 sha.js: 2.4.11 - transitivePeerDependencies: - - supports-color - dev: false /@emotion/hash@0.9.1: resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} @@ -1917,26 +1969,41 @@ packages: requiresBuild: true dependencies: '@emotion/memoize': 0.7.4 + dev: false optional: true /@emotion/is-prop-valid@1.2.2: resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} dependencies: '@emotion/memoize': 0.8.1 + dev: false /@emotion/memoize@0.7.4: resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==} requiresBuild: true + dev: false optional: true /@emotion/memoize@0.8.1: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} + dev: false /@emotion/stylis@0.8.5: resolution: {integrity: sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==} + dev: false /@emotion/unitless@0.7.5: resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==} + dev: false + + /@esbuild/aix-ppc64@0.19.12: + resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true /@esbuild/aix-ppc64@0.20.2: resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} @@ -1947,8 +2014,8 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.16.17: - resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==} + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1956,8 +2023,8 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.18.20: - resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + /@esbuild/android-arm64@0.19.12: + resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1974,8 +2041,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.16.17: - resolution: {integrity: sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==} + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1983,8 +2050,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.18.20: - resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + /@esbuild/android-arm@0.19.12: + resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -2001,8 +2068,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.16.17: - resolution: {integrity: sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==} + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -2010,8 +2077,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.18.20: - resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + /@esbuild/android-x64@0.19.12: + resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -2028,8 +2095,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.16.17: - resolution: {integrity: sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==} + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -2037,8 +2104,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.18.20: - resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + /@esbuild/darwin-arm64@0.19.12: + resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -2055,8 +2122,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.16.17: - resolution: {integrity: sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==} + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -2064,8 +2131,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.18.20: - resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + /@esbuild/darwin-x64@0.19.12: + resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -2082,8 +2149,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.16.17: - resolution: {integrity: sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==} + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -2091,8 +2158,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.18.20: - resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + /@esbuild/freebsd-arm64@0.19.12: + resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -2109,8 +2176,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.16.17: - resolution: {integrity: sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==} + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -2118,8 +2185,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.18.20: - resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + /@esbuild/freebsd-x64@0.19.12: + resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -2136,8 +2203,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.16.17: - resolution: {integrity: sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==} + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -2145,8 +2212,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.18.20: - resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + /@esbuild/linux-arm64@0.19.12: + resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -2163,8 +2230,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.16.17: - resolution: {integrity: sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==} + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -2172,8 +2239,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.18.20: - resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + /@esbuild/linux-arm@0.19.12: + resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -2190,8 +2257,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.16.17: - resolution: {integrity: sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==} + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -2199,8 +2266,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.18.20: - resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + /@esbuild/linux-ia32@0.19.12: + resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -2217,8 +2284,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.16.17: - resolution: {integrity: sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==} + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -2226,8 +2293,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.18.20: - resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + /@esbuild/linux-loong64@0.19.12: + resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -2244,8 +2311,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.16.17: - resolution: {integrity: sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==} + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -2253,8 +2320,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.18.20: - resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + /@esbuild/linux-mips64el@0.19.12: + resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -2271,8 +2338,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.16.17: - resolution: {integrity: sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==} + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -2280,8 +2347,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.18.20: - resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + /@esbuild/linux-ppc64@0.19.12: + resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -2298,8 +2365,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.16.17: - resolution: {integrity: sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==} + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -2307,8 +2374,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.18.20: - resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + /@esbuild/linux-riscv64@0.19.12: + resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -2325,8 +2392,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.16.17: - resolution: {integrity: sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==} + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -2334,8 +2401,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.18.20: - resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + /@esbuild/linux-s390x@0.19.12: + resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -2352,8 +2419,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.16.17: - resolution: {integrity: sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==} + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -2361,8 +2428,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.18.20: - resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + /@esbuild/linux-x64@0.19.12: + resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -2379,8 +2446,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.16.17: - resolution: {integrity: sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==} + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -2388,8 +2455,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.18.20: - resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + /@esbuild/netbsd-x64@0.19.12: + resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -2406,8 +2473,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.16.17: - resolution: {integrity: sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==} + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -2415,8 +2482,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.18.20: - resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + /@esbuild/openbsd-x64@0.19.12: + resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -2433,8 +2500,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.16.17: - resolution: {integrity: sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==} + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -2442,8 +2509,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.18.20: - resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + /@esbuild/sunos-x64@0.19.12: + resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -2460,8 +2527,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.16.17: - resolution: {integrity: sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==} + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -2469,8 +2536,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.18.20: - resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + /@esbuild/win32-arm64@0.19.12: + resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -2487,8 +2554,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.16.17: - resolution: {integrity: sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==} + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -2496,8 +2563,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.18.20: - resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + /@esbuild/win32-ia32@0.19.12: + resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -2514,8 +2581,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.16.17: - resolution: {integrity: sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==} + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -2523,8 +2590,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.18.20: - resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + /@esbuild/win32-x64@0.19.12: + resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -2541,75 +2608,6 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 8.57.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@eslint-community/eslint-utils@4.4.0(eslint@9.2.0): - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 9.2.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@eslint-community/regexpp@4.10.0: - resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: true - - /@eslint/eslintrc@2.1.4: - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4(supports-color@5.5.0) - espree: 9.6.1 - globals: 13.24.0 - ignore: 5.3.1 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@eslint/eslintrc@3.0.2: - resolution: {integrity: sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4(supports-color@5.5.0) - espree: 10.0.1 - globals: 14.0.0 - ignore: 5.3.1 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@eslint/js@8.57.0: - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /@eslint/js@9.2.0: - resolution: {integrity: sha512-ESiIudvhoYni+MdsI8oD7skpprZ89qKocwRM2KEvhhBJ9nl5MRh7BXU5GTod7Mdygq+AUl+QzId6iWJKR/wABA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - dev: true - /@ethereumjs/common@3.2.0: resolution: {integrity: sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA==} dependencies: @@ -2931,62 +2929,6 @@ packages: dependencies: '@hapi/hoek': 9.3.0 - /@humanwhocodes/config-array@0.11.14: - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4(supports-color@5.5.0) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@humanwhocodes/config-array@0.13.0: - resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4(supports-color@5.5.0) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@humanwhocodes/module-importer@1.0.1: - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - dev: true - - /@humanwhocodes/object-schema@2.0.3: - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - dev: true - - /@humanwhocodes/retry@0.2.4: - resolution: {integrity: sha512-Ttl/jHpxfS3st5sxwICYfk4pOH0WrLI1SpW283GgQL7sCWU7EHIOhX4b4fkIxr3tkfzwg8+FNojtzsIEE7Ecgg==} - engines: {node: '>=18.18'} - dev: true - - /@ianvs/prettier-plugin-sort-imports@4.2.1(prettier@2.8.8): - resolution: {integrity: sha512-NKN1LVFWUDGDGr3vt+6Ey3qPeN/163uR1pOPAlkWpgvAqgxQ6kSdUf1F0it8aHUtKRUzEGcK38Wxd07O61d7+Q==} - peerDependencies: - '@vue/compiler-sfc': 2.7.x || 3.x - prettier: 2 || 3 - peerDependenciesMeta: - '@vue/compiler-sfc': - optional: true - dependencies: - '@babel/core': 7.24.5 - '@babel/generator': 7.24.5 - '@babel/parser': 7.24.5 - '@babel/traverse': 7.24.5(supports-color@5.5.0) - '@babel/types': 7.24.5 - prettier: 2.8.8 - semver: 7.6.2 - transitivePeerDependencies: - - supports-color - dev: true - /@isaacs/ttlcache@1.4.1: resolution: {integrity: sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==} engines: {node: '>=12'} @@ -3008,7 +2950,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.12 + '@types/node': 22.7.5 jest-mock: 29.7.0 /@jest/expect-utils@29.7.0: @@ -3024,7 +2966,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.12.12 + '@types/node': 22.7.5 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -3041,7 +2983,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.12 + '@types/node': 22.7.5 '@types/yargs': 15.0.19 chalk: 4.1.2 @@ -3052,7 +2994,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.12 + '@types/node': 22.7.5 '@types/yargs': 17.0.32 chalk: 4.1.2 @@ -3172,20 +3114,30 @@ packages: transitivePeerDependencies: - supports-color - /@metamask/json-rpc-middleware-stream@6.0.2: - resolution: {integrity: sha512-jtyx3PRfc1kqoLpYveIVQNwsxYKefc64/LCl9h9Da1m3nUKEvypbYuXSIwi237qvOjKmNHQKsDOZg6f4uBf62Q==} + /@metamask/json-rpc-engine@8.0.2: + resolution: {integrity: sha512-IoQPmql8q7ABLruW7i4EYVHWUbF74yrp63bRuXV5Zf9BQwcn5H9Ww1eLtROYvI1bUXwOiHZ6qT5CWTrDc/t/AA==} engines: {node: '>=16.0.0'} dependencies: - '@metamask/json-rpc-engine': 7.3.3 + '@metamask/rpc-errors': 6.2.1 '@metamask/safe-event-emitter': 3.1.1 '@metamask/utils': 8.4.0 - readable-stream: 3.6.2 transitivePeerDependencies: - supports-color - /@metamask/object-multiplex@2.0.0: - resolution: {integrity: sha512-+ItrieVZie3j2LfYE0QkdW3dsEMfMEp419IGx1zyeLqjRZ14iQUPRO0H6CGgfAAoC0x6k2PfCAGRwJUA9BMrqA==} - engines: {node: ^16.20 || ^18.16 || >=20} + /@metamask/json-rpc-middleware-stream@7.0.2: + resolution: {integrity: sha512-yUdzsJK04Ev98Ck4D7lmRNQ8FPioXYhEUZOMS01LXW8qTvPGiRVXmVltj2p4wrLkh0vW7u6nv0mNl5xzC5Qmfg==} + engines: {node: '>=16.0.0'} + dependencies: + '@metamask/json-rpc-engine': 8.0.2 + '@metamask/safe-event-emitter': 3.1.1 + '@metamask/utils': 8.4.0 + readable-stream: 3.6.2 + transitivePeerDependencies: + - supports-color + + /@metamask/object-multiplex@2.0.0: + resolution: {integrity: sha512-+ItrieVZie3j2LfYE0QkdW3dsEMfMEp419IGx1zyeLqjRZ14iQUPRO0H6CGgfAAoC0x6k2PfCAGRwJUA9BMrqA==} + engines: {node: ^16.20 || ^18.16 || >=20} dependencies: once: 1.4.0 readable-stream: 3.6.2 @@ -3195,12 +3147,12 @@ packages: dependencies: bowser: 2.11.0 - /@metamask/providers@15.0.0: - resolution: {integrity: sha512-FXvL1NQNl6I7fMOJTfQYcBlBZ33vSlm6w80cMpmn8sJh0Lb7wcBpe02UwBsNlARnI+Qsr26XeDs6WHUHQh8CuA==} + /@metamask/providers@16.1.0: + resolution: {integrity: sha512-znVCvux30+3SaUwcUGaSf+pUckzT5ukPRpcBmy+muBLC0yaWnBcvDqGfcsw6CBIenUdFrVoAFa8B6jsuCY/a+g==} engines: {node: ^18.18 || >=20} dependencies: - '@metamask/json-rpc-engine': 7.3.3 - '@metamask/json-rpc-middleware-stream': 6.0.2 + '@metamask/json-rpc-engine': 8.0.2 + '@metamask/json-rpc-middleware-stream': 7.0.2 '@metamask/object-multiplex': 2.0.0 '@metamask/rpc-errors': 6.2.1 '@metamask/safe-event-emitter': 3.1.1 @@ -3230,10 +3182,10 @@ packages: resolution: {integrity: sha512-ihb3B0T/wJm1eUuArYP4lCTSEoZsClHhuWyfo/kMX3m/odpqNcPfsz5O2A3NT7dXCAgWPGDQGPqygCpgeniKMw==} engines: {node: '>=12.0.0'} - /@metamask/sdk-communication-layer@0.20.2(cross-fetch@4.0.0)(eciesjs@0.3.18)(eventemitter2@6.4.9)(readable-stream@3.6.2)(socket.io-client@4.7.5): - resolution: {integrity: sha512-TN+whYbCClFSkx52Ild1RcjoRyz8YZgwNvZeooIcZIvCfBM6U9W5273KGiY7WLc/oO4KKmFk17d7vMO4gNvhhw==} + /@metamask/sdk-communication-layer@0.30.0(cross-fetch@4.0.0)(eciesjs@0.3.18)(eventemitter2@6.4.9)(readable-stream@3.6.2)(socket.io-client@4.7.5): + resolution: {integrity: sha512-q5nbdYkAf76MsZxi1l5MJEAyd8sY9jLRapC8a7x1Q1BNV4rzQeFeux/d0mJ/jTR2LAwbnLZs2rL226AM75oK4w==} peerDependencies: - cross-fetch: ^3.1.5 + cross-fetch: ^4.0.0 eciesjs: ^0.3.16 eventemitter2: ^6.4.7 readable-stream: ^3.6.2 @@ -3247,18 +3199,17 @@ packages: eventemitter2: 6.4.9 readable-stream: 3.6.2 socket.io-client: 4.7.5 - utf-8-validate: 6.0.4 + utf-8-validate: 5.0.10 uuid: 8.3.2 transitivePeerDependencies: - supports-color - /@metamask/sdk-install-modal-web@0.20.2(i18next@22.5.1)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1): - resolution: {integrity: sha512-0QiaZhV15AGdN1zU2jfTI32eC3YkwEpzDfR9+oiZ9bd2G72c6lYBhTsmDGUd01aP6A+bqJR5PjI8Wh2AWtoLeA==} + /@metamask/sdk-install-modal-web@0.30.0(i18next@23.11.5)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1): + resolution: {integrity: sha512-1gT533Huja9tK3cmttvcpZirRAtWJ7vnYH+lnNRKEj2xIP335Df2cOwS+zqNC4GlRCZw7A3IsTjIzlKoxBY1uQ==} peerDependencies: - i18next: 22.5.1 + i18next: 23.11.5 react: ^18.2.0 react-dom: ^18.2.0 - react-i18next: ^13.2.2 react-native: '*' peerDependenciesMeta: react: @@ -3268,15 +3219,14 @@ packages: react-native: optional: true dependencies: - i18next: 22.5.1 + i18next: 23.11.5 qr-code-styling: 1.6.0-rc.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-i18next: 13.5.0(i18next@22.5.1)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) - react-native: 0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.2)(react@18.3.1) + react-native: 0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.11)(react@18.3.1) - /@metamask/sdk@0.20.3(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1): - resolution: {integrity: sha512-HZ9NwA+LxiXzuy0YWbWsuD4xejQtp85bhcCAf8UgpA/0dOyF3RS4dKDdBBXSyRgk3RWPjeJgHxioaH4CmBmiRA==} + /@metamask/sdk@0.30.0(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1): + resolution: {integrity: sha512-w+M5/Gfk9RRqvnCI5foKppH1dO79fu06defXxU6GfwKDZRhPbx0wgtFhQoTSWDlYOguC3MOM/PI1YCFREeAfsA==} peerDependencies: react: ^18.2.0 react-dom: ^18.2.0 @@ -3287,17 +3237,18 @@ packages: optional: true dependencies: '@metamask/onboarding': 1.0.1 - '@metamask/providers': 15.0.0 - '@metamask/sdk-communication-layer': 0.20.2(cross-fetch@4.0.0)(eciesjs@0.3.18)(eventemitter2@6.4.9)(readable-stream@3.6.2)(socket.io-client@4.7.5) - '@metamask/sdk-install-modal-web': 0.20.2(i18next@22.5.1)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1) + '@metamask/providers': 16.1.0 + '@metamask/sdk-communication-layer': 0.30.0(cross-fetch@4.0.0)(eciesjs@0.3.18)(eventemitter2@6.4.9)(readable-stream@3.6.2)(socket.io-client@4.7.5) + '@metamask/sdk-install-modal-web': 0.30.0(i18next@23.11.5)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) '@types/dom-screen-wake-lock': 1.0.3 + '@types/uuid': 10.0.0 bowser: 2.11.0 cross-fetch: 4.0.0 debug: 4.3.4(supports-color@5.5.0) eciesjs: 0.3.18 eth-rpc-errors: 4.0.3 eventemitter2: 6.4.9 - i18next: 22.5.1 + i18next: 23.11.5 i18next-browser-languagedetector: 7.1.0 obj-multiplex: 1.0.0 pump: 3.0.0 @@ -3313,7 +3264,6 @@ packages: transitivePeerDependencies: - bufferutil - encoding - - react-i18next - react-native - rollup - supports-color @@ -3336,8 +3286,8 @@ packages: engines: {node: '>=16.0.0'} dependencies: '@ethereumjs/tx': 4.2.0 - '@noble/hashes': 1.4.0 - '@scure/base': 1.1.6 + '@noble/hashes': 1.5.0 + '@scure/base': 1.1.9 '@types/debug': 4.1.12 debug: 4.3.4(supports-color@5.5.0) pony-cause: 2.1.11 @@ -3397,7 +3347,7 @@ packages: '@motionone/easing': 10.17.0 '@motionone/types': 10.17.0 '@motionone/utils': 10.17.0 - tslib: 2.6.2 + tslib: 2.7.0 /@motionone/dom@10.12.0: resolution: {integrity: sha512-UdPTtLMAktHiqV0atOczNYyDd/d8Cf5fFsd1tua03PqTwwCe/6lwhLSQ8a7TbnQ5SN0gm44N1slBfj+ORIhrqw==} @@ -3407,7 +3357,8 @@ packages: '@motionone/types': 10.17.0 '@motionone/utils': 10.17.0 hey-listen: 1.0.8 - tslib: 2.6.2 + tslib: 2.7.0 + dev: false /@motionone/dom@10.17.0: resolution: {integrity: sha512-cMm33swRlCX/qOPHWGbIlCl0K9Uwi6X5RiL8Ma6OrlJ/TP7Q+Np5GE4xcZkFptysFjMTi4zcZzpnNQGQ5D6M0Q==} @@ -3417,26 +3368,26 @@ packages: '@motionone/types': 10.17.0 '@motionone/utils': 10.17.0 hey-listen: 1.0.8 - tslib: 2.6.2 + tslib: 2.7.0 /@motionone/easing@10.17.0: resolution: {integrity: sha512-Bxe2wSuLu/qxqW4rBFS5m9tMLOw+QBh8v5A7Z5k4Ul4sTj5jAOfZG5R0bn5ywmk+Fs92Ij1feZ5pmC4TeXA8Tg==} dependencies: '@motionone/utils': 10.17.0 - tslib: 2.6.2 + tslib: 2.7.0 /@motionone/generators@10.17.0: resolution: {integrity: sha512-T6Uo5bDHrZWhIfxG/2Aut7qyWQyJIWehk6OB4qNvr/jwA/SRmixwbd7SOrxZi1z5rH3LIeFFBKK1xHnSbGPZSQ==} dependencies: '@motionone/types': 10.17.0 '@motionone/utils': 10.17.0 - tslib: 2.6.2 + tslib: 2.7.0 /@motionone/svelte@10.16.4: resolution: {integrity: sha512-zRVqk20lD1xqe+yEDZhMYgftsuHc25+9JSo+r0a0OWUJFocjSV9D/+UGhX4xgJsuwB9acPzXLr20w40VnY2PQA==} dependencies: '@motionone/dom': 10.17.0 - tslib: 2.6.2 + tslib: 2.7.0 /@motionone/types@10.17.0: resolution: {integrity: sha512-EgeeqOZVdRUTEHq95Z3t8Rsirc7chN5xFAPMYFobx8TPubkEfRSm5xihmMUkbaR2ErKJTUw3347QDPTHIW12IA==} @@ -3446,14 +3397,14 @@ packages: dependencies: '@motionone/types': 10.17.0 hey-listen: 1.0.8 - tslib: 2.6.2 + tslib: 2.7.0 /@motionone/vue@10.16.4: resolution: {integrity: sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg==} deprecated: Motion One for Vue is deprecated. Use Oku Motion instead https://oku-ui.com/motion dependencies: '@motionone/dom': 10.17.0 - tslib: 2.6.2 + tslib: 2.7.0 /@noble/curves@1.2.0: resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} @@ -3465,11 +3416,11 @@ packages: dependencies: '@noble/hashes': 1.3.3 - /@noble/curves@1.4.0: - resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} + /@noble/curves@1.6.0: + resolution: {integrity: sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==} + engines: {node: ^14.21.3 || >=16} dependencies: - '@noble/hashes': 1.4.0 - dev: false + '@noble/hashes': 1.5.0 /@noble/hashes@1.3.2: resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} @@ -3479,9 +3430,9 @@ packages: resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} engines: {node: '>= 16'} - /@noble/hashes@1.4.0: - resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} - engines: {node: '>= 16'} + /@noble/hashes@1.5.0: + resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} + engines: {node: ^14.21.3 || >=16} /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -3628,53 +3579,31 @@ packages: '@parcel/watcher-win32-ia32': 2.4.1 '@parcel/watcher-win32-x64': 2.4.1 - /@rainbow-me/rainbowkit@1.3.7(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.10.5)(wagmi@2.8.7): - resolution: {integrity: sha512-VZ12R8mgpwSuupajG5pkEHftKHP+h16Ci5JBmjuFzPhERqYTL3S/FzRDhha7gl+ZpQMWzF7NkMjURMK8Xjdb8A==} - engines: {node: '>=12.4'} - peerDependencies: - react: '>=17' - react-dom: '>=17' - viem: ~0.3.19 || ^1.0.0 - wagmi: ~1.0.1 || ~1.1.0 || ~1.2.0 || ~1.3.0 || ~1.4.0 - dependencies: - '@vanilla-extract/css': 1.14.0 - '@vanilla-extract/dynamic': 2.1.0 - '@vanilla-extract/sprinkles': 1.6.1(@vanilla-extract/css@1.14.0) - clsx: 2.1.0 - qrcode: 1.5.3 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.7(@types/react@18.3.2)(react@18.3.1) - ua-parser-js: 1.0.37 - viem: 2.10.5(typescript@5.4.5) - wagmi: 2.8.7(@tanstack/react-query@5.36.0)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) - transitivePeerDependencies: - - '@types/react' - dev: false - - /@rainbow-me/rainbowkit@2.0.0-beta.2(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.10.5)(wagmi@2.8.7): - resolution: {integrity: sha512-sookd/7Rm9k8T3BgH2vQSb8FHImBKFvu4+YYmoxkB0pu9ySLYx/3k0t0N1b2q0DYw/z8xF4qeZm7DhotDPU2gw==} + /@rainbow-me/rainbowkit@2.2.0(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(viem@2.21.32)(wagmi@2.12.20): + resolution: {integrity: sha512-N0wQ39UN6Soi6/ujk9lVy5KY2oY6me/dqMPe5BYWlZIKbpBc2De3cl9phSLPw+/rncL3Cp1r6kRZuMe0b+mP9Q==} engines: {node: '>=12.4'} peerDependencies: - react: '>=17' - react-dom: '>=17' + '@tanstack/react-query': '>=5.0.0' + react: '>=18' + react-dom: '>=18' viem: 2.x - wagmi: 2.x - dependencies: - '@vanilla-extract/css': 1.14.0 - '@vanilla-extract/dynamic': 2.1.0 - '@vanilla-extract/sprinkles': 1.6.1(@vanilla-extract/css@1.14.0) - clsx: 2.1.0 - i18n-js: 4.4.3 - qrcode: 1.5.3 + wagmi: ^2.9.0 + dependencies: + '@tanstack/react-query': 5.59.15(react@18.3.1) + '@vanilla-extract/css': 1.15.5 + '@vanilla-extract/dynamic': 2.1.2 + '@vanilla-extract/sprinkles': 1.6.3(@vanilla-extract/css@1.15.5) + clsx: 2.1.1 + qrcode: 1.5.4 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.7(@types/react@18.3.2)(react@18.3.1) + react-remove-scroll: 2.6.0(@types/react@18.3.2)(react@18.3.1) ua-parser-js: 1.0.37 - viem: 2.10.5(typescript@5.4.5) - wagmi: 2.8.7(@tanstack/react-query@5.36.0)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) + wagmi: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) transitivePeerDependencies: - '@types/react' + - babel-plugin-macros dev: false /@react-native-community/cli-clean@13.6.6: @@ -3997,7 +3926,7 @@ packages: /@react-native/normalize-colors@0.74.83: resolution: {integrity: sha512-jhCY95gRDE44qYawWVvhTjTplW1g+JtKTKM3f8xYT1dJtJ8QWv+gqEtKcfmOHfDkSDaMKG0AGBaDTSK8GXLH8Q==} - /@react-native/virtualized-lists@0.74.83(@types/react@18.3.2)(react-native@0.74.1)(react@18.3.1): + /@react-native/virtualized-lists@0.74.83(@types/react@18.3.11)(react-native@0.74.1)(react@18.3.1): resolution: {integrity: sha512-rmaLeE34rj7py4FxTod7iMTC7BAsm+HrGA8WxYmEJeyTV7WSaxAkosKoYBz8038mOiwnG9VwA/7FrB6bEQvn1A==} engines: {node: '>=18'} peerDependencies: @@ -4008,11 +3937,11 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.3.2 + '@types/react': 18.3.11 invariant: 2.2.4 nullthrows: 1.1.1 react: 18.3.1 - react-native: 0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.2)(react@18.3.1) + react-native: 0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.11)(react@18.3.1) /@rnx-kit/chromium-edge-launcher@1.0.0: resolution: {integrity: sha512-lzD84av1ZQhYUS+jsGqJiCMaJO2dn9u+RTT9n9q6D3SaKVwWqv+7AoRKqBu19bkwyE+iFRl1ymr40QS90jVFYg==} @@ -4215,10 +4144,10 @@ packages: - '@types/node' dev: true - /@safe-global/safe-apps-provider@0.18.1(typescript@5.4.5): - resolution: {integrity: sha512-V4a05A3EgJcriqtDoJklDz1BOinWhC6P0hjUSxshA4KOZM7rGPCTto/usXs09zr1vvL28evl/NldSTv97j2bmg==} + /@safe-global/safe-apps-provider@0.18.3(typescript@5.4.5): + resolution: {integrity: sha512-f/0cNv3S4v7p8rowAjj0hDCg8Q8P/wBjp5twkNWeBdvd0RDr7BuRBPPk74LCqmjQ82P+1ltLlkmVFSmxTIT7XQ==} dependencies: - '@safe-global/safe-apps-sdk': 8.1.0(typescript@5.4.5) + '@safe-global/safe-apps-sdk': 9.1.0(typescript@5.4.5) events: 3.3.0 transitivePeerDependencies: - bufferutil @@ -4226,73 +4155,49 @@ packages: - utf-8-validate - zod - /@safe-global/safe-apps-provider@0.18.2(typescript@5.4.5): - resolution: {integrity: sha512-yHHAcppwE7aIUWEeZiYAClQzZCdP5l0Kbd0CBlhKAsTcqZnx4Gh3G3G3frY5LlWcGzp9qmQ5jv+J1GBpaZLDgw==} - dependencies: - '@safe-global/safe-apps-sdk': 9.0.0(typescript@5.4.5) - events: 3.3.0 - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - - zod - dev: false - - /@safe-global/safe-apps-sdk@8.1.0(typescript@5.4.5): - resolution: {integrity: sha512-XJbEPuaVc7b9n23MqlF6c+ToYIS3f7P2Sel8f3cSBQ9WORE4xrSuvhMpK9fDSFqJ7by/brc+rmJR/5HViRr0/w==} - dependencies: - '@safe-global/safe-gateway-typescript-sdk': 3.21.1 - viem: 1.21.4(typescript@5.4.5)(zod@3.23.8) - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - - zod - - /@safe-global/safe-apps-sdk@9.0.0(typescript@5.4.5): - resolution: {integrity: sha512-fEqmQBU3JqTjORSl3XYrcaxdxkUqeeM39qsQjqCzzTHioN8DEfg3JCLq6EBoXzcKTVOYi8SPzLV7KJccdDw+4w==} + /@safe-global/safe-apps-sdk@9.1.0(typescript@5.4.5): + resolution: {integrity: sha512-N5p/ulfnnA2Pi2M3YeWjULeWbjo7ei22JwU/IXnhoHzKq3pYCN6ynL9mJBOlvDVv892EgLPCWCOwQk/uBT2v0Q==} dependencies: '@safe-global/safe-gateway-typescript-sdk': 3.21.1 - viem: 1.21.4(typescript@5.4.5)(zod@3.23.8) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) transitivePeerDependencies: - bufferutil - typescript - utf-8-validate - zod - dev: false /@safe-global/safe-gateway-typescript-sdk@3.21.1: resolution: {integrity: sha512-7nakIjcRSs6781LkizYpIfXh1DYlkUDqyALciqz/BjFU/S97sVjZdL4cuKsG9NEarytE+f6p0Qbq2Bo1aocVUA==} engines: {node: '>=16'} - /@scure/base@1.1.6: - resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} - - /@scure/bip32@1.3.2: - resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==} - dependencies: - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.3 - '@scure/base': 1.1.6 + /@scure/base@1.1.9: + resolution: {integrity: sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==} /@scure/bip32@1.3.3: resolution: {integrity: sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ==} dependencies: '@noble/curves': 1.3.0 '@noble/hashes': 1.3.3 - '@scure/base': 1.1.6 + '@scure/base': 1.1.9 - /@scure/bip39@1.2.1: - resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} + /@scure/bip32@1.5.0: + resolution: {integrity: sha512-8EnFYkqEQdnkuGBVpCzKxyIwDCBLDVj3oiX0EKUFre/tOjL/Hqba1D6n/8RcmaQy4f95qQFrO2A8Sr6ybh4NRw==} dependencies: - '@noble/hashes': 1.3.3 - '@scure/base': 1.1.6 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@scure/base': 1.1.9 /@scure/bip39@1.2.2: resolution: {integrity: sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA==} dependencies: '@noble/hashes': 1.3.3 - '@scure/base': 1.1.6 + '@scure/base': 1.1.9 + + /@scure/bip39@1.4.0: + resolution: {integrity: sha512-BEEm6p8IueV/ZTfQLp/0vhw4NPnT9oWf5+28nvmeUICjP99f4vr2d+qc7AVGDDtwRep6ifR43Yed9ERVmiITzw==} + dependencies: + '@noble/hashes': 1.5.0 + '@scure/base': 1.1.9 /@sideway/address@4.1.5: resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} @@ -4332,8 +4237,8 @@ packages: resolution: {integrity: sha512-USa6OS1jbh8zOapRJ/CBZImZ8Xb7AJjROZl5adql9TpOoBN9BUzyyouS5oPuZHft7S7eB8uJPuXWYjMi6BHgOw==} dependencies: '@babel/runtime': 7.24.5 - '@noble/curves': 1.4.0 - '@noble/hashes': 1.4.0 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 '@solana/buffer-layout': 4.0.1 agentkeepalive: 4.5.0 bigint-buffer: 1.1.5 @@ -4450,64 +4355,16 @@ packages: '@stablelib/random': 1.0.2 '@stablelib/wipe': 1.0.1 - /@tanstack/query-core@4.29.1: - resolution: {integrity: sha512-vkPewLEG8ua0efo3SsVT0BcBtkq5RZX8oPhDAyKL+k/rdOYSQTEocfGEXSaBwIwsXeOGBUpfKqI+UmHvNqdWXg==} - - /@tanstack/query-core@4.36.1: - resolution: {integrity: sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA==} - dev: false - - /@tanstack/query-core@5.36.0: - resolution: {integrity: sha512-B5BD3pg/mztDR36i77hGcyySKKeYrbM5mnogOROTBi1SUml5ByRK7PGUUl16vvubvQC+mSnqziFG/VIy/DE3FQ==} - dev: false - - /@tanstack/query-persist-client-core@4.36.1: - resolution: {integrity: sha512-eocgCeI7D7TRv1IUUBMfVwOI0wdSmMkBIbkKhqEdTrnUHUQEeOaYac8oeZk2cumAWJdycu6P/wB+WqGynTnzXg==} - dependencies: - '@tanstack/query-core': 4.36.1 - dev: false - - /@tanstack/query-sync-storage-persister@4.36.1: - resolution: {integrity: sha512-yMEt5hWe2+1eclf1agMtXHnPIkxEida0lYWkfdhR8U6KXk/lO4Vca6piJmhKI85t0NHlx3l/z6zX+t/Fn5O9NA==} - dependencies: - '@tanstack/query-persist-client-core': 4.36.1 - dev: false - - /@tanstack/react-query-persist-client@4.36.1(@tanstack/react-query@4.29.1): - resolution: {integrity: sha512-32I5b9aAu4NCiXZ7Te/KEQLfHbYeTNriVPrKYcvEThnZ9tlW01vLcSoxpUIsMYRsembvJUUAkzYBAiZHLOd6pQ==} - peerDependencies: - '@tanstack/react-query': ^4.36.1 - dependencies: - '@tanstack/query-persist-client-core': 4.36.1 - '@tanstack/react-query': 4.29.1(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) - dev: false - - /@tanstack/react-query@4.29.1(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1): - resolution: {integrity: sha512-/crv1v+OeuGG6EOvaQmyeo9GCKtH4jbmuhZkvk9ulufRiHcTr/A9+YP9GevEAZzUTdzXMwenpTbyxBGvG2xXvw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-native: '*' - peerDependenciesMeta: - react-dom: - optional: true - react-native: - optional: true - dependencies: - '@tanstack/query-core': 4.29.1 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-native: 0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.2)(react@18.3.1) - use-sync-external-store: 1.2.2(react@18.3.1) + /@tanstack/query-core@5.59.13: + resolution: {integrity: sha512-Oou0bBu/P8+oYjXsJQ11j+gcpLAMpqW42UlokQYEz4dE7+hOtVO9rVuolJKgEccqzvyFzqX4/zZWY+R/v1wVsQ==} - /@tanstack/react-query@5.36.0(react@18.3.1): - resolution: {integrity: sha512-BATvtM0rohwg7pRHUnxgeDiwLWRGZ8OM/4y8LImHVpecQWoH6Uhytu3Z8YV6V7hQ1sMQBFcUrGE1/e4MxR6YiA==} + /@tanstack/react-query@5.59.15(react@18.3.1): + resolution: {integrity: sha512-QbVlAkTI78wB4Mqgf2RDmgC0AOiJqer2c5k9STOOSXGv1S6ZkY37r/6UpE8DbQ2Du0ohsdoXgFNEyv+4eDoPEw==} peerDependencies: - react: ^18.0.0 + react: ^18 || ^19 dependencies: - '@tanstack/query-core': 5.36.0 + '@tanstack/query-core': 5.59.13 react: 18.3.1 - dev: false /@testing-library/dom@10.1.0: resolution: {integrity: sha512-wdsYKy5zupPyLCW2Je5DLHSxSfbIp6h80WoHOQc+RPtmPGA52O9x5MJEkv92Sjonpq+poOAtUKhh1kBGAXBrNA==} @@ -4555,7 +4412,7 @@ packages: vitest: 1.6.0(jsdom@24.0.0) dev: true - /@testing-library/react@15.0.7(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1): + /@testing-library/react@15.0.7(@types/react@18.3.11)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-cg0RvEdD1TIhhkm1IeYMQxrzy0MtUNfa3minv4MjbgcYzJAZ7yD0i0lwoPOTPr+INtiXFezt2o8xMSnyHhEn2Q==} engines: {node: '>=18'} peerDependencies: @@ -4568,7 +4425,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 '@testing-library/dom': 10.1.0 - '@types/react': 18.3.2 + '@types/react': 18.3.11 '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -4623,7 +4480,7 @@ packages: /@types/connect@3.4.38: resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: - '@types/node': 20.12.12 + '@types/node': 22.7.5 dev: false /@types/debug@4.1.12: @@ -4658,10 +4515,6 @@ packages: pretty-format: 29.7.0 dev: true - /@types/json-schema@7.0.15: - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - dev: true - /@types/minimist@1.2.5: resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} dev: true @@ -4672,23 +4525,24 @@ packages: /@types/node-forge@1.3.11: resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} dependencies: - '@types/node': 20.12.12 + '@types/node': 22.7.5 /@types/node@12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} /@types/node@18.15.13: resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + dev: true /@types/node@18.19.33: resolution: {integrity: sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==} dependencies: undici-types: 5.26.5 - /@types/node@20.12.12: - resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} + /@types/node@22.7.5: + resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} dependencies: - undici-types: 5.26.5 + undici-types: 6.19.8 /@types/normalize-package-data@2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -4700,9 +4554,15 @@ packages: /@types/react-dom@18.3.0: resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==} dependencies: - '@types/react': 18.3.2 + '@types/react': 18.3.11 dev: true + /@types/react@18.3.11: + resolution: {integrity: sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ==} + dependencies: + '@types/prop-types': 15.7.12 + csstype: 3.1.3 + /@types/react@18.3.2: resolution: {integrity: sha512-Btgg89dAnqD4vV7R3hlwOxgqobUQKgx3MmrQRi0yYbs/P0ym8XozIAlkqVilPqHQwXs4e9Tf63rrCgl58BcO4w==} dependencies: @@ -4712,7 +4572,7 @@ packages: /@types/secp256k1@4.0.6: resolution: {integrity: sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==} dependencies: - '@types/node': 20.12.12 + '@types/node': 22.7.5 /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} @@ -4730,10 +4590,13 @@ packages: /@types/trusted-types@2.0.7: resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + /@types/uuid@10.0.0: + resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} + /@types/ws@7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 20.12.12 + '@types/node': 22.7.5 dev: false /@types/yargs-parser@21.0.3: @@ -4749,301 +4612,41 @@ packages: dependencies: '@types/yargs-parser': 21.0.3 - /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.57.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare: 1.4.0 - semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/eslint-plugin@7.9.0(@typescript-eslint/parser@7.9.0)(eslint@9.2.0)(typescript@5.4.5): - resolution: {integrity: sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.9.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.9.0 - '@typescript-eslint/type-utils': 7.9.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.9.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.9.0 - eslint: 9.2.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.57.0 - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/parser@7.9.0(eslint@9.2.0)(typescript@5.4.5): - resolution: {integrity: sha512-qHMJfkL5qvgQB2aLvhUSXxbK7OLnDkwPzFalg458pxQgfxKDfT1ZDbHQM/I6mDIf/svlMkj21kzKuQ2ixJlatQ==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 7.9.0 - '@typescript-eslint/types': 7.9.0 - '@typescript-eslint/typescript-estree': 7.9.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.9.0 - debug: 4.3.4(supports-color@5.5.0) - eslint: 9.2.0 - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/scope-manager@6.21.0: - resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - dev: true - - /@typescript-eslint/scope-manager@7.9.0: - resolution: {integrity: sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.9.0 - '@typescript-eslint/visitor-keys': 7.9.0 - dev: true - - /@typescript-eslint/type-utils@6.21.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/type-utils@7.9.0(eslint@9.2.0)(typescript@5.4.5): - resolution: {integrity: sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 7.9.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.9.0(eslint@9.2.0)(typescript@5.4.5) - debug: 4.3.4(supports-color@5.5.0) - eslint: 9.2.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/types@6.21.0: - resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} - engines: {node: ^16.0.0 || >=18.0.0} - dev: true - - /@typescript-eslint/types@7.9.0: - resolution: {integrity: sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==} - engines: {node: ^18.18.0 || >=20.0.0} - dev: true - - /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5): - resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/typescript-estree@7.9.0(typescript@5.4.5): - resolution: {integrity: sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 7.9.0 - '@typescript-eslint/visitor-keys': 7.9.0 - debug: 4.3.4(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.4 - semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) - eslint: 8.57.0 - semver: 7.6.2 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/utils@7.9.0(eslint@9.2.0)(typescript@5.4.5): - resolution: {integrity: sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.2.0) - '@typescript-eslint/scope-manager': 7.9.0 - '@typescript-eslint/types': 7.9.0 - '@typescript-eslint/typescript-estree': 7.9.0(typescript@5.4.5) - eslint: 9.2.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/visitor-keys@6.21.0: - resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.21.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@typescript-eslint/visitor-keys@7.9.0: - resolution: {integrity: sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.9.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@ungap/structured-clone@1.2.0: - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - dev: true - - /@vanilla-extract/css@1.14.0: - resolution: {integrity: sha512-rYfm7JciWZ8PFzBM/HDiE2GLnKI3xJ6/vdmVJ5BSgcCZ5CxRlM9Cjqclni9lGzF3eMOijnUhCd/KV8TOzyzbMA==} + /@vanilla-extract/css@1.15.5: + resolution: {integrity: sha512-N1nQebRWnXvlcmu9fXKVUs145EVwmWtMD95bpiEKtvehHDpUhmO1l2bauS7FGYKbi3dU1IurJbGpQhBclTr1ng==} dependencies: '@emotion/hash': 0.9.1 - '@vanilla-extract/private': 1.0.4 - chalk: 4.1.2 + '@vanilla-extract/private': 1.0.6 css-what: 6.1.0 cssesc: 3.0.0 csstype: 3.1.3 + dedent: 1.5.3 deep-object-diff: 1.1.9 deepmerge: 4.3.1 + lru-cache: 10.4.3 media-query-parser: 2.0.2 modern-ahocorasick: 1.0.1 - outdent: 0.8.0 + picocolors: 1.0.1 + transitivePeerDependencies: + - babel-plugin-macros dev: false - /@vanilla-extract/dynamic@2.1.0: - resolution: {integrity: sha512-8zl0IgBYRtgD1h+56Zu13wHTiMTJSVEa4F7RWX9vTB/5Xe2KtjoiqApy/szHPVFA56c+ex6A4GpCQjT1bKXbYw==} + /@vanilla-extract/dynamic@2.1.2: + resolution: {integrity: sha512-9BGMciD8rO1hdSPIAh1ntsG4LPD3IYKhywR7VOmmz9OO4Lx1hlwkSg3E6X07ujFx7YuBfx0GDQnApG9ESHvB2A==} dependencies: - '@vanilla-extract/private': 1.0.4 + '@vanilla-extract/private': 1.0.6 dev: false - /@vanilla-extract/private@1.0.4: - resolution: {integrity: sha512-8FGD6AejeC/nXcblgNCM5rnZb9KXa4WNkR03HCWtdJBpANjTgjHEglNLFnhuvdQ78tC6afaxBPI+g7F2NX3tgg==} + /@vanilla-extract/private@1.0.6: + resolution: {integrity: sha512-ytsG/JLweEjw7DBuZ/0JCN4WAQgM9erfSTdS1NQY778hFQSZ6cfCDEZZ0sgVm4k54uNz6ImKB33AYvSR//fjxw==} dev: false - /@vanilla-extract/sprinkles@1.6.1(@vanilla-extract/css@1.14.0): - resolution: {integrity: sha512-N/RGKwGAAidBupZ436RpuweRQHEFGU+mvAqBo8PRMAjJEmHoPDttV8RObaMLrJHWLqvX+XUMinHUnD0hFRQISw==} + /@vanilla-extract/sprinkles@1.6.3(@vanilla-extract/css@1.15.5): + resolution: {integrity: sha512-oCHlQeYOBIJIA2yWy2GnY5wE2A7hGHDyJplJo4lb+KEIBcJWRnDJDg8ywDwQS5VfWJrBBO3drzYZPFpWQjAMiQ==} peerDependencies: '@vanilla-extract/css': ^1.0.0 dependencies: - '@vanilla-extract/css': 1.14.0 + '@vanilla-extract/css': 1.15.5 dev: false /@viem/anvil@0.0.10: @@ -5052,7 +4655,7 @@ packages: execa: 7.2.0 get-port: 6.1.2 http-proxy: 1.18.1 - ws: 8.17.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 8.17.0 transitivePeerDependencies: - bufferutil - debug @@ -5188,72 +4791,61 @@ packages: resolution: {integrity: sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==} dev: true - /@wagmi/cli@1.5.2(@wagmi/core@2.9.7)(typescript@5.4.5)(wagmi@2.8.7): - resolution: {integrity: sha512-UfLMYhW6mQBCjR8A5s01Chf9GpHzdpcuuBuzJ36QGXcMSJAxylz5ImVZWfCRV0ct1UruydjKVSW1QSI6azNxRQ==} - engines: {node: '>=14'} + /@wagmi/cli@2.1.16(typescript@5.4.5): + resolution: {integrity: sha512-uERiNCAwThM6Vwgyrimlf+X8tOF0EjDnir6NHqCoumTquJ1/nlKBvpe0CHD3aDx2RQCOWCqhkUIImtN9yk3Oag==} hasBin: true peerDependencies: - '@wagmi/core': '>=1.0.0' typescript: '>=5.0.4' - wagmi: '>=1.0.0' peerDependenciesMeta: - '@wagmi/core': - optional: true typescript: optional: true - wagmi: - optional: true dependencies: - '@wagmi/core': 2.9.7(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) - abitype: 0.8.7(typescript@5.4.5)(zod@3.23.8) - abort-controller: 3.0.0 - bundle-require: 3.1.2(esbuild@0.16.17) + abitype: 1.0.6(typescript@5.4.5)(zod@3.23.8) + bundle-require: 4.2.1(esbuild@0.19.12) cac: 6.7.14 - change-case: 4.1.2 + change-case: 5.4.4 chokidar: 3.6.0 dedent: 0.7.0 - detect-package-manager: 2.0.1 dotenv: 16.4.5 dotenv-expand: 10.0.0 - esbuild: 0.16.17 - execa: 6.1.0 + esbuild: 0.19.12 + execa: 8.0.1 + fdir: 6.4.2(picomatch@3.0.1) find-up: 6.3.0 - fs-extra: 10.1.0 - globby: 13.2.2 - node-fetch: 3.3.2 + fs-extra: 11.2.0 ora: 6.3.1 pathe: 1.1.2 picocolors: 1.0.1 - prettier: 2.8.8 + picomatch: 3.0.1 + prettier: 3.3.3 typescript: 5.4.5 - viem: 1.21.4(typescript@5.4.5)(zod@3.23.8) - wagmi: 2.8.7(@tanstack/react-query@4.29.1)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) zod: 3.23.8 transitivePeerDependencies: - bufferutil - utf-8-validate dev: true - /@wagmi/connectors@3.1.11(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@1.21.4): - resolution: {integrity: sha512-wzxp9f9PtSUFjDUP/QDjc1t7HON4D8wrVKsw35ejdO8hToDpx1gU9lwH/47Zo/1zExGezQc392sjoHSszYd7OA==} + /@wagmi/connectors@5.2.2(@types/react@18.3.11)(@wagmi/core@2.13.9)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32): + resolution: {integrity: sha512-G9+0tLWLiG+CyZzI6cqV5mgUnLkYFtdN+kTD7RHesquwRXY6hzTAjCJL19gBuAKzrTXUhaNcxuIYszsRV+/qFA==} peerDependencies: + '@wagmi/core': 2.13.9 typescript: '>=5.0.4' - viem: '>=0.3.35' + viem: 2.x peerDependenciesMeta: typescript: optional: true dependencies: - '@coinbase/wallet-sdk': 3.9.3 - '@safe-global/safe-apps-provider': 0.18.2(typescript@5.4.5) - '@safe-global/safe-apps-sdk': 8.1.0(typescript@5.4.5) - '@walletconnect/ethereum-provider': 2.11.0(@types/react@18.3.2)(react@18.3.1) - '@walletconnect/legacy-provider': 2.0.0 - '@walletconnect/modal': 2.6.2(@types/react@18.3.2)(react@18.3.1) - '@walletconnect/utils': 2.11.0 - abitype: 0.8.7(typescript@5.4.5)(zod@3.23.8) - eventemitter3: 4.0.7 + '@coinbase/wallet-sdk': 4.0.4 + '@metamask/sdk': 0.30.0(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) + '@safe-global/safe-apps-provider': 0.18.3(typescript@5.4.5) + '@safe-global/safe-apps-sdk': 9.1.0(typescript@5.4.5) + '@wagmi/core': 2.13.9(@types/react@18.3.11)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) + '@walletconnect/ethereum-provider': 2.17.0(@types/react@18.3.11)(react@18.3.1) + '@walletconnect/modal': 2.7.0(@types/react@18.3.11)(react@18.3.1) + cbw-sdk: /@coinbase/wallet-sdk@3.9.3 typescript: 5.4.5 - viem: 1.21.4(typescript@5.4.5)(zod@3.23.8) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -5272,31 +4864,35 @@ packages: - encoding - ioredis - react + - react-dom + - react-native + - rollup - supports-color - uWebSockets.js - utf-8-validate - zod - dev: false + dev: true - /@wagmi/connectors@4.3.9(@types/react@18.3.2)(@wagmi/core@2.9.7)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5): - resolution: {integrity: sha512-sY6qWoWpiC9KFx10zkkVw3Hv2iNWuQTsHanTXX9bLfQ477i5S+QDYdkxx5n2Lf/KLoWL3CcohA7Gej0svgzz1Q==} + /@wagmi/connectors@5.2.2(@types/react@18.3.2)(@wagmi/core@2.13.9)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32): + resolution: {integrity: sha512-G9+0tLWLiG+CyZzI6cqV5mgUnLkYFtdN+kTD7RHesquwRXY6hzTAjCJL19gBuAKzrTXUhaNcxuIYszsRV+/qFA==} peerDependencies: - '@wagmi/core': 2.9.7 + '@wagmi/core': 2.13.9 typescript: '>=5.0.4' viem: 2.x peerDependenciesMeta: typescript: optional: true dependencies: - '@coinbase/wallet-sdk': 3.9.1 - '@metamask/sdk': 0.20.3(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1) - '@safe-global/safe-apps-provider': 0.18.1(typescript@5.4.5) - '@safe-global/safe-apps-sdk': 8.1.0(typescript@5.4.5) - '@wagmi/core': 2.9.7(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) - '@walletconnect/ethereum-provider': 2.13.0(@types/react@18.3.2)(react@18.3.1) - '@walletconnect/modal': 2.6.2(@types/react@18.3.2)(react@18.3.1) + '@coinbase/wallet-sdk': 4.0.4 + '@metamask/sdk': 0.30.0(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) + '@safe-global/safe-apps-provider': 0.18.3(typescript@5.4.5) + '@safe-global/safe-apps-sdk': 9.1.0(typescript@5.4.5) + '@wagmi/core': 2.13.9(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) + '@walletconnect/ethereum-provider': 2.17.0(@types/react@18.3.2)(react@18.3.1) + '@walletconnect/modal': 2.7.0(@types/react@18.3.2)(react@18.3.1) + cbw-sdk: /@coinbase/wallet-sdk@3.9.3 typescript: 5.4.5 - viem: 2.10.5(typescript@5.4.5) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -5316,56 +4912,39 @@ packages: - ioredis - react - react-dom - - react-i18next - react-native - rollup - supports-color - uWebSockets.js - utf-8-validate - zod + dev: false - /@wagmi/core@1.4.13(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@1.21.4): - resolution: {integrity: sha512-ytMCvXbBOgfDu9Qw67279wq/jNEe7EZLjLyekX7ROnvHRADqFr3lwZI6ih41UmtRZAmXAx8Ghyuqy154EjB5mQ==} + /@wagmi/core@2.13.9(@types/react@18.3.11)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32): + resolution: {integrity: sha512-l5pGU97ANyCj48D/pffNkw5AB1R7K2X0vEgCGyHMo21u/Pj/SHvoA35VPta/kqOSZzELXpLxBbOZD4yw7FyCxQ==} peerDependencies: + '@tanstack/query-core': '>=5.0.0' typescript: '>=5.0.4' - viem: '>=0.3.35' + viem: 2.x peerDependenciesMeta: + '@tanstack/query-core': + optional: true typescript: optional: true dependencies: - '@wagmi/connectors': 3.1.11(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@1.21.4) - abitype: 0.8.7(typescript@5.4.5)(zod@3.23.8) - eventemitter3: 4.0.7 + eventemitter3: 5.0.1 + mipd: 0.0.7(typescript@5.4.5) typescript: 5.4.5 - viem: 1.21.4(typescript@5.4.5)(zod@3.23.8) - zustand: 4.5.2(@types/react@18.3.2)(react@18.3.1) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) + zustand: 4.4.1(@types/react@18.3.11)(react@18.3.1) transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - '@types/react' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - encoding - immer - - ioredis - react - - supports-color - - uWebSockets.js - - utf-8-validate - - zod - dev: false + dev: true - /@wagmi/core@2.9.7(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5): - resolution: {integrity: sha512-PYkuZsiqVZAgPRuADD4UJeKR1TU94tn9LLsdd/f8y2nWbf+6Xzs7i5uQLjB+Drbm4NobgEUj0PqdPUQxCqPCQw==} + /@wagmi/core@2.13.9(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32): + resolution: {integrity: sha512-l5pGU97ANyCj48D/pffNkw5AB1R7K2X0vEgCGyHMo21u/Pj/SHvoA35VPta/kqOSZzELXpLxBbOZD4yw7FyCxQ==} peerDependencies: '@tanstack/query-core': '>=5.0.0' typescript: '>=5.0.4' @@ -5377,60 +4956,19 @@ packages: optional: true dependencies: eventemitter3: 5.0.1 - mipd: 0.0.5(typescript@5.4.5) + mipd: 0.0.7(typescript@5.4.5) typescript: 5.4.5 - viem: 2.10.5(typescript@5.4.5) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) zustand: 4.4.1(@types/react@18.3.2)(react@18.3.1) transitivePeerDependencies: - '@types/react' - - bufferutil - immer - react - - utf-8-validate - - zod - - /@walletconnect/core@2.11.0: - resolution: {integrity: sha512-2Tjp5BCevI7dbmqo/OrCjX4tqgMqwJNQLlQAlphqPfvwlF9+tIu6pGcVbSN3U9zyXzWIZCeleqEaWUeSeET4Ew==} - dependencies: - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-provider': 1.0.13 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/jsonrpc-ws-connection': 1.0.14 - '@walletconnect/keyvaluestorage': 1.1.1 - '@walletconnect/logger': 2.1.2 - '@walletconnect/relay-api': 1.0.10 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.11.0 - '@walletconnect/utils': 2.11.0 - events: 3.3.0 - isomorphic-unfetch: 3.1.0 - lodash.isequal: 4.5.0 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - encoding - - ioredis - - uWebSockets.js - - utf-8-validate dev: false - /@walletconnect/core@2.13.0: - resolution: {integrity: sha512-blDuZxQenjeXcVJvHxPznTNl6c/2DO4VNrFnus+qHmO6OtT5lZRowdMtlCaCNb1q0OxzgrmBDcTOCbFcCpio/g==} + /@walletconnect/core@2.17.0: + resolution: {integrity: sha512-On+uSaCfWdsMIQsECwWHZBmUXfrnqmv6B8SXRRuTJgd8tUpEvBkLQH4X7XkSm3zW6ozEkQTCagZ2ox2YPn3kbw==} + engines: {node: '>=18'} dependencies: '@walletconnect/heartbeat': 1.2.2 '@walletconnect/jsonrpc-provider': 1.0.14 @@ -5439,14 +4977,13 @@ packages: '@walletconnect/jsonrpc-ws-connection': 1.0.14 '@walletconnect/keyvaluestorage': 1.1.1 '@walletconnect/logger': 2.1.2 - '@walletconnect/relay-api': 1.0.10 + '@walletconnect/relay-api': 1.0.11 '@walletconnect/relay-auth': 1.0.4 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.13.0 - '@walletconnect/utils': 2.13.0 + '@walletconnect/types': 2.17.0 + '@walletconnect/utils': 2.17.0 events: 3.3.0 - isomorphic-unfetch: 3.1.0 lodash.isequal: 4.5.0 uint8arrays: 3.1.0 transitivePeerDependencies: @@ -5463,47 +5000,27 @@ packages: - '@upstash/redis' - '@vercel/kv' - bufferutil - - encoding - ioredis - uWebSockets.js - utf-8-validate - /@walletconnect/crypto@1.0.3: - resolution: {integrity: sha512-+2jdORD7XQs76I2Odgr3wwrtyuLUXD/kprNVsjWRhhhdO9Mt6WqVzOPu0/t7OHSmgal8k7SoBQzUc5hu/8zL/g==} - dependencies: - '@walletconnect/encoding': 1.0.2 - '@walletconnect/environment': 1.0.1 - '@walletconnect/randombytes': 1.0.3 - aes-js: 3.1.2 - hash.js: 1.1.7 - tslib: 1.14.1 - dev: false - - /@walletconnect/encoding@1.0.2: - resolution: {integrity: sha512-CrwSBrjqJ7rpGQcTL3kU+Ief+Bcuu9PH6JLOb+wM6NITX1GTxR/MfNwnQfhLKK6xpRAyj2/nM04OOH6wS8Imag==} - dependencies: - is-typedarray: 1.0.0 - tslib: 1.14.1 - typedarray-to-buffer: 3.1.5 - dev: false - /@walletconnect/environment@1.0.1: resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} dependencies: tslib: 1.14.1 - /@walletconnect/ethereum-provider@2.11.0(@types/react@18.3.2)(react@18.3.1): - resolution: {integrity: sha512-YrTeHVjuSuhlUw7SQ6xBJXDuJ6iAC+RwINm9nVhoKYJSHAy3EVSJZOofMKrnecL0iRMtD29nj57mxAInIBRuZA==} + /@walletconnect/ethereum-provider@2.17.0(@types/react@18.3.11)(react@18.3.1): + resolution: {integrity: sha512-b+KTAXOb6JjoxkwpgYQQKPUcTwENGmdEdZoIDLeRicUmZTn/IQKfkMoC2frClB4YxkyoVMtj1oMV2JAax+yu9A==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8 '@walletconnect/jsonrpc-provider': 1.0.14 '@walletconnect/jsonrpc-types': 1.0.4 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/modal': 2.6.2(@types/react@18.3.2)(react@18.3.1) - '@walletconnect/sign-client': 2.11.0 - '@walletconnect/types': 2.11.0 - '@walletconnect/universal-provider': 2.11.0 - '@walletconnect/utils': 2.11.0 + '@walletconnect/modal': 2.7.0(@types/react@18.3.11)(react@18.3.1) + '@walletconnect/sign-client': 2.17.0 + '@walletconnect/types': 2.17.0 + '@walletconnect/universal-provider': 2.17.0 + '@walletconnect/utils': 2.17.0 events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -5525,20 +5042,20 @@ packages: - react - uWebSockets.js - utf-8-validate - dev: false + dev: true - /@walletconnect/ethereum-provider@2.13.0(@types/react@18.3.2)(react@18.3.1): - resolution: {integrity: sha512-dnpW8mmLpWl1AZUYGYZpaAfGw1HFkL0WSlhk5xekx3IJJKn4pLacX2QeIOo0iNkzNQxZfux1AK4Grl1DvtzZEA==} + /@walletconnect/ethereum-provider@2.17.0(@types/react@18.3.2)(react@18.3.1): + resolution: {integrity: sha512-b+KTAXOb6JjoxkwpgYQQKPUcTwENGmdEdZoIDLeRicUmZTn/IQKfkMoC2frClB4YxkyoVMtj1oMV2JAax+yu9A==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8 '@walletconnect/jsonrpc-provider': 1.0.14 '@walletconnect/jsonrpc-types': 1.0.4 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/modal': 2.6.2(@types/react@18.3.2)(react@18.3.1) - '@walletconnect/sign-client': 2.13.0 - '@walletconnect/types': 2.13.0 - '@walletconnect/universal-provider': 2.13.0 - '@walletconnect/utils': 2.13.0 + '@walletconnect/modal': 2.7.0(@types/react@18.3.2)(react@18.3.1) + '@walletconnect/sign-client': 2.17.0 + '@walletconnect/types': 2.17.0 + '@walletconnect/universal-provider': 2.17.0 + '@walletconnect/utils': 2.17.0 events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -5560,6 +5077,7 @@ packages: - react - uWebSockets.js - utf-8-validate + dev: false /@walletconnect/events@1.0.1: resolution: {integrity: sha512-NPTqaoi0oPBVNuLv7qPaJazmGHs5JGyO8eEAk5VGKmJzDR7AHzD4k6ilox5kxk1iwiOnFopBOOMLs86Oa76HpQ==} @@ -5567,14 +5085,6 @@ packages: keyvaluestorage-interface: 1.0.0 tslib: 1.14.1 - /@walletconnect/heartbeat@1.2.1: - resolution: {integrity: sha512-yVzws616xsDLJxuG/28FqtZ5rzrTA4gUjdEMTbWB5Y8V1XHRmqq4efAxCw5ie7WjbXFSUyBHaWlMR+2/CpQC5Q==} - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/time': 1.0.2 - tslib: 1.14.1 - dev: false - /@walletconnect/heartbeat@1.2.2: resolution: {integrity: sha512-uASiRmC5MwhuRuf05vq4AT48Pq8RMi876zV8rr8cV969uTOzWdB/k+Lj5yI2PBtB1bGQisGen7MM1GcZlQTBXw==} dependencies: @@ -5592,14 +5102,6 @@ packages: transitivePeerDependencies: - encoding - /@walletconnect/jsonrpc-provider@1.0.13: - resolution: {integrity: sha512-K73EpThqHnSR26gOyNEL+acEex3P7VWZe6KE12ZwKzAt2H4e5gldZHbjsu2QR9cLeJ8AXuO7kEMOIcRv1QEc7g==} - dependencies: - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/safe-json': 1.0.2 - tslib: 1.14.1 - dev: false - /@walletconnect/jsonrpc-provider@1.0.14: resolution: {integrity: sha512-rtsNY1XqHvWj0EtITNeuf8PHMvlCLiS3EjQL+WOkxEOA4KPxsohFnBDeyPYiNm4ZvkQdLnece36opYidmtbmow==} dependencies: @@ -5607,13 +5109,6 @@ packages: '@walletconnect/safe-json': 1.0.2 events: 3.3.0 - /@walletconnect/jsonrpc-types@1.0.3: - resolution: {integrity: sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw==} - dependencies: - keyvaluestorage-interface: 1.0.0 - tslib: 1.14.1 - dev: false - /@walletconnect/jsonrpc-types@1.0.4: resolution: {integrity: sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ==} dependencies: @@ -5664,108 +5159,76 @@ packages: - ioredis - uWebSockets.js - /@walletconnect/legacy-client@2.0.0: - resolution: {integrity: sha512-v5L7rYk9loVnfvUf0mF+76bUPFaU5/Vh7mzL6/950CD/yoGdzYZ3Kj+L7mkC6HPMEGeQsBP1+sqBuiVGZ/aODA==} + /@walletconnect/logger@2.1.2: + resolution: {integrity: sha512-aAb28I3S6pYXZHQm5ESB+V6rDqIYfsnHaQyzFbwUUBFY4H0OXx/YtTl8lvhUNhMMfb9UxbwEBS253TlXUYJWSw==} dependencies: - '@walletconnect/crypto': 1.0.3 - '@walletconnect/encoding': 1.0.2 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/legacy-types': 2.0.0 - '@walletconnect/legacy-utils': 2.0.0 '@walletconnect/safe-json': 1.0.2 - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - query-string: 6.14.1 - dev: false - - /@walletconnect/legacy-modal@2.0.0: - resolution: {integrity: sha512-jckNd8lMhm4X7dX9TDdxM3bXKJnaqkRs6K2Mo5j6GmbIF9Eyx40jZ5+q457RVxvM6ciZEDT5s1wBHWdWoOo+9Q==} - dependencies: - '@walletconnect/legacy-types': 2.0.0 - '@walletconnect/legacy-utils': 2.0.0 - copy-to-clipboard: 3.3.3 - preact: 10.21.0 - qrcode: 1.5.3 - dev: false + pino: 7.11.0 - /@walletconnect/legacy-provider@2.0.0: - resolution: {integrity: sha512-A8xPebMI1A+50HbWwTpFCbwP7G+1NGKdTKyg8BUUg3h3Y9JucpC1W6w/x0v1Xw7qFEqQnz74LoIN/A3ytH9xrQ==} + /@walletconnect/modal-core@2.7.0(@types/react@18.3.11)(react@18.3.1): + resolution: {integrity: sha512-oyMIfdlNdpyKF2kTJowTixZSo0PGlCJRdssUN/EZdA6H6v03hZnf09JnwpljZNfir2M65Dvjm/15nGrDQnlxSA==} dependencies: - '@walletconnect/jsonrpc-http-connection': 1.0.8 - '@walletconnect/jsonrpc-provider': 1.0.14 - '@walletconnect/legacy-client': 2.0.0 - '@walletconnect/legacy-modal': 2.0.0 - '@walletconnect/legacy-types': 2.0.0 - '@walletconnect/legacy-utils': 2.0.0 + valtio: 1.11.2(@types/react@18.3.11)(react@18.3.1) transitivePeerDependencies: - - encoding - dev: false - - /@walletconnect/legacy-types@2.0.0: - resolution: {integrity: sha512-sOVrA7HUdbI1OwKyPOQU0/DdvTSVFlsXWpAk2K2WvP2erTkBWPMTJq6cv2BmKdoJ3p6gLApT7sd+jHi3OF71uw==} - dependencies: - '@walletconnect/jsonrpc-types': 1.0.4 - dev: false + - '@types/react' + - react + dev: true - /@walletconnect/legacy-utils@2.0.0: - resolution: {integrity: sha512-CPWxSVVXw0kgNCxvU126g4GiV3mzXmC8IPJ15twE46aJ1FX+RHEIfAzFMFz2F2+fEhBxL63A7dwNQKDXorRPcQ==} + /@walletconnect/modal-core@2.7.0(@types/react@18.3.2)(react@18.3.1): + resolution: {integrity: sha512-oyMIfdlNdpyKF2kTJowTixZSo0PGlCJRdssUN/EZdA6H6v03hZnf09JnwpljZNfir2M65Dvjm/15nGrDQnlxSA==} dependencies: - '@walletconnect/encoding': 1.0.2 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/legacy-types': 2.0.0 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - query-string: 6.14.1 + valtio: 1.11.2(@types/react@18.3.2)(react@18.3.1) + transitivePeerDependencies: + - '@types/react' + - react dev: false - /@walletconnect/logger@2.1.2: - resolution: {integrity: sha512-aAb28I3S6pYXZHQm5ESB+V6rDqIYfsnHaQyzFbwUUBFY4H0OXx/YtTl8lvhUNhMMfb9UxbwEBS253TlXUYJWSw==} - dependencies: - '@walletconnect/safe-json': 1.0.2 - pino: 7.11.0 - - /@walletconnect/modal-core@2.6.2(@types/react@18.3.2)(react@18.3.1): - resolution: {integrity: sha512-cv8ibvdOJQv2B+nyxP9IIFdxvQznMz8OOr/oR/AaUZym4hjXNL/l1a2UlSQBXrVjo3xxbouMxLb3kBsHoYP2CA==} + /@walletconnect/modal-ui@2.7.0(@types/react@18.3.11)(react@18.3.1): + resolution: {integrity: sha512-gERYvU7D7K1ANCN/8vUgsE0d2hnRemfAFZ2novm9aZBg7TEd/4EgB+AqbJ+1dc7GhOL6dazckVq78TgccHb7mQ==} dependencies: - valtio: 1.11.2(@types/react@18.3.2)(react@18.3.1) + '@walletconnect/modal-core': 2.7.0(@types/react@18.3.11)(react@18.3.1) + lit: 2.8.0 + motion: 10.16.2 + qrcode: 1.5.3 transitivePeerDependencies: - '@types/react' - react + dev: true - /@walletconnect/modal-ui@2.6.2(@types/react@18.3.2)(react@18.3.1): - resolution: {integrity: sha512-rbdstM1HPGvr7jprQkyPggX7rP4XiCG85ZA+zWBEX0dVQg8PpAgRUqpeub4xQKDgY7pY/xLRXSiCVdWGqvG2HA==} + /@walletconnect/modal-ui@2.7.0(@types/react@18.3.2)(react@18.3.1): + resolution: {integrity: sha512-gERYvU7D7K1ANCN/8vUgsE0d2hnRemfAFZ2novm9aZBg7TEd/4EgB+AqbJ+1dc7GhOL6dazckVq78TgccHb7mQ==} dependencies: - '@walletconnect/modal-core': 2.6.2(@types/react@18.3.2)(react@18.3.1) + '@walletconnect/modal-core': 2.7.0(@types/react@18.3.2)(react@18.3.1) lit: 2.8.0 motion: 10.16.2 qrcode: 1.5.3 transitivePeerDependencies: - '@types/react' - react + dev: false - /@walletconnect/modal@2.6.2(@types/react@18.3.2)(react@18.3.1): - resolution: {integrity: sha512-eFopgKi8AjKf/0U4SemvcYw9zlLpx9njVN8sf6DAkowC2Md0gPU/UNEbH1Wwj407pEKnEds98pKWib1NN1ACoA==} + /@walletconnect/modal@2.7.0(@types/react@18.3.11)(react@18.3.1): + resolution: {integrity: sha512-RQVt58oJ+rwqnPcIvRFeMGKuXb9qkgSmwz4noF8JZGUym3gUAzVs+uW2NQ1Owm9XOJAV+sANrtJ+VoVq1ftElw==} dependencies: - '@walletconnect/modal-core': 2.6.2(@types/react@18.3.2)(react@18.3.1) - '@walletconnect/modal-ui': 2.6.2(@types/react@18.3.2)(react@18.3.1) + '@walletconnect/modal-core': 2.7.0(@types/react@18.3.11)(react@18.3.1) + '@walletconnect/modal-ui': 2.7.0(@types/react@18.3.11)(react@18.3.1) transitivePeerDependencies: - '@types/react' - react + dev: true - /@walletconnect/randombytes@1.0.3: - resolution: {integrity: sha512-35lpzxcHFbTN3ABefC9W+uBpNZl1GC4Wpx0ed30gibfO/y9oLdy1NznbV96HARQKSBV9J9M/rrtIvf6a23jfYw==} + /@walletconnect/modal@2.7.0(@types/react@18.3.2)(react@18.3.1): + resolution: {integrity: sha512-RQVt58oJ+rwqnPcIvRFeMGKuXb9qkgSmwz4noF8JZGUym3gUAzVs+uW2NQ1Owm9XOJAV+sANrtJ+VoVq1ftElw==} dependencies: - '@walletconnect/encoding': 1.0.2 - '@walletconnect/environment': 1.0.1 - randombytes: 2.1.0 - tslib: 1.14.1 + '@walletconnect/modal-core': 2.7.0(@types/react@18.3.2)(react@18.3.1) + '@walletconnect/modal-ui': 2.7.0(@types/react@18.3.2)(react@18.3.1) + transitivePeerDependencies: + - '@types/react' + - react dev: false - /@walletconnect/relay-api@1.0.10: - resolution: {integrity: sha512-tqrdd4zU9VBNqUaXXQASaexklv6A54yEyQQEXYOCr+Jz8Ket0dmPBDyg19LVSNUN2cipAghQc45/KVmfFJ0cYw==} + /@walletconnect/relay-api@1.0.11: + resolution: {integrity: sha512-tLPErkze/HmC9aCmdZOhtVmYZq1wKfWTJtygQHoWtgg722Jd4homo54Cs4ak2RUFUZIGO2RsOpIcWipaua5D5Q==} dependencies: '@walletconnect/jsonrpc-types': 1.0.4 @@ -5777,56 +5240,24 @@ packages: '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 tslib: 1.14.1 - uint8arrays: 3.1.0 + uint8arrays: 3.1.1 /@walletconnect/safe-json@1.0.2: resolution: {integrity: sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==} dependencies: tslib: 1.14.1 - /@walletconnect/sign-client@2.11.0: - resolution: {integrity: sha512-H2ukscibBS+6WrzQWh+WyVBqO5z4F5et12JcwobdwgHnJSlqIoZxqnUYYWNCI5rUR5UKsKWaUyto4AE9N5dw4Q==} + /@walletconnect/sign-client@2.17.0: + resolution: {integrity: sha512-sErYwvSSHQolNXni47L3Bm10ptJc1s1YoJvJd34s5E9h9+d3rj7PrhbiW9X82deN+Dm5oA8X9tC4xty1yIBrVg==} dependencies: - '@walletconnect/core': 2.11.0 - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/logger': 2.1.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.11.0 - '@walletconnect/utils': 2.11.0 - events: 3.3.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - encoding - - ioredis - - uWebSockets.js - - utf-8-validate - dev: false - - /@walletconnect/sign-client@2.13.0: - resolution: {integrity: sha512-En7KSvNUlQFx20IsYGsFgkNJ2lpvDvRsSFOT5PTdGskwCkUfOpB33SQJ6nCrN19gyoKPNvWg80Cy6MJI0TjNYA==} - dependencies: - '@walletconnect/core': 2.13.0 + '@walletconnect/core': 2.17.0 '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.2 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.1.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.13.0 - '@walletconnect/utils': 2.13.0 + '@walletconnect/types': 2.17.0 + '@walletconnect/utils': 2.17.0 events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -5842,7 +5273,6 @@ packages: - '@upstash/redis' - '@vercel/kv' - bufferutil - - encoding - ioredis - uWebSockets.js - utf-8-validate @@ -5852,34 +5282,8 @@ packages: dependencies: tslib: 1.14.1 - /@walletconnect/types@2.11.0: - resolution: {integrity: sha512-AB5b1lrEbCGHxqS2vqfCkIoODieH+ZAUp9rA1O2ftrhnqDJiJK983Df87JhYhECsQUBHHfALphA8ydER0q+9sw==} - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/keyvaluestorage': 1.1.1 - '@walletconnect/logger': 2.1.2 - events: 3.3.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - ioredis - - uWebSockets.js - dev: false - - /@walletconnect/types@2.13.0: - resolution: {integrity: sha512-MWaVT0FkZwzYbD3tvk8F+2qpPlz1LUSWHuqbINUtMXnSzJtXN49Y99fR7FuBhNFtDalfuWsEK17GrNA+KnAsPQ==} + /@walletconnect/types@2.17.0: + resolution: {integrity: sha512-i1pn9URpvt9bcjRDkabuAmpA9K7mzyKoLJlbsAujRVX7pfaG7wur7u9Jz0bk1HxvuABL5LHNncTnVKSXKQ5jZA==} dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.2 @@ -5903,49 +5307,17 @@ packages: - ioredis - uWebSockets.js - /@walletconnect/universal-provider@2.11.0: - resolution: {integrity: sha512-zgJv8jDvIMP4Qse/D9oIRXGdfoNqonsrjPZanQ/CHNe7oXGOBiQND2IIeX+tS0H7uNA0TPvctljCLiIN9nw4eA==} - dependencies: - '@walletconnect/jsonrpc-http-connection': 1.0.8 - '@walletconnect/jsonrpc-provider': 1.0.13 - '@walletconnect/jsonrpc-types': 1.0.4 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/logger': 2.1.2 - '@walletconnect/sign-client': 2.11.0 - '@walletconnect/types': 2.11.0 - '@walletconnect/utils': 2.11.0 - events: 3.3.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - encoding - - ioredis - - uWebSockets.js - - utf-8-validate - dev: false - - /@walletconnect/universal-provider@2.13.0: - resolution: {integrity: sha512-B5QvO8pnk5Bqn4aIt0OukGEQn2Auk9VbHfhQb9cGwgmSCd1GlprX/Qblu4gyT5+TjHMb1Gz5UssUaZWTWbDhBg==} + /@walletconnect/universal-provider@2.17.0: + resolution: {integrity: sha512-d3V5Be7AqLrvzcdMZSBS8DmGDRdqnyLk1DWmRKAGgR6ieUWykhhUKlvfeoZtvJrIXrY7rUGYpH1X41UtFkW5Pw==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8 '@walletconnect/jsonrpc-provider': 1.0.14 '@walletconnect/jsonrpc-types': 1.0.4 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.1.2 - '@walletconnect/sign-client': 2.13.0 - '@walletconnect/types': 2.13.0 - '@walletconnect/utils': 2.13.0 + '@walletconnect/sign-client': 2.17.0 + '@walletconnect/types': 2.17.0 + '@walletconnect/utils': 2.17.0 events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -5966,55 +5338,23 @@ packages: - uWebSockets.js - utf-8-validate - /@walletconnect/utils@2.11.0: - resolution: {integrity: sha512-hxkHPlTlDQILHfIKXlmzgNJau/YcSBC3XHUSuZuKZbNEw3duFT6h6pm3HT/1+j1a22IG05WDsNBuTCRkwss+BQ==} + /@walletconnect/utils@2.17.0: + resolution: {integrity: sha512-1aeQvjwsXy4Yh9G6g2eGmXrEl+BzkNjHRdCrGdMYqFTFa8ROEJfTGsSH3pLsNDlOY94CoBUvJvM55q/PMoN/FQ==} dependencies: '@stablelib/chacha20poly1305': 1.0.1 '@stablelib/hkdf': 1.0.1 '@stablelib/random': 1.0.2 '@stablelib/sha256': 1.0.1 '@stablelib/x25519': 1.0.3 - '@walletconnect/relay-api': 1.0.10 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.11.0 - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - query-string: 7.1.3 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - ioredis - - uWebSockets.js - dev: false - - /@walletconnect/utils@2.13.0: - resolution: {integrity: sha512-q1eDCsRHj5iLe7fF8RroGoPZpdo2CYMZzQSrw1iqL+2+GOeqapxxuJ1vaJkmDUkwgklfB22ufqG6KQnz78sD4w==} - dependencies: - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/relay-api': 1.0.10 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.0.4 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.13.0 + '@walletconnect/types': 2.17.0 '@walletconnect/window-getters': 1.0.1 '@walletconnect/window-metadata': 1.0.1 detect-browser: 5.3.0 + elliptic: 6.5.7 query-string: 7.1.3 uint8arrays: 3.1.0 transitivePeerDependencies: @@ -6052,34 +5392,8 @@ packages: through: 2.3.8 dev: false - /abitype@0.8.7(typescript@5.4.5)(zod@3.23.8): - resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.19.1 - peerDependenciesMeta: - zod: - optional: true - dependencies: - typescript: 5.4.5 - zod: 3.23.8 - - /abitype@0.9.8(typescript@5.4.5)(zod@3.23.8): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.19.1 - peerDependenciesMeta: - typescript: - optional: true - zod: - optional: true - dependencies: - typescript: 5.4.5 - zod: 3.23.8 - - /abitype@1.0.0(typescript@5.4.5): - resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} + /abitype@1.0.6(typescript@5.4.5)(zod@3.23.8): + resolution: {integrity: sha512-MMSqYh4+C/aVqI2RQaWqbvI4Kxo5cQV40WQ4QFtDnNzCkqChm8MuENhElmynZlO0qUy/ObkEUaXtKqYnx1Kp3A==} peerDependencies: typescript: '>=5.0.4' zod: ^3 >=3.22.0 @@ -6090,6 +5404,7 @@ packages: optional: true dependencies: typescript: 5.4.5 + zod: 3.23.8 /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} @@ -6104,14 +5419,6 @@ packages: mime-types: 2.1.35 negotiator: 0.6.3 - /acorn-jsx@5.3.2(acorn@8.11.3): - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: 8.11.3 - dev: true - /acorn-walk@8.3.2: resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} engines: {node: '>=0.4.0'} @@ -6125,10 +5432,6 @@ packages: /aes-js@3.0.0: resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} - /aes-js@3.1.2: - resolution: {integrity: sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==} - dev: false - /aes-js@4.0.0-beta.5: resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} @@ -6165,13 +5468,6 @@ packages: engines: {node: '>=6'} dev: true - /ansi-escapes@5.0.0: - resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==} - engines: {node: '>=12'} - dependencies: - type-fest: 1.4.0 - dev: true - /ansi-fragments@0.2.1: resolution: {integrity: sha512-DykbNHxuXQwUDRv5ibc2b0x7uw7wmwOGLBUd5RmaQ5z8Lhx19vwvKV+FAsM5rEA6dEcHxX+/Ad5s9eF2k2bB+w==} dependencies: @@ -6208,11 +5504,6 @@ packages: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} engines: {node: '>=10'} - /ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - dev: true - /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -6228,10 +5519,6 @@ packages: dependencies: sprintf-js: 1.0.3 - /argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: true - /aria-query@5.3.0: resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} dependencies: @@ -6291,7 +5578,7 @@ packages: resolution: {integrity: sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg==} engines: {node: '>=4'} dependencies: - tslib: 2.6.2 + tslib: 2.7.0 /astral-regex@1.0.0: resolution: {integrity: sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==} @@ -6303,7 +5590,7 @@ packages: /async-mutex@0.2.6: resolution: {integrity: sha512-Hs4R+4SPgamu6rSGW8C7cV9gaWUKEHykfzCCvIRuaVv636Ju10ZdeUbvb4TBEW0INuq2DHZqXbK4Nd3yG4RaRw==} dependencies: - tslib: 2.6.2 + tslib: 2.7.0 /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -6372,6 +5659,7 @@ packages: styled-components: 5.3.11(@babel/core@7.24.5)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1) transitivePeerDependencies: - '@babel/core' + dev: false /babel-plugin-transform-flow-enums@0.0.2(@babel/core@7.24.5): resolution: {integrity: sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==} @@ -6410,10 +5698,6 @@ packages: bindings: 1.5.0 dev: false - /bignumber.js@9.1.2: - resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} - dev: false - /binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} @@ -6526,13 +5810,13 @@ packages: dependencies: node-gyp-build: 4.8.1 - /bundle-require@3.1.2(esbuild@0.16.17): - resolution: {integrity: sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA==} + /bundle-require@4.2.1(esbuild@0.19.12): + resolution: {integrity: sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: - esbuild: '>=0.13' + esbuild: '>=0.17' dependencies: - esbuild: 0.16.17 + esbuild: 0.19.12 load-tsconfig: 0.2.5 dev: true @@ -6590,18 +5874,6 @@ packages: resolution: {integrity: sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==} engines: {node: '>=4'} - /callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - dev: true - - /camel-case@4.1.2: - resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} - dependencies: - pascal-case: 3.1.2 - tslib: 2.6.2 - dev: true - /camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} @@ -6621,18 +5893,11 @@ packages: /camelize@1.0.1: resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} + dev: false /caniuse-lite@1.0.30001618: resolution: {integrity: sha512-p407+D1tIkDvsEAPS22lJxLQQaG8OTBEqo0KhzfABGk0TU4juBNDSfH0hyAp/HRyx+M8L17z/ltyhxh27FTfQg==} - /capital-case@1.0.4: - resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case-first: 2.0.2 - dev: true - /chai@4.4.1: resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} engines: {node: '>=4'} @@ -6674,21 +5939,8 @@ packages: engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true - /change-case@4.1.2: - resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==} - dependencies: - camel-case: 4.1.2 - capital-case: 1.0.4 - constant-case: 3.0.4 - dot-case: 3.0.4 - header-case: 2.0.4 - no-case: 3.0.4 - param-case: 3.0.4 - pascal-case: 3.1.2 - path-case: 3.0.4 - sentence-case: 3.0.4 - snake-case: 3.0.4 - tslib: 2.6.2 + /change-case@5.4.4: + resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} dev: true /chardet@0.7.0: @@ -6720,7 +5972,7 @@ packages: engines: {node: '>=12.13.0'} hasBin: true dependencies: - '@types/node': 20.12.12 + '@types/node': 22.7.5 escape-string-regexp: 4.0.0 is-wsl: 2.2.0 lighthouse-logger: 1.4.2 @@ -6756,14 +6008,6 @@ packages: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} - /cli-truncate@3.1.0: - resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - slice-ansi: 5.0.0 - string-width: 5.1.2 - dev: true - /clipboardy@4.0.0: resolution: {integrity: sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==} engines: {node: '>=18'} @@ -6811,8 +6055,8 @@ packages: resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} engines: {node: '>=6'} - /clsx@2.1.0: - resolution: {integrity: sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==} + /clsx@2.1.1: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} dev: false @@ -6836,10 +6080,6 @@ packages: /colorette@1.4.0: resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} - /colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - dev: true - /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -6850,11 +6090,6 @@ packages: /command-exists@1.2.9: resolution: {integrity: sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==} - /commander@11.0.0: - resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==} - engines: {node: '>=16'} - dev: true - /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -6906,8 +6141,8 @@ packages: transitivePeerDependencies: - supports-color - /connectkit@1.7.3(@babel/core@7.24.5)(@tanstack/react-query@4.29.1)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)(viem@2.10.5)(wagmi@2.8.7): - resolution: {integrity: sha512-q357F3N2I0s+UyTzymWnijJnPp7yZp8z+Qg803OGE/p3TeAv9o9P4uLhiSavgOjeTOxLr0rj1pgPQc3yC7zApw==} + /connectkit@1.8.2(@babel/core@7.24.5)(@tanstack/react-query@5.59.15)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)(viem@2.21.32)(wagmi@2.12.20): + resolution: {integrity: sha512-Za6jR5RtCimzSFqAH1OgUYES96ThTei6d/TvKWNU3GeZPPnwVojtfhFn9wUOam81RknxylvVpG727BPmjguzbA==} engines: {node: '>=12.4'} peerDependencies: '@tanstack/react-query': '>=5.0.0' @@ -6916,47 +6151,19 @@ packages: viem: 2.x wagmi: 2.x dependencies: - '@tanstack/react-query': 4.29.1(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) + '@tanstack/react-query': 5.59.15(react@18.3.1) buffer: 6.0.3 detect-browser: 5.3.0 framer-motion: 6.5.1(react-dom@18.3.1)(react@18.3.1) - qrcode: 1.5.3 + qrcode: 1.5.4 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) react-transition-state: 1.1.5(react-dom@18.3.1)(react@18.3.1) react-use-measure: 2.1.1(react-dom@18.3.1)(react@18.3.1) resize-observer-polyfill: 1.5.1 styled-components: 5.3.11(@babel/core@7.24.5)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1) - viem: 2.10.5(typescript@5.4.5) - wagmi: 2.8.7(@tanstack/react-query@4.29.1)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) - transitivePeerDependencies: - - '@babel/core' - - react-is - dev: true - - /connectkit@1.7.3(@babel/core@7.24.5)(@tanstack/react-query@5.36.0)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)(viem@1.21.4)(wagmi@1.4.13): - resolution: {integrity: sha512-q357F3N2I0s+UyTzymWnijJnPp7yZp8z+Qg803OGE/p3TeAv9o9P4uLhiSavgOjeTOxLr0rj1pgPQc3yC7zApw==} - engines: {node: '>=12.4'} - peerDependencies: - '@tanstack/react-query': '>=5.0.0' - react: 17.x || 18.x - react-dom: 17.x || 18.x - viem: 2.x - wagmi: 2.x - dependencies: - '@tanstack/react-query': 5.36.0(react@18.3.1) - buffer: 6.0.3 - detect-browser: 5.3.0 - framer-motion: 6.5.1(react-dom@18.3.1)(react@18.3.1) - qrcode: 1.5.3 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-transition-state: 1.1.5(react-dom@18.3.1)(react@18.3.1) - react-use-measure: 2.1.1(react-dom@18.3.1)(react@18.3.1) - resize-observer-polyfill: 1.5.1 - styled-components: 5.3.11(@babel/core@7.24.5)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1) - viem: 1.21.4(typescript@5.4.5)(zod@3.23.8) - wagmi: 1.4.13(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(typescript@5.4.5)(viem@1.21.4) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) + wagmi: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) transitivePeerDependencies: - '@babel/core' - react-is @@ -6966,26 +6173,12 @@ packages: resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} - /constant-case@3.0.4: - resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case: 2.0.2 - dev: true - /convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} /cookie-es@1.1.0: resolution: {integrity: sha512-L2rLOcK0wzWSfSDA33YR+PUHDG10a8px7rUHKWbGLP4YfbsMed2KFUw5fczvDPbT98DDe3LEzviswl810apTEw==} - /copy-to-clipboard@3.3.3: - resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} - dependencies: - toggle-selection: 1.0.6 - dev: false - /core-js-compat@3.37.1: resolution: {integrity: sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==} dependencies: @@ -7049,6 +6242,7 @@ packages: /css-color-keywords@1.0.0: resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} engines: {node: '>=4'} + dev: false /css-to-react-native@3.2.0: resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} @@ -7056,6 +6250,7 @@ packages: camelize: 1.0.1 css-color-keywords: 1.0.0 postcss-value-parser: 4.2.0 + dev: false /css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} @@ -7104,11 +6299,6 @@ packages: stream-transform: 2.1.3 dev: true - /data-uri-to-buffer@4.0.1: - resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} - engines: {node: '>= 12'} - dev: true - /data-urls@5.0.0: resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} engines: {node: '>=18'} @@ -7159,6 +6349,7 @@ packages: /debounce@1.2.1: resolution: {integrity: sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==} + dev: false /debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} @@ -7206,6 +6397,15 @@ packages: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true + /dedent@1.5.3: + resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + dev: false + /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} engines: {node: '>=6'} @@ -7213,10 +6413,6 @@ packages: type-detect: 4.0.8 dev: true - /deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true - /deep-object-diff@1.1.9: resolution: {integrity: sha512-Rn+RuwkmkDwCi2/oXOFS9Gsr5lJZu/yTGpK7wAaAIE75CC+LCGEZHpY6VQJa/RoJcrmaA/docWJZvYohlNkWPA==} dev: false @@ -7300,13 +6496,6 @@ packages: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} dev: false - /detect-package-manager@2.0.1: - resolution: {integrity: sha512-j/lJHyoLlWi6G1LDdLgvUtz60Zo5GEj+sVYtTVXnYLDPuzgC3llMxonXym9zIwhhUII8vjdw0LXxavpLqTbl1A==} - engines: {node: '>=12'} - dependencies: - execa: 5.1.1 - dev: true - /diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -7322,13 +6511,6 @@ packages: path-type: 4.0.0 dev: true - /doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dependencies: - esutils: 2.0.3 - dev: true - /dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} dev: true @@ -7337,13 +6519,6 @@ packages: resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} dev: true - /dot-case@3.0.4: - resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - dev: true - /dotenv-expand@10.0.0: resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} engines: {node: '>=12'} @@ -7362,10 +6537,6 @@ packages: readable-stream: 3.6.2 stream-shift: 1.0.3 - /eastasianwidth@0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - dev: true - /eciesjs@0.3.18: resolution: {integrity: sha512-RQhegEtLSyIiGJmFTZfvCTHER/fymipXFVx6OwSRYD6hOuy+6Kjpk0dGvIfP9kxn/smBpxQy71uxpGO406ITCw==} dependencies: @@ -7401,13 +6572,20 @@ packages: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 + /elliptic@6.5.7: + resolution: {integrity: sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==} + dependencies: + bn.js: 4.12.0 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - /emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - dev: true - /encode-utf8@1.0.3: resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} @@ -7575,36 +6753,6 @@ packages: es6-promise: 4.2.8 dev: false - /esbuild@0.16.17: - resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.16.17 - '@esbuild/android-arm64': 0.16.17 - '@esbuild/android-x64': 0.16.17 - '@esbuild/darwin-arm64': 0.16.17 - '@esbuild/darwin-x64': 0.16.17 - '@esbuild/freebsd-arm64': 0.16.17 - '@esbuild/freebsd-x64': 0.16.17 - '@esbuild/linux-arm': 0.16.17 - '@esbuild/linux-arm64': 0.16.17 - '@esbuild/linux-ia32': 0.16.17 - '@esbuild/linux-loong64': 0.16.17 - '@esbuild/linux-mips64el': 0.16.17 - '@esbuild/linux-ppc64': 0.16.17 - '@esbuild/linux-riscv64': 0.16.17 - '@esbuild/linux-s390x': 0.16.17 - '@esbuild/linux-x64': 0.16.17 - '@esbuild/netbsd-x64': 0.16.17 - '@esbuild/openbsd-x64': 0.16.17 - '@esbuild/sunos-x64': 0.16.17 - '@esbuild/win32-arm64': 0.16.17 - '@esbuild/win32-ia32': 0.16.17 - '@esbuild/win32-x64': 0.16.17 - dev: true - /esbuild@0.18.20: resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} @@ -7635,6 +6783,37 @@ packages: '@esbuild/win32-x64': 0.18.20 dev: true + /esbuild@0.19.12: + resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.19.12 + '@esbuild/android-arm': 0.19.12 + '@esbuild/android-arm64': 0.19.12 + '@esbuild/android-x64': 0.19.12 + '@esbuild/darwin-arm64': 0.19.12 + '@esbuild/darwin-x64': 0.19.12 + '@esbuild/freebsd-arm64': 0.19.12 + '@esbuild/freebsd-x64': 0.19.12 + '@esbuild/linux-arm': 0.19.12 + '@esbuild/linux-arm64': 0.19.12 + '@esbuild/linux-ia32': 0.19.12 + '@esbuild/linux-loong64': 0.19.12 + '@esbuild/linux-mips64el': 0.19.12 + '@esbuild/linux-ppc64': 0.19.12 + '@esbuild/linux-riscv64': 0.19.12 + '@esbuild/linux-s390x': 0.19.12 + '@esbuild/linux-x64': 0.19.12 + '@esbuild/netbsd-x64': 0.19.12 + '@esbuild/openbsd-x64': 0.19.12 + '@esbuild/sunos-x64': 0.19.12 + '@esbuild/win32-arm64': 0.19.12 + '@esbuild/win32-ia32': 0.19.12 + '@esbuild/win32-x64': 0.19.12 + dev: true + /esbuild@0.20.2: resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} engines: {node: '>=12'} @@ -7685,217 +6864,11 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-prettier@9.1.0(eslint@8.57.0): - resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - dependencies: - eslint: 8.57.0 - dev: true - - /eslint-config-prettier@9.1.0(eslint@9.2.0): - resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - dependencies: - eslint: 9.2.0 - dev: true - - /eslint-plugin-unused-imports@3.2.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint@8.57.0): - resolution: {integrity: sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': 6 - 7 - eslint: '8' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - dependencies: - '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.4.5) - eslint: 8.57.0 - eslint-rule-composer: 0.3.0 - dev: true - - /eslint-plugin-unused-imports@3.2.0(@typescript-eslint/eslint-plugin@7.9.0)(eslint@9.2.0): - resolution: {integrity: sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': 6 - 7 - eslint: '8' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - dependencies: - '@typescript-eslint/eslint-plugin': 7.9.0(@typescript-eslint/parser@7.9.0)(eslint@9.2.0)(typescript@5.4.5) - eslint: 9.2.0 - eslint-rule-composer: 0.3.0 - dev: true - - /eslint-rule-composer@0.3.0: - resolution: {integrity: sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==} - engines: {node: '>=4.0.0'} - dev: true - - /eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - dev: true - - /eslint-scope@8.0.1: - resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - dev: true - - /eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /eslint-visitor-keys@4.0.0: - resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - dev: true - - /eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - hasBin: true - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@5.5.0) - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 - ignore: 5.3.1 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.4 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint@9.2.0: - resolution: {integrity: sha512-0n/I88vZpCOzO+PQpt0lbsqmn9AsnsJAQseIqhZFI8ibQT0U1AkEKRxA3EVMos0BoHSXDQvCXY25TUjB5tr8Og==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - hasBin: true - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.2.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 3.0.2 - '@eslint/js': 9.2.0 - '@humanwhocodes/config-array': 0.13.0 - '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.2.4 - '@nodelib/fs.walk': 1.2.8 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@5.5.0) - escape-string-regexp: 4.0.0 - eslint-scope: 8.0.1 - eslint-visitor-keys: 4.0.0 - espree: 10.0.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 - find-up: 5.0.0 - glob-parent: 6.0.2 - ignore: 5.3.1 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.4 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - - /espree@10.0.1: - resolution: {integrity: sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 4.0.0 - dev: true - - /espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.4.3 - dev: true - /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - /esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} - engines: {node: '>=0.10'} - dependencies: - estraverse: 5.3.0 - dev: true - - /esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - dependencies: - estraverse: 5.3.0 - dev: true - - /estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - dev: true - /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true @@ -8006,6 +6979,23 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate + dev: true + + /ethers@6.13.4: + resolution: {integrity: sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA==} + engines: {node: '>=14.0.0'} + dependencies: + '@adraffy/ens-normalize': 1.10.1 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 22.7.5 + aes-js: 4.0.0-beta.5 + tslib: 2.7.0 + ws: 8.17.1 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false /event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} @@ -8038,21 +7028,6 @@ packages: signal-exit: 3.0.7 strip-final-newline: 2.0.0 - /execa@6.1.0: - resolution: {integrity: sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 3.0.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.3.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - dev: true - /execa@7.2.0: resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} @@ -8135,10 +7110,6 @@ packages: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true - /fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true - /fast-redact@3.5.0: resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} engines: {node: '>=6'} @@ -8166,26 +7137,15 @@ packages: dependencies: bser: 2.1.1 - /fetch-blob@3.2.0: - resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} - engines: {node: ^12.20 || >= 14.13} - dependencies: - node-domexception: 1.0.0 - web-streams-polyfill: 3.3.3 - dev: true - - /file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - flat-cache: 3.2.0 - dev: true - - /file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} + /fdir@6.4.2(picomatch@3.0.1): + resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true dependencies: - flat-cache: 4.0.1 + picomatch: 3.0.1 dev: true /file-uri-to-path@1.0.0: @@ -8259,27 +7219,6 @@ packages: pkg-dir: 4.2.0 dev: true - /flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - flatted: 3.3.1 - keyv: 4.5.4 - rimraf: 3.0.2 - dev: true - - /flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} - dependencies: - flatted: 3.3.1 - keyv: 4.5.4 - dev: true - - /flatted@3.3.1: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} - dev: true - /flow-enums-runtime@0.0.6: resolution: {integrity: sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==} @@ -8323,13 +7262,6 @@ packages: mime-types: 2.1.35 dev: true - /formdata-polyfill@4.0.10: - resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} - engines: {node: '>=12.20.0'} - dependencies: - fetch-blob: 3.2.0 - dev: true - /framer-motion@6.5.1(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-o1BGqqposwi7cgDrtg0dNONhkmPsUFDaLcKXigzuTFC5x58mE8iyTazxSudFzmT6MEyJKfjjU8ItoMe3W+3fiw==} peerDependencies: @@ -8343,22 +7275,24 @@ packages: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) style-value-types: 5.0.0 - tslib: 2.6.2 + tslib: 2.7.0 optionalDependencies: '@emotion/is-prop-valid': 0.8.8 + dev: false /framesync@6.0.1: resolution: {integrity: sha512-fUY88kXvGiIItgNC7wcTOl0SNRCVXMKSWW2Yzfmn7EKNc+MpCzcz9DhdHcdjbrtN3c6R4H5dTY2jiCpPdysEjA==} dependencies: - tslib: 2.6.2 + tslib: 2.7.0 + dev: false /fresh@0.5.2: resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} - /fs-extra@10.1.0: - resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} - engines: {node: '>=12'} + /fs-extra@11.2.0: + resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} + engines: {node: '>=14.14'} dependencies: graceful-fs: 4.2.11 jsonfile: 6.1.0 @@ -8471,13 +7405,6 @@ packages: dependencies: is-glob: 4.0.3 - /glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - dependencies: - is-glob: 4.0.3 - dev: true - /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: @@ -8492,18 +7419,6 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - /globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.20.2 - dev: true - - /globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} - dev: true - /globalthis@1.0.4: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} @@ -8524,17 +7439,6 @@ packages: slash: 3.0.0 dev: true - /globby@13.2.2: - resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.1 - merge2: 1.4.1 - slash: 4.0.0 - dev: true - /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: @@ -8547,10 +7451,6 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true - /graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - dev: true - /h3@1.11.1: resolution: {integrity: sha512-AbaH6IDnZN6nmbnJOH72y3c5Wwh9P97soSVdGSBbcDACRdkC0FEWf25pzx4f/NuOCK6quHmW18yF2Wx+G4Zi1A==} dependencies: @@ -8620,13 +7520,6 @@ packages: hasBin: true dev: true - /header-case@2.0.4: - resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==} - dependencies: - capital-case: 1.0.4 - tslib: 2.6.2 - dev: true - /hermes-estree@0.19.1: resolution: {integrity: sha512-daLGV3Q2MKk8w4evNMKwS8zBE/rcpA800nu1Q5kM08IKijoSnPe9Uo1iIxzPKRkn95IxxsgBMPeYHt3VG4ej2g==} @@ -8663,6 +7556,7 @@ packages: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} dependencies: react-is: 16.13.1 + dev: false /hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -8679,11 +7573,6 @@ packages: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true - /html-parse-stringify@3.0.1: - resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==} - dependencies: - void-elements: 3.1.0 - /http-errors@2.0.0: resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} engines: {node: '>= 0.8'} @@ -8737,11 +7626,6 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - /human-signals@3.0.1: - resolution: {integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==} - engines: {node: '>=12.20.0'} - dev: true - /human-signals@4.3.1: resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} engines: {node: '>=14.18.0'} @@ -8763,21 +7647,13 @@ packages: hasBin: true dev: true - /i18n-js@4.4.3: - resolution: {integrity: sha512-QIIyvJ+wOKdigL4BlgwiFFrpoXeGdlC8EYgori64YSWm1mnhNYYjIfRu5wETFrmiNP2fyD6xIjVG8dlzaiQr/A==} - dependencies: - bignumber.js: 9.1.2 - lodash: 4.17.21 - make-plural: 7.4.0 - dev: false - /i18next-browser-languagedetector@7.1.0: resolution: {integrity: sha512-cr2k7u1XJJ4HTOjM9GyOMtbOA47RtUoWRAtt52z43r3AoMs2StYKyjS3URPhzHaf+mn10hY9dZWamga5WPQjhA==} dependencies: '@babel/runtime': 7.24.5 - /i18next@22.5.1: - resolution: {integrity: sha512-8TGPgM3pAD+VRsMtUMNknRz3kzqwp/gPALrWMsDnmC1mKqJwpWyooQRLMcbTwq8z8YwSmuj+ZYvc+xCuEpkssA==} + /i18next@23.11.5: + resolution: {integrity: sha512-41pvpVbW9rhZPk5xjCX2TPJi2861LEig/YRhUkY+1FQ2IQPS0bKUDYnEqY8XPPbB48h1uIwLnP9iiEfuSl20CA==} dependencies: '@babel/runtime': 7.24.5 @@ -8820,14 +7696,6 @@ packages: caller-path: 2.0.0 resolve-from: 3.0.0 - /import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} - engines: {node: '>=6'} - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - dev: true - /import-lazy@4.0.0: resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} engines: {node: '>=8'} @@ -8955,11 +7823,6 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - /is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - dev: true - /is-generator-function@1.0.10: resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} engines: {node: '>= 0.4'} @@ -9004,11 +7867,6 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - /is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - dev: true - /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -9074,10 +7932,6 @@ packages: dependencies: which-typed-array: 1.1.15 - /is-typedarray@1.0.0: - resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} - dev: false - /is-unicode-supported@0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} @@ -9134,14 +7988,6 @@ packages: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} - /isomorphic-unfetch@3.1.0: - resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==} - dependencies: - node-fetch: 2.7.0 - unfetch: 4.2.0 - transitivePeerDependencies: - - encoding - /isomorphic-ws@4.0.1(ws@7.5.9): resolution: {integrity: sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==} peerDependencies: @@ -9150,12 +7996,12 @@ packages: ws: 7.5.9 dev: false - /isows@1.0.3(ws@8.13.0): - resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} + /isows@1.0.6(ws@8.18.0): + resolution: {integrity: sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==} peerDependencies: ws: '*' dependencies: - ws: 8.13.0 + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) /istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} @@ -9218,7 +8064,7 @@ packages: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.12 + '@types/node': 22.7.5 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -9255,7 +8101,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.12.12 + '@types/node': 22.7.5 jest-util: 29.7.0 /jest-util@29.7.0: @@ -9263,7 +8109,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.12.12 + '@types/node': 22.7.5 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -9284,7 +8130,7 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 20.12.12 + '@types/node': 22.7.5 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -9323,13 +8169,6 @@ packages: argparse: 1.0.10 esprima: 4.0.1 - /js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - dependencies: - argparse: 2.0.1 - dev: true - /jsc-android@250231.0.0: resolution: {integrity: sha512-rS46PvsjYmdmuz1OAWXY/1kCYG7pnf1TBqeTiOJr1iDz7s5DLxxC9n/ZMknLDxzYzNVfI7R95MH10emSSG1Wuw==} @@ -9393,7 +8232,7 @@ packages: whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 14.0.0 - ws: 8.17.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 8.17.0 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil @@ -9410,10 +8249,6 @@ packages: engines: {node: '>=4'} hasBin: true - /json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - dev: true - /json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} @@ -9435,10 +8270,6 @@ packages: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} dev: true - /json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true - /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} dev: false @@ -9475,12 +8306,6 @@ packages: node-gyp-build: 4.8.1 readable-stream: 3.6.2 - /keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - dependencies: - json-buffer: 3.0.1 - dev: true - /keyvaluestorage-interface@1.0.0: resolution: {integrity: sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==} @@ -9505,14 +8330,6 @@ packages: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} - /levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - dev: true - /lighthouse-logger@1.4.2: resolution: {integrity: sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==} dependencies: @@ -9521,35 +8338,10 @@ packages: transitivePeerDependencies: - supports-color - /lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} - dev: true - /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /lint-staged@14.0.1: - resolution: {integrity: sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==} - engines: {node: ^16.14.0 || >=18.0.0} - hasBin: true - dependencies: - chalk: 5.3.0 - commander: 11.0.0 - debug: 4.3.4(supports-color@5.5.0) - execa: 7.2.0 - lilconfig: 2.1.0 - listr2: 6.6.1 - micromatch: 4.0.5 - pidtree: 0.6.0 - string-argv: 0.3.2 - yaml: 2.3.1 - transitivePeerDependencies: - - enquirer - - supports-color - dev: true - /listhen@1.7.2: resolution: {integrity: sha512-7/HamOm5YD9Wb7CFgAZkKgVPA96WwhcTQoqtm2VTZGVbVVn3IWKRBTgrU7cchA3Q8k9iCsG8Osoi9GX4JsGM9g==} hasBin: true @@ -9575,23 +8367,6 @@ packages: transitivePeerDependencies: - uWebSockets.js - /listr2@6.6.1: - resolution: {integrity: sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==} - engines: {node: '>=16.0.0'} - peerDependencies: - enquirer: '>= 2.3.0 < 3' - peerDependenciesMeta: - enquirer: - optional: true - dependencies: - cli-truncate: 3.1.0 - colorette: 2.0.20 - eventemitter3: 5.0.1 - log-update: 5.0.1 - rfdc: 1.3.1 - wrap-ansi: 8.1.0 - dev: true - /lit-element@3.3.3: resolution: {integrity: sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==} dependencies: @@ -9670,10 +8445,6 @@ packages: /lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} - /lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - dev: true - /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: true @@ -9699,17 +8470,6 @@ packages: is-unicode-supported: 1.3.0 dev: true - /log-update@5.0.1: - resolution: {integrity: sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - ansi-escapes: 5.0.0 - cli-cursor: 4.0.0 - slice-ansi: 5.0.0 - strip-ansi: 7.1.0 - wrap-ansi: 8.1.0 - dev: true - /logkitty@0.7.1: resolution: {integrity: sha512-/3ER20CTTbahrCrpYfPn7Xavv9diBROZpoXGVZDWMw4b/X4uuUwAC0ki85tgsdMRONURyIJbcOvS94QsUBYPbQ==} hasBin: true @@ -9730,15 +8490,8 @@ packages: get-func-name: 2.0.2 dev: true - /lower-case@2.0.2: - resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} - dependencies: - tslib: 2.6.2 - dev: true - - /lru-cache@10.2.2: - resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} - engines: {node: 14 || >=16.14} + /lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} /lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} @@ -9784,10 +8537,6 @@ packages: semver: 7.6.2 dev: true - /make-plural@7.4.0: - resolution: {integrity: sha512-4/gC9KVNTV6pvYg2gFeQYTW3mWaoJt7WZE5vrp1KnQDgW92JtYZnzmZT81oj/dUTqAIu0ufI2x3dkgu3bB1tYg==} - dev: false - /makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} dependencies: @@ -10099,14 +8848,7 @@ packages: /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: - brace-expansion: 1.1.11 - - /minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - brace-expansion: 2.0.1 - dev: true + brace-expansion: 1.1.11 /minimatch@9.0.4: resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} @@ -10127,8 +8869,8 @@ packages: /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - /mipd@0.0.5(typescript@5.4.5): - resolution: {integrity: sha512-gbKA784D2WKb5H/GtqEv+Ofd1S9Zj+Z/PGDIl1u1QAbswkxD28BQ5bSXQxkeBzPBABg1iDSbiwGG1XqlOxRspA==} + /mipd@0.0.7(typescript@5.4.5): + resolution: {integrity: sha512-aAPZPNDQ3uMTdKbuO2YmAw2TxLHO0moa4YKAyETM/DTj5FloZo+a+8tU+iv4GmW+sOxKLSRwcSFuczk+Cpt6fg==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -10136,11 +8878,6 @@ packages: optional: true dependencies: typescript: 5.4.5 - viem: 1.21.4(typescript@5.4.5)(zod@3.23.8) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - zod /mixme@0.5.10: resolution: {integrity: sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==} @@ -10206,10 +8943,6 @@ packages: hasBin: true dev: true - /natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true - /negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} @@ -10217,13 +8950,6 @@ packages: /neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - /no-case@3.0.4: - resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} - dependencies: - lower-case: 2.0.2 - tslib: 2.6.2 - dev: true - /nocache@3.0.4: resolution: {integrity: sha512-WDD0bdg9mbq6F4mRxEYcPWwfA1vxd0mrvKOyxI7Xj/atfRHVeutzuWByG//jfm4uPzp0y4Kj051EORCBSQMycw==} engines: {node: '>=12.0.0'} @@ -10247,11 +8973,6 @@ packages: dependencies: minimatch: 3.1.2 - /node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - dev: true - /node-fetch-native@1.6.4: resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} @@ -10266,15 +8987,6 @@ packages: dependencies: whatwg-url: 5.0.0 - /node-fetch@3.3.2: - resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - data-uri-to-buffer: 4.0.1 - fetch-blob: 3.2.0 - formdata-polyfill: 4.0.10 - dev: true - /node-forge@1.3.1: resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} engines: {node: '>= 6.13.0'} @@ -10426,18 +9138,6 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 - /optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} - dependencies: - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - word-wrap: 1.2.5 - dev: true - /ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} @@ -10476,10 +9176,6 @@ packages: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} dev: true - /outdent@0.8.0: - resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==} - dev: false - /p-filter@2.1.0: resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} engines: {node: '>=8'} @@ -10547,20 +9243,6 @@ packages: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} - /param-case@3.0.4: - resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - - /parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - dependencies: - callsites: 3.1.0 - dev: true - /parse-json@4.0.0: resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} engines: {node: '>=4'} @@ -10588,24 +9270,10 @@ packages: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} - /pascal-case@3.1.2: - resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - dev: true - /path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} dev: true - /path-case@3.0.4: - resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - /path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} engines: {node: '>=4'} @@ -10653,10 +9321,9 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - /pidtree@0.6.0: - resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} - engines: {node: '>=0.10'} - hasBin: true + /picomatch@3.0.1: + resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} + engines: {node: '>=10'} dev: true /pify@3.0.0: @@ -10734,7 +9401,8 @@ packages: framesync: 6.0.1 hey-listen: 1.0.8 style-value-types: 5.0.0 - tslib: 2.6.2 + tslib: 2.7.0 + dev: false /possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} @@ -10742,6 +9410,7 @@ packages: /postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + dev: false /postcss@8.4.38: resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} @@ -10765,17 +9434,18 @@ packages: which-pm: 2.0.0 dev: true - /prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - dev: true - /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true dev: true + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true + dev: true + /pretty-format@26.6.2: resolution: {integrity: sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==} engines: {node: '>= 10'} @@ -10869,14 +9539,14 @@ packages: pngjs: 5.0.0 yargs: 15.4.1 - /query-string@6.14.1: - resolution: {integrity: sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==} - engines: {node: '>=6'} + /qrcode@1.5.4: + resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==} + engines: {node: '>=10.13.0'} + hasBin: true dependencies: - decode-uri-component: 0.2.2 - filter-obj: 1.1.0 - split-on-first: 1.1.0 - strict-uri-encode: 2.0.0 + dijkstrajs: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 dev: false /query-string@7.1.3: @@ -10916,12 +9586,6 @@ packages: /radix3@1.1.2: resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==} - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - dependencies: - safe-buffer: 5.2.1 - dev: false - /range-parser@1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} @@ -10944,28 +9608,9 @@ packages: react: 18.3.1 scheduler: 0.23.2 - /react-i18next@13.5.0(i18next@22.5.1)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1): - resolution: {integrity: sha512-CFJ5NDGJ2MUyBohEHxljOq/39NQ972rh1ajnadG9BjTk+UXbHLq4z5DKEbEQBDoIhUmmbuS/fIMJKo6VOax1HA==} - peerDependencies: - i18next: '>= 23.2.3' - react: '>= 16.8.0' - react-dom: '*' - react-native: '*' - peerDependenciesMeta: - react-dom: - optional: true - react-native: - optional: true - dependencies: - '@babel/runtime': 7.24.5 - html-parse-stringify: 3.0.1 - i18next: 22.5.1 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-native: 0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.2)(react@18.3.1) - /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + dev: false /react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} @@ -10982,9 +9627,9 @@ packages: escape-string-regexp: 2.0.0 invariant: 2.2.4 react: 18.3.1 - react-native: 0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.2)(react@18.3.1) + react-native: 0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.11)(react@18.3.1) - /react-native@0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.2)(react@18.3.1): + /react-native@0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5)(@types/react@18.3.11)(react@18.3.1): resolution: {integrity: sha512-0H2XpmghwOtfPpM2LKqHIN7gxy+7G/r1hwJHKLV6uoyXGC/gCojRtoo5NqyKrWpFC8cqyT6wTYCLuG7CxEKilg==} engines: {node: '>=18'} hasBin: true @@ -11005,8 +9650,8 @@ packages: '@react-native/gradle-plugin': 0.74.83 '@react-native/js-polyfills': 0.74.83 '@react-native/normalize-colors': 0.74.83 - '@react-native/virtualized-lists': 0.74.83(@types/react@18.3.2)(react-native@0.74.1)(react@18.3.1) - '@types/react': 18.3.2 + '@react-native/virtualized-lists': 0.74.83(@types/react@18.3.11)(react-native@0.74.1)(react@18.3.1) + '@types/react': 18.3.11 abort-controller: 3.0.0 anser: 1.4.10 ansi-regex: 5.0.1 @@ -11059,11 +9704,11 @@ packages: '@types/react': 18.3.2 react: 18.3.1 react-style-singleton: 2.2.1(@types/react@18.3.2)(react@18.3.1) - tslib: 2.6.2 + tslib: 2.7.0 dev: false - /react-remove-scroll@2.5.7(@types/react@18.3.2)(react@18.3.1): - resolution: {integrity: sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==} + /react-remove-scroll@2.6.0(@types/react@18.3.2)(react@18.3.1): + resolution: {integrity: sha512-I2U4JVEsQenxDAKaVa3VZ/JeJZe0/2DxPWL8Tj8yLKctQJQiZM52pn/GWFpSp8dftjM3pSAHVJZscAnC/y+ySQ==} engines: {node: '>=10'} peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -11076,7 +9721,7 @@ packages: react: 18.3.1 react-remove-scroll-bar: 2.3.6(@types/react@18.3.2)(react@18.3.1) react-style-singleton: 2.2.1(@types/react@18.3.2)(react@18.3.1) - tslib: 2.6.2 + tslib: 2.7.0 use-callback-ref: 1.3.2(@types/react@18.3.2)(react@18.3.1) use-sidecar: 1.1.2(@types/react@18.3.2)(react@18.3.1) dev: false @@ -11104,7 +9749,7 @@ packages: get-nonce: 1.0.1 invariant: 2.2.4 react: 18.3.1 - tslib: 2.6.2 + tslib: 2.7.0 dev: false /react-transition-state@1.1.5(react-dom@18.3.1)(react@18.3.1): @@ -11115,6 +9760,7 @@ packages: dependencies: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + dev: false /react-use-measure@2.1.1(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-nocZhN26cproIiIduswYpV5y5lQpSQS1y/4KuvUCjSKmw7ZWIS/+g3aFnX3WdBkyuGUtTLif3UTqnLLhbDoQig==} @@ -11125,6 +9771,7 @@ packages: debounce: 1.2.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + dev: false /react@18.3.1: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} @@ -11200,7 +9847,7 @@ packages: ast-types: 0.15.2 esprima: 4.0.1 source-map: 0.6.1 - tslib: 2.6.2 + tslib: 2.7.0 /redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} @@ -11270,16 +9917,12 @@ packages: /resize-observer-polyfill@1.5.1: resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==} + dev: false /resolve-from@3.0.0: resolution: {integrity: sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==} engines: {node: '>=4'} - /resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - dev: true - /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -11319,12 +9962,9 @@ packages: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - /rfdc@1.3.1: - resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==} - dev: true - /rimraf@2.6.3: resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true dependencies: glob: 7.2.3 @@ -11389,7 +10029,7 @@ packages: dependencies: eventemitter3: 4.0.7 uuid: 8.3.2 - ws: 8.17.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) optionalDependencies: bufferutil: 4.0.8 utf-8-validate: 5.0.10 @@ -11514,14 +10154,6 @@ packages: transitivePeerDependencies: - supports-color - /sentence-case@3.0.4: - resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case-first: 2.0.2 - dev: true - /serialize-error@2.1.0: resolution: {integrity: sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==} engines: {node: '>=0.10.0'} @@ -11579,6 +10211,7 @@ packages: /shallowequal@1.1.0: resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} + dev: false /shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} @@ -11633,11 +10266,6 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - /slash@4.0.0: - resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} - engines: {node: '>=12'} - dev: true - /slice-ansi@2.1.0: resolution: {integrity: sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==} engines: {node: '>=6'} @@ -11646,14 +10274,6 @@ packages: astral-regex: 1.0.0 is-fullwidth-code-point: 2.0.0 - /slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - dev: true - /smartwrap@2.0.2: resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} engines: {node: '>=6'} @@ -11667,13 +10287,6 @@ packages: yargs: 15.4.1 dev: true - /snake-case@3.0.4: - resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - /socket.io-client@4.7.5: resolution: {integrity: sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ==} engines: {node: '>=10.0.0'} @@ -11827,15 +10440,6 @@ packages: is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - /string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} - dependencies: - eastasianwidth: 0.2.0 - emoji-regex: 9.2.2 - strip-ansi: 7.1.0 - dev: true - /string.prototype.trim@1.2.9: resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} engines: {node: '>= 0.4'} @@ -11930,7 +10534,8 @@ packages: resolution: {integrity: sha512-08yq36Ikn4kx4YU6RD7jWEv27v4V+PUsOGa4n/as8Et3CuODMJQ00ENeAVXAeydX4Z2j1XHZF1K2sX4mGl18fA==} dependencies: hey-listen: 1.0.8 - tslib: 2.6.2 + tslib: 2.7.0 + dev: false /styled-components@5.3.11(@babel/core@7.24.5)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1): resolution: {integrity: sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==} @@ -11955,6 +10560,7 @@ packages: supports-color: 5.5.0 transitivePeerDependencies: - '@babel/core' + dev: false /sudo-prompt@9.2.1: resolution: {integrity: sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==} @@ -12035,10 +10641,6 @@ packages: resolution: {integrity: sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==} dev: false - /text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true - /thread-stream@0.15.2: resolution: {integrity: sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA==} dependencies: @@ -12095,10 +10697,6 @@ packages: dependencies: is-number: 7.0.0 - /toggle-selection@1.0.6: - resolution: {integrity: sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==} - dev: false - /toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} @@ -12128,23 +10726,15 @@ packages: engines: {node: '>=8'} dev: true - /ts-api-utils@1.3.0(typescript@5.4.5): - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} - engines: {node: '>=16'} - peerDependencies: - typescript: '>=4.2.0' - dependencies: - typescript: 5.4.5 - dev: true - /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} /tslib@2.4.0: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + dev: true - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + /tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} /tty-table@4.2.3: resolution: {integrity: sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==} @@ -12160,13 +10750,6 @@ packages: yargs: 17.7.2 dev: true - /type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - dev: true - /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} @@ -12176,11 +10759,6 @@ packages: engines: {node: '>=10'} dev: true - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - dev: true - /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} @@ -12195,11 +10773,6 @@ packages: engines: {node: '>=8'} dev: true - /type-fest@1.4.0: - resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} - engines: {node: '>=10'} - dev: true - /typed-array-buffer@1.0.2: resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} engines: {node: '>= 0.4'} @@ -12244,12 +10817,6 @@ packages: possible-typed-array-names: 1.0.0 dev: true - /typedarray-to-buffer@3.1.5: - resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} - dependencies: - is-typedarray: 1.0.0 - dev: false - /typescript@5.4.2: resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} engines: {node: '>=14.17'} @@ -12261,6 +10828,12 @@ packages: engines: {node: '>=14.17'} hasBin: true + /typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + /ua-parser-js@1.0.37: resolution: {integrity: sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==} dev: false @@ -12277,7 +10850,6 @@ packages: resolution: {integrity: sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==} dependencies: multiformats: 9.9.0 - dev: false /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -12294,6 +10866,9 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + /undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + /unenv@1.9.0: resolution: {integrity: sha512-QKnFNznRxmbOF1hDgzpqrlIf6NC5sbZ2OJ+5Wl3OX8uM+LUJXbj4TXvLJCtwbPTmbMHCLIz6JLKNinNsMShK9g==} dependencies: @@ -12303,9 +10878,6 @@ packages: node-fetch-native: 1.6.4 pathe: 1.1.2 - /unfetch@4.2.0: - resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==} - /unicode-canonical-property-names-ecmascript@2.0.0: resolution: {integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==} engines: {node: '>=4'} @@ -12393,7 +10965,7 @@ packages: h3: 1.11.1 idb-keyval: 6.2.1 listhen: 1.7.2 - lru-cache: 10.2.2 + lru-cache: 10.4.3 mri: 1.2.0 node-fetch-native: 1.6.4 ofetch: 1.3.4 @@ -12419,18 +10991,6 @@ packages: escalade: 3.1.2 picocolors: 1.0.1 - /upper-case-first@2.0.2: - resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} - dependencies: - tslib: 2.6.2 - dev: true - - /upper-case@2.0.2: - resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==} - dependencies: - tslib: 2.6.2 - dev: true - /uqr@0.1.2: resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==} @@ -12459,7 +11019,7 @@ packages: dependencies: '@types/react': 18.3.2 react: 18.3.1 - tslib: 2.6.2 + tslib: 2.7.0 dev: false /use-sidecar@1.1.2(@types/react@18.3.2)(react@18.3.1): @@ -12475,7 +11035,7 @@ packages: '@types/react': 18.3.2 detect-node-es: 1.1.0 react: 18.3.1 - tslib: 2.6.2 + tslib: 2.7.0 dev: false /use-sync-external-store@1.2.0(react@18.3.1): @@ -12485,13 +11045,6 @@ packages: dependencies: react: 18.3.1 - /use-sync-external-store@1.2.2(react@18.3.1): - resolution: {integrity: sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.3.1 - /utf-8-validate@5.0.10: resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} engines: {node: '>=6.14.2'} @@ -12499,13 +11052,6 @@ packages: dependencies: node-gyp-build: 4.8.1 - /utf-8-validate@6.0.4: - resolution: {integrity: sha512-xu9GQDeFp+eZ6LnCywXN/zBancWvOpUMzgjLPSjy4BRHSmTelvn2E0DG0o1sTiw5hkCKBHo8rwSKncfRfv2EEQ==} - engines: {node: '>=6.14.2'} - requiresBuild: true - dependencies: - node-gyp-build: 4.8.1 - /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -12551,6 +11097,24 @@ packages: engines: {node: '>= 0.10'} dev: true + /valtio@1.11.2(@types/react@18.3.11)(react@18.3.1): + resolution: {integrity: sha512-1XfIxnUXzyswPAPXo1P3Pdx2mq/pIqZICkWN60Hby0d9Iqb+MEIpqgYVlbflvHdrp2YR/q3jyKWRPJJ100yxaw==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=16.8' + react: '>=16.8' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + dependencies: + '@types/react': 18.3.11 + proxy-compare: 2.5.1 + react: 18.3.1 + use-sync-external-store: 1.2.0(react@18.3.1) + dev: true + /valtio@1.11.2(@types/react@18.3.2)(react@18.3.1): resolution: {integrity: sha512-1XfIxnUXzyswPAPXo1P3Pdx2mq/pIqZICkWN60Hby0d9Iqb+MEIpqgYVlbflvHdrp2YR/q3jyKWRPJJ100yxaw==} engines: {node: '>=12.20.0'} @@ -12567,50 +11131,30 @@ packages: proxy-compare: 2.5.1 react: 18.3.1 use-sync-external-store: 1.2.0(react@18.3.1) + dev: false /vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - /viem@1.21.4(typescript@5.4.5)(zod@3.23.8): - resolution: {integrity: sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==} - peerDependencies: - typescript: '>=5.0.4' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@adraffy/ens-normalize': 1.10.0 - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@scure/bip32': 1.3.2 - '@scure/bip39': 1.2.1 - abitype: 0.9.8(typescript@5.4.5)(zod@3.23.8) - isows: 1.0.3(ws@8.13.0) - typescript: 5.4.5 - ws: 8.13.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - zod - - /viem@2.10.5(typescript@5.4.5): - resolution: {integrity: sha512-rzU2y6poYgXu7axcQmwddaJ/nGP3tjtslXdUCu+PvryeXACuuqoyP3chjTEHciG84a663gYbrVGbxNUFA3aURQ==} + /viem@2.21.32(typescript@5.4.5)(zod@3.23.8): + resolution: {integrity: sha512-2oXt5JNIb683oy7C8wuIJ/SeL3XtHVMEQpy1U2TA6WMnJQ4ScssRvyPwYLcaP6mKlrGXE/cR/V7ncWpvLUVPYQ==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: typescript: optional: true dependencies: - '@adraffy/ens-normalize': 1.10.0 - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@scure/bip32': 1.3.2 - '@scure/bip39': 1.2.1 - abitype: 1.0.0(typescript@5.4.5) - isows: 1.0.3(ws@8.13.0) + '@adraffy/ens-normalize': 1.11.0 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@scure/bip32': 1.5.0 + '@scure/bip39': 1.4.0 + abitype: 1.0.6(typescript@5.4.5)(zod@3.23.8) + isows: 1.0.6(ws@8.18.0) typescript: 5.4.5 - ws: 8.13.0 + webauthn-p256: 0.0.10 + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -12791,10 +11335,6 @@ packages: /vlq@1.0.1: resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==} - /void-elements@3.1.0: - resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} - engines: {node: '>=0.10.0'} - /vue-template-compiler@2.7.16: resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} dependencies: @@ -12821,53 +11361,8 @@ packages: xml-name-validator: 5.0.0 dev: true - /wagmi@1.4.13(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)(typescript@5.4.5)(viem@1.21.4): - resolution: {integrity: sha512-AScVYFjqNt1wMgL99Bob7MLdhoTZ3XKiOZL5HVBdy4W1sh7QodA3gQ8IsmTuUrQ7oQaTxjiXEhwg7sWNrPBvJA==} - peerDependencies: - react: '>=17.0.0' - typescript: '>=5.0.4' - viem: '>=0.3.35' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@tanstack/query-sync-storage-persister': 4.36.1 - '@tanstack/react-query': 4.29.1(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) - '@tanstack/react-query-persist-client': 4.36.1(@tanstack/react-query@4.29.1) - '@wagmi/core': 1.4.13(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@1.21.4) - abitype: 0.8.7(typescript@5.4.5)(zod@3.23.8) - react: 18.3.1 - typescript: 5.4.5 - use-sync-external-store: 1.2.2(react@18.3.1) - viem: 1.21.4(typescript@5.4.5)(zod@3.23.8) - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@types/react' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - encoding - - immer - - ioredis - - react-dom - - react-native - - supports-color - - uWebSockets.js - - utf-8-validate - - zod - dev: false - - /wagmi@2.8.7(@tanstack/react-query@4.29.1)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5): - resolution: {integrity: sha512-IHnX2KzN8eENyKoWWd/bdtYuc2xDSvuN2xAw0S5X/I/Po6YO5GR1QbD/JvNmUmJem0napzhKFa8Pamh7Tk97fg==} + /wagmi@2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.11)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32): + resolution: {integrity: sha512-U7UCQQL38ed2AaAMFwfSYjSFW94CwAbf/+ntaG43z1U5i8jdrxh85tP7rcpMWgnd7510/S3Gje0m7uTIS3iYFw==} peerDependencies: '@tanstack/react-query': '>=5.0.0' react: '>=18' @@ -12877,13 +11372,13 @@ packages: typescript: optional: true dependencies: - '@tanstack/react-query': 4.29.1(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1) - '@wagmi/connectors': 4.3.9(@types/react@18.3.2)(@wagmi/core@2.9.7)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) - '@wagmi/core': 2.9.7(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) + '@tanstack/react-query': 5.59.15(react@18.3.1) + '@wagmi/connectors': 5.2.2(@types/react@18.3.11)(@wagmi/core@2.13.9)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) + '@wagmi/core': 2.13.9(@types/react@18.3.11)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) react: 18.3.1 typescript: 5.4.5 use-sync-external-store: 1.2.0(react@18.3.1) - viem: 2.10.5(typescript@5.4.5) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -12904,7 +11399,6 @@ packages: - immer - ioredis - react-dom - - react-i18next - react-native - rollup - supports-color @@ -12913,8 +11407,8 @@ packages: - zod dev: true - /wagmi@2.8.7(@tanstack/react-query@5.36.0)(@types/react@18.3.2)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5): - resolution: {integrity: sha512-IHnX2KzN8eENyKoWWd/bdtYuc2xDSvuN2xAw0S5X/I/Po6YO5GR1QbD/JvNmUmJem0napzhKFa8Pamh7Tk97fg==} + /wagmi@2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32): + resolution: {integrity: sha512-U7UCQQL38ed2AaAMFwfSYjSFW94CwAbf/+ntaG43z1U5i8jdrxh85tP7rcpMWgnd7510/S3Gje0m7uTIS3iYFw==} peerDependencies: '@tanstack/react-query': '>=5.0.0' react: '>=18' @@ -12924,13 +11418,13 @@ packages: typescript: optional: true dependencies: - '@tanstack/react-query': 5.36.0(react@18.3.1) - '@wagmi/connectors': 4.3.9(@types/react@18.3.2)(@wagmi/core@2.9.7)(react-dom@18.3.1)(react-i18next@13.5.0)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) - '@wagmi/core': 2.9.7(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.10.5) + '@tanstack/react-query': 5.59.15(react@18.3.1) + '@wagmi/connectors': 5.2.2(@types/react@18.3.2)(@wagmi/core@2.13.9)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) + '@wagmi/core': 2.13.9(@types/react@18.3.2)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) react: 18.3.1 typescript: 5.4.5 use-sync-external-store: 1.2.0(react@18.3.1) - viem: 2.10.5(typescript@5.4.5) + viem: 2.21.32(typescript@5.4.5)(zod@3.23.8) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -12951,7 +11445,6 @@ packages: - immer - ioredis - react-dom - - react-i18next - react-native - rollup - supports-color @@ -12970,10 +11463,11 @@ packages: dependencies: defaults: 1.0.4 - /web-streams-polyfill@3.3.3: - resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} - engines: {node: '>= 8'} - dev: true + /webauthn-p256@0.0.10: + resolution: {integrity: sha512-EeYD+gmIT80YkSIDb2iWq0lq2zbHo1CxHlQTeJ+KkCILWpVy3zASH3ByD4bopzfk0uCwXxLqKGLqp2W4O28VFA==} + dependencies: + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 /webextension-polyfill@0.10.0: resolution: {integrity: sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g==} @@ -13069,11 +11563,6 @@ packages: stackback: 0.0.2 dev: true - /word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} - dev: true - /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -13090,15 +11579,6 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 - /wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} - engines: {node: '>=12'} - dependencies: - ansi-styles: 6.2.1 - string-width: 5.1.2 - strip-ansi: 7.1.0 - dev: true - /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -13158,8 +11638,8 @@ packages: utf-8-validate: optional: true - /ws@8.13.0: - resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + /ws@8.17.0: + resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -13169,9 +11649,23 @@ packages: optional: true utf-8-validate: optional: true + dev: true - /ws@8.17.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): - resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==} + /ws@8.17.1: + resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false + + /ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -13196,6 +11690,7 @@ packages: optional: true utf-8-validate: optional: true + dev: true /xml-name-validator@5.0.0: resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} @@ -13232,11 +11727,6 @@ packages: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true - /yaml@2.3.1: - resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} - engines: {node: '>= 14'} - dev: true - /yaml@2.4.2: resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} engines: {node: '>= 14'} @@ -13323,7 +11813,7 @@ packages: /zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} - /zustand@4.4.1(@types/react@18.3.2)(react@18.3.1): + /zustand@4.4.1(@types/react@18.3.11)(react@18.3.1): resolution: {integrity: sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==} engines: {node: '>=12.7.0'} peerDependencies: @@ -13338,16 +11828,17 @@ packages: react: optional: true dependencies: - '@types/react': 18.3.2 + '@types/react': 18.3.11 react: 18.3.1 use-sync-external-store: 1.2.0(react@18.3.1) + dev: true - /zustand@4.5.2(@types/react@18.3.2)(react@18.3.1): - resolution: {integrity: sha512-2cN1tPkDVkwCy5ickKrI7vijSjPksFRfqS6237NzT0vqSsztTNnQdHw9mmN7uBdk3gceVXU0a+21jFzFzAc9+g==} + /zustand@4.4.1(@types/react@18.3.2)(react@18.3.1): + resolution: {integrity: sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==} engines: {node: '>=12.7.0'} peerDependencies: '@types/react': '>=16.8' - immer: '>=9.0.6' + immer: '>=9.0' react: '>=16.8' peerDependenciesMeta: '@types/react': From 99410c5bf20390550a0286e240abc48027bee008 Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Mon, 21 Oct 2024 16:40:12 -0700 Subject: [PATCH 2/8] Add biome config + format --- .husky/pre-push | 2 +- biome.json | 38 + .../vite-wagmi-ethers-rainbowkit/package.json | 1 + examples/vite-wagmi-ethers/package.json | 1 + examples/vite-wagmi-ethers6/package.json | 1 + examples/vite-wagmi-viem/package.json | 1 + packages/sdk/abis/ERC1155.ts | 4 +- packages/sdk/abis/ERC20.ts | 4 +- packages/sdk/abis/ERC721.ts | 4 +- packages/sdk/abis/MultiCallAuthenticated.ts | 4 +- packages/sdk/abis/index.ts | 14 +- packages/sdk/package.json | 2 +- packages/sdk/src/TokenboundClient.ts | 323 ++++---- packages/sdk/src/constants/crossChain.ts | 16 +- .../src/constants/eip1167Implementation.ts | 2 +- packages/sdk/src/constants/index.ts | 10 +- packages/sdk/src/constants/interfaces.ts | 2 +- packages/sdk/src/constants/multicall.ts | 4 +- .../sdk/src/constants/tokenboundAddresses.ts | 20 +- packages/sdk/src/functions/crossChain.ts | 40 +- packages/sdk/src/functions/index.ts | 6 +- packages/sdk/src/functions/viemV2.ts | 82 +- packages/sdk/src/functions/viemV3.ts | 60 +- packages/sdk/src/index.ts | 12 +- packages/sdk/src/test/TestAll.test.ts | 737 +++++++++--------- packages/sdk/src/test/config/anvil.ts | 10 +- packages/sdk/src/test/config/base.ts | 2 +- packages/sdk/src/test/config/index.ts | 6 +- packages/sdk/src/test/config/mints.ts | 10 +- packages/sdk/src/test/config/setup.ts | 2 +- packages/sdk/src/test/config/shell.ts | 2 +- packages/sdk/src/test/constants/addresses.ts | 4 +- packages/sdk/src/test/constants/anvil.ts | 10 +- packages/sdk/src/test/constants/index.ts | 6 +- packages/sdk/src/test/constants/regexes.ts | 2 +- packages/sdk/src/test/mockWallet.tsx | 20 +- packages/sdk/src/test/types/index.ts | 2 +- packages/sdk/src/test/types/testers.ts | 4 +- packages/sdk/src/test/utils/clients.ts | 12 +- packages/sdk/src/test/utils/debug.ts | 12 +- packages/sdk/src/test/utils/ethToWei.ts | 4 +- packages/sdk/src/test/utils/getAnvilLogs.ts | 4 +- packages/sdk/src/test/utils/getWETHBalance.ts | 16 +- .../sdk/src/test/utils/getZora1155Balance.ts | 18 +- .../sdk/src/test/utils/getZora721Balance.ts | 18 +- packages/sdk/src/test/utils/index.ts | 16 +- packages/sdk/src/test/utils/shellCommand.ts | 14 +- .../sdk/src/test/wagmi-cli-hooks/generated.ts | 48 +- .../sdk/src/types/abstractEthersSigner.ts | 4 +- .../abstractEthersTransactionResponse.ts | 4 +- packages/sdk/src/types/addresses.ts | 2 +- packages/sdk/src/types/anvilAccount.ts | 8 +- packages/sdk/src/types/callData.ts | 8 +- packages/sdk/src/types/contractABIPair.ts | 8 +- packages/sdk/src/types/erc6551Bytecode.ts | 16 +- packages/sdk/src/types/index.ts | 24 +- packages/sdk/src/types/messages.ts | 14 +- packages/sdk/src/types/multicall.ts | 12 +- packages/sdk/src/types/operations.ts | 4 +- packages/sdk/src/types/params.ts | 151 ++-- packages/sdk/src/types/prettify.ts | 4 +- packages/sdk/src/utils/addressToUint8Array.ts | 8 +- packages/sdk/src/utils/chainIdToChain.ts | 10 +- .../sdk/src/utils/getImplementationName.ts | 8 +- packages/sdk/src/utils/index.ts | 14 +- packages/sdk/src/utils/messageTypeguards.ts | 10 +- .../sdk/src/utils/normalizeEthersMessage.ts | 8 +- packages/sdk/src/utils/resolvePossibleENS.ts | 14 +- packages/sdk/src/utils/segmentBytecode.ts | 12 +- packages/sdk/vite.config.ts | 10 +- packages/sdk/vitest.config.ts | 4 +- packages/sdk/wagmi.config.ts | 10 +- pnpm-lock.yaml | 12 + 73 files changed, 1026 insertions(+), 985 deletions(-) create mode 100644 biome.json diff --git a/.husky/pre-push b/.husky/pre-push index a5a29d9..67e2f4c 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -pnpm lint-staged +pnpm lint:fix diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..c2e501b --- /dev/null +++ b/biome.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "files": { + "ignore": [ + "node_modules/*", + "dist/**/*" + ] + }, + "formatter": { + "enabled": true, + "formatWithErrors": false, + "indentStyle": "tab", + "lineWidth": 80 + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "correctness": { + "noUnusedImports": "error" + }, + "suspicious": { + "noArrayIndexKey": "off", + "noExplicitAny": "off" + } + } + }, + "javascript": { + "formatter": { + "trailingCommas": "all", + "semicolons": "asNeeded", + "arrowParentheses": "always" + } + } +} diff --git a/examples/vite-wagmi-ethers-rainbowkit/package.json b/examples/vite-wagmi-ethers-rainbowkit/package.json index 39e9967..5c0d79b 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/package.json +++ b/examples/vite-wagmi-ethers-rainbowkit/package.json @@ -23,6 +23,7 @@ "wagmi": "^2.12.20" }, "devDependencies": { + "@biomejs/biome": "1.9.4", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.4", diff --git a/examples/vite-wagmi-ethers/package.json b/examples/vite-wagmi-ethers/package.json index cdc8b4d..e8f1600 100644 --- a/examples/vite-wagmi-ethers/package.json +++ b/examples/vite-wagmi-ethers/package.json @@ -23,6 +23,7 @@ "wagmi": "^2.12.20" }, "devDependencies": { + "@biomejs/biome": "1.9.4", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.4", diff --git a/examples/vite-wagmi-ethers6/package.json b/examples/vite-wagmi-ethers6/package.json index 87b5ca5..afb1c32 100644 --- a/examples/vite-wagmi-ethers6/package.json +++ b/examples/vite-wagmi-ethers6/package.json @@ -22,6 +22,7 @@ "wagmi": "^2.12.20" }, "devDependencies": { + "@biomejs/biome": "1.9.4", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.4", diff --git a/examples/vite-wagmi-viem/package.json b/examples/vite-wagmi-viem/package.json index 50455b2..65af749 100644 --- a/examples/vite-wagmi-viem/package.json +++ b/examples/vite-wagmi-viem/package.json @@ -22,6 +22,7 @@ "wagmi": "^2.12.20" }, "devDependencies": { + "@biomejs/biome": "1.9.4", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.4", diff --git a/packages/sdk/abis/ERC1155.ts b/packages/sdk/abis/ERC1155.ts index 325f836..749edd7 100644 --- a/packages/sdk/abis/ERC1155.ts +++ b/packages/sdk/abis/ERC1155.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem"; +import { Abi } from "viem" export const erc1155Abi = [ { @@ -34,4 +34,4 @@ export const erc1155Abi = [ stateMutability: "nonpayable", type: "function", }, -] as Abi; +] as Abi diff --git a/packages/sdk/abis/ERC20.ts b/packages/sdk/abis/ERC20.ts index cc1eb4a..4effb2a 100644 --- a/packages/sdk/abis/ERC20.ts +++ b/packages/sdk/abis/ERC20.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem"; +import { Abi } from "viem" export const erc20Abi = [ { @@ -95,4 +95,4 @@ export const erc20Abi = [ name: "transferFrom", outputs: [{ name: "", type: "bool" }], }, -] as Abi; +] as Abi diff --git a/packages/sdk/abis/ERC721.ts b/packages/sdk/abis/ERC721.ts index cf97220..4819b9a 100644 --- a/packages/sdk/abis/ERC721.ts +++ b/packages/sdk/abis/ERC721.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem"; +import { Abi } from "viem" export const erc721Abi = [ { @@ -24,4 +24,4 @@ export const erc721Abi = [ stateMutability: "nonpayable", type: "function", }, -] as Abi; +] as Abi diff --git a/packages/sdk/abis/MultiCallAuthenticated.ts b/packages/sdk/abis/MultiCallAuthenticated.ts index d42587e..164b561 100644 --- a/packages/sdk/abis/MultiCallAuthenticated.ts +++ b/packages/sdk/abis/MultiCallAuthenticated.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem"; +import { Abi } from "viem" export const multicall3AuthenticatedABI = [ { @@ -237,4 +237,4 @@ export const multicall3AuthenticatedABI = [ stateMutability: "payable", type: "function", }, -] as Abi; +] as Abi diff --git a/packages/sdk/abis/index.ts b/packages/sdk/abis/index.ts index 9189503..589f808 100644 --- a/packages/sdk/abis/index.ts +++ b/packages/sdk/abis/index.ts @@ -1,9 +1,9 @@ -import erc6551RegistryAbiV2 from "./ERC6551RegistryV2.json"; -import erc6551AccountAbiV2 from "./IERC6551AccountV2.json"; -import { erc1155Abi } from "./ERC1155"; -import { erc721Abi } from "./ERC721"; -import { erc20Abi } from "./ERC20"; -import { multicall3AuthenticatedABI } from "./MultiCallAuthenticated"; +import erc6551RegistryAbiV2 from "./ERC6551RegistryV2.json" +import erc6551AccountAbiV2 from "./IERC6551AccountV2.json" +import { erc1155Abi } from "./ERC1155" +import { erc721Abi } from "./ERC721" +import { erc20Abi } from "./ERC20" +import { multicall3AuthenticatedABI } from "./MultiCallAuthenticated" export { erc6551RegistryAbiV2, @@ -12,4 +12,4 @@ export { erc721Abi, erc20Abi, multicall3AuthenticatedABI, -}; +} diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 834cdd9..5e5824e 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@biomejs/biome": "1.9.4", - "@tanstack/react-query": "^5.59.15", + "@tanstack/react-query": "^5.59.15", "@testing-library/dom": "^10.1.0", "@testing-library/jest-dom": "^6.4.2", "@testing-library/react": "^15.0.4", diff --git a/packages/sdk/src/TokenboundClient.ts b/packages/sdk/src/TokenboundClient.ts index efe6470..8aeb9bf 100644 --- a/packages/sdk/src/TokenboundClient.ts +++ b/packages/sdk/src/TokenboundClient.ts @@ -13,13 +13,13 @@ import { isAddressEqual, numberToHex, custom, -} from "viem"; +} from "viem" import { erc1155Abi, erc721Abi, erc20Abi, multicall3AuthenticatedABI, -} from "../abis"; +} from "../abis" import { getAccount, computeAccount, @@ -31,7 +31,7 @@ import { getTokenboundV3Account, prepareCreateTokenboundV3Account, encodeCrossChainCall, -} from "./functions"; +} from "./functions" import { AbstractEthersSigner, AbstractEthersTransactionResponse, @@ -57,7 +57,7 @@ import { ValidSignerParams, MultiCallTx, CallData, -} from "./types"; +} from "./types" import { chainIdToChain, segmentBytecode, @@ -67,30 +67,30 @@ import { isViemSignableMessage, resolvePossibleENS, getImplementationName, -} from "./utils"; +} from "./utils" import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2, MULTICALL_AUTHENTICATED_ADDRESS, -} from "./constants"; -import { version as TB_SDK_VERSION } from "../package.json"; +} from "./constants" +import { version as TB_SDK_VERSION } from "../package.json" declare global { interface Window { - tokenboundSDK?: string; + tokenboundSDK?: string } } class TokenboundClient { - private chainId: number; - private chain: Chain; - public isInitialized: boolean = false; - public publicClient: PublicClient; - private supportsV3: boolean = true; // Default to V3 implementation - private signer?: AbstractEthersSigner; - private walletClient?: WalletClient; - private implementationAddress: `0x${string}`; - private registryAddress: `0x${string}`; + private chainId: number + private chain: Chain + public isInitialized: boolean = false + public publicClient: PublicClient + private supportsV3: boolean = true // Default to V3 implementation + private signer?: AbstractEthersSigner + private walletClient?: WalletClient + private implementationAddress: `0x${string}` + private registryAddress: `0x${string}` constructor(options: TokenboundClientOptions) { const { @@ -103,31 +103,31 @@ class TokenboundClient { registryAddress, publicClientRPCUrl, version, - } = options; + } = options if (!chainId && !chain) { - throw new Error("chain or chainId required."); + throw new Error("chain or chainId required.") } if (signer && walletClient) { throw new Error( "Only one of `signer` or `walletClient` should be provided.", - ); + ) } if (publicClient && publicClientRPCUrl) { throw new Error( "Only one of `publicClient` or `publicClientRPCUrl` should be provided.", - ); + ) } - this.chainId = chainId ?? chain!.id; - this.chain = chain ?? chainIdToChain(this.chainId); + this.chainId = chainId ?? chain!.id + this.chain = chain ?? chainIdToChain(this.chainId) if (signer) { - this.signer = signer; + this.signer = signer } else if (walletClient) { - this.walletClient = walletClient; + this.walletClient = walletClient } // Use a custom publicClient if provided @@ -141,11 +141,11 @@ class TokenboundClient { walletClient && !publicClientRPCUrl ? custom(walletClient.transport) : http(publicClientRPCUrl ?? undefined), - }); + }) - this.registryAddress = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS; + this.registryAddress = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS this.implementationAddress = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS; + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS // If legacy V2 implementation is in use, use V2 registry (unless custom registry is provided) const isV2 = @@ -154,19 +154,19 @@ class TokenboundClient { isAddressEqual( implementationAddress, ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS, - )); + )) if (isV2) { - this.supportsV3 = false; + this.supportsV3 = false if (!registryAddress) - this.registryAddress = ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; + this.registryAddress = ERC_6551_LEGACY_V2.REGISTRY.ADDRESS } - this.isInitialized = true; + this.isInitialized = true if (typeof window !== "undefined") { - const implementationName = getImplementationName(implementationAddress); - window.tokenboundSDK = `Tokenbound SDK ${TB_SDK_VERSION} - ${implementationName}`; + const implementationName = getImplementationName(implementationAddress) + window.tokenboundSDK = `Tokenbound SDK ${TB_SDK_VERSION} - ${implementationName}` } } @@ -175,7 +175,7 @@ class TokenboundClient { * @returns The version of the SDK. */ public getSDKVersion(): string { - return TB_SDK_VERSION; + return TB_SDK_VERSION } /** @@ -185,10 +185,10 @@ class TokenboundClient { * @returns The tokenbound account address. */ public getAccount(params: GetAccountParams): `0x${string}` { - const { tokenContract, tokenId, salt = 0, chainId = this.chainId } = params; + const { tokenContract, tokenId, salt = 0, chainId = this.chainId } = params try { - const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount; + const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount return getAcct( tokenContract, tokenId, @@ -196,9 +196,9 @@ class TokenboundClient { this.implementationAddress, this.registryAddress, salt, - ); + ) } catch (error) { - throw error; + throw error } } @@ -217,9 +217,9 @@ class TokenboundClient { salt = 0, chainId = this.chainId, appendedCalls = [], - } = params; + } = params - const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount; + const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount const computedAcct = getAcct( tokenContract, @@ -228,16 +228,16 @@ class TokenboundClient { this.implementationAddress, this.registryAddress, salt, - ); + ) const isCustomImplementation = ![ ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS, ERC_6551_DEFAULT.IMPLEMENTATION.ADDRESS, - ].includes(getAddress(this.implementationAddress)); + ].includes(getAddress(this.implementationAddress)) const prepareBasicCreateAccount = this.supportsV3 ? prepareCreateTokenboundV3Account - : prepareCreateAccount; + : prepareCreateAccount const preparedBasicCreateAccount = await prepareBasicCreateAccount( tokenContract, @@ -246,7 +246,7 @@ class TokenboundClient { this.implementationAddress, this.registryAddress, salt, - ); + ) if ( appendedCalls.length > 0 && @@ -254,12 +254,12 @@ class TokenboundClient { ) { throw new Error( "Multicall via appendedCalls is not supported using the legacy V2 implementation or custom implementations", - ); + ) } if (isCustomImplementation) { // Don't initialize for custom implementations. Allow third-party handling of initialization. - return preparedBasicCreateAccount; + return preparedBasicCreateAccount } else { // For standard implementations, use the multicall3 aggregate function to create and initialize the account in one transaction return { @@ -290,7 +290,7 @@ class TokenboundClient { ], ], }), - } as MultiCallTx; + } as MultiCallTx } } @@ -309,12 +309,12 @@ class TokenboundClient { salt = 0, chainId = this.chainId, appendedCalls = [], - } = params; + } = params try { - let txHash: `0x${string}` | undefined; + let txHash: `0x${string}` | undefined - const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount; + const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount const computedAcct = getAcct( tokenContract, @@ -323,7 +323,7 @@ class TokenboundClient { this.implementationAddress, this.registryAddress, salt, - ); + ) const preparedCreateAccount = await this.prepareCreateAccount({ tokenContract, @@ -331,14 +331,14 @@ class TokenboundClient { chainId, salt, appendedCalls, - }); + }) if (this.signer) { txHash = (await this.signer .sendTransaction(preparedCreateAccount) .then( (tx: AbstractEthersTransactionResponse) => tx.hash, - )) as `0x${string}`; + )) as `0x${string}` } else if (this.walletClient) { txHash = this.supportsV3 ? await this.walletClient.sendTransaction({ @@ -354,19 +354,19 @@ class TokenboundClient { this.registryAddress, salt, chainId, - ); + ) } if (txHash) { return { account: computedAcct, txHash, - }; + } } else { - throw new Error("No wallet client or signer available."); + throw new Error("No wallet client or signer available.") } } catch (error) { - throw error; + throw error } } @@ -385,11 +385,11 @@ class TokenboundClient { if (this.supportsV3) { throw new Error( "prepareExecuteCall() is not supported on V3 implementation deployments, use prepareExecute() instead.", - ); + ) } - const { account, to, value, data } = params; - return prepareExecuteCall(account, to, value, data); + const { account, to, value, data } = params + return prepareExecuteCall(account, to, value, data) } /** @@ -402,12 +402,12 @@ class TokenboundClient { * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use execute() instead. */ public async executeCall(params: ExecuteCallParams): Promise<`0x${string}`> { - const preparedExecuteCall = await this.prepareExecuteCall(params); + const preparedExecuteCall = await this.prepareExecuteCall(params) if (this.supportsV3) { throw new Error( "executeCall() is not supported on V3 implementation deployments, use execute() instead.", - ); + ) } try { if (this.signer) { @@ -415,7 +415,7 @@ class TokenboundClient { .sendTransaction(preparedExecuteCall) .then( (tx: AbstractEthersTransactionResponse) => tx.hash, - )) as `0x${string}`; + )) as `0x${string}` } else if (this.walletClient) { return await this.walletClient.sendTransaction({ // chain and account need to be added explicitly @@ -423,12 +423,12 @@ class TokenboundClient { chain: this.chain, account: this.walletClient.account!, ...preparedExecuteCall, - }); + }) } else { - throw new Error("No wallet client or signer available."); + throw new Error("No wallet client or signer available.") } } catch (error) { - throw error; + throw error } } @@ -444,16 +444,16 @@ class TokenboundClient { params: PrepareExecutionParams, ): Promise { // operation?: CallOperation // The type of operation to perform ( CALL: 0, DELEGATECALL: 1, CREATE: 2, CREATE2: 3) - const { account, to, value, data, chainId = this.chainId } = params; - const operation = CALL_OPERATIONS.CALL; + const { account, to, value, data, chainId = this.chainId } = params + const operation = CALL_OPERATIONS.CALL if (!this.supportsV3) { // const { operation, ...rest } = params - return await this.prepareExecuteCall(params); + return await this.prepareExecuteCall(params) } - let executionArgs = [to, value, data, operation]; - let executionValue = 0n; + let executionArgs = [to, value, data, operation] + let executionValue = 0n // Handle cross-chain call encoding if (this.chainId !== chainId) { @@ -469,28 +469,23 @@ class TokenboundClient { data: data as `0x${string}`, originChainId: this.chainId, destinationChainId: chainId, - }); - - executionArgs = [ - crossChainTo, - crossChainValue, - crossChainData, - operation, - ]; - executionValue = crossChainValue; + }) + + executionArgs = [crossChainTo, crossChainValue, crossChainData, operation] + executionValue = crossChainValue } const executionData = encodeFunctionData({ abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, functionName: "execute", args: executionArgs, - }); + }) return { to: account, value: executionValue, data: executionData, - }; + } } /** @@ -505,17 +500,17 @@ class TokenboundClient { try { if (!this.supportsV3) { // const { operation, ...rest } = params - return await this.executeCall(params); + return await this.executeCall(params) } - const preparedExecution = await this.prepareExecution(params); + const preparedExecution = await this.prepareExecution(params) if (this.signer) { return (await this.signer .sendTransaction(preparedExecution) .then( (tx: AbstractEthersTransactionResponse) => tx.hash, - )) as `0x${string}`; + )) as `0x${string}` } else if (this.walletClient) { return await this.walletClient.sendTransaction({ // chain and account need to be added explicitly @@ -523,12 +518,12 @@ class TokenboundClient { chain: this.chain, account: this.walletClient.account!, ...preparedExecution, - }); + }) } else { - throw new Error("No wallet client or signer available."); + throw new Error("No wallet client or signer available.") } } catch (error) { - throw error; + throw error } } @@ -538,21 +533,21 @@ class TokenboundClient { * @returns a Promise that resolves to true if the account is a valid signer, otherwise false */ public async isValidSigner({ account }: ValidSignerParams): Promise { - const { signer, walletClient } = this; - const data = numberToHex(0, { size: 32 }); - const VALID_SIGNER_MAGIC_VALUE = "0x523e3260"; // isValidSigner MUST return this bytes4 magic value if the given signer is valid + const { signer, walletClient } = this + const data = numberToHex(0, { size: 32 }) + const VALID_SIGNER_MAGIC_VALUE = "0x523e3260" // isValidSigner MUST return this bytes4 magic value if the given signer is valid const walletAddress: `0x${string}` = - walletClient?.account?.address ?? signer?.address; + walletClient?.account?.address ?? signer?.address try { if (!signer && !walletClient) { - throw new Error("No signer or wallet client available."); + throw new Error("No signer or wallet client available.") } if (!this.supportsV3) { throw new Error( "isValidSigner is not supported using the V2 implementation", - ); + ) } const validityCheck = await this.publicClient.readContract({ @@ -560,11 +555,11 @@ class TokenboundClient { abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, functionName: "isValidSigner", args: [walletAddress, data], - }); + }) - return validityCheck === VALID_SIGNER_MAGIC_VALUE; + return validityCheck === VALID_SIGNER_MAGIC_VALUE } catch (error) { - throw error; + throw error } } @@ -580,10 +575,10 @@ class TokenboundClient { return await this.publicClient .getBytecode({ address: accountAddress }) .then((bytecode: GetBytecodeReturnType) => { - return !!bytecode ? bytecode.length > 2 : false; - }); + return !!bytecode ? bytecode.length > 2 : false + }) } catch (error) { - throw error; + throw error } } @@ -598,10 +593,10 @@ class TokenboundClient { try { const rawBytecode = await this.publicClient.getBytecode({ address: accountAddress, - }); - const bytecode = rawBytecode?.slice(2); + }) + const bytecode = rawBytecode?.slice(2) - if (!bytecode || !rawBytecode || !(rawBytecode.length > 2)) return null; + if (!bytecode || !rawBytecode || !(rawBytecode.length > 2)) return null const [ erc1167Header, @@ -611,20 +606,20 @@ class TokenboundClient { rawChainId, rawTokenContract, rawTokenId, - ] = segmentBytecode(bytecode, 10, 20, 15, 32, 32, 32, 32); + ] = segmentBytecode(bytecode, 10, 20, 15, 32, 32, 32, 32) - const chainId = hexToNumber(`0x${rawChainId}`, { size: 32 }); + const chainId = hexToNumber(`0x${rawChainId}`, { size: 32 }) const implementationAddress: `0x${string}` = getAddress( `0x${rawImplementationAddress}`, - ); - const salt = hexToNumber(`0x${rawSalt}`, { size: 32 }); + ) + const salt = hexToNumber(`0x${rawSalt}`, { size: 32 }) const tokenContract: `0x${string}` = getAddress( `0x${rawTokenContract.slice( rawTokenContract.length - 40, rawTokenContract.length, )}`, - ); - const tokenId = hexToNumber(`0x${rawTokenId}`, { size: 32 }).toString(); + ) + const tokenId = hexToNumber(`0x${rawTokenId}`, { size: 32 }).toString() return { erc1167Header, @@ -634,9 +629,9 @@ class TokenboundClient { tokenId, tokenContract, chainId, - }; + } } catch (error) { - throw error; + throw error } } @@ -651,21 +646,21 @@ class TokenboundClient { try { const deconstructedBytecode = await this.deconstructBytecode({ accountAddress, - }); + }) if (!deconstructedBytecode) throw new Error( "The tokenbound account has not been deployed at this address", - ); + ) - const { chainId, tokenContract, tokenId } = deconstructedBytecode; + const { chainId, tokenContract, tokenId } = deconstructedBytecode return { tokenContract, tokenId, chainId, - }; + } } catch (error) { - throw error; + throw error } } @@ -688,54 +683,52 @@ class TokenboundClient { amount = 1, recipientAddress, chainId, - } = params; + } = params - const is1155: boolean = tokenType === NFTTokenType.ERC1155; + const is1155: boolean = tokenType === NFTTokenType.ERC1155 if (!is1155 && amount !== 1) { - throw new Error( - "ERC721 transfers can only transfer one token at a time.", - ); + throw new Error("ERC721 transfers can only transfer one token at a time.") } try { const recipient = await resolvePossibleENS( this.publicClient, recipientAddress, - ); + ) // Configure required args based on token type // ERC1155: safeTransferFrom(address,address,uint256,uint256,bytes) // ERC721: safeTransferFrom(address,address,uint256) - const sharedArgs = [tbAccountAddress, recipient, tokenId]; + const sharedArgs = [tbAccountAddress, recipient, tokenId] const transferArgs: unknown[] = is1155 ? [...sharedArgs, amount, "0x"] - : sharedArgs; + : sharedArgs const transferCallData = encodeFunctionData({ abi: is1155 ? erc1155Abi : erc721Abi, functionName: "safeTransferFrom", args: transferArgs, - }); + }) const execution = { account: tbAccountAddress, to: tokenContract, value: BigInt(0), data: transferCallData, - }; + } if (this.supportsV3) { return await this.execute({ ...execution, chainId, - }); + }) } - return await this.executeCall(execution); + return await this.executeCall(execution) } catch (error) { - console.log(error); - throw error; + console.log(error) + throw error } } @@ -752,32 +745,32 @@ class TokenboundClient { amount, recipientAddress, chainId, - } = params; - const weiValue = parseUnits(`${amount}`, 18); // convert ETH to wei + } = params + const weiValue = parseUnits(`${amount}`, 18) // convert ETH to wei try { const recipient = await resolvePossibleENS( this.publicClient, recipientAddress, - ); + ) const execution = { account: tbAccountAddress, to: recipient, value: weiValue, data: "0x", - }; + } if (this.supportsV3) { return await this.execute({ ...execution, chainId, - }); + }) } - return await this.executeCall(execution); + return await this.executeCall(execution) } catch (err) { - console.log(err); - throw err; + console.log(err) + throw err } } @@ -800,44 +793,42 @@ class TokenboundClient { erc20tokenAddress, erc20tokenDecimals, chainId, - } = params; + } = params if (erc20tokenDecimals < 0 || erc20tokenDecimals > 18) - throw new Error( - "Decimal value out of range. Should be between 0 and 18.", - ); + throw new Error("Decimal value out of range. Should be between 0 and 18.") - const amountBaseUnit = parseUnits(`${amount}`, erc20tokenDecimals); + const amountBaseUnit = parseUnits(`${amount}`, erc20tokenDecimals) try { const recipient = await resolvePossibleENS( this.publicClient, recipientAddress, - ); + ) const callData = encodeFunctionData({ abi: erc20Abi, functionName: "transfer", args: [recipient, amountBaseUnit], - }); + }) const execution = { account: tbAccountAddress, to: erc20tokenAddress, value: 0n, data: callData, - }; + } if (this.supportsV3) { return await this.execute({ ...execution, chainId, - }); + }) } - return await this.executeCall(execution); + return await this.executeCall(execution) } catch (error) { - console.log(error); - throw error; + console.log(error) + throw error } } @@ -847,39 +838,39 @@ class TokenboundClient { * @returns a Promise that resolves to a signed Hex string */ public async signMessage(params: SignMessageParams): Promise<`0x${string}`> { - const { message } = params; + const { message } = params try { if (this.signer) { // Normalize message for Ethers 5 and 6 compatibility if (!isEthers5SignableMessage && !isEthers6SignableMessage) { - throw new Error("Message is not a valid Ethers signable message."); + throw new Error("Message is not a valid Ethers signable message.") } const normalizedMessage = normalizeMessage( message as EthersSignableMessage, - ); - return await this.signer.signMessage(normalizedMessage); + ) + return await this.signer.signMessage(normalizedMessage) } else if (this.walletClient) { if (!isViemSignableMessage(message)) { - throw new Error("Message is not a valid viem signable message."); + throw new Error("Message is not a valid viem signable message.") } return await this.walletClient.signMessage({ account: this.walletClient.account!, message: message as SignableMessage, - }); + }) } - throw new Error("No wallet client or signer available."); + throw new Error("No wallet client or signer available.") } catch (error) { - console.log(error); - throw error; + console.log(error) + throw error } } } -const erc6551AccountAbiV2 = ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI; -const erc6551RegistryAbiV2 = ERC_6551_LEGACY_V2.REGISTRY.ABI; -const erc6551AccountAbiV3 = ERC_6551_DEFAULT.IMPLEMENTATION.ABI; -const erc6551AccountProxyAbiV3 = ERC_6551_DEFAULT.ACCOUNT_PROXY!.ABI; -const erc6551RegistryAbiV3 = ERC_6551_DEFAULT.REGISTRY.ABI; +const erc6551AccountAbiV2 = ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI +const erc6551RegistryAbiV2 = ERC_6551_LEGACY_V2.REGISTRY.ABI +const erc6551AccountAbiV3 = ERC_6551_DEFAULT.IMPLEMENTATION.ABI +const erc6551AccountProxyAbiV3 = ERC_6551_DEFAULT.ACCOUNT_PROXY!.ABI +const erc6551RegistryAbiV3 = ERC_6551_DEFAULT.REGISTRY.ABI export { TokenboundClient, @@ -894,4 +885,4 @@ export { computeAccount, prepareExecuteCall, executeCall, -}; +} diff --git a/packages/sdk/src/constants/crossChain.ts b/packages/sdk/src/constants/crossChain.ts index 342aafe..fa98cb7 100644 --- a/packages/sdk/src/constants/crossChain.ts +++ b/packages/sdk/src/constants/crossChain.ts @@ -1,5 +1,5 @@ -export const LZ_TESTNET_EXECUTOR = "0xEF7B07Db21d449C50b00De4563FfFe4C9dd33f1f"; -export const LZ_MAINNET_EXECUTOR = "0x0F220412Bf22E05EBcC5070D60fd7136A08aF22C"; +export const LZ_TESTNET_EXECUTOR = "0xEF7B07Db21d449C50b00De4563FfFe4C9dd33f1f" +export const LZ_MAINNET_EXECUTOR = "0x0F220412Bf22E05EBcC5070D60fd7136A08aF22C" export const LZ_MAINNET_EXECUTORS: { [originChainId: number]: `0x${string}` } = { @@ -15,7 +15,7 @@ export const LZ_MAINNET_EXECUTORS: { [originChainId: number]: `0x${string}` } = 59144: LZ_MAINNET_EXECUTOR, // arbitrum 42161: LZ_MAINNET_EXECUTOR, - }; + } export const LZ_TESTNET_EXECUTORS: { [originChainId: number]: `0x${string}` } = { @@ -31,12 +31,12 @@ export const LZ_TESTNET_EXECUTORS: { [originChainId: number]: `0x${string}` } = 59140: LZ_TESTNET_EXECUTOR, // arbitrum sepolia 421614: LZ_TESTNET_EXECUTOR, - }; + } export const LZ_EXECUTORS: { [originChainId: number]: `0x${string}` } = { ...LZ_TESTNET_EXECUTORS, ...LZ_MAINNET_EXECUTORS, -}; +} export const LZ_MAINNET_EIDS: { [chainId: number]: number } = { // ethereum @@ -51,7 +51,7 @@ export const LZ_MAINNET_EIDS: { [chainId: number]: number } = { 59144: 30183, // arbitrum 42161: 30110, -}; +} export const LZ_TESTNET_EIDS: { [chainId: number]: number } = { // sepolia @@ -66,9 +66,9 @@ export const LZ_TESTNET_EIDS: { [chainId: number]: number } = { 59140: 40157, // arbitrum sepolia 421614: 40231, -}; +} export const LZ_EIDS: { [chainId: number]: number } = { ...LZ_TESTNET_EIDS, ...LZ_MAINNET_EIDS, -}; +} diff --git a/packages/sdk/src/constants/eip1167Implementation.ts b/packages/sdk/src/constants/eip1167Implementation.ts index 4aee7dd..f31f47a 100644 --- a/packages/sdk/src/constants/eip1167Implementation.ts +++ b/packages/sdk/src/constants/eip1167Implementation.ts @@ -1,2 +1,2 @@ export const STANDARD_EIP_1167_IMPLEMENTATION = - "0x5af43d82803e903d91602b57fd5bf3"; + "0x5af43d82803e903d91602b57fd5bf3" diff --git a/packages/sdk/src/constants/index.ts b/packages/sdk/src/constants/index.ts index cdd5925..d824a84 100644 --- a/packages/sdk/src/constants/index.ts +++ b/packages/sdk/src/constants/index.ts @@ -1,5 +1,5 @@ -export * from "./tokenboundAddresses"; -export * from "./interfaces"; -export * from "./eip1167Implementation"; -export * from "./multicall"; -export * from "./crossChain"; +export * from "./tokenboundAddresses" +export * from "./interfaces" +export * from "./eip1167Implementation" +export * from "./multicall" +export * from "./crossChain" diff --git a/packages/sdk/src/constants/interfaces.ts b/packages/sdk/src/constants/interfaces.ts index 7be8a25..74aa3ca 100644 --- a/packages/sdk/src/constants/interfaces.ts +++ b/packages/sdk/src/constants/interfaces.ts @@ -1 +1 @@ -export const IERC_6551_ACCOUNT_INTERFACE = "0x6faff5f1"; +export const IERC_6551_ACCOUNT_INTERFACE = "0x6faff5f1" diff --git a/packages/sdk/src/constants/multicall.ts b/packages/sdk/src/constants/multicall.ts index e82bbca..0e35464 100644 --- a/packages/sdk/src/constants/multicall.ts +++ b/packages/sdk/src/constants/multicall.ts @@ -1,5 +1,5 @@ -import { getAddress } from "viem"; +import { getAddress } from "viem" export const MULTICALL_AUTHENTICATED_ADDRESS: `0x${string}` = getAddress( "0xcA1167915584462449EE5b4Ea51c37fE81eCDCCD", -); +) diff --git a/packages/sdk/src/constants/tokenboundAddresses.ts b/packages/sdk/src/constants/tokenboundAddresses.ts index 70becf9..60f537b 100644 --- a/packages/sdk/src/constants/tokenboundAddresses.ts +++ b/packages/sdk/src/constants/tokenboundAddresses.ts @@ -1,20 +1,20 @@ -import { Abi, getAddress } from "viem"; +import { Abi, getAddress } from "viem" -import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../../abis"; +import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../../abis" import { erc6551AccountV3ABI, erc6551AccountProxyV3ABI, erc6551RegistryV3ABI, -} from "../../src/test/wagmi-cli-hooks/generated"; +} from "../../src/test/wagmi-cli-hooks/generated" -import { ContractABIPair } from "../types"; +import { ContractABIPair } from "../types" type Standard6551Deployment = { - IMPLEMENTATION: ContractABIPair; - REGISTRY: ContractABIPair; - ACCOUNT_PROXY?: ContractABIPair; -}; + IMPLEMENTATION: ContractABIPair + REGISTRY: ContractABIPair + ACCOUNT_PROXY?: ContractABIPair +} export const ERC_6551_LEGACY_V2: Standard6551Deployment = { IMPLEMENTATION: { @@ -25,7 +25,7 @@ export const ERC_6551_LEGACY_V2: Standard6551Deployment = { ADDRESS: getAddress("0x02101dfB77FDE026414827Fdc604ddAF224F0921"), ABI: erc6551RegistryAbiV2 as Abi, }, -}; +} export const ERC_6551_DEFAULT: Standard6551Deployment = { ACCOUNT_PROXY: { @@ -40,4 +40,4 @@ export const ERC_6551_DEFAULT: Standard6551Deployment = { ADDRESS: getAddress("0x000000006551c19487814612e58FE06813775758"), ABI: erc6551RegistryV3ABI, }, -}; +} diff --git a/packages/sdk/src/functions/crossChain.ts b/packages/sdk/src/functions/crossChain.ts index c37e63f..0cc08ea 100644 --- a/packages/sdk/src/functions/crossChain.ts +++ b/packages/sdk/src/functions/crossChain.ts @@ -1,14 +1,14 @@ -import { PublicClient, encodeFunctionData, parseAbi } from "viem"; -import { ERC_6551_DEFAULT, LZ_EXECUTORS, LZ_EIDS } from "../constants"; -import { Options } from "@layerzerolabs/lz-v2-utilities"; -import { CallData } from "../types"; +import { PublicClient, encodeFunctionData, parseAbi } from "viem" +import { ERC_6551_DEFAULT, LZ_EXECUTORS, LZ_EIDS } from "../constants" +import { Options } from "@layerzerolabs/lz-v2-utilities" +import { CallData } from "../types" type CrossChainCallParams = { - publicClient: PublicClient; - account: `0x${string}`; - originChainId: number; - destinationChainId: number; -} & CallData; + publicClient: PublicClient + account: `0x${string}` + originChainId: number + destinationChainId: number +} & CallData export async function encodeCrossChainCall( params: CrossChainCallParams, @@ -21,44 +21,44 @@ export async function encodeCrossChainCall( data, account, publicClient, - } = params; + } = params const lzExecutorAbi = parseAbi([ "function quote(uint32 eid, address sender, bytes calldata payload, bytes calldata options) external view returns (uint256 nativeFee, uint256 lzTokenFee)", "function execute(uint32 eid, bytes calldata payload, bytes calldata options) external payable", - ]); + ]) - const lzExecutor = LZ_EXECUTORS[originChainId]; - const lzEid = LZ_EIDS[destinationChainId]; + const lzExecutor = LZ_EXECUTORS[originChainId] + const lzEid = LZ_EIDS[destinationChainId] const destinationExecutionData = encodeFunctionData({ abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, functionName: "execute", args: [to, value, data, 0], - }); + }) - const txOptions = Options.newOptions().addExecutorLzReceiveOption(200000, 0); + const txOptions = Options.newOptions().addExecutorLzReceiveOption(200000, 0) - const txOptionsHex = txOptions.toHex() as `0x${string}`; + const txOptionsHex = txOptions.toHex() as `0x${string}` const quoteData = await publicClient.readContract({ address: lzExecutor, abi: lzExecutorAbi, functionName: "quote", args: [lzEid, account, destinationExecutionData, txOptionsHex], - }); + }) - const txValue = quoteData.at(0) || 0n; + const txValue = quoteData.at(0) || 0n const encodedLzCall = encodeFunctionData({ abi: lzExecutorAbi, functionName: "execute", args: [lzEid, destinationExecutionData, txOptionsHex], - }); + }) return { to: lzExecutor, value: txValue + 10n, data: encodedLzCall, - }; + } } diff --git a/packages/sdk/src/functions/index.ts b/packages/sdk/src/functions/index.ts index 290a3e6..d573579 100644 --- a/packages/sdk/src/functions/index.ts +++ b/packages/sdk/src/functions/index.ts @@ -1,3 +1,3 @@ -export * from "./viemV2"; -export * from "./viemV3"; -export * from "./crossChain"; +export * from "./viemV2" +export * from "./viemV3" +export * from "./crossChain" diff --git a/packages/sdk/src/functions/viemV2.ts b/packages/sdk/src/functions/viemV2.ts index 3dbc1cb..938e581 100644 --- a/packages/sdk/src/functions/viemV2.ts +++ b/packages/sdk/src/functions/viemV2.ts @@ -8,17 +8,17 @@ import { encodeAbiParameters, pad, getAddress, -} from "viem"; +} from "viem" -import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../../abis"; +import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../../abis" import { erc6551AccountProxyV3ABI, erc6551AccountV3ABI, erc6551RegistryV3ABI, -} from "../../src/test/wagmi-cli-hooks/generated"; -import { addressToUint8Array } from "../utils"; -import { ERC_6551_LEGACY_V2 } from "../constants"; -import { CallData } from "../types"; +} from "../../src/test/wagmi-cli-hooks/generated" +import { addressToUint8Array } from "../utils" +import { ERC_6551_LEGACY_V2 } from "../constants" +import { CallData } from "../types" export { erc6551AccountAbiV2, @@ -26,7 +26,7 @@ export { erc6551AccountProxyV3ABI, erc6551AccountV3ABI, erc6551RegistryV3ABI, -}; +} /** * @deprecated Direct consumption of this function is deprecated. Consume via TokenboundClient instead. @@ -41,7 +41,7 @@ export async function getAccount( ): Promise<`0x${string}`> { const erc6551registry = registryAddress ? getAddress(registryAddress) - : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; + : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS const registry = getContract({ address: erc6551registry, @@ -49,9 +49,9 @@ export async function getAccount( client: { public: client as PublicClient, }, - }); + }) - const chainId = await client.getChainId(); + const chainId = await client.getChainId() const account = await registry.read.account([ implementationAddress @@ -61,9 +61,9 @@ export async function getAccount( tokenContract, tokenId, 0, - ]); + ]) - return account as `0x${string}`; + return account as `0x${string}` } /** @@ -78,13 +78,13 @@ export async function prepareCreateAccount( registryAddress?: `0x${string}`, salt?: number, ): Promise { - salt = salt ?? 0; + salt = salt ?? 0 const implementation = implementationAddress ? getAddress(implementationAddress) - : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS; + : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS const erc6551registry = registryAddress ? getAddress(registryAddress) - : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; + : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS const initData = encodeFunctionData({ abi: [ @@ -97,7 +97,7 @@ export async function prepareCreateAccount( }, ], functionName: "initialize", - }); + }) return { to: erc6551registry, @@ -107,7 +107,7 @@ export async function prepareCreateAccount( functionName: "createAccount", args: [implementation, chainId, tokenContract, tokenId, salt, initData], }), - }; + } } /** @@ -123,13 +123,13 @@ export async function createAccount( salt?: number, chainId?: number, ): Promise<`0x${string}`> { - salt = salt ?? 0; + salt = salt ?? 0 const implementation = implementationAddress ? getAddress(implementationAddress) - : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS; + : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS const erc6551registry = registryAddress ? getAddress(registryAddress) - : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; + : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS const registry = getContract({ address: erc6551registry, @@ -137,9 +137,9 @@ export async function createAccount( client: { wallet: client, }, - }); + }) - const _chainId = chainId || (await client.getChainId()); + const _chainId = chainId || (await client.getChainId()) const initData = encodeFunctionData({ abi: [ @@ -152,7 +152,7 @@ export async function createAccount( }, ], functionName: "initialize", - }); + }) return registry.write.createAccount([ implementation, @@ -161,7 +161,7 @@ export async function createAccount( tokenId, salt, initData, - ]); + ]) } /** @@ -182,7 +182,7 @@ export async function prepareExecuteCall( functionName: "executeCall", args: [to as `0x${string}`, value, data as `0x${string}`], }), - }; + } } /** @@ -202,13 +202,13 @@ export async function executeCall( client: { wallet: client, }, - }); + }) return registry.write.executeCall([ to as `0x${string}`, value, data as `0x${string}`, - ]); + ]) } /** @@ -223,13 +223,13 @@ export function computeAccount( registryAddress?: `0x${string}`, salt?: number, ): `0x${string}` { - salt = salt ?? 0; + salt = salt ?? 0 const implementation = implementationAddress ? getAddress(implementationAddress) - : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS; + : ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS const erc6551registry = registryAddress ? getAddress(registryAddress) - : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS; + : ERC_6551_LEGACY_V2.REGISTRY.ADDRESS const code = getCreationCode( implementation, @@ -237,17 +237,17 @@ export function computeAccount( tokenContract, tokenId, salt.toString(), - ); + ) - const bigIntSalt = BigInt(salt).toString(16) as `0x${string}`; - const saltHex = pad(bigIntSalt, { size: 32 }); + const bigIntSalt = BigInt(salt).toString(16) as `0x${string}` + const saltHex = pad(bigIntSalt, { size: 32 }) return getContractAddress({ bytecode: code, from: erc6551registry, opcode: "CREATE2", salt: saltHex, - }); + }) } /** @@ -266,24 +266,24 @@ export function getCreationCode( { type: "uint256" }, { type: "address" }, { type: "uint256" }, - ]; + ] const values: (string | bigint)[] = [ salt_, BigInt(chainId_), tokenContract_, tokenId_, - ]; - const encodedABI = encodeAbiParameters(types, values); - const hexImplementation = implementation_ as `0x${string}`; + ] + const encodedABI = encodeAbiParameters(types, values) + const hexImplementation = implementation_ as `0x${string}` const hexCreationCode = concat([ "0x3d60ad80600a3d3981f3363d3d373d3d3d363d73", hexImplementation, "0x5af43d82803e903d91602b57fd5bf3", encodedABI, - ]); + ]) - const creationCode = addressToUint8Array(hexCreationCode); + const creationCode = addressToUint8Array(hexCreationCode) - return creationCode; + return creationCode } diff --git a/packages/sdk/src/functions/viemV3.ts b/packages/sdk/src/functions/viemV3.ts index c4ea1f8..be9e727 100644 --- a/packages/sdk/src/functions/viemV3.ts +++ b/packages/sdk/src/functions/viemV3.ts @@ -11,21 +11,21 @@ import { getAddress, numberToBytes, bytesToHex, -} from "viem"; +} from "viem" import { erc6551AccountProxyV3ABI, erc6551AccountV3ABI, erc6551RegistryV3ABI, -} from "../../src/test/wagmi-cli-hooks/generated"; -import { addressToUint8Array } from "../utils"; +} from "../../src/test/wagmi-cli-hooks/generated" +import { addressToUint8Array } from "../utils" import { ERC_6551_DEFAULT, STANDARD_EIP_1167_IMPLEMENTATION, -} from "../constants"; -import { CallData } from "../types"; -export { erc6551AccountProxyV3ABI, erc6551AccountV3ABI, erc6551RegistryV3ABI }; +} from "../constants" +import { CallData } from "../types" +export { erc6551AccountProxyV3ABI, erc6551AccountV3ABI, erc6551RegistryV3ABI } /** * @deprecated Direct consumption of this function is deprecated. Consume via TokenboundClient instead. @@ -39,10 +39,10 @@ export async function prepareCreateTokenboundV3Account( registryAddress?: `0x${string}`, salt?: number, ): Promise { - salt = salt ?? 0; + salt = salt ?? 0 const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS; - const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS; + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS + const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS return { to: getAddress(erc6551registry), @@ -58,7 +58,7 @@ export async function prepareCreateTokenboundV3Account( tokenId, ], }), - }; + } } /** @@ -73,10 +73,10 @@ export async function createTokenboundV3Account( registryAddress?: `0x${string}`, salt?: number, ): Promise<`0x${string}`> { - salt = salt ?? 0; + salt = salt ?? 0 const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS; - const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS; + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS + const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS const registry = getContract({ address: erc6551registry, @@ -84,9 +84,9 @@ export async function createTokenboundV3Account( client: { wallet: client, }, - }); + }) - const chainId = await client.getChainId(); + const chainId = await client.getChainId() return await registry.write.createAccount([ erc6551implementation, @@ -96,7 +96,7 @@ export async function createTokenboundV3Account( chainId, tokenContract, tokenId, - ]); + ]) } /** @@ -117,7 +117,7 @@ export async function prepareTokenboundV3Execute( functionName: "execute", args: [to as `0x${string}`, value, data as `0x${string}`], }), - }; + } } /** @@ -137,13 +137,13 @@ export async function tokenboundV3Execute( client: { wallet: client, }, - }); + }) return await registry.write.execute([ to as `0x${string}`, value, data as `0x${string}`, - ]); + ]) } /** @@ -158,40 +158,40 @@ export function getTokenboundV3Account( registryAddress?: `0x${string}`, salt?: number, ): `0x${string}` { - salt = salt ?? 0; + salt = salt ?? 0 const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS; - const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS; + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS + const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS const types = [ { type: "uint256" }, // salt { type: "uint256" }, // chainId { type: "address" }, // tokenContract { type: "uint256" }, // tokenId - ]; + ] const values: (string | bigint)[] = [ salt.toString(), BigInt(chainId), tokenContract, tokenId, - ]; - const encodedABI = encodeAbiParameters(types, values); + ] + const encodedABI = encodeAbiParameters(types, values) const hexCreationCode = concat([ "0x3d60ad80600a3d3981f3363d3d373d3d3d363d73", getAddress(erc6551implementation), STANDARD_EIP_1167_IMPLEMENTATION, encodedABI, - ]); + ]) - const creationCode = addressToUint8Array(hexCreationCode); - const bigIntSalt = BigInt(salt).toString(16) as `0x${string}`; - const saltHex = pad(bigIntSalt, { size: 32 }); + const creationCode = addressToUint8Array(hexCreationCode) + const bigIntSalt = BigInt(salt).toString(16) as `0x${string}` + const saltHex = pad(bigIntSalt, { size: 32 }) return getContractAddress({ bytecode: creationCode, from: getAddress(erc6551registry), opcode: "CREATE2", salt: saltHex, - }); + }) } diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 9587740..dcd0548 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -1,4 +1,4 @@ -import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../abis"; +import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../abis" import { getAccount, @@ -8,7 +8,7 @@ import { prepareExecuteCall, executeCall, prepareCreateAccount, -} from "./functions"; +} from "./functions" import { TokenboundAccountNFT, @@ -33,14 +33,14 @@ import { CALL_OPERATIONS, SegmentedERC6551Bytecode, CallData, -} from "./types"; +} from "./types" import { TokenboundClient, erc6551AccountAbiV3, erc6551AccountProxyAbiV3, erc6551RegistryAbiV3, -} from "./TokenboundClient"; +} from "./TokenboundClient" export { TokenboundClient, @@ -58,7 +58,7 @@ export { prepareExecuteCall, executeCall, CALL_OPERATIONS, -}; +} export type { TokenboundClientOptions, @@ -81,4 +81,4 @@ export type { Call3, CallData, SegmentedERC6551Bytecode, -}; +} diff --git a/packages/sdk/src/test/TestAll.test.ts b/packages/sdk/src/test/TestAll.test.ts index ee36030..91e6053 100644 --- a/packages/sdk/src/test/TestAll.test.ts +++ b/packages/sdk/src/test/TestAll.test.ts @@ -1,10 +1,10 @@ // This suite tests Tokenbound SDK methods with // viem walletClient + publicClient and Ethers 5/6. -import { zora, mainnet } from "viem/chains"; -import { describe, beforeAll, afterAll, expect, it, vi } from "vitest"; -import { ethers, providers } from "ethers"; -import { createAnvil } from "@viem/anvil"; +import { zora, mainnet } from "viem/chains" +import { describe, beforeAll, afterAll, expect, it, vi } from "vitest" +import { ethers, providers } from "ethers" +import { createAnvil } from "@viem/anvil" import { WalletClient, PublicClient, @@ -20,15 +20,15 @@ import { parseAbiParameters, isAddress, isHex, -} from "viem"; -import { privateKeyToAccount } from "viem/accounts"; +} from "viem" +import { privateKeyToAccount } from "viem/accounts" import { ADDRESS_REGEX, ANVIL_ACCOUNTS, ANVIL_RPC_URL, WETH_CONTRACT_ADDRESS, -} from "./constants"; -import { resolvePossibleENS } from "../utils"; +} from "./constants" +import { resolvePossibleENS } from "../utils" import { ethToWei, getPublicClient, @@ -36,48 +36,48 @@ import { // debugTransaction, getZora1155Balance, getZora721Balance, -} from "./utils"; +} from "./utils" import { ANVIL_CONFIG, CREATE_ANVIL_OPTIONS, zora721, zora1155, TEST_CONFIG, -} from "./config"; -import { wethABI } from "./wagmi-cli-hooks/generated"; -import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "../constants"; -import { Call3, TBImplementationVersion, TBVersion } from "../types"; -import { JsonRpcSigner, JsonRpcProvider } from "ethers6"; -import { erc20Abi } from "viem"; -import { CreateAccountParams, TokenboundClient } from "../"; +} from "./config" +import { wethABI } from "./wagmi-cli-hooks/generated" +import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "../constants" +import { Call3, TBImplementationVersion, TBVersion } from "../types" +import { JsonRpcSigner, JsonRpcProvider } from "ethers6" +import { erc20Abi } from "viem" +import { CreateAccountParams, TokenboundClient } from "../" -export const pool = Number(process.env.VITEST_POOL_ID ?? 1); +export const pool = Number(process.env.VITEST_POOL_ID ?? 1) -const TIMEOUT = 60000; // default 10000 -const ANVIL_USER_0 = getAddress(ANVIL_ACCOUNTS[0].address); -const ANVIL_USER_1 = getAddress(ANVIL_ACCOUNTS[1].address); +const TIMEOUT = 60000 // default 10000 +const ANVIL_USER_0 = getAddress(ANVIL_ACCOUNTS[0].address) +const ANVIL_USER_1 = getAddress(ANVIL_ACCOUNTS[1].address) const walletClient = createWalletClient({ transport: http(ANVIL_RPC_URL), chain: ANVIL_CONFIG.ACTIVE_CHAIN, account: privateKeyToAccount(ANVIL_ACCOUNTS[0].privateKey), -}); +}) -const ethers5Provider = new ethers.providers.JsonRpcProvider(ANVIL_RPC_URL); +const ethers5Provider = new ethers.providers.JsonRpcProvider(ANVIL_RPC_URL) const ethers5Signer = new ethers.Wallet( ANVIL_ACCOUNTS[0].privateKey, ethers5Provider, -); +) -const ethers6Provider = new JsonRpcProvider(ANVIL_RPC_URL); -const ethers6Signer = new JsonRpcSigner(ethers6Provider, ANVIL_USER_0); +const ethers6Provider = new JsonRpcProvider(ANVIL_RPC_URL) +const ethers6Signer = new JsonRpcSigner(ethers6Provider, ANVIL_USER_0) type TestConfig = { - testName: string; - walletClient?: WalletClient; - signer?: any; - version?: TBImplementationVersion; -}; + testName: string + walletClient?: WalletClient + signer?: any + version?: TBImplementationVersion +} export const ENABLED_TESTS: Array = [ { @@ -107,37 +107,37 @@ export const ENABLED_TESTS: Array = [ testName: "ethers@6 v3", signer: ethers6Signer, }, -]; +] describe.each(ENABLED_TESTS)( "$testName", ({ testName, walletClient, signer, version }) => { - const isV2 = version === TBVersion.V2; - const isV3 = isV2 === false; - const viemOnlyIt = walletClient ? it : it.skip; // Skip tests that are non-functional in Ethers - const v3OnlyIt = isV3 ? it : it.skip; + const isV2 = version === TBVersion.V2 + const isV3 = isV2 === false + const viemOnlyIt = walletClient ? it : it.skip // Skip tests that are non-functional in Ethers + const v3OnlyIt = isV3 ? it : it.skip // Set up Anvil instance + clients - const anvil = createAnvil({ ...CREATE_ANVIL_OPTIONS }); - const CUSTOM_SALT = 6551; - let tokenboundClient: TokenboundClient; - let publicClient: PublicClient; - let NFT_IN_EOA: CreateAccountParams; - let NFT_FOR_MULTICALL_CREATE: CreateAccountParams; - let TOKENID_IN_EOA: string; - let TOKENID_FOR_MULTICALL_CREATE: string; - let TOKENID1_IN_TBA: string; - let TOKENID2_IN_TBA: string; - let ZORA721_TBA_ADDRESS: `0x${string}`; - let ZORA721_TBA_ADDRESS_CUSTOM_SALT: `0x${string}`; - let ZORA721_TBA_ADDRESS_MULTICALL: `0x${string}`; - - const ERC6551_DEPLOYMENT = isV2 ? ERC_6551_LEGACY_V2 : ERC_6551_DEFAULT; + const anvil = createAnvil({ ...CREATE_ANVIL_OPTIONS }) + const CUSTOM_SALT = 6551 + let tokenboundClient: TokenboundClient + let publicClient: PublicClient + let NFT_IN_EOA: CreateAccountParams + let NFT_FOR_MULTICALL_CREATE: CreateAccountParams + let TOKENID_IN_EOA: string + let TOKENID_FOR_MULTICALL_CREATE: string + let TOKENID1_IN_TBA: string + let TOKENID2_IN_TBA: string + let ZORA721_TBA_ADDRESS: `0x${string}` + let ZORA721_TBA_ADDRESS_CUSTOM_SALT: `0x${string}` + let ZORA721_TBA_ADDRESS_MULTICALL: `0x${string}` + + const ERC6551_DEPLOYMENT = isV2 ? ERC_6551_LEGACY_V2 : ERC_6551_DEFAULT // Spin up a fresh anvil instance each time we run the test suite against a different signer beforeAll(async () => { try { // publicClient = getPublicClient({ chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id }) - publicClient = getPublicClient({ chain: ANVIL_CONFIG.ACTIVE_CHAIN }); + publicClient = getPublicClient({ chain: ANVIL_CONFIG.ACTIVE_CHAIN }) // Pass in the Anvil test walletClient + publicClient tokenboundClient = new TokenboundClient({ @@ -152,33 +152,33 @@ describe.each(ENABLED_TESTS)( registryAddress: isV3 ? undefined : ERC6551_DEPLOYMENT.REGISTRY.ADDRESS, - }); + }) - await anvil.start(); - console.log(`START → \x1b[94m ${testName} \x1b[0m`); + await anvil.start() + console.log(`START → \x1b[94m ${testName} \x1b[0m`) } catch (err) { - console.error("Error during setup:", err); + console.error("Error during setup:", err) } - }, TIMEOUT); + }, TIMEOUT) afterAll(async () => { - await anvil.stop(); - console.log(`END → \x1b[94m ${testName} \x1b[0m`); - }); + await anvil.stop() + console.log(`END → \x1b[94m ${testName} \x1b[0m`) + }) it("can get the SDK version", () => { - const sdkVersion: string = tokenboundClient.getSDKVersion(); - console.log(`SDK Version → \x1b[94m ${sdkVersion} \x1b[0m`); + const sdkVersion: string = tokenboundClient.getSDKVersion() + console.log(`SDK Version → \x1b[94m ${sdkVersion} \x1b[0m`) // console.log('SDK Version:', sdkVersion) - expect(sdkVersion).toBeDefined(); - }); + expect(sdkVersion).toBeDefined() + }) // To test the SDK methods, we need to mint some NFTs into the Anvil wallet // so that we can transfer them to the TBA and test the TBA methods. it( "can mint 2 Zora 721 NFTs into Anvil wallet #0", async () => { - let mintLogs: Log[] = []; + let mintLogs: Log[] = [] // Set up observer for mint event so we can get the tokenId const unwatch = publicClient.watchContractEvent({ @@ -189,78 +189,78 @@ describe.each(ENABLED_TESTS)( to: ANVIL_USER_0, }, onLogs: (logs) => { - mintLogs = logs; - const { tokenId: eoaTokenId } = logs[0].args; - const { tokenId: tbaToken1Id } = logs[1].args; - const { tokenId: tbaToken2Id } = logs[2].args; - const { tokenId: multicallTokenId } = logs[3].args; + mintLogs = logs + const { tokenId: eoaTokenId } = logs[0].args + const { tokenId: tbaToken1Id } = logs[1].args + const { tokenId: tbaToken2Id } = logs[2].args + const { tokenId: multicallTokenId } = logs[3].args if (eoaTokenId && tbaToken1Id && tbaToken2Id && multicallTokenId) { - TOKENID_IN_EOA = eoaTokenId.toString(); - TOKENID_FOR_MULTICALL_CREATE = multicallTokenId.toString(); - TOKENID1_IN_TBA = tbaToken1Id.toString(); - TOKENID2_IN_TBA = tbaToken2Id.toString(); + TOKENID_IN_EOA = eoaTokenId.toString() + TOKENID_FOR_MULTICALL_CREATE = multicallTokenId.toString() + TOKENID1_IN_TBA = tbaToken1Id.toString() + TOKENID2_IN_TBA = tbaToken2Id.toString() NFT_IN_EOA = { tokenContract: zora721.proxyContractAddress, tokenId: TOKENID_IN_EOA, - }; + } NFT_FOR_MULTICALL_CREATE = { tokenContract: zora721.proxyContractAddress, tokenId: TOKENID_FOR_MULTICALL_CREATE, - }; + } } }, - }); + }) // Prepare mint transaction const encodedMintFunctionData = encodeFunctionData({ abi: zora721.abi, functionName: "purchase", args: [BigInt(zora721.quantity)], - }); + }) const prepared721Mint = { to: zora721.proxyContractAddress, value: zora721.mintPrice * BigInt(zora721.quantity), data: encodedMintFunctionData, - }; + } - let mintTxHash: `0x${string}`; + let mintTxHash: `0x${string}` if (walletClient) { mintTxHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, account: ANVIL_USER_0, ...prepared721Mint, - }); + }) } else if (signer) { mintTxHash = await signer .sendTransaction({ chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, ...prepared721Mint, }) - .then((tx: providers.TransactionResponse) => tx.hash); + .then((tx: providers.TransactionResponse) => tx.hash) } const zoraBalanceInAnvilWallet = await getZora721Balance({ publicClient, walletAddress: ANVIL_USER_0, - }); + }) await vi.waitFor(() => { - expect(mintLogs.length).toBe(zora721.quantity); - expect(mintTxHash).toMatch(ADDRESS_REGEX); - expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA); + expect(mintLogs.length).toBe(zora721.quantity) + expect(mintTxHash).toMatch(ADDRESS_REGEX) + expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA) expect(NFT_FOR_MULTICALL_CREATE.tokenId).toBe( TOKENID_FOR_MULTICALL_CREATE, - ); - expect(zoraBalanceInAnvilWallet).toBe(4n); - unwatch(); - }); + ) + expect(zoraBalanceInAnvilWallet).toBe(4n) + unwatch() + }) }, TIMEOUT, - ); + ) it( "can prepareCreateAccount", @@ -268,38 +268,38 @@ describe.each(ENABLED_TESTS)( const preparedAccount = await tokenboundClient.prepareCreateAccount({ tokenContract: zora721.proxyContractAddress, tokenId: "1", - }); + }) - if (!preparedAccount.to) return false; + if (!preparedAccount.to) return false - expect(isAddress(preparedAccount.to)).toEqual(true); - expect(typeof preparedAccount.value).toEqual("bigint"); - expect(isHex(preparedAccount.data)).toEqual(true); + expect(isAddress(preparedAccount.to)).toEqual(true) + expect(typeof preparedAccount.value).toEqual("bigint") + expect(isHex(preparedAccount.data)).toEqual(true) }, TIMEOUT, - ); + ) // We create the account using an NFT in the EOA wallet so we can test the EOA methods and use the TBA address for tests it( "can createAccount", async () => { const { account, txHash } = - await tokenboundClient.createAccount(NFT_IN_EOA); - console.log("CREATED ACCT", account); + await tokenboundClient.createAccount(NFT_IN_EOA) + console.log("CREATED ACCT", account) const createdAccountTxReceipt = await publicClient.waitForTransactionReceipt({ hash: txHash, - }); + }) - ZORA721_TBA_ADDRESS = account; + ZORA721_TBA_ADDRESS = account await vi.waitFor(() => { - expect(account).toMatch(ADDRESS_REGEX); - expect(createdAccountTxReceipt.status).toBe("success"); - }); + expect(account).toMatch(ADDRESS_REGEX) + expect(createdAccountTxReceipt.status).toBe("success") + }) }, TIMEOUT, - ); + ) it( "can createAccount with a custom salt", @@ -307,133 +307,133 @@ describe.each(ENABLED_TESTS)( const { account, txHash } = await tokenboundClient.createAccount({ ...NFT_IN_EOA, salt: CUSTOM_SALT, - }); - console.log("CREATED ACCT WITH CUSTOM SALT", account); + }) + console.log("CREATED ACCT WITH CUSTOM SALT", account) const createdAccountTxReceipt = await publicClient.waitForTransactionReceipt({ hash: txHash, - }); + }) - ZORA721_TBA_ADDRESS_CUSTOM_SALT = account; + ZORA721_TBA_ADDRESS_CUSTOM_SALT = account await vi.waitFor(() => { - expect(account).toMatch(ADDRESS_REGEX); - expect(createdAccountTxReceipt.status).toBe("success"); - }); + expect(account).toMatch(ADDRESS_REGEX) + expect(createdAccountTxReceipt.status).toBe("success") + }) }, TIMEOUT, - ); + ) it( "can createAccount with a custom chainId", async () => { - const HARDHAT_CHAIN_ID = 31337; + const HARDHAT_CHAIN_ID = 31337 const { account, txHash } = await tokenboundClient.createAccount({ ...NFT_IN_EOA, chainId: HARDHAT_CHAIN_ID, - }); - console.log("CREATED ACCT WITH CUSTOM CHAIN ID", account); + }) + console.log("CREATED ACCT WITH CUSTOM CHAIN ID", account) const createdAccountTxReceipt = await publicClient.waitForTransactionReceipt({ hash: txHash, - }); + }) const bytecode = await tokenboundClient.deconstructBytecode({ accountAddress: account, - }); + }) - if (!bytecode) return false; + if (!bytecode) return false - const { chainId } = bytecode; + const { chainId } = bytecode - console.log("CHAINID OF CREATED ACCT", chainId); + console.log("CHAINID OF CREATED ACCT", chainId) - expect(isAddress(account)).toEqual(true); - expect(createdAccountTxReceipt.status).toBe("success"); - expect(chainId).toBe(HARDHAT_CHAIN_ID); + expect(isAddress(account)).toEqual(true) + expect(createdAccountTxReceipt.status).toBe("success") + expect(chainId).toBe(HARDHAT_CHAIN_ID) }, TIMEOUT, - ); + ) v3OnlyIt( "can createAccount and append multicall transaction(s) that use the deployed TBA", async () => { const multicallTBAAddress = tokenboundClient.getAccount( NFT_FOR_MULTICALL_CREATE, - ); + ) // Perform a simple ERC20 balanceOf call to test the appended multicall transaction const encodedBalanceOfFunctionData = encodeFunctionData({ abi: erc20Abi, functionName: "balanceOf", args: [multicallTBAAddress], - }); + }) const preparedBalanceOfByTBA = await tokenboundClient.prepareExecution({ account: multicallTBAAddress, to: WETH_CONTRACT_ADDRESS, value: 0n, data: encodedBalanceOfFunctionData, - }); + }) const appendedCall: Call3 = { target: multicallTBAAddress, // Execute with TBA allowFailure: false, callData: preparedBalanceOfByTBA.data, - }; + } const { account, txHash } = await tokenboundClient.createAccount({ ...NFT_FOR_MULTICALL_CREATE, appendedCalls: [appendedCall], - }); - console.log("CREATED ACCT WITH MULTICALL", account); + }) + console.log("CREATED ACCT WITH MULTICALL", account) const createdAccountTxReceipt = await publicClient.waitForTransactionReceipt({ hash: txHash, - }); + }) - ZORA721_TBA_ADDRESS_MULTICALL = account; + ZORA721_TBA_ADDRESS_MULTICALL = account await vi.waitFor(() => { - expect(account).toMatch(ADDRESS_REGEX); - expect(createdAccountTxReceipt.status).toBe("success"); - }); + expect(account).toMatch(ADDRESS_REGEX) + expect(createdAccountTxReceipt.status).toBe("success") + }) }, TIMEOUT, - ); + ) it("can checkAccountDeployment for the created account", async () => { const isAccountDeployed = await tokenboundClient.checkAccountDeployment({ accountAddress: ZORA721_TBA_ADDRESS, - }); + }) - console.log(`isAccountDeployed ${testName}`, isAccountDeployed); + console.log(`isAccountDeployed ${testName}`, isAccountDeployed) - expect(isAccountDeployed).toEqual(true); - }); + expect(isAccountDeployed).toEqual(true) + }) it("can getNFT for the created account", async () => { const nft = await tokenboundClient.getNFT({ accountAddress: ZORA721_TBA_ADDRESS, - }); + }) - if (!nft) throw new Error("Bytecode is undefined"); + if (!nft) throw new Error("Bytecode is undefined") - const { chainId, tokenContract, tokenId } = nft; + const { chainId, tokenContract, tokenId } = nft - expect(chainId).toEqual(ANVIL_CONFIG.ACTIVE_CHAIN.id); - expect(tokenContract).toEqual(NFT_IN_EOA.tokenContract); - expect(tokenId).toEqual(NFT_IN_EOA.tokenId); - }); + expect(chainId).toEqual(ANVIL_CONFIG.ACTIVE_CHAIN.id) + expect(tokenContract).toEqual(NFT_IN_EOA.tokenContract) + expect(tokenId).toEqual(NFT_IN_EOA.tokenId) + }) it("can deconstructBytecode for the created account", async () => { const bytecode = await tokenboundClient.deconstructBytecode({ accountAddress: ZORA721_TBA_ADDRESS, - }); + }) - if (!bytecode) throw new Error("Bytecode is undefined"); + if (!bytecode) throw new Error("Bytecode is undefined") const { chainId, @@ -443,47 +443,47 @@ describe.each(ENABLED_TESTS)( salt, erc1167Header, erc1167Footer, - } = bytecode; + } = bytecode - expect(chainId).toEqual(ANVIL_CONFIG.ACTIVE_CHAIN.id); - expect(erc1167Header).toEqual(TEST_CONFIG.ERC1167_HEADER); + expect(chainId).toEqual(ANVIL_CONFIG.ACTIVE_CHAIN.id) + expect(erc1167Header).toEqual(TEST_CONFIG.ERC1167_HEADER) // expect(implementationAddress).toEqual(ERC6551_DEPLOYMENT.IMPLEMENTATION.ADDRESS) if (isV2) { expect(implementationAddress).toEqual( ERC6551_DEPLOYMENT.IMPLEMENTATION.ADDRESS, - ); + ) } if (isV3) { expect(implementationAddress).toEqual( ERC6551_DEPLOYMENT.ACCOUNT_PROXY?.ADDRESS, - ); + ) } - expect(erc1167Footer).toEqual(TEST_CONFIG.ERC1167_FOOTER); - expect(tokenContract).toEqual(NFT_IN_EOA.tokenContract); - expect(tokenId).toEqual(NFT_IN_EOA.tokenId); - expect(salt).toEqual(0); - }); + expect(erc1167Footer).toEqual(TEST_CONFIG.ERC1167_FOOTER) + expect(tokenContract).toEqual(NFT_IN_EOA.tokenContract) + expect(tokenId).toEqual(NFT_IN_EOA.tokenId) + expect(salt).toEqual(0) + }) it("can getAccount", async () => { - const getAccount = tokenboundClient.getAccount(NFT_IN_EOA); + const getAccount = tokenboundClient.getAccount(NFT_IN_EOA) await vi.waitFor(() => { - expect(getAccount).toMatch(ADDRESS_REGEX); - expect(getAccount).toEqual(ZORA721_TBA_ADDRESS); - }); - }); + expect(getAccount).toMatch(ADDRESS_REGEX) + expect(getAccount).toEqual(ZORA721_TBA_ADDRESS) + }) + }) it("can getAccount with a custom salt", async () => { const getAccount = tokenboundClient.getAccount({ ...NFT_IN_EOA, salt: CUSTOM_SALT, - }); + }) await vi.waitFor(() => { - expect(getAccount).toMatch(ADDRESS_REGEX); - expect(getAccount).toEqual(ZORA721_TBA_ADDRESS_CUSTOM_SALT); - }); - }); + expect(getAccount).toMatch(ADDRESS_REGEX) + expect(getAccount).toEqual(ZORA721_TBA_ADDRESS_CUSTOM_SALT) + }) + }) // We transfer an NFT to the TBA so that we can test the TBA methods. it( @@ -494,7 +494,7 @@ describe.each(ENABLED_TESTS)( ZORA721_TBA_ADDRESS, "tokenId", TOKENID1_IN_TBA, - ); + ) const transferCallData = encodeFunctionData({ abi: zora721.abi, @@ -504,51 +504,51 @@ describe.each(ENABLED_TESTS)( ZORA721_TBA_ADDRESS, // to BigInt(TOKENID1_IN_TBA), // tokenId ], - }); + }) const preparedNFTTransfer = { to: zora721.proxyContractAddress, value: 0n, data: transferCallData, - }; + } - let transferHash: `0x${string}`; + let transferHash: `0x${string}` if (walletClient) { transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, account: walletClient.account!.address, ...preparedNFTTransfer, - }); + }) } else { const tx = await signer.sendTransaction({ chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, ...preparedNFTTransfer, - }); + }) - transferHash = tx.hash; + transferHash = tx.hash } const transactionReceipt = await publicClient.waitForTransactionReceipt( { hash: transferHash, }, - ); + ) const tbaNFTBalance = await getZora721Balance({ publicClient, walletAddress: ZORA721_TBA_ADDRESS, - }); - console.log("# of NFTs in TBA: ", tbaNFTBalance.toString()); + }) + console.log("# of NFTs in TBA: ", tbaNFTBalance.toString()) await vi.waitFor(() => { - expect(transferHash).toMatch(ADDRESS_REGEX); - expect(transactionReceipt.status).toBe("success"); - expect(tbaNFTBalance).toBe(1n); - }); + expect(transferHash).toMatch(ADDRESS_REGEX) + expect(transactionReceipt.status).toBe("success") + expect(tbaNFTBalance).toBe(1n) + }) }, TIMEOUT, - ); + ) it( "can transfer another minted NFT to the TBA", @@ -561,91 +561,91 @@ describe.each(ENABLED_TESTS)( ZORA721_TBA_ADDRESS, // to BigInt(TOKENID2_IN_TBA), // tokenId ], - }); + }) const preparedNFTTransfer = { to: zora721.proxyContractAddress, value: 0n, data: transferCallData, - }; + } - let transferHash: `0x${string}`; + let transferHash: `0x${string}` if (walletClient) { transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, account: walletClient.account!.address, ...preparedNFTTransfer, - }); + }) } else { const tx = await signer.sendTransaction({ chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, ...preparedNFTTransfer, - }); - transferHash = tx.hash; + }) + transferHash = tx.hash } const transactionReceipt = await publicClient.waitForTransactionReceipt( { hash: transferHash, }, - ); + ) const tbaNFTBalance = await getZora721Balance({ publicClient, walletAddress: ZORA721_TBA_ADDRESS, - }); - console.log("# of NFTs in TBA: ", tbaNFTBalance.toString()); + }) + console.log("# of NFTs in TBA: ", tbaNFTBalance.toString()) await vi.waitFor(() => { - expect(transferHash).toMatch(ADDRESS_REGEX); - expect(transactionReceipt.status).toBe("success"); - expect(tbaNFTBalance).toBe(2n); - }); + expect(transferHash).toMatch(ADDRESS_REGEX) + expect(transactionReceipt.status).toBe("success") + expect(tbaNFTBalance).toBe(2n) + }) }, TIMEOUT, - ); + ) // To perform transactions using the SDK, we need to transfer some ETH into the TBA. it( "can transfer ETH to the TBA", async () => { - const ethAmount = 1; - const ethAmountWei = parseUnits(`${ethAmount}`, 18); + const ethAmount = 1 + const ethAmountWei = parseUnits(`${ethAmount}`, 18) const preparedETHTransfer = { to: ZORA721_TBA_ADDRESS, value: ethAmountWei, // data is optional if nil - }; + } - let transferHash: `0x${string}`; + let transferHash: `0x${string}` if (walletClient) { transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, account: walletClient.account!.address, ...preparedETHTransfer, - }); + }) } else { transferHash = await signer .sendTransaction({ chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, ...preparedETHTransfer, }) - .then((tx: providers.TransactionResponse) => tx.hash); + .then((tx: providers.TransactionResponse) => tx.hash) } const balanceAfter = await publicClient.getBalance({ address: ZORA721_TBA_ADDRESS, - }); + }) await vi.waitFor(() => { - expect(transferHash).toMatch(ADDRESS_REGEX); - expect(balanceAfter).toBe(ethAmountWei); - }); + expect(transferHash).toMatch(ADDRESS_REGEX) + expect(balanceAfter).toBe(ethAmountWei) + }) }, TIMEOUT, - ); + ) it(isV2 ? "can prepareExecuteCall" : "can prepareExecution", async () => { const execution = { @@ -653,16 +653,16 @@ describe.each(ENABLED_TESTS)( to: TEST_CONFIG.RECIPIENT_ADDRESS, value: 0n, data: "", - }; + } const preparedCall = isV3 ? await tokenboundClient.prepareExecution(execution) - : await tokenboundClient.prepareExecuteCall(execution); + : await tokenboundClient.prepareExecuteCall(execution) - expect(isAddress(preparedCall.to)).toEqual(true); - expect(typeof preparedCall.value).toEqual("bigint"); - expect(isHex(preparedCall.data)).toEqual(true); - }); + expect(isAddress(preparedCall.to)).toEqual(true) + expect(typeof preparedCall.value).toEqual("bigint") + expect(isHex(preparedCall.data)).toEqual(true) + }) // Execute a basic call with no value with the TBA to see if it works. it( @@ -673,23 +673,23 @@ describe.each(ENABLED_TESTS)( to: zora721.proxyContractAddress, value: 0n, data: "", - }; + } const executedCallTxHash = isV3 ? await tokenboundClient.execute(execution) - : await tokenboundClient.executeCall(execution); + : await tokenboundClient.executeCall(execution) const transactionReceipt = await publicClient.getTransactionReceipt({ hash: executedCallTxHash, - }); + }) await vi.waitFor(() => { - expect(executedCallTxHash).toMatch(ADDRESS_REGEX); - expect(transactionReceipt.status).toBe("success"); - }); + expect(executedCallTxHash).toMatch(ADDRESS_REGEX) + expect(transactionReceipt.status).toBe("success") + }) }, TIMEOUT, - ); + ) it( `can fall back to executeCall from execute for V2`, @@ -699,93 +699,93 @@ describe.each(ENABLED_TESTS)( to: zora721.proxyContractAddress, value: 0n, data: "", - }; + } - const executedCallTxHash = await tokenboundClient.execute(execution); + const executedCallTxHash = await tokenboundClient.execute(execution) const transactionReceipt = await publicClient.getTransactionReceipt({ hash: executedCallTxHash, - }); + }) await vi.waitFor(() => { - expect(executedCallTxHash).toMatch(ADDRESS_REGEX); - expect(transactionReceipt.status).toBe("success"); - }); + expect(executedCallTxHash).toMatch(ADDRESS_REGEX) + expect(transactionReceipt.status).toBe("success") + }) }, TIMEOUT, - ); + ) // Other methods in the SDK implement executeCall, like transferETH, transferNFT, etc. // so they provide further assurance that executeCall is working as expected: it("can transferETH with the TBA", async () => { - const EXPECTED_BALANCE_BEFORE = parseUnits("1", 18); - const EXPECTED_BALANCE_AFTER = parseUnits("0.75", 18); + const EXPECTED_BALANCE_BEFORE = parseUnits("1", 18) + const EXPECTED_BALANCE_AFTER = parseUnits("0.75", 18) const balanceBefore = await publicClient.getBalance({ address: ZORA721_TBA_ADDRESS, - }); + }) const ethTransferHash = await tokenboundClient.transferETH({ account: ZORA721_TBA_ADDRESS, amount: 0.25, recipientAddress: ANVIL_USER_1, - }); + }) const transactionReceipt = await publicClient.getTransactionReceipt({ hash: ethTransferHash, - }); + }) const balanceAfter = await publicClient.getBalance({ address: ZORA721_TBA_ADDRESS, - }); + }) console.log( "BEFORE: ", formatEther(balanceBefore), "AFTER: ", formatEther(balanceAfter), - ); + ) await vi.waitFor(() => { - expect(ethTransferHash).toMatch(ADDRESS_REGEX); - expect(transactionReceipt.status).toBe("success"); - expect(balanceBefore).toBe(EXPECTED_BALANCE_BEFORE); - expect(balanceAfter).toBe(EXPECTED_BALANCE_AFTER); - }); - }); + expect(ethTransferHash).toMatch(ADDRESS_REGEX) + expect(transactionReceipt.status).toBe("success") + expect(balanceBefore).toBe(EXPECTED_BALANCE_BEFORE) + expect(balanceAfter).toBe(EXPECTED_BALANCE_AFTER) + }) + }) it("can transferETH to an ENS with the TBA", async () => { - const EXPECTED_BALANCE_BEFORE = parseUnits("0.75", 18); - const EXPECTED_BALANCE_AFTER = parseUnits("0.5", 18); + const EXPECTED_BALANCE_BEFORE = parseUnits("0.75", 18) + const EXPECTED_BALANCE_AFTER = parseUnits("0.5", 18) const balanceBefore = await publicClient.getBalance({ address: ZORA721_TBA_ADDRESS, - }); + }) const ethTransferHash = await tokenboundClient.transferETH({ account: ZORA721_TBA_ADDRESS, amount: 0.25, recipientAddress: "jeebay.eth", - }); + }) const balanceAfter = await publicClient.getBalance({ address: ZORA721_TBA_ADDRESS, - }); + }) console.log( "BEFORE: ", formatEther(balanceBefore), "AFTER: ", formatEther(balanceAfter), - ); + ) await vi.waitFor(() => { - expect(ethTransferHash).toMatch(ADDRESS_REGEX); - expect(balanceBefore).toBe(EXPECTED_BALANCE_BEFORE); - expect(balanceAfter).toBe(EXPECTED_BALANCE_AFTER); - }); - }); + expect(ethTransferHash).toMatch(ADDRESS_REGEX) + expect(balanceBefore).toBe(EXPECTED_BALANCE_BEFORE) + expect(balanceAfter).toBe(EXPECTED_BALANCE_AFTER) + }) + }) it("will not allow transferNFT 721 with an amount other than 1", async () => { - vi.spyOn(console, "error"); + vi.spyOn(console, "error") await expect(() => tokenboundClient.transferNFT({ @@ -796,8 +796,8 @@ describe.each(ENABLED_TESTS)( recipientAddress: ANVIL_USER_1, amount: 2, }), - ).rejects.toThrowError(); - }); + ).rejects.toThrowError() + }) it("can transferNFT a 721 with the TBA", async () => { const transferNFTHash = await tokenboundClient.transferNFT({ @@ -806,18 +806,18 @@ describe.each(ENABLED_TESTS)( tokenContract: zora721.proxyContractAddress, tokenId: TOKENID1_IN_TBA, recipientAddress: ANVIL_USER_1, - }); + }) const anvilAccount1NFTBalance = await getZora721Balance({ publicClient, walletAddress: ANVIL_USER_1, - }); + }) await vi.waitFor(() => { - expect(transferNFTHash).toMatch(ADDRESS_REGEX); - expect(anvilAccount1NFTBalance).toBe(1n); - }); - }); + expect(transferNFTHash).toMatch(ADDRESS_REGEX) + expect(anvilAccount1NFTBalance).toBe(1n) + }) + }) it("can transferNFT to an ENS with the TBA", async () => { const transferNFTHash = await tokenboundClient.transferNFT({ @@ -826,60 +826,60 @@ describe.each(ENABLED_TESTS)( tokenContract: zora721.proxyContractAddress, tokenId: TOKENID2_IN_TBA, recipientAddress: "jeebay.eth", - }); + }) - const addr = await resolvePossibleENS(publicClient, "jeebay.eth"); + const addr = await resolvePossibleENS(publicClient, "jeebay.eth") const anvilAccount1NFTBalance = await getZora721Balance({ publicClient, walletAddress: addr, - }); + }) await vi.waitFor(() => { - expect(transferNFTHash).toMatch(ADDRESS_REGEX); - expect(anvilAccount1NFTBalance).toBe(1n); - }); - }); + expect(transferNFTHash).toMatch(ADDRESS_REGEX) + expect(anvilAccount1NFTBalance).toBe(1n) + }) + }) it("can mint 4 Zora 721 NFTs with the TBA", async () => { const encodedMintFunctionData = encodeFunctionData({ abi: zora721.abi, functionName: "purchase", args: [BigInt(zora721.quantity)], - }); + }) const execution = { account: ZORA721_TBA_ADDRESS, to: zora721.proxyContractAddress, value: zora721.mintPrice * BigInt(zora721.quantity), data: encodedMintFunctionData, - }; + } const mintToTBATxHash = isV3 ? await tokenboundClient.execute(execution) - : await tokenboundClient.executeCall(execution); + : await tokenboundClient.executeCall(execution) const zoraBalanceInTBA = await getZora721Balance({ publicClient, walletAddress: ZORA721_TBA_ADDRESS, - }); + }) - console.log("721s MINTED TO TBA: ", zoraBalanceInTBA.toString()); + console.log("721s MINTED TO TBA: ", zoraBalanceInTBA.toString()) await vi.waitFor(() => { - expect(mintToTBATxHash).toMatch(ADDRESS_REGEX); - expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA); - expect(zoraBalanceInTBA).toBe(4n); - }); - }); + expect(mintToTBATxHash).toMatch(ADDRESS_REGEX) + expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA) + expect(zoraBalanceInTBA).toBe(4n) + }) + }) it("can mint an 1155 with the TBA", async () => { - const mintingAccount: `0x${string}` = ZORA721_TBA_ADDRESS; + const mintingAccount: `0x${string}` = ZORA721_TBA_ADDRESS const minterArguments: `0x${string}` = encodeAbiParameters( parseAbiParameters("address"), [mintingAccount], - ); + ) const data = encodeFunctionData({ abi: zora1155.abi, @@ -890,34 +890,34 @@ describe.each(ENABLED_TESTS)( zora1155.quantity, // uint256 minterArguments, // bytes ], - }); + }) const execution = { account: mintingAccount, to: zora1155.proxyContractAddress, value: zora1155.mintFee * zora1155.quantity, data, - }; + } const mint1155TxHash = isV3 ? await tokenboundClient.execute(execution) - : await tokenboundClient.executeCall(execution); + : await tokenboundClient.executeCall(execution) const zora1155BalanceInTBA = await getZora1155Balance({ publicClient, walletAddress: mintingAccount, - }); + }) - console.log("1155 Balance", zora1155BalanceInTBA); + console.log("1155 Balance", zora1155BalanceInTBA) await vi.waitFor(() => { - expect(mint1155TxHash).toMatch(ADDRESS_REGEX); - expect(zora1155BalanceInTBA).toBe(5n); - }); - }); + expect(mint1155TxHash).toMatch(ADDRESS_REGEX) + expect(zora1155BalanceInTBA).toBe(5n) + }) + }) it("can transferNFT an 1155 with the TBA", async () => { - const transferAmount = 2; + const transferAmount = 2 const transferNFTHash = await tokenboundClient.transferNFT({ account: ZORA721_TBA_ADDRESS, @@ -926,96 +926,93 @@ describe.each(ENABLED_TESTS)( tokenId: zora1155.tokenId.toString(), recipientAddress: ANVIL_USER_1, amount: transferAmount, - }); + }) const anvilAccount1_1155Balance = await getZora1155Balance({ publicClient, walletAddress: ANVIL_USER_1, - }); + }) - console.log("1155 Balance", anvilAccount1_1155Balance); + console.log("1155 Balance", anvilAccount1_1155Balance) await vi.waitFor(() => { - expect(transferNFTHash).toMatch(ADDRESS_REGEX); - expect(anvilAccount1_1155Balance).toBe(BigInt(transferAmount)); - }); - }); + expect(transferNFTHash).toMatch(ADDRESS_REGEX) + expect(anvilAccount1_1155Balance).toBe(BigInt(transferAmount)) + }) + }) v3OnlyIt( "can verify if a wallet isValidSigner for an owned NFT", async () => { - console.log( - "ZORA721_TBA_ADDRESS in isValidSigner", - ZORA721_TBA_ADDRESS, - ); + console.log("ZORA721_TBA_ADDRESS in isValidSigner", ZORA721_TBA_ADDRESS) const isValidSigner = await tokenboundClient.isValidSigner({ account: ZORA721_TBA_ADDRESS, - }); + }) - console.log("isValidSigner?", isValidSigner); + console.log("isValidSigner?", isValidSigner) await vi.waitFor(() => { - expect(isValidSigner).toBe(true); - }); + expect(isValidSigner).toBe(true) + }) }, - ); + ) // Test signing in viem only. // Ethers 5/6 don't appear to support signing messages via personal_sign with this testing configuration. viemOnlyIt("can sign a message", async () => { const signedMessageHash = await tokenboundClient.signMessage({ message: "Sign me", - }); + }) - console.log("SIGNED MESSAGE: ", signedMessageHash); + console.log("SIGNED MESSAGE: ", signedMessageHash) await vi.waitFor(() => { - expect(signedMessageHash).toMatch(ADDRESS_REGEX); - }); - }); + expect(signedMessageHash).toMatch(ADDRESS_REGEX) + }) + }) // Test signing hex message in viem only. viemOnlyIt("can sign a hexified message", async () => { const hexSignedMessageHash = await tokenboundClient.signMessage({ message: { raw: "0x68656c6c6f20776f726c64" }, - }); + }) - console.log("HEX SIGNED MESSAGE: ", hexSignedMessageHash); + console.log("HEX SIGNED MESSAGE: ", hexSignedMessageHash) await vi.waitFor(() => { - expect(hexSignedMessageHash).toMatch(ADDRESS_REGEX); - }); - }); + expect(hexSignedMessageHash).toMatch(ADDRESS_REGEX) + }) + }) // Test signing Uint8Array message as raw in viem only. viemOnlyIt("can sign a Uint8Array message as raw", async () => { const uint8ArrayMessage: Uint8Array = new Uint8Array([ 72, 101, 108, 108, 111, - ]); // "Hello" in ASCII + ]) // "Hello" in ASCII const rawUint8Hash = await tokenboundClient.signMessage({ message: { raw: uint8ArrayMessage }, - }); + }) await vi.waitFor(() => { - expect(rawUint8Hash).toMatch(ADDRESS_REGEX); - }); - }); + expect(rawUint8Hash).toMatch(ADDRESS_REGEX) + }) + }) // Test signing ArrayLike message in viem only. viemOnlyIt( "throws when viem incorrectly receives an ArrayLike message for signing", async () => { - vi.spyOn(console, "error"); - const arrayMessage: ArrayLike = [72, 101, 108, 108, 111]; // "Hello" in ASCII + vi.spyOn(console, "error") + const arrayMessage: ArrayLike = [72, 101, 108, 108, 111] // "Hello" in ASCII await expect(() => tokenboundClient.signMessage({ message: arrayMessage, }), - ).rejects.toThrowError(); + ).rejects.toThrowError() }, - ); + ) // Test signing Uint8Array message in viem only. viemOnlyIt( @@ -1023,37 +1020,37 @@ describe.each(ENABLED_TESTS)( async () => { const uint8ArrayMessage: Uint8Array = new Uint8Array([ 72, 101, 108, 108, 111, - ]); // "Hello" in ASCII + ]) // "Hello" in ASCII await expect(() => tokenboundClient.signMessage({ message: uint8ArrayMessage, }), - ).rejects.toThrowError(); + ).rejects.toThrowError() }, - ); + ) it( "can transferERC20 with the TBA", async () => { - const depositEthValue = 0.2; - const depositWeiValue = ethToWei(depositEthValue); - const transferEthValue = 0.1; - const transferWeiValue = ethToWei(transferEthValue); - let wethDepositHash: `0x${string}`; - let wethTransferHash: `0x${string}`; + const depositEthValue = 0.2 + const depositWeiValue = ethToWei(depositEthValue) + const transferEthValue = 0.1 + const transferWeiValue = ethToWei(transferEthValue) + let wethDepositHash: `0x${string}` + let wethTransferHash: `0x${string}` const tbaWETHInitial = await getWETHBalance({ publicClient, walletAddress: ZORA721_TBA_ADDRESS, - }); + }) // Prepare encoded WETH transfer to TBA const wethTransferCallData = encodeFunctionData({ abi: wethABI, functionName: "transfer", args: [ZORA721_TBA_ADDRESS, depositWeiValue], - }); + }) if (walletClient) { const wethContract = getContract({ @@ -1062,14 +1059,14 @@ describe.each(ENABLED_TESTS)( client: { wallet: walletClient, }, - }); + }) // Convert ETH to WETH in ANVIL_USER_0 wallet wethDepositHash = await wethContract.write.deposit({ account: ANVIL_USER_0, chain: ANVIL_CONFIG.ACTIVE_CHAIN, value: depositWeiValue, - }); + }) // Transfer WETH from ANVIL_USER_0 to TBA wethTransferHash = await walletClient.sendTransaction({ @@ -1078,7 +1075,7 @@ describe.each(ENABLED_TESTS)( to: WETH_CONTRACT_ADDRESS, value: 0n, data: wethTransferCallData, - }); + }) } else if (signer) { // Convert ETH to WETH in ANVIL_USER_0 wallet wethDepositHash = await signer @@ -1086,7 +1083,7 @@ describe.each(ENABLED_TESTS)( to: WETH_CONTRACT_ADDRESS, value: depositWeiValue, }) - .then((tx: providers.TransactionResponse) => tx.hash); + .then((tx: providers.TransactionResponse) => tx.hash) // Transfer WETH from ANVIL_USER_0 to TBA wethTransferHash = await signer @@ -1095,13 +1092,13 @@ describe.each(ENABLED_TESTS)( value: BigInt(0), data: wethTransferCallData, }) - .then((tx: providers.TransactionResponse) => tx.hash); + .then((tx: providers.TransactionResponse) => tx.hash) } const tbaWETHReceived = await getWETHBalance({ publicClient, walletAddress: ZORA721_TBA_ADDRESS, - }); + }) // Transfer WETH from TBA to ANVIL_USER_1 const transferredERC20Hash = await tokenboundClient.transferERC20({ @@ -1110,7 +1107,7 @@ describe.each(ENABLED_TESTS)( recipientAddress: ANVIL_USER_1, erc20tokenAddress: WETH_CONTRACT_ADDRESS, erc20tokenDecimals: 18, - }); + }) // Transfer WETH from TBA to jeebay.eth const ensTransferredERC20Hash = await tokenboundClient.transferERC20({ @@ -1119,22 +1116,22 @@ describe.each(ENABLED_TESTS)( recipientAddress: "jeebay.eth", erc20tokenAddress: WETH_CONTRACT_ADDRESS, erc20tokenDecimals: 18, - }); + }) const tbaWETHFinal = await getWETHBalance({ publicClient, walletAddress: ZORA721_TBA_ADDRESS, - }); + }) const anvilUser1WETHBalance = await getWETHBalance({ publicClient, walletAddress: ANVIL_USER_1, - }); + }) const ensWETHBalance = await getWETHBalance({ publicClient, walletAddress: "jeebay.eth", - }); + }) console.log( "TBA WETH INITIAL: ", @@ -1147,48 +1144,48 @@ describe.each(ENABLED_TESTS)( formatEther(anvilUser1WETHBalance), "ENS BALANCE: ", formatEther(ensWETHBalance), - ); + ) await vi.waitFor(() => { - expect(wethDepositHash).toMatch(ADDRESS_REGEX); - expect(wethTransferHash).toMatch(ADDRESS_REGEX); - expect(transferredERC20Hash).toMatch(ADDRESS_REGEX); - expect(ensTransferredERC20Hash).toMatch(ADDRESS_REGEX); - expect(tbaWETHReceived).toBe(depositWeiValue); - expect(anvilUser1WETHBalance).toBe(transferWeiValue); - expect(ensWETHBalance).toBe(transferWeiValue); - }); + expect(wethDepositHash).toMatch(ADDRESS_REGEX) + expect(wethTransferHash).toMatch(ADDRESS_REGEX) + expect(transferredERC20Hash).toMatch(ADDRESS_REGEX) + expect(ensTransferredERC20Hash).toMatch(ADDRESS_REGEX) + expect(tbaWETHReceived).toBe(depositWeiValue) + expect(anvilUser1WETHBalance).toBe(transferWeiValue) + expect(ensWETHBalance).toBe(transferWeiValue) + }) }, TIMEOUT, - ); + ) }, -); +) describe("Custom client configurations", () => { it("can use a custom publicClient RPC URL", async () => { - const customPublicClientRPCUrl = "https://cloudflare-eth.com"; + const customPublicClientRPCUrl = "https://cloudflare-eth.com" const tokenboundClient = new TokenboundClient({ chain: mainnet, walletClient, publicClientRPCUrl: customPublicClientRPCUrl, - }); + }) await vi.waitFor(() => { expect(tokenboundClient.publicClient?.transport?.url).toBe( customPublicClientRPCUrl, - ); - }); - }); + ) + }) + }) it("can use a custom chain as parameter", async () => { - const ZORA_CHAIN_ID = 7777777; + const ZORA_CHAIN_ID = 7777777 const tokenboundClient = new TokenboundClient({ walletClient, chain: zora, - }); + }) await vi.waitFor(() => { - expect(tokenboundClient.publicClient?.chain?.id).toBe(ZORA_CHAIN_ID); - }); - }); -}); + expect(tokenboundClient.publicClient?.chain?.id).toBe(ZORA_CHAIN_ID) + }) + }) +}) diff --git a/packages/sdk/src/test/config/anvil.ts b/packages/sdk/src/test/config/anvil.ts index 209117a..26c046b 100644 --- a/packages/sdk/src/test/config/anvil.ts +++ b/packages/sdk/src/test/config/anvil.ts @@ -1,15 +1,15 @@ /// -import { CreateAnvilOptions } from "@viem/anvil"; -import { mainnet } from "viem/chains"; +import { CreateAnvilOptions } from "@viem/anvil" +import { mainnet } from "viem/chains" -const ACTIVE_CHAIN = mainnet; +const ACTIVE_CHAIN = mainnet export const ANVIL_CONFIG = { TIMEOUT: 60000, // default 10000 ACTIVE_CHAIN: ACTIVE_CHAIN, -}; +} export const CREATE_ANVIL_OPTIONS: CreateAnvilOptions = { forkUrl: import.meta.env.VITE_ANVIL_MAINNET_FORK_ENDPOINT, -}; +} diff --git a/packages/sdk/src/test/config/base.ts b/packages/sdk/src/test/config/base.ts index d74eb39..43a3566 100644 --- a/packages/sdk/src/test/config/base.ts +++ b/packages/sdk/src/test/config/base.ts @@ -4,4 +4,4 @@ export const TEST_CONFIG = { ), ERC1167_HEADER: "363d3d373d3d3d363d73", ERC1167_FOOTER: "5af43d82803e903d91602b57fd5bf3", -}; +} diff --git a/packages/sdk/src/test/config/index.ts b/packages/sdk/src/test/config/index.ts index 1790f1c..5a2da7b 100644 --- a/packages/sdk/src/test/config/index.ts +++ b/packages/sdk/src/test/config/index.ts @@ -1,3 +1,3 @@ -export * from "./anvil"; -export * from "./base"; -export * from "./mints"; +export * from "./anvil" +export * from "./base" +export * from "./mints" diff --git a/packages/sdk/src/test/config/mints.ts b/packages/sdk/src/test/config/mints.ts index fcdf1d3..0a254d4 100644 --- a/packages/sdk/src/test/config/mints.ts +++ b/packages/sdk/src/test/config/mints.ts @@ -1,6 +1,6 @@ -import { getAddress } from "viem"; -import { ethToWei } from "../utils"; -import { zora721DropABI, zora1155ABI } from "../wagmi-cli-hooks/generated"; +import { getAddress } from "viem" +import { ethToWei } from "../utils" +import { zora721DropABI, zora1155ABI } from "../wagmi-cli-hooks/generated" // Zora Webb's First Deep Field: https://zora.co/collect/eth:0x28ee638f2fcb66b4106acab7efd225aeb2bd7e8d export const zora721 = { @@ -10,7 +10,7 @@ export const zora721 = { ), mintPrice: BigInt(0), quantity: 4, -}; +} // https://zora.co/collect/eth:0x373075bab7d668ed2473d8233ebdebcf49eb758e/1 export const zora1155 = { @@ -24,4 +24,4 @@ export const zora1155 = { tokenId: BigInt(1), mintFee: ethToWei(0.000777), quantity: BigInt(5), -}; +} diff --git a/packages/sdk/src/test/config/setup.ts b/packages/sdk/src/test/config/setup.ts index d0de870..df6631e 100644 --- a/packages/sdk/src/test/config/setup.ts +++ b/packages/sdk/src/test/config/setup.ts @@ -1 +1 @@ -import "@testing-library/jest-dom"; +import "@testing-library/jest-dom" diff --git a/packages/sdk/src/test/config/shell.ts b/packages/sdk/src/test/config/shell.ts index 0e8d17f..a230a72 100644 --- a/packages/sdk/src/test/config/shell.ts +++ b/packages/sdk/src/test/config/shell.ts @@ -4,4 +4,4 @@ export const SHELL_COMMANDS = { // DEPLOY_REGISTRY: // 'forge script --fork-url http://127.0.0.1:8545 6551contracts/script/DeployRegistry.s.sol --broadcast', // DEPLOY_ACCOUNT_IMPLEMENTATION: `forge create 6551contracts/src/examples/simple/SimpleERC6551Account.sol:SimpleERC6551Account --rpc-url=$RPC_URL --private-key=$PRIVATE_KEY`, -}; +} diff --git a/packages/sdk/src/test/constants/addresses.ts b/packages/sdk/src/test/constants/addresses.ts index 1dd4690..47bcbd3 100644 --- a/packages/sdk/src/test/constants/addresses.ts +++ b/packages/sdk/src/test/constants/addresses.ts @@ -1,5 +1,5 @@ -import { getAddress } from "viem"; +import { getAddress } from "viem" export const WETH_CONTRACT_ADDRESS = getAddress( "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", -); +) diff --git a/packages/sdk/src/test/constants/anvil.ts b/packages/sdk/src/test/constants/anvil.ts index 0c53b4d..3566a6f 100644 --- a/packages/sdk/src/test/constants/anvil.ts +++ b/packages/sdk/src/test/constants/anvil.ts @@ -1,8 +1,8 @@ -import { foundry } from "viem/chains"; -import { AnvilAccount } from "../../types"; -import { getAddress } from "viem"; +import { foundry } from "viem/chains" +import { AnvilAccount } from "../../types" +import { getAddress } from "viem" -export const ANVIL_RPC_URL = foundry.rpcUrls.default.http[0]; +export const ANVIL_RPC_URL = foundry.rpcUrls.default.http[0] // Anvil Accounts for local testing export const ANVIL_ACCOUNTS: AnvilAccount[] = [ @@ -50,4 +50,4 @@ export const ANVIL_ACCOUNTS: AnvilAccount[] = [ // (7) 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356 // (8) 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 // (9) 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 -]; +] diff --git a/packages/sdk/src/test/constants/index.ts b/packages/sdk/src/test/constants/index.ts index 2eb1f15..81ea8fd 100644 --- a/packages/sdk/src/test/constants/index.ts +++ b/packages/sdk/src/test/constants/index.ts @@ -1,3 +1,3 @@ -export * from "./addresses"; -export * from "./anvil"; -export * from "./regexes"; +export * from "./addresses" +export * from "./anvil" +export * from "./regexes" diff --git a/packages/sdk/src/test/constants/regexes.ts b/packages/sdk/src/test/constants/regexes.ts index ef2df20..2c81da0 100644 --- a/packages/sdk/src/test/constants/regexes.ts +++ b/packages/sdk/src/test/constants/regexes.ts @@ -1 +1 @@ -export const ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}/; +export const ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}/ diff --git a/packages/sdk/src/test/mockWallet.tsx b/packages/sdk/src/test/mockWallet.tsx index 14cf085..0ecb6a5 100644 --- a/packages/sdk/src/test/mockWallet.tsx +++ b/packages/sdk/src/test/mockWallet.tsx @@ -1,8 +1,8 @@ -import { RenderOptions, RenderResult, render } from "@testing-library/react"; -import { default as userEvent } from "@testing-library/user-event"; -import * as React from "react"; +import { RenderOptions, RenderResult, render } from "@testing-library/react" +import { default as userEvent } from "@testing-library/user-event" +import * as React from "react" -import { WalletClient, PublicClient } from "viem"; +import { WalletClient, PublicClient } from "viem" import { CreateConfigParameters, @@ -11,7 +11,7 @@ import { // WalletClient, // PublicClient, createConfig, -} from "wagmi"; +} from "wagmi" // import { createPublicClient, WalletClient, PublicClient, createWalletClient, http } from 'viem' // import { MockConnector } from 'wagmi/connectors/mock' @@ -48,11 +48,11 @@ import { // options?: RenderOptions // ): RenderResult => render(ui, { wrapper: Providers, ...options }) -export * from "@testing-library/react"; +export * from "@testing-library/react" // export { renderWithWagmiConfig } -export type UserEvent = ReturnType; -export { default as userEvent } from "@testing-library/user-event"; +export type UserEvent = ReturnType +export { default as userEvent } from "@testing-library/user-event" -export { getMockWalletClient } from "./utils"; -export { ADDRESS_REGEX } from "./constants"; +export { getMockWalletClient } from "./utils" +export { ADDRESS_REGEX } from "./constants" diff --git a/packages/sdk/src/test/types/index.ts b/packages/sdk/src/test/types/index.ts index 65cd856..ee4b79c 100644 --- a/packages/sdk/src/test/types/index.ts +++ b/packages/sdk/src/test/types/index.ts @@ -1 +1 @@ -export * from "./testers"; +export * from "./testers" diff --git a/packages/sdk/src/test/types/testers.ts b/packages/sdk/src/test/types/testers.ts index 4b8b0cd..54148ba 100644 --- a/packages/sdk/src/test/types/testers.ts +++ b/packages/sdk/src/test/types/testers.ts @@ -2,6 +2,6 @@ export const Tester = { ETHERS: "ETHERS", ETHERS_6: "ETHERS_6", VIEM_WALLETCLIENT: "VIEM_WALLETCLIENT", -} as const; +} as const -export type TesterType = (typeof Tester)[keyof typeof Tester]; +export type TesterType = (typeof Tester)[keyof typeof Tester] diff --git a/packages/sdk/src/test/utils/clients.ts b/packages/sdk/src/test/utils/clients.ts index 2be8742..b48dbc8 100644 --- a/packages/sdk/src/test/utils/clients.ts +++ b/packages/sdk/src/test/utils/clients.ts @@ -5,17 +5,17 @@ import { createWalletClient, http, Chain, -} from "viem"; -import { foundry } from "viem/chains"; +} from "viem" +import { foundry } from "viem/chains" // import { chainIdToChain } from '../../utils' -import { ANVIL_RPC_URL, ANVIL_ACCOUNTS } from "../constants"; +import { ANVIL_RPC_URL, ANVIL_ACCOUNTS } from "../constants" export const getPublicClient = ({ // chainId = foundry.id, chain, }: { // chainId?: number - chain: Chain; + chain: Chain }): PublicClient => { // const chain = chainIdToChain(chainId) @@ -25,5 +25,5 @@ export const getPublicClient = ({ transport: http(ANVIL_RPC_URL), chain, pollingInterval: 100, - }); -}; + }) +} diff --git a/packages/sdk/src/test/utils/debug.ts b/packages/sdk/src/test/utils/debug.ts index c5b7056..2979946 100644 --- a/packages/sdk/src/test/utils/debug.ts +++ b/packages/sdk/src/test/utils/debug.ts @@ -1,4 +1,4 @@ -import { PublicClient } from "viem"; +import { PublicClient } from "viem" /** * Emits console output related to the given transaction hash for debugging purposes. @@ -11,14 +11,14 @@ export async function debugTransaction({ publicClient, hash, }: { publicClient: PublicClient; hash: `0x${string}` }) { - console.log("DEBUGGING TRANSACTION: ", hash); + console.log("DEBUGGING TRANSACTION: ", hash) const transactionReceipt = await publicClient.getTransactionReceipt({ hash, - }); - console.log("transactionReceipt", transactionReceipt); + }) + console.log("transactionReceipt", transactionReceipt) const transaction = await publicClient.getTransaction({ hash, - }); - console.log("transaction", transaction); + }) + console.log("transaction", transaction) } diff --git a/packages/sdk/src/test/utils/ethToWei.ts b/packages/sdk/src/test/utils/ethToWei.ts index 00ab545..2e2323d 100644 --- a/packages/sdk/src/test/utils/ethToWei.ts +++ b/packages/sdk/src/test/utils/ethToWei.ts @@ -1,5 +1,5 @@ -import { parseUnits } from "viem"; +import { parseUnits } from "viem" export function ethToWei(eth: number) { - return parseUnits(eth.toString(), 18); + return parseUnits(eth.toString(), 18) } diff --git a/packages/sdk/src/test/utils/getAnvilLogs.ts b/packages/sdk/src/test/utils/getAnvilLogs.ts index fad9aab..b638b65 100644 --- a/packages/sdk/src/test/utils/getAnvilLogs.ts +++ b/packages/sdk/src/test/utils/getAnvilLogs.ts @@ -4,7 +4,7 @@ export async function getAnvilLogs(url: string, id: number): Promise { headers: { "Content-Type": "application/json", }, - }); + }) - return response.json(); + return response.json() } diff --git a/packages/sdk/src/test/utils/getWETHBalance.ts b/packages/sdk/src/test/utils/getWETHBalance.ts index 18bcc76..7554b06 100644 --- a/packages/sdk/src/test/utils/getWETHBalance.ts +++ b/packages/sdk/src/test/utils/getWETHBalance.ts @@ -1,20 +1,20 @@ -import { PublicClient, erc20Abi } from "viem"; -import { WETH_CONTRACT_ADDRESS } from "../constants"; -import { resolvePossibleENS } from "../../utils"; -import { PossibleENSAddress } from "../../types"; +import { PublicClient, erc20Abi } from "viem" +import { WETH_CONTRACT_ADDRESS } from "../constants" +import { resolvePossibleENS } from "../../utils" +import { PossibleENSAddress } from "../../types" export async function getWETHBalance({ publicClient, walletAddress, }: { - publicClient: PublicClient; - walletAddress: PossibleENSAddress; + publicClient: PublicClient + walletAddress: PossibleENSAddress }) { - const address = await resolvePossibleENS(publicClient, walletAddress); + const address = await resolvePossibleENS(publicClient, walletAddress) return await publicClient.readContract({ address: WETH_CONTRACT_ADDRESS, abi: erc20Abi, functionName: "balanceOf", args: [address], - }); + }) } diff --git a/packages/sdk/src/test/utils/getZora1155Balance.ts b/packages/sdk/src/test/utils/getZora1155Balance.ts index d8af383..eced5b9 100644 --- a/packages/sdk/src/test/utils/getZora1155Balance.ts +++ b/packages/sdk/src/test/utils/getZora1155Balance.ts @@ -1,21 +1,21 @@ -import { PublicClient } from "viem"; -import { zora1155 } from "../config"; -import { zora1155ABI } from "../wagmi-cli-hooks/generated"; -import { resolvePossibleENS } from "../../utils"; -import { PossibleENSAddress } from "../../types"; +import { PublicClient } from "viem" +import { zora1155 } from "../config" +import { zora1155ABI } from "../wagmi-cli-hooks/generated" +import { resolvePossibleENS } from "../../utils" +import { PossibleENSAddress } from "../../types" export async function getZora1155Balance({ publicClient, walletAddress, }: { - publicClient: PublicClient; - walletAddress: PossibleENSAddress; + publicClient: PublicClient + walletAddress: PossibleENSAddress }) { - const address = await resolvePossibleENS(publicClient, walletAddress); + const address = await resolvePossibleENS(publicClient, walletAddress) return await publicClient.readContract({ address: zora1155.proxyContractAddress, abi: zora1155ABI, functionName: "balanceOf", args: [address, zora1155.tokenId], - }); + }) } diff --git a/packages/sdk/src/test/utils/getZora721Balance.ts b/packages/sdk/src/test/utils/getZora721Balance.ts index 0a064be..fa85975 100644 --- a/packages/sdk/src/test/utils/getZora721Balance.ts +++ b/packages/sdk/src/test/utils/getZora721Balance.ts @@ -1,22 +1,22 @@ -import { PublicClient, getAddress } from "viem"; -import { zora721 } from "../config"; -import { zora721DropABI } from "../wagmi-cli-hooks/generated"; -import { resolvePossibleENS } from "../../utils"; -import { PossibleENSAddress } from "../../types"; +import { PublicClient, getAddress } from "viem" +import { zora721 } from "../config" +import { zora721DropABI } from "../wagmi-cli-hooks/generated" +import { resolvePossibleENS } from "../../utils" +import { PossibleENSAddress } from "../../types" export async function getZora721Balance({ publicClient, walletAddress, }: { - publicClient: PublicClient; - walletAddress: PossibleENSAddress; + publicClient: PublicClient + walletAddress: PossibleENSAddress }) { - const address = await resolvePossibleENS(publicClient, walletAddress); + const address = await resolvePossibleENS(publicClient, walletAddress) return await publicClient.readContract({ address: zora721.proxyContractAddress, abi: zora721DropABI, functionName: "balanceOf", args: [address], - }); + }) } diff --git a/packages/sdk/src/test/utils/index.ts b/packages/sdk/src/test/utils/index.ts index 796a5c2..3bff077 100644 --- a/packages/sdk/src/test/utils/index.ts +++ b/packages/sdk/src/test/utils/index.ts @@ -1,8 +1,8 @@ -export * from "./clients"; -export * from "./debug"; -export * from "./shellCommand"; -export * from "./ethToWei"; -export * from "./getAnvilLogs"; -export * from "./getWETHBalance"; -export * from "./getZora1155Balance"; -export * from "./getZora721Balance"; +export * from "./clients" +export * from "./debug" +export * from "./shellCommand" +export * from "./ethToWei" +export * from "./getAnvilLogs" +export * from "./getWETHBalance" +export * from "./getZora1155Balance" +export * from "./getZora721Balance" diff --git a/packages/sdk/src/test/utils/shellCommand.ts b/packages/sdk/src/test/utils/shellCommand.ts index 0ad5a82..f5cceff 100644 --- a/packages/sdk/src/test/utils/shellCommand.ts +++ b/packages/sdk/src/test/utils/shellCommand.ts @@ -1,4 +1,4 @@ -import { exec } from "child_process"; // Node.js child_process module +import { exec } from "child_process" // Node.js child_process module /** * Executes a shell command and returns the output as a promise. @@ -16,11 +16,11 @@ export function shellCommand(cmd: string): Promise { return new Promise((resolve, reject) => { exec(cmd, (error, stdout, stderr) => { if (error) { - console.warn(`Error executing command: ${cmd}`); - reject(error); - return; + console.warn(`Error executing command: ${cmd}`) + reject(error) + return } - resolve(stdout || stderr); - }); - }); + resolve(stdout || stderr) + }) + }) } diff --git a/packages/sdk/src/test/wagmi-cli-hooks/generated.ts b/packages/sdk/src/test/wagmi-cli-hooks/generated.ts index ad5ad23..f379328 100644 --- a/packages/sdk/src/test/wagmi-cli-hooks/generated.ts +++ b/packages/sdk/src/test/wagmi-cli-hooks/generated.ts @@ -77,7 +77,7 @@ export const erc6551AccountProxyV3ABI = [ outputs: [], }, { stateMutability: "payable", type: "receive" }, -] as const; +] as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F) @@ -86,7 +86,7 @@ export const erc6551AccountProxyV3ABI = [ export const erc6551AccountProxyV3Address = { 1: "0x55266d75D1a14E4572138116aF39863Ed6596E7F", 5: "0x55266d75D1a14E4572138116aF39863Ed6596E7F", -} as const; +} as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F) @@ -95,7 +95,7 @@ export const erc6551AccountProxyV3Address = { export const erc6551AccountProxyV3Config = { address: erc6551AccountProxyV3Address, abi: erc6551AccountProxyV3ABI, -} as const; +} as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC6551Account_V2_ @@ -171,7 +171,7 @@ export const erc6551AccountV2ABI = [ outputs: [], }, { stateMutability: "payable", type: "receive" }, -] as const; +] as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x2D25602551487C3f3354dD80D76D54383A243358) @@ -180,7 +180,7 @@ export const erc6551AccountV2ABI = [ export const erc6551AccountV2Address = { 1: "0x2D25602551487C3f3354dD80D76D54383A243358", 5: "0x2D25602551487C3f3354dD80D76D54383A243358", -} as const; +} as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x2D25602551487C3f3354dD80D76D54383A243358) @@ -189,7 +189,7 @@ export const erc6551AccountV2Address = { export const erc6551AccountV2Config = { address: erc6551AccountV2Address, abi: erc6551AccountV2ABI, -} as const; +} as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC6551Account_V3_ @@ -675,7 +675,7 @@ export const erc6551AccountV3ABI = [ ], }, { stateMutability: "payable", type: "receive" }, -] as const; +] as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC) @@ -684,7 +684,7 @@ export const erc6551AccountV3ABI = [ export const erc6551AccountV3Address = { 1: "0x41C8f39463A868d3A88af00cd0fe7102F30E44eC", 5: "0x41C8f39463A868d3A88af00cd0fe7102F30E44eC", -} as const; +} as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC) @@ -693,7 +693,7 @@ export const erc6551AccountV3Address = { export const erc6551AccountV3Config = { address: erc6551AccountV3Address, abi: erc6551AccountV3ABI, -} as const; +} as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC6551Registry_V2_ @@ -775,7 +775,7 @@ export const erc6551RegistryV2ABI = [ name: "createAccount", outputs: [{ name: "", internalType: "address", type: "address" }], }, -] as const; +] as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x02101dfB77FDE026414827Fdc604ddAF224F0921) @@ -784,7 +784,7 @@ export const erc6551RegistryV2ABI = [ export const erc6551RegistryV2Address = { 1: "0x02101dfB77FDE026414827Fdc604ddAF224F0921", 5: "0x02101dfB77FDE026414827Fdc604ddAF224F0921", -} as const; +} as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x02101dfB77FDE026414827Fdc604ddAF224F0921) @@ -793,7 +793,7 @@ export const erc6551RegistryV2Address = { export const erc6551RegistryV2Config = { address: erc6551RegistryV2Address, abi: erc6551RegistryV2ABI, -} as const; +} as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC6551Registry_V3_ @@ -874,7 +874,7 @@ export const erc6551RegistryV3ABI = [ name: "createAccount", outputs: [{ name: "", internalType: "address", type: "address" }], }, -] as const; +] as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x000000006551c19487814612e58FE06813775758) @@ -883,7 +883,7 @@ export const erc6551RegistryV3ABI = [ export const erc6551RegistryV3Address = { 1: "0x000000006551c19487814612e58FE06813775758", 5: "0x000000006551c19487814612e58FE06813775758", -} as const; +} as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x000000006551c19487814612e58FE06813775758) @@ -892,7 +892,7 @@ export const erc6551RegistryV3Address = { export const erc6551RegistryV3Config = { address: erc6551RegistryV3Address, abi: erc6551RegistryV3ABI, -} as const; +} as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // WETH_ @@ -1054,7 +1054,7 @@ export const wethABI = [ ], name: "Withdrawal", }, -] as const; +] as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) @@ -1063,13 +1063,13 @@ export const wethABI = [ export const wethAddress = { 1: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 5: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", -} as const; +} as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6) */ -export const wethConfig = { address: wethAddress, abi: wethABI } as const; +export const wethConfig = { address: wethAddress, abi: wethABI } as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Zora1155_ @@ -2479,7 +2479,7 @@ export const zora1155ABI = [ name: "withdrawRewards", outputs: [], }, -] as const; +] as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) @@ -2488,7 +2488,7 @@ export const zora1155ABI = [ export const zora1155Address = { 1: "0x4482c5929618b848a46E3DA830A3D71085A5DE07", 5: "0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA", -} as const; +} as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) @@ -2497,7 +2497,7 @@ export const zora1155Address = { export const zora1155Config = { address: zora1155Address, abi: zora1155ABI, -} as const; +} as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Zora721Drop_ @@ -3802,7 +3802,7 @@ export const zora721DropABI = [ ], }, { stateMutability: "payable", type: "receive" }, -] as const; +] as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x7c74dfe39976dc395529c14e54a597809980e01c) @@ -3811,7 +3811,7 @@ export const zora721DropABI = [ export const zora721DropAddress = { 1: "0x7C74dfe39976dc395529c14e54a597809980e01C", 5: "0xe4c17055048aEe01D0d122804816fEe5E6ac4A67", -} as const; +} as const /** * - [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x7c74dfe39976dc395529c14e54a597809980e01c) @@ -3820,4 +3820,4 @@ export const zora721DropAddress = { export const zora721DropConfig = { address: zora721DropAddress, abi: zora721DropABI, -} as const; +} as const diff --git a/packages/sdk/src/types/abstractEthersSigner.ts b/packages/sdk/src/types/abstractEthersSigner.ts index 6967c01..2771d2b 100644 --- a/packages/sdk/src/types/abstractEthersSigner.ts +++ b/packages/sdk/src/types/abstractEthersSigner.ts @@ -3,5 +3,5 @@ // This type assures that there is at least some degree of type safety on the Ethers implementation of the TokenboundClient. export type AbstractEthersSigner = { - readonly _isSigner: boolean; -} & Record; + readonly _isSigner: boolean +} & Record diff --git a/packages/sdk/src/types/abstractEthersTransactionResponse.ts b/packages/sdk/src/types/abstractEthersTransactionResponse.ts index 75d4c1f..b07c76f 100644 --- a/packages/sdk/src/types/abstractEthersTransactionResponse.ts +++ b/packages/sdk/src/types/abstractEthersTransactionResponse.ts @@ -3,5 +3,5 @@ // This type assures that there is at least some degree of type safety on the Ethers implementation of the TokenboundClient. export type AbstractEthersTransactionResponse = { - hash: string; -} & Record; + hash: string +} & Record diff --git a/packages/sdk/src/types/addresses.ts b/packages/sdk/src/types/addresses.ts index 754b964..f80091b 100644 --- a/packages/sdk/src/types/addresses.ts +++ b/packages/sdk/src/types/addresses.ts @@ -1 +1 @@ -export type PossibleENSAddress = `0x${string}` | `${string}.eth`; +export type PossibleENSAddress = `0x${string}` | `${string}.eth` diff --git a/packages/sdk/src/types/anvilAccount.ts b/packages/sdk/src/types/anvilAccount.ts index 95ab158..fe750a6 100644 --- a/packages/sdk/src/types/anvilAccount.ts +++ b/packages/sdk/src/types/anvilAccount.ts @@ -1,5 +1,5 @@ export type AnvilAccount = { - name: string; - address: `0x${string}`; - privateKey: `0x${string}`; -}; + name: string + address: `0x${string}` + privateKey: `0x${string}` +} diff --git a/packages/sdk/src/types/callData.ts b/packages/sdk/src/types/callData.ts index 769a4ce..4a3ed4a 100644 --- a/packages/sdk/src/types/callData.ts +++ b/packages/sdk/src/types/callData.ts @@ -1,5 +1,5 @@ export type CallData = { - to: `0x${string}`; - value: bigint; - data: `0x${string}`; -}; + to: `0x${string}` + value: bigint + data: `0x${string}` +} diff --git a/packages/sdk/src/types/contractABIPair.ts b/packages/sdk/src/types/contractABIPair.ts index bc98e9d..27a464e 100644 --- a/packages/sdk/src/types/contractABIPair.ts +++ b/packages/sdk/src/types/contractABIPair.ts @@ -1,6 +1,6 @@ -import { Abi } from "viem"; +import { Abi } from "viem" export type ContractABIPair = { - ADDRESS: `0x${string}`; - ABI: Abi; -}; + ADDRESS: `0x${string}` + ABI: Abi +} diff --git a/packages/sdk/src/types/erc6551Bytecode.ts b/packages/sdk/src/types/erc6551Bytecode.ts index 922881c..b1112b9 100644 --- a/packages/sdk/src/types/erc6551Bytecode.ts +++ b/packages/sdk/src/types/erc6551Bytecode.ts @@ -1,11 +1,11 @@ // Segmented ERC6551 bytecode export type SegmentedERC6551Bytecode = { - erc1167Header: string; // 10 bytes - implementationAddress: `0x${string}`; // 20 bytes - erc1167Footer: string; // 15 bytes - salt: number; // 32 bytes - tokenId: string; // 32 bytes - tokenContract: `0x${string}`; // 32 bytes - chainId: number; // 32 bytes -}; + erc1167Header: string // 10 bytes + implementationAddress: `0x${string}` // 20 bytes + erc1167Footer: string // 15 bytes + salt: number // 32 bytes + tokenId: string // 32 bytes + tokenContract: `0x${string}` // 32 bytes + chainId: number // 32 bytes +} diff --git a/packages/sdk/src/types/index.ts b/packages/sdk/src/types/index.ts index 80fc6e0..a315f55 100644 --- a/packages/sdk/src/types/index.ts +++ b/packages/sdk/src/types/index.ts @@ -1,12 +1,12 @@ -export * from "./abstractEthersSigner"; -export * from "./abstractEthersTransactionResponse"; -export * from "./addresses"; -export * from "./anvilAccount"; -export * from "./callData"; -export * from "./contractABIPair"; -export * from "./operations"; -export * from "./erc6551Bytecode"; -export * from "./messages"; -export * from "./multicall"; -export * from "./params"; -export * from "./prettify"; +export * from "./abstractEthersSigner" +export * from "./abstractEthersTransactionResponse" +export * from "./addresses" +export * from "./anvilAccount" +export * from "./callData" +export * from "./contractABIPair" +export * from "./operations" +export * from "./erc6551Bytecode" +export * from "./messages" +export * from "./multicall" +export * from "./params" +export * from "./prettify" diff --git a/packages/sdk/src/types/messages.ts b/packages/sdk/src/types/messages.ts index 315bafa..7302ffb 100644 --- a/packages/sdk/src/types/messages.ts +++ b/packages/sdk/src/types/messages.ts @@ -1,14 +1,14 @@ -import { SignableMessage } from "viem"; -import { Prettify } from "./prettify"; +import { SignableMessage } from "viem" +import { Prettify } from "./prettify" -export type Bytes = ArrayLike; -export type Ethers5SignableMessage = Bytes | string; -export type Ethers6SignableMessage = string | Uint8Array; +export type Bytes = ArrayLike +export type Ethers5SignableMessage = Bytes | string +export type Ethers6SignableMessage = string | Uint8Array export type EthersSignableMessage = | Ethers5SignableMessage - | Ethers6SignableMessage; + | Ethers6SignableMessage export type UniversalSignableMessage = Prettify< EthersSignableMessage | SignableMessage ->; // SignableMessage is string | { raw: Hex | ByteArray } // where ByteArray = Uint8Array +> // SignableMessage is string | { raw: Hex | ByteArray } // where ByteArray = Uint8Array diff --git a/packages/sdk/src/types/multicall.ts b/packages/sdk/src/types/multicall.ts index c315aae..fba390a 100644 --- a/packages/sdk/src/types/multicall.ts +++ b/packages/sdk/src/types/multicall.ts @@ -1,12 +1,12 @@ -import { TransactionRequestEIP1559 } from "viem"; +import { TransactionRequestEIP1559 } from "viem" export type Call3 = { - target: `0x${string}`; // The target contract - allowFailure: boolean; // If false, the entire call will revert if the call fails. - callData: `0x${string}`; // Encoded function data to call on the target contract. -}; + target: `0x${string}` // The target contract + allowFailure: boolean // If false, the entire call will revert if the call fails. + callData: `0x${string}` // Encoded function data to call on the target contract. +} export type MultiCallTx = Omit< TransactionRequestEIP1559, "from" | "account" ->; +> diff --git a/packages/sdk/src/types/operations.ts b/packages/sdk/src/types/operations.ts index 47009fd..b2e8d5e 100644 --- a/packages/sdk/src/types/operations.ts +++ b/packages/sdk/src/types/operations.ts @@ -3,7 +3,7 @@ export const CALL_OPERATIONS = { DELEGATECALL: 1, CREATE: 2, CREATE2: 3, -} as const; +} as const export type CallOperation = - (typeof CALL_OPERATIONS)[keyof typeof CALL_OPERATIONS]; + (typeof CALL_OPERATIONS)[keyof typeof CALL_OPERATIONS] diff --git a/packages/sdk/src/types/params.ts b/packages/sdk/src/types/params.ts index 726ac97..2c1570f 100644 --- a/packages/sdk/src/types/params.ts +++ b/packages/sdk/src/types/params.ts @@ -1,142 +1,141 @@ -import { WalletClient, PublicClient, Chain } from "viem"; -import { Prettify } from "./prettify"; -import { UniversalSignableMessage, CallOperation, Call3 } from "."; -import { PossibleENSAddress } from "./addresses"; -import { ERC_6551_LEGACY_V2 } from "../constants"; +import { WalletClient, PublicClient, Chain } from "viem" +import { Prettify } from "./prettify" +import { UniversalSignableMessage, CallOperation, Call3 } from "." +import { PossibleENSAddress } from "./addresses" +import { ERC_6551_LEGACY_V2 } from "../constants" export const NFTTokenType = { ERC721: "ERC721", ERC1155: "ERC1155", -} as const; +} as const export const TBVersion = { V2: 2, V3: 3, -} as const; +} as const -export type TBImplementationVersion = - (typeof TBVersion)[keyof typeof TBVersion]; +export type TBImplementationVersion = (typeof TBVersion)[keyof typeof TBVersion] -type TokenType = (typeof NFTTokenType)[keyof typeof NFTTokenType]; +type TokenType = (typeof NFTTokenType)[keyof typeof NFTTokenType] type NFTParams = Prettify<{ - tokenContract: `0x${string}`; - tokenId: string; -}>; + tokenContract: `0x${string}` + tokenId: string +}> export type TokenboundAccountNFT = Prettify< NFTParams & { - chainId: number; + chainId: number } ->; +> interface TokenTypeParams { - tokenType: TokenType; + tokenType: TokenType } export type NFTTransferParams = Prettify< TokenTypeParams & NFTParams & { - recipientAddress: PossibleENSAddress; - account: `0x${string}`; - amount?: number; - chainId?: number; + recipientAddress: PossibleENSAddress + account: `0x${string}` + amount?: number + chainId?: number } ->; +> export type ETHTransferParams = Prettify<{ - account: `0x${string}`; - recipientAddress: PossibleENSAddress; - amount: number; - chainId?: number; -}>; + account: `0x${string}` + recipientAddress: PossibleENSAddress + amount: number + chainId?: number +}> export type ERC20TransferParams = Prettify<{ - account: `0x${string}`; - recipientAddress: PossibleENSAddress; - amount: number; - erc20tokenAddress: `0x${string}`; - erc20tokenDecimals: number; - chainId?: number; -}>; + account: `0x${string}` + recipientAddress: PossibleENSAddress + amount: number + erc20tokenAddress: `0x${string}` + erc20tokenDecimals: number + chainId?: number +}> type ImplementationAddress = | `0x${string}` - | typeof ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS; + | typeof ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS export type TokenboundClientOptions = Prettify<{ - chainId?: number; - chain?: Chain; - signer?: any; - walletClient?: WalletClient; - publicClient?: PublicClient; - publicClientRPCUrl?: string; - implementationAddress?: ImplementationAddress; - registryAddress?: `0x${string}`; - version?: TBImplementationVersion; -}>; + chainId?: number + chain?: Chain + signer?: any + walletClient?: WalletClient + publicClient?: PublicClient + publicClientRPCUrl?: string + implementationAddress?: ImplementationAddress + registryAddress?: `0x${string}` + version?: TBImplementationVersion +}> type Custom6551Implementation = Prettify<{ - salt?: number; -}>; + salt?: number +}> export type TBAccountParams = Prettify< NFTParams & { - chainId?: number; + chainId?: number } ->; +> export type GetAccountParams = Prettify< TBAccountParams & Partial ->; +> export type MultiCallParams = Prettify<{ - appendedCalls?: Call3[]; -}>; + appendedCalls?: Call3[] +}> export type PrepareCreateAccountParams = Prettify< TBAccountParams & MultiCallParams & Partial ->; +> export type CreateAccountParams = Prettify< TBAccountParams & MultiCallParams & Partial ->; +> export type ExecuteCallParams = Prettify<{ - account: `0x${string}`; - to: `0x${string}`; - value: bigint; - data: string; -}>; -export type PrepareExecuteCallParams = ExecuteCallParams; + account: `0x${string}` + to: `0x${string}` + value: bigint + data: string +}> +export type PrepareExecuteCallParams = ExecuteCallParams export type ExecuteParams = Prettify< ExecuteCallParams & { operation?: CallOperation; chainId?: number } ->; -export type PrepareExecutionParams = ExecuteParams; +> +export type PrepareExecutionParams = ExecuteParams export type ValidSignerParams = Prettify<{ - account: `0x${string}`; - data?: string; -}>; + account: `0x${string}` + data?: string +}> export type ComputeAccountParams = Prettify< TBAccountParams & { - chainId: number; + chainId: number } & Partial ->; +> export type GetCreationCodeParams = Prettify<{ - implementation_: `0x${string}`; - chainId_: number; - tokenContract_: string; - tokenId_: string; - salt_: string; -}>; + implementation_: `0x${string}` + chainId_: number + tokenContract_: string + tokenId_: string + salt_: string +}> export type BytecodeParams = Prettify<{ - accountAddress: `0x${string}`; -}>; + accountAddress: `0x${string}` +}> export type SignMessageParams = Prettify<{ - message: UniversalSignableMessage; -}>; + message: UniversalSignableMessage +}> diff --git a/packages/sdk/src/types/prettify.ts b/packages/sdk/src/types/prettify.ts index 259e8fb..b91c64a 100644 --- a/packages/sdk/src/types/prettify.ts +++ b/packages/sdk/src/types/prettify.ts @@ -1,3 +1,3 @@ export type Prettify = { - [K in keyof T]: T[K]; -} & {}; + [K in keyof T]: T[K] +} & {} diff --git a/packages/sdk/src/utils/addressToUint8Array.ts b/packages/sdk/src/utils/addressToUint8Array.ts index 686a882..63e8b80 100644 --- a/packages/sdk/src/utils/addressToUint8Array.ts +++ b/packages/sdk/src/utils/addressToUint8Array.ts @@ -1,13 +1,13 @@ export function addressToUint8Array(address: `0x${string}`): Uint8Array { // Remove '0x' prefix - const cleanAddress = address.slice(2); + const cleanAddress = address.slice(2) // Convert hex string to Uint8Array - const array = new Uint8Array(cleanAddress.length / 2); + const array = new Uint8Array(cleanAddress.length / 2) for (let i = 0; i < cleanAddress.length; i += 2) { - array[i / 2] = parseInt(cleanAddress.substr(i, 2), 16); + array[i / 2] = parseInt(cleanAddress.substr(i, 2), 16) } - return array; + return array } diff --git a/packages/sdk/src/utils/chainIdToChain.ts b/packages/sdk/src/utils/chainIdToChain.ts index 9cbc6a1..7d2309c 100644 --- a/packages/sdk/src/utils/chainIdToChain.ts +++ b/packages/sdk/src/utils/chainIdToChain.ts @@ -1,4 +1,4 @@ -import { Chain } from "viem"; +import { Chain } from "viem" import { mainnet, goerli, @@ -16,7 +16,7 @@ import { gnosis, zora, zoraTestnet, -} from "viem/chains"; +} from "viem/chains" const enabledChains = { mainnet, @@ -35,7 +35,7 @@ const enabledChains = { linea, zora, zoraTestnet, -}; +} /** * Gets the chain object for the given chain id. @@ -46,9 +46,9 @@ const enabledChains = { export function chainIdToChain(chainId: number): Chain { for (const chain of Object.values(enabledChains)) { if (chain.id === chainId) { - return chain; + return chain } } - throw new Error(`Chain with id ${chainId} not found`); + throw new Error(`Chain with id ${chainId} not found`) } diff --git a/packages/sdk/src/utils/getImplementationName.ts b/packages/sdk/src/utils/getImplementationName.ts index 203f989..a5dd20a 100644 --- a/packages/sdk/src/utils/getImplementationName.ts +++ b/packages/sdk/src/utils/getImplementationName.ts @@ -1,15 +1,15 @@ -import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "../constants"; +import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "../constants" export function getImplementationName( implementationAddress?: `0x${string}`, ): string { switch (implementationAddress) { case ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS: - return "Implementation: Default V1"; + return "Implementation: Default V1" case ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS: case undefined: - return "Implementation: Default V3"; + return "Implementation: Default V3" default: - return `Custom Implementation: ${implementationAddress}`; + return `Custom Implementation: ${implementationAddress}` } } diff --git a/packages/sdk/src/utils/index.ts b/packages/sdk/src/utils/index.ts index add044c..b1dceab 100644 --- a/packages/sdk/src/utils/index.ts +++ b/packages/sdk/src/utils/index.ts @@ -1,7 +1,7 @@ -export * from "./addressToUint8Array"; -export * from "./chainIdToChain"; -export * from "./getImplementationName"; -export * from "./messageTypeguards"; -export * from "./normalizeEthersMessage"; -export * from "./resolvePossibleENS"; -export * from "./segmentBytecode"; +export * from "./addressToUint8Array" +export * from "./chainIdToChain" +export * from "./getImplementationName" +export * from "./messageTypeguards" +export * from "./normalizeEthersMessage" +export * from "./resolvePossibleENS" +export * from "./segmentBytecode" diff --git a/packages/sdk/src/utils/messageTypeguards.ts b/packages/sdk/src/utils/messageTypeguards.ts index 485acc2..44d38aa 100644 --- a/packages/sdk/src/utils/messageTypeguards.ts +++ b/packages/sdk/src/utils/messageTypeguards.ts @@ -1,9 +1,9 @@ -import { SignableMessage } from "viem"; +import { SignableMessage } from "viem" import { Ethers5SignableMessage, Ethers6SignableMessage, UniversalSignableMessage, -} from "../types"; +} from "../types" export function isEthers5SignableMessage( message: UniversalSignableMessage, @@ -12,17 +12,17 @@ export function isEthers5SignableMessage( Array.isArray(message) || typeof message === "string" || ("length" in message && "byteLength" in message === false) - ); + ) } export function isEthers6SignableMessage( message: UniversalSignableMessage, ): message is Ethers6SignableMessage { - return typeof message === "string" || message instanceof Uint8Array; + return typeof message === "string" || message instanceof Uint8Array } export function isViemSignableMessage( message: UniversalSignableMessage, ): message is SignableMessage { - return typeof message === "string" || "raw" in message; + return typeof message === "string" || "raw" in message } diff --git a/packages/sdk/src/utils/normalizeEthersMessage.ts b/packages/sdk/src/utils/normalizeEthersMessage.ts index 6ae0e30..32b3c5a 100644 --- a/packages/sdk/src/utils/normalizeEthersMessage.ts +++ b/packages/sdk/src/utils/normalizeEthersMessage.ts @@ -1,4 +1,4 @@ -import { Bytes } from "../types"; +import { Bytes } from "../types" // The types Bytes | string in Ethers 5 and string | Uint8Array in Ethers 6 are somewhat compatible but not entirely. // This function normalizes the message type to Uint8Array so we can sign using the AbstractEthersSigner without knowing the Ethers version. @@ -7,13 +7,13 @@ export function normalizeMessage( message: Bytes | string | Uint8Array, ): string | Uint8Array { if (typeof message === "string") { - return message; + return message } if (message instanceof Uint8Array) { - return message; + return message } // Convert ArrayLike to Uint8Array - return new Uint8Array(Array.from(message)); + return new Uint8Array(Array.from(message)) } diff --git a/packages/sdk/src/utils/resolvePossibleENS.ts b/packages/sdk/src/utils/resolvePossibleENS.ts index efdfe26..0dc06b0 100644 --- a/packages/sdk/src/utils/resolvePossibleENS.ts +++ b/packages/sdk/src/utils/resolvePossibleENS.ts @@ -1,21 +1,21 @@ -import { normalize } from "viem/ens"; -import { PossibleENSAddress } from "../types"; -import { PublicClient, getAddress } from "viem"; +import { normalize } from "viem/ens" +import { PossibleENSAddress } from "../types" +import { PublicClient, getAddress } from "viem" export async function resolvePossibleENS( publicClient: PublicClient, possibleENSAddress: PossibleENSAddress, ): Promise<`0x${string}`> { - const isENS = possibleENSAddress.endsWith(".eth"); + const isENS = possibleENSAddress.endsWith(".eth") const address = isENS ? await publicClient.getEnsAddress({ name: normalize(possibleENSAddress), }) - : getAddress(possibleENSAddress); + : getAddress(possibleENSAddress) if (!address) { - throw new Error("Failed to resolve ENS address"); + throw new Error("Failed to resolve ENS address") } - return address; + return address } diff --git a/packages/sdk/src/utils/segmentBytecode.ts b/packages/sdk/src/utils/segmentBytecode.ts index 0b5b5da..7c32c34 100644 --- a/packages/sdk/src/utils/segmentBytecode.ts +++ b/packages/sdk/src/utils/segmentBytecode.ts @@ -11,14 +11,14 @@ * console.log(segments); // ["0x", "1234", "567890ab"] */ export function segmentBytecode(input: string, ...lengths: number[]): string[] { - let position = 0; - const segments: string[] = []; - const cleanInput = input.startsWith("0x") ? input.substring(2) : input; // Remove "0x" prefix if present + let position = 0 + const segments: string[] = [] + const cleanInput = input.startsWith("0x") ? input.substring(2) : input // Remove "0x" prefix if present for (const length of lengths) { - segments.push(cleanInput.substr(position, length * 2)); - position += length * 2; + segments.push(cleanInput.substr(position, length * 2)) + position += length * 2 } - return segments; + return segments } diff --git a/packages/sdk/vite.config.ts b/packages/sdk/vite.config.ts index eeb0259..9670bb7 100644 --- a/packages/sdk/vite.config.ts +++ b/packages/sdk/vite.config.ts @@ -1,7 +1,7 @@ -import { resolve } from "path"; -import { PluginOption, defineConfig } from "vite"; -import { visualizer } from "rollup-plugin-visualizer"; -import dts from "vite-plugin-dts"; +import { resolve } from "path" +import { PluginOption, defineConfig } from "vite" +import { visualizer } from "rollup-plugin-visualizer" +import dts from "vite-plugin-dts" // https://vitejs.dev/config/ export default defineConfig({ @@ -41,4 +41,4 @@ export default defineConfig({ optimizeDeps: { exclude: ["**/__test__/**", "**/*.test.ts", "**/*.spec.ts", "./test/**/"], }, -}); +}) diff --git a/packages/sdk/vitest.config.ts b/packages/sdk/vitest.config.ts index 6b23de7..49397a8 100644 --- a/packages/sdk/vitest.config.ts +++ b/packages/sdk/vitest.config.ts @@ -1,5 +1,5 @@ /// -import { defineConfig } from "vitest/config"; +import { defineConfig } from "vitest/config" export default defineConfig({ test: { @@ -19,4 +19,4 @@ export default defineConfig({ globals: true, setupFiles: "./src/test/config/setup.ts", }, -}); +}) diff --git a/packages/sdk/wagmi.config.ts b/packages/sdk/wagmi.config.ts index 6bc73f2..70622d2 100644 --- a/packages/sdk/wagmi.config.ts +++ b/packages/sdk/wagmi.config.ts @@ -1,7 +1,7 @@ -import { defineConfig } from "@wagmi/cli"; -import { etherscan } from "@wagmi/cli/plugins"; -import { mainnet, goerli } from "viem/chains"; -import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "./src/constants"; +import { defineConfig } from "@wagmi/cli" +import { etherscan } from "@wagmi/cli/plugins" +import { mainnet, goerli } from "viem/chains" +import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "./src/constants" export default defineConfig({ out: "src/test/wagmi-cli-hooks/generated.ts", @@ -72,4 +72,4 @@ export default defineConfig({ ], }), ], -}); +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4bdd7f3..4e4a537 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,6 +60,9 @@ importers: specifier: ^2.12.20 version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) devDependencies: + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 '@types/react': specifier: ^18.2.21 version: 18.3.2 @@ -115,6 +118,9 @@ importers: specifier: ^2.12.20 version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) devDependencies: + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 '@types/react': specifier: ^18.2.21 version: 18.3.2 @@ -167,6 +173,9 @@ importers: specifier: ^2.12.20 version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) devDependencies: + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 '@types/react': specifier: ^18.2.21 version: 18.3.2 @@ -219,6 +228,9 @@ importers: specifier: ^2.12.20 version: 2.12.20(@tanstack/react-query@5.59.15)(@types/react@18.3.2)(react-dom@18.3.1)(react-native@0.74.1)(react@18.3.1)(typescript@5.4.5)(viem@2.21.32) devDependencies: + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 '@types/react': specifier: ^18.2.21 version: 18.3.2 From f896bd275d983d16febf4f4d0b42c30a53e83dad Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Mon, 21 Oct 2024 17:13:20 -0700 Subject: [PATCH 3/8] add biome scripts --- package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a6b6288..71d7621 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,11 @@ "scripts": { "clean": "rm -rf node_modules", "test": "cd packages/sdk && pnpm test", - "prepare": "husky install" + "prepare": "husky install", + "lint": "biome lint .", + "lint:fix": "biome lint --write --unsafe .", + "format": "biome format .", + "format:fix": "biome format --write ." }, "keywords": [], "author": "", From 938ee9f37b8888d7d641c4004a848281f3efbe33 Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Mon, 21 Oct 2024 17:55:15 -0700 Subject: [PATCH 4/8] clean up biome-highlighted errors/warnings --- .gitignore | 1 + .husky/pre-push | 2 +- .prettierignore | 2 - .prettierrc | 19 - biome.json | 2 +- .../vite-wagmi-ethers-rainbowkit/polyfills.ts | 4 +- .../src/hooks/useEthersSigner.ts | 2 +- .../vite-wagmi-ethers-rainbowkit/src/main.tsx | 1 - examples/vite-wagmi-ethers/polyfills.ts | 4 +- examples/vite-wagmi-ethers/src/App.tsx | 4 +- examples/vite-wagmi-ethers/src/wagmi.ts | 2 +- examples/vite-wagmi-ethers6/polyfills.ts | 4 +- examples/vite-wagmi-viem/polyfills.ts | 4 +- examples/vite-wagmi-viem/src/App.tsx | 140 ----- examples/vite-wagmi-viem/src/main.tsx | 2 +- packages/sdk/abis/ERC1155.ts | 2 +- packages/sdk/abis/ERC20.ts | 2 +- packages/sdk/abis/ERC721.ts | 2 +- packages/sdk/abis/MultiCallAuthenticated.ts | 2 +- packages/sdk/src/TokenboundClient.ts | 496 +++++++++--------- .../sdk/src/constants/tokenboundAddresses.ts | 4 +- packages/sdk/src/functions/crossChain.ts | 4 +- packages/sdk/src/functions/viemV2.ts | 6 +- packages/sdk/src/functions/viemV3.ts | 37 +- packages/sdk/src/index.ts | 40 +- packages/sdk/src/test/TestAll.test.ts | 22 +- packages/sdk/src/test/config/anvil.ts | 2 +- packages/sdk/src/test/config/base.ts | 2 +- packages/sdk/src/test/constants/anvil.ts | 2 +- packages/sdk/src/test/mockWallet.tsx | 16 +- packages/sdk/src/test/utils/clients.ts | 9 +- packages/sdk/src/test/utils/debug.ts | 2 +- packages/sdk/src/test/utils/getWETHBalance.ts | 4 +- .../sdk/src/test/utils/getZora1155Balance.ts | 4 +- .../sdk/src/test/utils/getZora721Balance.ts | 4 +- packages/sdk/src/test/utils/shellCommand.ts | 2 +- packages/sdk/src/types/contractABIPair.ts | 2 +- packages/sdk/src/types/messages.ts | 4 +- packages/sdk/src/types/multicall.ts | 2 +- packages/sdk/src/types/params.ts | 10 +- packages/sdk/src/utils/addressToUint8Array.ts | 2 +- packages/sdk/src/utils/chainIdToChain.ts | 2 +- .../sdk/src/utils/getImplementationName.ts | 2 +- packages/sdk/src/utils/messageTypeguards.ts | 4 +- .../sdk/src/utils/normalizeEthersMessage.ts | 2 +- packages/sdk/src/utils/resolvePossibleENS.ts | 4 +- packages/sdk/vite.config.ts | 4 +- 47 files changed, 354 insertions(+), 541 deletions(-) delete mode 100644 .prettierignore delete mode 100644 .prettierrc delete mode 100644 examples/vite-wagmi-viem/src/App.tsx diff --git a/.gitignore b/.gitignore index 05e7a6f..04ef140 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ dist-ssr /broadcast /cache /out +/.vscode diff --git a/.husky/pre-push b/.husky/pre-push index 67e2f4c..fe21507 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -pnpm lint:fix +# pnpm lint:fix diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 1380c2e..0000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.next \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 14172fe..0000000 --- a/.prettierrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "arrowParens": "always", - "endOfLine": "lf", - "importOrderSortSpecifiers": true, - "printWidth": 90, - "semi": false, - "singleQuote": true, - "trailingComma": "es5", - "importOrderSeparation": true, - "importOrder": [ - "^[components]", - "^[constants]", - "^[hooks]", - "^[styles]", - "^[types]", - "^@(.*)$", - "^[./]" - ] -} diff --git a/biome.json b/biome.json index c2e501b..69a1c2e 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "files": { "ignore": [ "node_modules/*", diff --git a/examples/vite-wagmi-ethers-rainbowkit/polyfills.ts b/examples/vite-wagmi-ethers-rainbowkit/polyfills.ts index 57e078c..beda33f 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/polyfills.ts +++ b/examples/vite-wagmi-ethers-rainbowkit/polyfills.ts @@ -1,5 +1,5 @@ -import { Buffer } from 'buffer' -import process from 'process' +import { Buffer } from 'node:buffer' +import process from 'node:process' window.global = window window.process = process diff --git a/examples/vite-wagmi-ethers-rainbowkit/src/hooks/useEthersSigner.ts b/examples/vite-wagmi-ethers-rainbowkit/src/hooks/useEthersSigner.ts index 32ca16b..81b8e4c 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/src/hooks/useEthersSigner.ts +++ b/examples/vite-wagmi-ethers-rainbowkit/src/hooks/useEthersSigner.ts @@ -1,6 +1,6 @@ import * as React from 'react' import { useWalletClient } from 'wagmi' -import { type WalletClient } from 'viem' +import type { WalletClient } from 'viem' import { providers } from 'ethers' // Ethers.js Adapters for Wagmi Wallet Client diff --git a/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx b/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx index 8fdb32a..6df0995 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx +++ b/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx @@ -5,7 +5,6 @@ import * as ReactDOM from 'react-dom/client' import { WagmiProvider } from 'wagmi'; import { - mainnet, baseSepolia, } from 'wagmi/chains'; import { diff --git a/examples/vite-wagmi-ethers/polyfills.ts b/examples/vite-wagmi-ethers/polyfills.ts index 57e078c..beda33f 100644 --- a/examples/vite-wagmi-ethers/polyfills.ts +++ b/examples/vite-wagmi-ethers/polyfills.ts @@ -1,5 +1,5 @@ -import { Buffer } from 'buffer' -import process from 'process' +import { Buffer } from 'node:buffer' +import process from 'node:process' window.global = window window.process = process diff --git a/examples/vite-wagmi-ethers/src/App.tsx b/examples/vite-wagmi-ethers/src/App.tsx index a3b7244..9ff7db6 100644 --- a/examples/vite-wagmi-ethers/src/App.tsx +++ b/examples/vite-wagmi-ethers/src/App.tsx @@ -67,8 +67,8 @@ export function App() { const createAccount = useCallback(async () => { if (!tokenboundClient || !address) return const createdAccount = await tokenboundClient.createAccount({ - tokenContract: TOKEN_CONTRACT, - tokenId: TOKEN_ID, + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, }) console.log(`new account: ${createdAccount}`) alert(`new account: ${createdAccount}`) diff --git a/examples/vite-wagmi-ethers/src/wagmi.ts b/examples/vite-wagmi-ethers/src/wagmi.ts index 1b62cd1..eea8bf1 100644 --- a/examples/vite-wagmi-ethers/src/wagmi.ts +++ b/examples/vite-wagmi-ethers/src/wagmi.ts @@ -2,7 +2,7 @@ import { getDefaultConfig } from "connectkit"; import { createConfig } from "wagmi"; import { baseSepolia } from 'wagmi/chains' -import { Chain } from 'viem' +import type { Chain } from 'viem' const chains: readonly [Chain, ...Chain[]] = [baseSepolia] diff --git a/examples/vite-wagmi-ethers6/polyfills.ts b/examples/vite-wagmi-ethers6/polyfills.ts index 57e078c..beda33f 100644 --- a/examples/vite-wagmi-ethers6/polyfills.ts +++ b/examples/vite-wagmi-ethers6/polyfills.ts @@ -1,5 +1,5 @@ -import { Buffer } from 'buffer' -import process from 'process' +import { Buffer } from 'node:buffer' +import process from 'node:process' window.global = window window.process = process diff --git a/examples/vite-wagmi-viem/polyfills.ts b/examples/vite-wagmi-viem/polyfills.ts index 57e078c..beda33f 100644 --- a/examples/vite-wagmi-viem/polyfills.ts +++ b/examples/vite-wagmi-viem/polyfills.ts @@ -1,5 +1,5 @@ -import { Buffer } from 'buffer' -import process from 'process' +import { Buffer } from 'node:buffer' +import process from 'node:process' window.global = window window.process = process diff --git a/examples/vite-wagmi-viem/src/App.tsx b/examples/vite-wagmi-viem/src/App.tsx deleted file mode 100644 index 074958a..0000000 --- a/examples/vite-wagmi-viem/src/App.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import { ConnectButton } from '@rainbow-me/rainbowkit' -import { - useAccount, -} from 'wagmi' - -import { Account } from './components' - -import { - createWalletClient, - http, - custom, - WalletClient, - parseUnits, - getAddress, -} from 'viem' -import { baseSepolia } from 'viem/chains' -import { TokenboundClient } from '@tokenbound/sdk' -import { useCallback, useEffect } from 'react' - -declare global { - interface Window { - ethereum?: any // CoinbaseWalletSDK also defines window.ethereum, so we have to work around that :( - } -} - -// Origin NFT: MoonTrees #0 on Base Sepolia -const originNFT = { - tokenContract: getAddress('0xcf7ea35b7421a8ff2ff460a939e294ac13a05342'), - tokenId: '0', -} - -// TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia -const sendingTBA = '0x5F50CAf6244d10C32965354F8c4d84D84503D42D' -const recipientAddress = getAddress('0x9FefE8a875E7a9b0574751E191a2AF205828dEA4') -const ethAmount = 0.005 -const ethAmountWei = parseUnits(`${ethAmount}`, 18) - -export function App() { - const { isConnected, address } = useAccount() - - const walletClient: WalletClient = createWalletClient({ - chain: baseSepolia, - account: address, - transport: window.ethereum ? custom(window.ethereum) : http(), - }) - - const tokenboundClient = new TokenboundClient({ - walletClient, - chainId: baseSepolia.id, - // implementationAddress: '0x2d25602551487c3f3354dd80d76d54383a243358', - }) - - useEffect(() => { - async function testTokenboundClass() { - if (!tokenboundClient) return - - const tokenboundAccount = tokenboundClient.getAccount({ - tokenContract: originNFT.tokenContract, - tokenId: originNFT.tokenId, - }) - - const preparedExecution = await tokenboundClient.prepareExecution({ - account: tokenboundAccount, - to: recipientAddress, - value: 0n, - data: '', - }) - - const preparedCreateAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: originNFT.tokenContract, - tokenId: originNFT.tokenId, - }) - - console.log('getAccount', tokenboundAccount) - console.log('preparedExecution', preparedExecution) - console.log('preparedAccount', preparedCreateAccount) - - // if (address) { - // walletClient?.sendTransaction(preparedCreateAccount) - // walletClient?.sendTransaction(preparedExecuteCall) - // } - } - - testTokenboundClass() - }, []) - - const createAccount = useCallback(async () => { - if (!tokenboundClient || !address) return - const createdAccount = await tokenboundClient.createAccount({ - tokenContract: originNFT.tokenContract, - tokenId: originNFT.tokenId, - }) - console.log(`new account: ${createdAccount}`) - alert(`new account: ${createdAccount}`) - }, [tokenboundClient]) - - const execute = useCallback(async () => { - if (!tokenboundClient || !address) return - const executedCall = await tokenboundClient.execute({ - account: sendingTBA, - to: recipientAddress, - value: ethAmountWei, - data: '0x', - }) - executedCall && alert(`Executed: ${executedCall}`) - }, [tokenboundClient]) - - const transferETH = useCallback(async () => { - if (!tokenboundClient || !address) return - const executedTransfer = await tokenboundClient.transferETH({ - account: sendingTBA, - recipientAddress, - amount: ethAmount, - }) - executedTransfer && alert(`Sent ${ethAmount} ETH to ${recipientAddress}`) - }, [tokenboundClient]) - - return ( - <> -

viem walletClient + ConnectKit + Vite

- - {isConnected && } - {address && ( -
- - - -
- )} - - ) -} diff --git a/examples/vite-wagmi-viem/src/main.tsx b/examples/vite-wagmi-viem/src/main.tsx index b1ffbd4..a569dba 100644 --- a/examples/vite-wagmi-viem/src/main.tsx +++ b/examples/vite-wagmi-viem/src/main.tsx @@ -3,7 +3,7 @@ import '@rainbow-me/rainbowkit/styles.css' import { http } from 'viem'; import { createConfig, WagmiProvider } from 'wagmi'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query' -import { RainbowKitProvider, getDefaultConfig, lightTheme } from '@rainbow-me/rainbowkit' +import { RainbowKitProvider, lightTheme } from '@rainbow-me/rainbowkit' import { baseSepolia } from 'wagmi/chains'; import * as React from 'react' diff --git a/packages/sdk/abis/ERC1155.ts b/packages/sdk/abis/ERC1155.ts index 749edd7..5147b58 100644 --- a/packages/sdk/abis/ERC1155.ts +++ b/packages/sdk/abis/ERC1155.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem" +import type { Abi } from "viem" export const erc1155Abi = [ { diff --git a/packages/sdk/abis/ERC20.ts b/packages/sdk/abis/ERC20.ts index 4effb2a..ba16dc2 100644 --- a/packages/sdk/abis/ERC20.ts +++ b/packages/sdk/abis/ERC20.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem" +import type { Abi } from "viem" export const erc20Abi = [ { diff --git a/packages/sdk/abis/ERC721.ts b/packages/sdk/abis/ERC721.ts index 4819b9a..47bc3c5 100644 --- a/packages/sdk/abis/ERC721.ts +++ b/packages/sdk/abis/ERC721.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem" +import type { Abi } from "viem" export const erc721Abi = [ { diff --git a/packages/sdk/abis/MultiCallAuthenticated.ts b/packages/sdk/abis/MultiCallAuthenticated.ts index 164b561..27c7586 100644 --- a/packages/sdk/abis/MultiCallAuthenticated.ts +++ b/packages/sdk/abis/MultiCallAuthenticated.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem" +import type { Abi } from "viem" export const multicall3AuthenticatedABI = [ { diff --git a/packages/sdk/src/TokenboundClient.ts b/packages/sdk/src/TokenboundClient.ts index 8aeb9bf..05f792d 100644 --- a/packages/sdk/src/TokenboundClient.ts +++ b/packages/sdk/src/TokenboundClient.ts @@ -1,15 +1,15 @@ import { - WalletClient, - PublicClient, - Chain, + type WalletClient, + type PublicClient, + type Chain, createPublicClient, http, - GetBytecodeReturnType, + type GetBytecodeReturnType, hexToNumber, getAddress, encodeFunctionData, parseUnits, - SignableMessage, + type SignableMessage, isAddressEqual, numberToHex, custom, @@ -33,30 +33,30 @@ import { encodeCrossChainCall, } from "./functions" import { - AbstractEthersSigner, - AbstractEthersTransactionResponse, - BytecodeParams, - CreateAccountParams, - ERC20TransferParams, - SignMessageParams, - ETHTransferParams, - ExecuteCallParams, - GetAccountParams, + type AbstractEthersSigner, + type AbstractEthersTransactionResponse, + type BytecodeParams, + type CreateAccountParams, + type ERC20TransferParams, + type SignMessageParams, + type ETHTransferParams, + type ExecuteCallParams, + type GetAccountParams, NFTTokenType, - NFTTransferParams, + type NFTTransferParams, TBVersion, - PrepareCreateAccountParams, - PrepareExecuteCallParams, - SegmentedERC6551Bytecode, - TokenboundAccountNFT, - TokenboundClientOptions, - EthersSignableMessage, - ExecuteParams, + type PrepareCreateAccountParams, + type PrepareExecuteCallParams, + type SegmentedERC6551Bytecode, + type TokenboundAccountNFT, + type TokenboundClientOptions, + type EthersSignableMessage, + type ExecuteParams, CALL_OPERATIONS, - PrepareExecutionParams, - ValidSignerParams, - MultiCallTx, - CallData, + type PrepareExecutionParams, + type ValidSignerParams, + type MultiCallTx, + type CallData, } from "./types" import { chainIdToChain, @@ -84,9 +84,9 @@ declare global { class TokenboundClient { private chainId: number private chain: Chain - public isInitialized: boolean = false + public isInitialized = false public publicClient: PublicClient - private supportsV3: boolean = true // Default to V3 implementation + private supportsV3 = true // Default to V3 implementation private signer?: AbstractEthersSigner private walletClient?: WalletClient private implementationAddress: `0x${string}` @@ -121,7 +121,11 @@ class TokenboundClient { ) } - this.chainId = chainId ?? chain!.id + if (!ERC_6551_DEFAULT.ACCOUNT_PROXY) { + throw new Error("ERC_6551_DEFAULT.ACCOUNT_PROXY is undefined") + } + + this.chainId = chainId ?? (chain?.id as number) this.chain = chain ?? chainIdToChain(this.chainId) if (signer) { @@ -145,7 +149,7 @@ class TokenboundClient { this.registryAddress = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS this.implementationAddress = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS // If legacy V2 implementation is in use, use V2 registry (unless custom registry is provided) const isV2 = @@ -186,20 +190,15 @@ class TokenboundClient { */ public getAccount(params: GetAccountParams): `0x${string}` { const { tokenContract, tokenId, salt = 0, chainId = this.chainId } = params - - try { - const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount - return getAcct( - tokenContract, - tokenId, - chainId, - this.implementationAddress, - this.registryAddress, - salt, - ) - } catch (error) { - throw error - } + const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount + return getAcct( + tokenContract, + tokenId, + chainId, + this.implementationAddress, + this.registryAddress, + salt, + ) } /** @@ -211,6 +210,10 @@ class TokenboundClient { public async prepareCreateAccount( params: PrepareCreateAccountParams, ): Promise { + if (!ERC_6551_DEFAULT.ACCOUNT_PROXY) { + throw new Error("ERC_6551_DEFAULT.ACCOUNT_PROXY is undefined") + } + const { tokenContract, tokenId, @@ -231,7 +234,7 @@ class TokenboundClient { ) const isCustomImplementation = ![ - ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS, + ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS, ERC_6551_DEFAULT.IMPLEMENTATION.ADDRESS, ].includes(getAddress(this.implementationAddress)) @@ -260,38 +263,37 @@ class TokenboundClient { if (isCustomImplementation) { // Don't initialize for custom implementations. Allow third-party handling of initialization. return preparedBasicCreateAccount - } else { - // For standard implementations, use the multicall3 aggregate function to create and initialize the account in one transaction - return { - to: MULTICALL_AUTHENTICATED_ADDRESS, - value: BigInt(0), - data: encodeFunctionData({ - abi: multicall3AuthenticatedABI, - functionName: "aggregate3", - args: [ - [ - { - target: this.registryAddress, - allowFailure: false, - callData: preparedBasicCreateAccount.data, - }, - { - target: computedAcct, - allowFailure: false, - callData: encodeFunctionData({ - abi: ERC_6551_DEFAULT.ACCOUNT_PROXY?.ABI!, - functionName: "initialize", - args: [ERC_6551_DEFAULT.IMPLEMENTATION!.ADDRESS], - }), - }, - // Append Multicall3 calls, so the newly-created Tokenbound account - // can be used to execute calls immediately after creation - ...appendedCalls, - ], - ], - }), - } as MultiCallTx } + // For standard implementations, use the multicall3 aggregate function to create and initialize the account in one transaction + return { + to: MULTICALL_AUTHENTICATED_ADDRESS, + value: BigInt(0), + data: encodeFunctionData({ + abi: multicall3AuthenticatedABI, + functionName: "aggregate3", + args: [ + [ + { + target: this.registryAddress, + allowFailure: false, + callData: preparedBasicCreateAccount.data, + }, + { + target: computedAcct, + allowFailure: false, + callData: encodeFunctionData({ + abi: ERC_6551_DEFAULT.ACCOUNT_PROXY?.ABI, + functionName: "initialize", + args: [ERC_6551_DEFAULT.IMPLEMENTATION?.ADDRESS], + }), + }, + // Append Multicall3 calls, so the newly-created Tokenbound account + // can be used to execute calls immediately after creation + ...appendedCalls, + ], + ], + }), + } as MultiCallTx } /** @@ -310,64 +312,59 @@ class TokenboundClient { chainId = this.chainId, appendedCalls = [], } = params + let txHash: `0x${string}` | undefined - try { - let txHash: `0x${string}` | undefined - - const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount + const getAcct = this.supportsV3 ? getTokenboundV3Account : computeAccount - const computedAcct = getAcct( - tokenContract, - tokenId, - chainId, - this.implementationAddress, - this.registryAddress, - salt, - ) + const computedAcct = getAcct( + tokenContract, + tokenId, + chainId, + this.implementationAddress, + this.registryAddress, + salt, + ) - const preparedCreateAccount = await this.prepareCreateAccount({ - tokenContract, - tokenId, - chainId, - salt, - appendedCalls, - }) + const preparedCreateAccount = await this.prepareCreateAccount({ + tokenContract, + tokenId, + chainId, + salt, + appendedCalls, + }) - if (this.signer) { - txHash = (await this.signer - .sendTransaction(preparedCreateAccount) - .then( - (tx: AbstractEthersTransactionResponse) => tx.hash, - )) as `0x${string}` - } else if (this.walletClient) { - txHash = this.supportsV3 - ? await this.walletClient.sendTransaction({ - ...preparedCreateAccount, - chain: this.chain, - account: this.walletClient?.account?.address!, - }) // @BJ TODO: extract into viemV3? - : await createAccount( - tokenContract, - tokenId, - this.walletClient, - this.implementationAddress, - this.registryAddress, - salt, - chainId, - ) - } + if (this.signer) { + txHash = (await this.signer + .sendTransaction(preparedCreateAccount) + .then( + (tx: AbstractEthersTransactionResponse) => tx.hash, + )) as `0x${string}` + } else if (this.walletClient) { + txHash = this.supportsV3 + ? await this.walletClient.sendTransaction({ + ...preparedCreateAccount, + chain: this.chain, + // biome-ignore lint/style/noNonNullAssertion: Should exist + account: this.walletClient?.account?.address!, + }) // @BJ TODO: extract into viemV3? + : await createAccount( + tokenContract, + tokenId, + this.walletClient, + this.implementationAddress, + this.registryAddress, + salt, + chainId, + ) + } - if (txHash) { - return { - account: computedAcct, - txHash, - } - } else { - throw new Error("No wallet client or signer available.") + if (txHash) { + return { + account: computedAcct, + txHash, } - } catch (error) { - throw error } + throw new Error("No wallet client or signer available.") } /** @@ -409,27 +406,24 @@ class TokenboundClient { "executeCall() is not supported on V3 implementation deployments, use execute() instead.", ) } - try { - if (this.signer) { - return (await this.signer - .sendTransaction(preparedExecuteCall) - .then( - (tx: AbstractEthersTransactionResponse) => tx.hash, - )) as `0x${string}` - } else if (this.walletClient) { - return await this.walletClient.sendTransaction({ - // chain and account need to be added explicitly - // because they're optional when instantiating a WalletClient - chain: this.chain, - account: this.walletClient.account!, - ...preparedExecuteCall, - }) - } else { - throw new Error("No wallet client or signer available.") - } - } catch (error) { - throw error + if (this.signer) { + return (await this.signer + .sendTransaction(preparedExecuteCall) + .then( + (tx: AbstractEthersTransactionResponse) => tx.hash, + )) as `0x${string}` } + if (this.walletClient) { + return await this.walletClient.sendTransaction({ + // chain and account need to be added explicitly + // because they're optional when instantiating a WalletClient + chain: this.chain, + // biome-ignore lint/style/noNonNullAssertion: Should exist + account: this.walletClient.account!, + ...preparedExecuteCall, + }) + } + throw new Error("No wallet client or signer available.") } /** @@ -497,34 +491,31 @@ class TokenboundClient { * @returns a Promise that resolves to the transaction hash of the executed call */ public async execute(params: ExecuteParams): Promise<`0x${string}`> { - try { - if (!this.supportsV3) { - // const { operation, ...rest } = params - return await this.executeCall(params) - } + if (!this.supportsV3) { + // const { operation, ...rest } = params + return await this.executeCall(params) + } - const preparedExecution = await this.prepareExecution(params) + const preparedExecution = await this.prepareExecution(params) - if (this.signer) { - return (await this.signer - .sendTransaction(preparedExecution) - .then( - (tx: AbstractEthersTransactionResponse) => tx.hash, - )) as `0x${string}` - } else if (this.walletClient) { - return await this.walletClient.sendTransaction({ - // chain and account need to be added explicitly - // because they're optional when instantiating a WalletClient - chain: this.chain, - account: this.walletClient.account!, - ...preparedExecution, - }) - } else { - throw new Error("No wallet client or signer available.") - } - } catch (error) { - throw error + if (this.signer) { + return (await this.signer + .sendTransaction(preparedExecution) + .then( + (tx: AbstractEthersTransactionResponse) => tx.hash, + )) as `0x${string}` + } + if (this.walletClient) { + return await this.walletClient.sendTransaction({ + // chain and account need to be added explicitly + // because they're optional when instantiating a WalletClient + chain: this.chain, + // biome-ignore lint/style/noNonNullAssertion: Should exist + account: this.walletClient.account!, + ...preparedExecution, + }) } + throw new Error("No wallet client or signer available.") } /** @@ -538,29 +529,24 @@ class TokenboundClient { const VALID_SIGNER_MAGIC_VALUE = "0x523e3260" // isValidSigner MUST return this bytes4 magic value if the given signer is valid const walletAddress: `0x${string}` = walletClient?.account?.address ?? signer?.address + if (!signer && !walletClient) { + throw new Error("No signer or wallet client available.") + } - try { - if (!signer && !walletClient) { - throw new Error("No signer or wallet client available.") - } - - if (!this.supportsV3) { - throw new Error( - "isValidSigner is not supported using the V2 implementation", - ) - } + if (!this.supportsV3) { + throw new Error( + "isValidSigner is not supported using the V2 implementation", + ) + } - const validityCheck = await this.publicClient.readContract({ - address: account, - abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, - functionName: "isValidSigner", - args: [walletAddress, data], - }) + const validityCheck = await this.publicClient.readContract({ + address: account, + abi: ERC_6551_DEFAULT.IMPLEMENTATION.ABI, + functionName: "isValidSigner", + args: [walletAddress, data], + }) - return validityCheck === VALID_SIGNER_MAGIC_VALUE - } catch (error) { - throw error - } + return validityCheck === VALID_SIGNER_MAGIC_VALUE } /** @@ -571,15 +557,11 @@ class TokenboundClient { public async checkAccountDeployment({ accountAddress, }: BytecodeParams): Promise { - try { - return await this.publicClient - .getBytecode({ address: accountAddress }) - .then((bytecode: GetBytecodeReturnType) => { - return !!bytecode ? bytecode.length > 2 : false - }) - } catch (error) { - throw error - } + return await this.publicClient + .getBytecode({ address: accountAddress }) + .then((bytecode: GetBytecodeReturnType) => { + return bytecode ? bytecode.length > 2 : false + }) } /** @@ -590,48 +572,44 @@ class TokenboundClient { public async deconstructBytecode({ accountAddress, }: BytecodeParams): Promise { - try { - const rawBytecode = await this.publicClient.getBytecode({ - address: accountAddress, - }) - const bytecode = rawBytecode?.slice(2) - - if (!bytecode || !rawBytecode || !(rawBytecode.length > 2)) return null - - const [ - erc1167Header, - rawImplementationAddress, - erc1167Footer, - rawSalt, - rawChainId, - rawTokenContract, - rawTokenId, - ] = segmentBytecode(bytecode, 10, 20, 15, 32, 32, 32, 32) - - const chainId = hexToNumber(`0x${rawChainId}`, { size: 32 }) - const implementationAddress: `0x${string}` = getAddress( - `0x${rawImplementationAddress}`, - ) - const salt = hexToNumber(`0x${rawSalt}`, { size: 32 }) - const tokenContract: `0x${string}` = getAddress( - `0x${rawTokenContract.slice( - rawTokenContract.length - 40, - rawTokenContract.length, - )}`, - ) - const tokenId = hexToNumber(`0x${rawTokenId}`, { size: 32 }).toString() + const rawBytecode = await this.publicClient.getBytecode({ + address: accountAddress, + }) + const bytecode = rawBytecode?.slice(2) + + if (!bytecode || !rawBytecode || !(rawBytecode.length > 2)) return null + + const [ + erc1167Header, + rawImplementationAddress, + erc1167Footer, + rawSalt, + rawChainId, + rawTokenContract, + rawTokenId, + ] = segmentBytecode(bytecode, 10, 20, 15, 32, 32, 32, 32) + + const chainId = hexToNumber(`0x${rawChainId}`, { size: 32 }) + const implementationAddress: `0x${string}` = getAddress( + `0x${rawImplementationAddress}`, + ) + const salt = hexToNumber(`0x${rawSalt}`, { size: 32 }) + const tokenContract: `0x${string}` = getAddress( + `0x${rawTokenContract.slice( + rawTokenContract.length - 40, + rawTokenContract.length, + )}`, + ) + const tokenId = hexToNumber(`0x${rawTokenId}`, { size: 32 }).toString() - return { - erc1167Header, - implementationAddress, - erc1167Footer, - salt, - tokenId, - tokenContract, - chainId, - } - } catch (error) { - throw error + return { + erc1167Header, + implementationAddress, + erc1167Footer, + salt, + tokenId, + tokenContract, + chainId, } } @@ -643,24 +621,20 @@ class TokenboundClient { public async getNFT({ accountAddress, }: BytecodeParams): Promise { - try { - const deconstructedBytecode = await this.deconstructBytecode({ - accountAddress, - }) - if (!deconstructedBytecode) - throw new Error( - "The tokenbound account has not been deployed at this address", - ) + const deconstructedBytecode = await this.deconstructBytecode({ + accountAddress, + }) + if (!deconstructedBytecode) + throw new Error( + "The tokenbound account has not been deployed at this address", + ) - const { chainId, tokenContract, tokenId } = deconstructedBytecode + const { chainId, tokenContract, tokenId } = deconstructedBytecode - return { - tokenContract, - tokenId, - chainId, - } - } catch (error) { - throw error + return { + tokenContract, + tokenId, + chainId, } } @@ -850,11 +824,13 @@ class TokenboundClient { message as EthersSignableMessage, ) return await this.signer.signMessage(normalizedMessage) - } else if (this.walletClient) { + } + if (this.walletClient) { if (!isViemSignableMessage(message)) { throw new Error("Message is not a valid viem signable message.") } return await this.walletClient.signMessage({ + // biome-ignore lint/style/noNonNullAssertion: Should exist account: this.walletClient.account!, message: message as SignableMessage, }) @@ -869,7 +845,7 @@ class TokenboundClient { const erc6551AccountAbiV2 = ERC_6551_LEGACY_V2.IMPLEMENTATION.ABI const erc6551RegistryAbiV2 = ERC_6551_LEGACY_V2.REGISTRY.ABI const erc6551AccountAbiV3 = ERC_6551_DEFAULT.IMPLEMENTATION.ABI -const erc6551AccountProxyAbiV3 = ERC_6551_DEFAULT.ACCOUNT_PROXY!.ABI +const erc6551AccountProxyAbiV3 = ERC_6551_DEFAULT.ACCOUNT_PROXY?.ABI const erc6551RegistryAbiV3 = ERC_6551_DEFAULT.REGISTRY.ABI export { diff --git a/packages/sdk/src/constants/tokenboundAddresses.ts b/packages/sdk/src/constants/tokenboundAddresses.ts index 60f537b..7b14e98 100644 --- a/packages/sdk/src/constants/tokenboundAddresses.ts +++ b/packages/sdk/src/constants/tokenboundAddresses.ts @@ -1,4 +1,4 @@ -import { Abi, getAddress } from "viem" +import { type Abi, getAddress } from "viem" import { erc6551AccountAbiV2, erc6551RegistryAbiV2 } from "../../abis" @@ -8,7 +8,7 @@ import { erc6551RegistryV3ABI, } from "../../src/test/wagmi-cli-hooks/generated" -import { ContractABIPair } from "../types" +import type { ContractABIPair } from "../types" type Standard6551Deployment = { IMPLEMENTATION: ContractABIPair diff --git a/packages/sdk/src/functions/crossChain.ts b/packages/sdk/src/functions/crossChain.ts index 0cc08ea..9e46746 100644 --- a/packages/sdk/src/functions/crossChain.ts +++ b/packages/sdk/src/functions/crossChain.ts @@ -1,7 +1,7 @@ -import { PublicClient, encodeFunctionData, parseAbi } from "viem" +import { type PublicClient, encodeFunctionData, parseAbi } from "viem" import { ERC_6551_DEFAULT, LZ_EXECUTORS, LZ_EIDS } from "../constants" import { Options } from "@layerzerolabs/lz-v2-utilities" -import { CallData } from "../types" +import type { CallData } from "../types" type CrossChainCallParams = { publicClient: PublicClient diff --git a/packages/sdk/src/functions/viemV2.ts b/packages/sdk/src/functions/viemV2.ts index 938e581..2c1b23a 100644 --- a/packages/sdk/src/functions/viemV2.ts +++ b/packages/sdk/src/functions/viemV2.ts @@ -2,8 +2,8 @@ import { getContract, getContractAddress, concat, - PublicClient, - WalletClient, + type PublicClient, + type WalletClient, encodeFunctionData, encodeAbiParameters, pad, @@ -18,7 +18,7 @@ import { } from "../../src/test/wagmi-cli-hooks/generated" import { addressToUint8Array } from "../utils" import { ERC_6551_LEGACY_V2 } from "../constants" -import { CallData } from "../types" +import type { CallData } from "../types" export { erc6551AccountAbiV2, diff --git a/packages/sdk/src/functions/viemV3.ts b/packages/sdk/src/functions/viemV3.ts index be9e727..c48cb18 100644 --- a/packages/sdk/src/functions/viemV3.ts +++ b/packages/sdk/src/functions/viemV3.ts @@ -2,7 +2,7 @@ import { getContract, getContractAddress, concat, - WalletClient, + type WalletClient, encodeFunctionData, encodeAbiParameters, pad, @@ -24,7 +24,7 @@ import { ERC_6551_DEFAULT, STANDARD_EIP_1167_IMPLEMENTATION, } from "../constants" -import { CallData } from "../types" +import type { CallData } from "../types" export { erc6551AccountProxyV3ABI, erc6551AccountV3ABI, erc6551RegistryV3ABI } /** @@ -39,9 +39,13 @@ export async function prepareCreateTokenboundV3Account( registryAddress?: `0x${string}`, salt?: number, ): Promise { - salt = salt ?? 0 + if (!ERC_6551_DEFAULT.ACCOUNT_PROXY) { + throw new Error("ERC_6551_DEFAULT.ACCOUNT_PROXY is undefined") + } + + const saltValue = salt ?? 0 const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS return { @@ -52,7 +56,7 @@ export async function prepareCreateTokenboundV3Account( functionName: "createAccount", args: [ getAddress(erc6551implementation), - bytesToHex(numberToBytes(salt, { size: 32 })), + bytesToHex(numberToBytes(saltValue, { size: 32 })), chainId, tokenContract, tokenId, @@ -73,9 +77,13 @@ export async function createTokenboundV3Account( registryAddress?: `0x${string}`, salt?: number, ): Promise<`0x${string}`> { - salt = salt ?? 0 + if (!ERC_6551_DEFAULT.ACCOUNT_PROXY) { + throw new Error("ERC_6551_DEFAULT.ACCOUNT_PROXY is undefined") + } + + const saltValue = salt ?? 0 const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS const registry = getContract({ @@ -91,7 +99,7 @@ export async function createTokenboundV3Account( return await registry.write.createAccount([ erc6551implementation, encodeAbiParameters(parseAbiParameters(["bytes32"]), [ - numberToHex(salt, { size: 32 }), + numberToHex(saltValue, { size: 32 }), ]), chainId, tokenContract, @@ -158,9 +166,14 @@ export function getTokenboundV3Account( registryAddress?: `0x${string}`, salt?: number, ): `0x${string}` { - salt = salt ?? 0 + const saltValue = salt ?? 0 + + if (!ERC_6551_DEFAULT.ACCOUNT_PROXY) { + throw new Error("ERC_6551_DEFAULT.ACCOUNT_PROXY is undefined") + } + const erc6551implementation = - implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS + implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY.ADDRESS const erc6551registry = registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS const types = [ { type: "uint256" }, // salt @@ -170,7 +183,7 @@ export function getTokenboundV3Account( ] const values: (string | bigint)[] = [ - salt.toString(), + saltValue.toString(), BigInt(chainId), tokenContract, tokenId, @@ -185,7 +198,7 @@ export function getTokenboundV3Account( ]) const creationCode = addressToUint8Array(hexCreationCode) - const bigIntSalt = BigInt(salt).toString(16) as `0x${string}` + const bigIntSalt = BigInt(saltValue).toString(16) as `0x${string}` const saltHex = pad(bigIntSalt, { size: 32 }) return getContractAddress({ diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index dcd0548..5791d34 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -11,28 +11,28 @@ import { } from "./functions" import { - TokenboundAccountNFT, - TokenboundClientOptions, - GetAccountParams, - TBAccountParams, - PrepareCreateAccountParams, - CreateAccountParams, - PrepareExecuteCallParams, - ExecuteCallParams, - SignMessageParams, - ComputeAccountParams, - GetCreationCodeParams, - ERC20TransferParams, - ETHTransferParams, - NFTTransferParams, - BytecodeParams, - TBImplementationVersion, + type TokenboundAccountNFT, + type TokenboundClientOptions, + type GetAccountParams, + type TBAccountParams, + type PrepareCreateAccountParams, + type CreateAccountParams, + type PrepareExecuteCallParams, + type ExecuteCallParams, + type SignMessageParams, + type ComputeAccountParams, + type GetCreationCodeParams, + type ERC20TransferParams, + type ETHTransferParams, + type NFTTransferParams, + type BytecodeParams, + type TBImplementationVersion, TBVersion, - MultiCallTx, - Call3, + type MultiCallTx, + type Call3, CALL_OPERATIONS, - SegmentedERC6551Bytecode, - CallData, + type SegmentedERC6551Bytecode, + type CallData, } from "./types" import { diff --git a/packages/sdk/src/test/TestAll.test.ts b/packages/sdk/src/test/TestAll.test.ts index 91e6053..e097fd8 100644 --- a/packages/sdk/src/test/TestAll.test.ts +++ b/packages/sdk/src/test/TestAll.test.ts @@ -3,16 +3,16 @@ import { zora, mainnet } from "viem/chains" import { describe, beforeAll, afterAll, expect, it, vi } from "vitest" -import { ethers, providers } from "ethers" +import { ethers, type providers } from "ethers" import { createAnvil } from "@viem/anvil" import { - WalletClient, - PublicClient, + type WalletClient, + type PublicClient, createWalletClient, http, getAddress, encodeFunctionData, - Log, + type Log, parseUnits, formatEther, getContract, @@ -46,10 +46,10 @@ import { } from "./config" import { wethABI } from "./wagmi-cli-hooks/generated" import { ERC_6551_DEFAULT, ERC_6551_LEGACY_V2 } from "../constants" -import { Call3, TBImplementationVersion, TBVersion } from "../types" +import { type Call3, type TBImplementationVersion, TBVersion } from "../types" import { JsonRpcSigner, JsonRpcProvider } from "ethers6" import { erc20Abi } from "viem" -import { CreateAccountParams, TokenboundClient } from "../" +import { type CreateAccountParams, TokenboundClient } from "../" export const pool = Number(process.env.VITEST_POOL_ID ?? 1) @@ -517,7 +517,7 @@ describe.each(ENABLED_TESTS)( if (walletClient) { transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, - account: walletClient.account!.address, + account: walletClient.account?.address, ...preparedNFTTransfer, }) } else { @@ -574,7 +574,7 @@ describe.each(ENABLED_TESTS)( if (walletClient) { transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, - account: walletClient.account!.address, + account: walletClient.account?.address, ...preparedNFTTransfer, }) } else { @@ -623,7 +623,7 @@ describe.each(ENABLED_TESTS)( if (walletClient) { transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, - account: walletClient.account!.address, + account: walletClient.account?.address, ...preparedETHTransfer, }) } else { @@ -666,7 +666,7 @@ describe.each(ENABLED_TESTS)( // Execute a basic call with no value with the TBA to see if it works. it( - isV2 ? `can executeCall with the TBA` : `can execute with the TBA`, + isV2 ? "can executeCall with the TBA" : "can execute with the TBA", async () => { const execution = { account: ZORA721_TBA_ADDRESS, @@ -692,7 +692,7 @@ describe.each(ENABLED_TESTS)( ) it( - `can fall back to executeCall from execute for V2`, + "can fall back to executeCall from execute for V2", async () => { const execution = { account: ZORA721_TBA_ADDRESS, diff --git a/packages/sdk/src/test/config/anvil.ts b/packages/sdk/src/test/config/anvil.ts index 26c046b..1e089c9 100644 --- a/packages/sdk/src/test/config/anvil.ts +++ b/packages/sdk/src/test/config/anvil.ts @@ -1,6 +1,6 @@ /// -import { CreateAnvilOptions } from "@viem/anvil" +import type { CreateAnvilOptions } from "@viem/anvil" import { mainnet } from "viem/chains" const ACTIVE_CHAIN = mainnet diff --git a/packages/sdk/src/test/config/base.ts b/packages/sdk/src/test/config/base.ts index 43a3566..d6fab9b 100644 --- a/packages/sdk/src/test/config/base.ts +++ b/packages/sdk/src/test/config/base.ts @@ -1,6 +1,6 @@ export const TEST_CONFIG = { RECIPIENT_ADDRESS: <`0x${string}`>( - `0x02101dfb77fde026414827fdc604ddaf224f0921` + "0x02101dfb77fde026414827fdc604ddaf224f0921" ), ERC1167_HEADER: "363d3d373d3d3d363d73", ERC1167_FOOTER: "5af43d82803e903d91602b57fd5bf3", diff --git a/packages/sdk/src/test/constants/anvil.ts b/packages/sdk/src/test/constants/anvil.ts index 3566a6f..6b51b8e 100644 --- a/packages/sdk/src/test/constants/anvil.ts +++ b/packages/sdk/src/test/constants/anvil.ts @@ -1,5 +1,5 @@ import { foundry } from "viem/chains" -import { AnvilAccount } from "../../types" +import type { AnvilAccount } from "../../types" import { getAddress } from "viem" export const ANVIL_RPC_URL = foundry.rpcUrls.default.http[0] diff --git a/packages/sdk/src/test/mockWallet.tsx b/packages/sdk/src/test/mockWallet.tsx index 0ecb6a5..d11912b 100644 --- a/packages/sdk/src/test/mockWallet.tsx +++ b/packages/sdk/src/test/mockWallet.tsx @@ -1,17 +1,5 @@ -import { RenderOptions, RenderResult, render } from "@testing-library/react" -import { default as userEvent } from "@testing-library/user-event" -import * as React from "react" - -import { WalletClient, PublicClient } from "viem" - -import { - CreateConfigParameters, - // WagmiConfig, - // WagmiConfigProps, - // WalletClient, - // PublicClient, - createConfig, -} from "wagmi" + +import type { default as userEvent } from "@testing-library/user-event" // import { createPublicClient, WalletClient, PublicClient, createWalletClient, http } from 'viem' // import { MockConnector } from 'wagmi/connectors/mock' diff --git a/packages/sdk/src/test/utils/clients.ts b/packages/sdk/src/test/utils/clients.ts index b48dbc8..64e4568 100644 --- a/packages/sdk/src/test/utils/clients.ts +++ b/packages/sdk/src/test/utils/clients.ts @@ -1,14 +1,11 @@ import { createPublicClient, - WalletClient, - PublicClient, - createWalletClient, + type PublicClient, http, - Chain, + type Chain, } from "viem" -import { foundry } from "viem/chains" // import { chainIdToChain } from '../../utils' -import { ANVIL_RPC_URL, ANVIL_ACCOUNTS } from "../constants" +import { ANVIL_RPC_URL, } from "../constants" export const getPublicClient = ({ // chainId = foundry.id, diff --git a/packages/sdk/src/test/utils/debug.ts b/packages/sdk/src/test/utils/debug.ts index 2979946..26f39cf 100644 --- a/packages/sdk/src/test/utils/debug.ts +++ b/packages/sdk/src/test/utils/debug.ts @@ -1,4 +1,4 @@ -import { PublicClient } from "viem" +import type { PublicClient } from "viem" /** * Emits console output related to the given transaction hash for debugging purposes. diff --git a/packages/sdk/src/test/utils/getWETHBalance.ts b/packages/sdk/src/test/utils/getWETHBalance.ts index 7554b06..cd2ae6c 100644 --- a/packages/sdk/src/test/utils/getWETHBalance.ts +++ b/packages/sdk/src/test/utils/getWETHBalance.ts @@ -1,7 +1,7 @@ -import { PublicClient, erc20Abi } from "viem" +import { type PublicClient, erc20Abi } from "viem" import { WETH_CONTRACT_ADDRESS } from "../constants" import { resolvePossibleENS } from "../../utils" -import { PossibleENSAddress } from "../../types" +import type { PossibleENSAddress } from "../../types" export async function getWETHBalance({ publicClient, diff --git a/packages/sdk/src/test/utils/getZora1155Balance.ts b/packages/sdk/src/test/utils/getZora1155Balance.ts index eced5b9..5added2 100644 --- a/packages/sdk/src/test/utils/getZora1155Balance.ts +++ b/packages/sdk/src/test/utils/getZora1155Balance.ts @@ -1,8 +1,8 @@ -import { PublicClient } from "viem" +import type { PublicClient } from "viem" import { zora1155 } from "../config" import { zora1155ABI } from "../wagmi-cli-hooks/generated" import { resolvePossibleENS } from "../../utils" -import { PossibleENSAddress } from "../../types" +import type { PossibleENSAddress } from "../../types" export async function getZora1155Balance({ publicClient, diff --git a/packages/sdk/src/test/utils/getZora721Balance.ts b/packages/sdk/src/test/utils/getZora721Balance.ts index fa85975..5e2df2b 100644 --- a/packages/sdk/src/test/utils/getZora721Balance.ts +++ b/packages/sdk/src/test/utils/getZora721Balance.ts @@ -1,8 +1,8 @@ -import { PublicClient, getAddress } from "viem" +import type { PublicClient, } from "viem" import { zora721 } from "../config" import { zora721DropABI } from "../wagmi-cli-hooks/generated" import { resolvePossibleENS } from "../../utils" -import { PossibleENSAddress } from "../../types" +import type { PossibleENSAddress } from "../../types" export async function getZora721Balance({ publicClient, diff --git a/packages/sdk/src/test/utils/shellCommand.ts b/packages/sdk/src/test/utils/shellCommand.ts index f5cceff..5b1a5b3 100644 --- a/packages/sdk/src/test/utils/shellCommand.ts +++ b/packages/sdk/src/test/utils/shellCommand.ts @@ -1,4 +1,4 @@ -import { exec } from "child_process" // Node.js child_process module +import { exec } from "node:child_process" // Node.js child_process module /** * Executes a shell command and returns the output as a promise. diff --git a/packages/sdk/src/types/contractABIPair.ts b/packages/sdk/src/types/contractABIPair.ts index 27a464e..4ac2ebc 100644 --- a/packages/sdk/src/types/contractABIPair.ts +++ b/packages/sdk/src/types/contractABIPair.ts @@ -1,4 +1,4 @@ -import { Abi } from "viem" +import type { Abi } from "viem" export type ContractABIPair = { ADDRESS: `0x${string}` diff --git a/packages/sdk/src/types/messages.ts b/packages/sdk/src/types/messages.ts index 7302ffb..1c8e91a 100644 --- a/packages/sdk/src/types/messages.ts +++ b/packages/sdk/src/types/messages.ts @@ -1,5 +1,5 @@ -import { SignableMessage } from "viem" -import { Prettify } from "./prettify" +import type { SignableMessage } from "viem" +import type { Prettify } from "./prettify" export type Bytes = ArrayLike export type Ethers5SignableMessage = Bytes | string diff --git a/packages/sdk/src/types/multicall.ts b/packages/sdk/src/types/multicall.ts index fba390a..b86db8c 100644 --- a/packages/sdk/src/types/multicall.ts +++ b/packages/sdk/src/types/multicall.ts @@ -1,4 +1,4 @@ -import { TransactionRequestEIP1559 } from "viem" +import type { TransactionRequestEIP1559 } from "viem" export type Call3 = { target: `0x${string}` // The target contract diff --git a/packages/sdk/src/types/params.ts b/packages/sdk/src/types/params.ts index 2c1570f..3167afd 100644 --- a/packages/sdk/src/types/params.ts +++ b/packages/sdk/src/types/params.ts @@ -1,8 +1,8 @@ -import { WalletClient, PublicClient, Chain } from "viem" -import { Prettify } from "./prettify" -import { UniversalSignableMessage, CallOperation, Call3 } from "." -import { PossibleENSAddress } from "./addresses" -import { ERC_6551_LEGACY_V2 } from "../constants" +import type { WalletClient, PublicClient, Chain } from "viem" +import type { Prettify } from "./prettify" +import type { UniversalSignableMessage, CallOperation, Call3 } from "." +import type { PossibleENSAddress } from "./addresses" +import type { ERC_6551_LEGACY_V2 } from "../constants" export const NFTTokenType = { ERC721: "ERC721", diff --git a/packages/sdk/src/utils/addressToUint8Array.ts b/packages/sdk/src/utils/addressToUint8Array.ts index 63e8b80..c34d793 100644 --- a/packages/sdk/src/utils/addressToUint8Array.ts +++ b/packages/sdk/src/utils/addressToUint8Array.ts @@ -6,7 +6,7 @@ export function addressToUint8Array(address: `0x${string}`): Uint8Array { const array = new Uint8Array(cleanAddress.length / 2) for (let i = 0; i < cleanAddress.length; i += 2) { - array[i / 2] = parseInt(cleanAddress.substr(i, 2), 16) + array[i / 2] = Number.parseInt(cleanAddress.substr(i, 2), 16) } return array diff --git a/packages/sdk/src/utils/chainIdToChain.ts b/packages/sdk/src/utils/chainIdToChain.ts index 7d2309c..b9e1f1d 100644 --- a/packages/sdk/src/utils/chainIdToChain.ts +++ b/packages/sdk/src/utils/chainIdToChain.ts @@ -1,4 +1,4 @@ -import { Chain } from "viem" +import type { Chain } from "viem" import { mainnet, goerli, diff --git a/packages/sdk/src/utils/getImplementationName.ts b/packages/sdk/src/utils/getImplementationName.ts index a5dd20a..272c29d 100644 --- a/packages/sdk/src/utils/getImplementationName.ts +++ b/packages/sdk/src/utils/getImplementationName.ts @@ -6,7 +6,7 @@ export function getImplementationName( switch (implementationAddress) { case ERC_6551_LEGACY_V2.IMPLEMENTATION.ADDRESS: return "Implementation: Default V1" - case ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS: + case ERC_6551_DEFAULT.ACCOUNT_PROXY?.ADDRESS: case undefined: return "Implementation: Default V3" default: diff --git a/packages/sdk/src/utils/messageTypeguards.ts b/packages/sdk/src/utils/messageTypeguards.ts index 44d38aa..1572caf 100644 --- a/packages/sdk/src/utils/messageTypeguards.ts +++ b/packages/sdk/src/utils/messageTypeguards.ts @@ -1,5 +1,5 @@ -import { SignableMessage } from "viem" -import { +import type { SignableMessage } from "viem" +import type { Ethers5SignableMessage, Ethers6SignableMessage, UniversalSignableMessage, diff --git a/packages/sdk/src/utils/normalizeEthersMessage.ts b/packages/sdk/src/utils/normalizeEthersMessage.ts index 32b3c5a..3af71b0 100644 --- a/packages/sdk/src/utils/normalizeEthersMessage.ts +++ b/packages/sdk/src/utils/normalizeEthersMessage.ts @@ -1,4 +1,4 @@ -import { Bytes } from "../types" +import type { Bytes } from "../types" // The types Bytes | string in Ethers 5 and string | Uint8Array in Ethers 6 are somewhat compatible but not entirely. // This function normalizes the message type to Uint8Array so we can sign using the AbstractEthersSigner without knowing the Ethers version. diff --git a/packages/sdk/src/utils/resolvePossibleENS.ts b/packages/sdk/src/utils/resolvePossibleENS.ts index 0dc06b0..e031e09 100644 --- a/packages/sdk/src/utils/resolvePossibleENS.ts +++ b/packages/sdk/src/utils/resolvePossibleENS.ts @@ -1,6 +1,6 @@ import { normalize } from "viem/ens" -import { PossibleENSAddress } from "../types" -import { PublicClient, getAddress } from "viem" +import type { PossibleENSAddress } from "../types" +import { type PublicClient, getAddress } from "viem" export async function resolvePossibleENS( publicClient: PublicClient, diff --git a/packages/sdk/vite.config.ts b/packages/sdk/vite.config.ts index 9670bb7..e0b985a 100644 --- a/packages/sdk/vite.config.ts +++ b/packages/sdk/vite.config.ts @@ -1,5 +1,5 @@ -import { resolve } from "path" -import { PluginOption, defineConfig } from "vite" +import { resolve } from "node:path" +import { type PluginOption, defineConfig } from "vite" import { visualizer } from "rollup-plugin-visualizer" import dts from "vite-plugin-dts" From ff73d777692d3006e35c4d978c550ca85167be7c Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Tue, 22 Oct 2024 12:49:27 -0700 Subject: [PATCH 5/8] guard against missing walletClient address in test --- packages/sdk/src/TokenboundClient.ts | 4 ++-- packages/sdk/src/test/TestAll.test.ts | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/sdk/src/TokenboundClient.ts b/packages/sdk/src/TokenboundClient.ts index 05f792d..915b67c 100644 --- a/packages/sdk/src/TokenboundClient.ts +++ b/packages/sdk/src/TokenboundClient.ts @@ -374,14 +374,14 @@ class TokenboundClient { * @param {bigint} params.value The value to send, in wei * @param {string} params.data The data to send * @returns a Promise with prepared transaction to execute a call on a tokenbound account. Can be sent via `sendTransaction` on a viem WalletClient or Ethers signer. - * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use prepareExecute() instead. + * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use prepareExecution() instead. */ public async prepareExecuteCall( params: PrepareExecuteCallParams, ): Promise { if (this.supportsV3) { throw new Error( - "prepareExecuteCall() is not supported on V3 implementation deployments, use prepareExecute() instead.", + "prepareExecuteCall() is not supported on V3 implementation deployments, use prepareExecution() instead.", ) } diff --git a/packages/sdk/src/test/TestAll.test.ts b/packages/sdk/src/test/TestAll.test.ts index e097fd8..14a05fe 100644 --- a/packages/sdk/src/test/TestAll.test.ts +++ b/packages/sdk/src/test/TestAll.test.ts @@ -51,7 +51,7 @@ import { JsonRpcSigner, JsonRpcProvider } from "ethers6" import { erc20Abi } from "viem" import { type CreateAccountParams, TokenboundClient } from "../" -export const pool = Number(process.env.VITEST_POOL_ID ?? 1) +const pool = Number(process.env.VITEST_POOL_ID ?? 1) const TIMEOUT = 60000 // default 10000 const ANVIL_USER_0 = getAddress(ANVIL_ACCOUNTS[0].address) @@ -79,7 +79,7 @@ type TestConfig = { version?: TBImplementationVersion } -export const ENABLED_TESTS: Array = [ +const ENABLED_TESTS: Array = [ { testName: "viem v2", walletClient, @@ -515,6 +515,9 @@ describe.each(ENABLED_TESTS)( let transferHash: `0x${string}` if (walletClient) { + if (!walletClient.account?.address) { + throw new Error("walletClient.account.address is undefined") + } transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, account: walletClient.account?.address, @@ -572,6 +575,9 @@ describe.each(ENABLED_TESTS)( let transferHash: `0x${string}` if (walletClient) { + if (!walletClient.account?.address) { + throw new Error("walletClient.account.address is undefined") + } transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, account: walletClient.account?.address, @@ -621,6 +627,9 @@ describe.each(ENABLED_TESTS)( let transferHash: `0x${string}` if (walletClient) { + if (!walletClient.account?.address) { + throw new Error("walletClient.account.address is undefined") + } transferHash = await walletClient.sendTransaction({ chain: ANVIL_CONFIG.ACTIVE_CHAIN, account: walletClient.account?.address, @@ -1053,6 +1062,10 @@ describe.each(ENABLED_TESTS)( }) if (walletClient) { + if (!walletClient.account?.address) { + throw new Error("walletClient.account is undefined") + } + const wethContract = getContract({ address: WETH_CONTRACT_ADDRESS, abi: wethABI, @@ -1070,7 +1083,7 @@ describe.each(ENABLED_TESTS)( // Transfer WETH from ANVIL_USER_0 to TBA wethTransferHash = await walletClient.sendTransaction({ - account: walletClient.account!, + account: walletClient.account, chain: ANVIL_CONFIG.ACTIVE_CHAIN, to: WETH_CONTRACT_ADDRESS, value: 0n, From f2c6311532ea2bd5ebdceb313de01e22fdc5831c Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Tue, 22 Oct 2024 13:28:44 -0700 Subject: [PATCH 6/8] format + add cross-chain viem example --- .../vite-wagmi-ethers-rainbowkit/src/App.tsx | 210 ++++++++-------- .../vite-wagmi-ethers-rainbowkit/src/main.tsx | 62 +++-- examples/vite-wagmi-ethers/src/App.tsx | 226 +++++++++--------- examples/vite-wagmi-ethers/src/main.tsx | 40 ++-- examples/vite-wagmi-ethers6/src/App.tsx | 214 +++++++++-------- examples/vite-wagmi-ethers6/src/main.tsx | 49 ++-- examples/vite-wagmi-viem/src/App.tsx | 168 +++++++++++++ examples/vite-wagmi-viem/src/main.tsx | 46 ++-- 8 files changed, 611 insertions(+), 404 deletions(-) create mode 100644 examples/vite-wagmi-viem/src/App.tsx diff --git a/examples/vite-wagmi-ethers-rainbowkit/src/App.tsx b/examples/vite-wagmi-ethers-rainbowkit/src/App.tsx index 420f125..cf75edc 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/src/App.tsx +++ b/examples/vite-wagmi-ethers-rainbowkit/src/App.tsx @@ -1,114 +1,122 @@ -import { ConnectButton } from '@rainbow-me/rainbowkit' -import { useAccount } from 'wagmi' -import { TokenboundClient } from '@tokenbound/sdk' +import { ConnectButton } from "@rainbow-me/rainbowkit" +import { useAccount } from "wagmi" +import { TokenboundClient } from "@tokenbound/sdk" -import { Account } from './components' +import { Account } from "./components" -import { parseUnits, getAddress } from 'viem' -import { useCallback, useEffect } from 'react' -import { useEthersSigner } from './hooks' +import { parseUnits, getAddress } from "viem" +import { useCallback, useEffect } from "react" +import { useEthersSigner } from "./hooks" // Origin NFT: MoonTrees #0 on Base Sepolia const originNFT = { - tokenContract: getAddress('0xcf7ea35b7421a8ff2ff460a939e294ac13a05342'), - tokenId: '0', + tokenContract: getAddress("0xcf7ea35b7421a8ff2ff460a939e294ac13a05342"), + tokenId: "0", } // TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia -const sendingTBA = '0x5F50CAf6244d10C32965354F8c4d84D84503D42D' -const recipientAddress = getAddress('0x9FefE8a875E7a9b0574751E191a2AF205828dEA4') +const sendingTBA = getAddress("0x5F50CAf6244d10C32965354F8c4d84D84503D42D") +const recipientAddress = getAddress( + "0x9FefE8a875E7a9b0574751E191a2AF205828dEA4", +) const ethAmount = 0.005 const ethAmountWei = parseUnits(`${ethAmount}`, 18) export function App() { - const { isConnected, address } = useAccount() - const signer = useEthersSigner({ chainId: 5 }) - // or useSigner() from legacy wagmi versions: const { data: signer } = useSigner() - - const tokenboundClient = new TokenboundClient({ signer, chainId: 5 }) - - useEffect(() => { - async function testTokenboundClass() { - const account = tokenboundClient.getAccount({ - tokenContract: originNFT.tokenContract, - tokenId: originNFT.tokenId, - }) - - const preparedExecution = await tokenboundClient.prepareExecution({ - account: account, - to: account, - value: 0n, - data: '', - }) - - const preparedAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: '0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb', - tokenId: '1', - }) - - console.log('getAccount', account) - console.log('preparedExecution', preparedExecution) - console.log('preparedAccount', preparedAccount) - - // if (signer) { - // signer?.sendTransaction(preparedAccount) - // signer?.sendTransaction(preparedExecuteCall) - // } - } - - testTokenboundClass() - }, [tokenboundClient]) - - const createAccount = useCallback(async () => { - if (!tokenboundClient || !address) return - const createdAccount = await tokenboundClient.createAccount({ - tokenContract: '0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb', - tokenId: '1', - }) - alert(`new account: ${createdAccount}`) - }, [tokenboundClient]) - - const execute = useCallback(async () => { - if (!tokenboundClient || !address) return - const executedCall = await tokenboundClient.execute({ - account: sendingTBA, - to: recipientAddress, - value: ethAmountWei, - data: '0x', - }) - executedCall && alert(`Executed: ${executedCall}`) - }, [tokenboundClient]) - - const transferETH = useCallback(async () => { - if (!tokenboundClient || !address) return - const executedTransfer = await tokenboundClient.transferETH({ - account: sendingTBA, - recipientAddress, - amount: ethAmount, - }) - executedTransfer && alert(`Sent ${ethAmount} ETH to ${recipientAddress}`) - }, [tokenboundClient]) - - return ( - <> -

Ethers 5 Signer + RainbowKit + Vite

- - {isConnected && } - {address && ( -
- - - -
- )} - - ) + const { isConnected, address } = useAccount() + const signer = useEthersSigner({ chainId: 5 }) + // or useSigner() from legacy wagmi versions: const { data: signer } = useSigner() + + const tokenboundClient = new TokenboundClient({ signer, chainId: 5 }) + + useEffect(() => { + async function testTokenboundClass() { + const account = tokenboundClient.getAccount({ + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, + }) + + const preparedExecution = await tokenboundClient.prepareExecution({ + account: account, + to: account, + value: 0n, + data: "", + }) + + const preparedAccount = await tokenboundClient.prepareCreateAccount({ + tokenContract: "0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb", + tokenId: "1", + }) + + console.log("getAccount", account) + console.log("preparedExecution", preparedExecution) + console.log("preparedAccount", preparedAccount) + + // if (signer) { + // signer?.sendTransaction(preparedAccount) + // signer?.sendTransaction(preparedExecuteCall) + // } + } + + testTokenboundClass() + }, [tokenboundClient]) + + const createAccount = useCallback(async () => { + if (!tokenboundClient || !address) return + const createdAccount = await tokenboundClient.createAccount({ + tokenContract: "0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb", + tokenId: "1", + }) + alert(`new account: ${createdAccount}`) + }, [tokenboundClient, address]) + + const execute = useCallback(async () => { + if (!tokenboundClient || !address) return + const executedCall = await tokenboundClient.execute({ + account: sendingTBA, + to: recipientAddress, + value: ethAmountWei, + data: "0x", + }) + executedCall && alert(`Executed: ${executedCall}`) + }, [tokenboundClient, address]) + + const transferETH = useCallback(async () => { + if (!tokenboundClient || !address) return + const executedTransfer = await tokenboundClient.transferETH({ + account: sendingTBA, + recipientAddress, + amount: ethAmount, + }) + executedTransfer && alert(`Sent ${ethAmount} ETH to ${recipientAddress}`) + }, [tokenboundClient, address]) + + return ( + <> +

Ethers 5 Signer + RainbowKit + Vite

+ + {isConnected && } + {address && ( +
+ + + +
+ )} + + ) } diff --git a/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx b/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx index 6df0995..cabe80e 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx +++ b/examples/vite-wagmi-ethers-rainbowkit/src/main.tsx @@ -1,38 +1,36 @@ -import '@rainbow-me/rainbowkit/styles.css' +import "@rainbow-me/rainbowkit/styles.css" -import * as React from 'react' -import * as ReactDOM from 'react-dom/client' -import { WagmiProvider } from 'wagmi'; +import * as React from "react" +import * as ReactDOM from "react-dom/client" +import { WagmiProvider } from "wagmi" -import { - baseSepolia, -} from 'wagmi/chains'; -import { - QueryClientProvider, - QueryClient, -} from "@tanstack/react-query"; +import { baseSepolia } from "wagmi/chains" +import { QueryClientProvider, QueryClient } from "@tanstack/react-query" -import { App } from './App' -import { - getDefaultConfig, - RainbowKitProvider, -} from '@rainbow-me/rainbowkit' -const queryClient = new QueryClient(); +import { App } from "./App" +import { getDefaultConfig, RainbowKitProvider } from "@rainbow-me/rainbowkit" +const queryClient = new QueryClient() const config = getDefaultConfig({ - appName: 'My RainbowKit App', - projectId: 'YOUR_PROJECT_ID', - chains: [baseSepolia], -}); + appName: "My RainbowKit App", + projectId: "YOUR_PROJECT_ID", + chains: [baseSepolia], +}) -ReactDOM.createRoot(document.getElementById('root')!).render( - - - - - - - - - -) +const htmlRoot = document.getElementById("root") + +if (htmlRoot) { + ReactDOM.createRoot(htmlRoot).render( + + + + + + + + + , + ) +} else { + console.error("Failed to find the root element") +} diff --git a/examples/vite-wagmi-ethers/src/App.tsx b/examples/vite-wagmi-ethers/src/App.tsx index 9ff7db6..af5313f 100644 --- a/examples/vite-wagmi-ethers/src/App.tsx +++ b/examples/vite-wagmi-ethers/src/App.tsx @@ -1,120 +1,130 @@ -import { ConnectKitButton } from 'connectkit' -import { useAccount } from 'wagmi' -import { TokenboundClient } from '@tokenbound/sdk' +import { ConnectKitButton } from "connectkit" +import { useAccount } from "wagmi" +import { TokenboundClient } from "@tokenbound/sdk" -import { Account } from './components' -import { parseUnits, getAddress } from 'viem' -import { useCallback, useEffect } from 'react' -import { useEthersSigner } from './hooks' +import { Account } from "./components" +import { parseUnits, getAddress } from "viem" +import { useCallback, useEffect } from "react" +import { useEthersSigner } from "./hooks" // Origin NFT: MoonTrees #0 on Base Sepolia const originNFT = { - tokenContract: getAddress('0xcf7ea35b7421a8ff2ff460a939e294ac13a05342'), - tokenId: '0', + tokenContract: getAddress("0xcf7ea35b7421a8ff2ff460a939e294ac13a05342"), + tokenId: "0", } // TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia -const sendingTBA = '0x5F50CAf6244d10C32965354F8c4d84D84503D42D' -const recipientAddress = getAddress('0x9FefE8a875E7a9b0574751E191a2AF205828dEA4') +const sendingTBA = getAddress("0x5F50CAf6244d10C32965354F8c4d84D84503D42D") +const recipientAddress = getAddress( + "0x9FefE8a875E7a9b0574751E191a2AF205828dEA4", +) const ethAmount = 0.005 const ethAmountWei = parseUnits(`${ethAmount}`, 18) export function App() { - const { isConnected, address } = useAccount() - const signer = useEthersSigner({ chainId: 5 }) - // or useSigner() from legacy wagmi versions: const { data: signer } = useSigner() - - const tokenboundClient = new TokenboundClient({ - signer, - chainId: 5, - }) - - useEffect(() => { - console.log('signer', signer) - async function testTokenboundClass() { - if (!tokenboundClient) return - - const tokenboundAccount = tokenboundClient.getAccount({ - tokenContract: originNFT.tokenContract, - tokenId: originNFT.tokenId, - }) - - const preparedExecution = await tokenboundClient.prepareExecution({ - account: tokenboundAccount, - to: recipientAddress, - value: 0n, - data: '', - }) - - const preparedCreateAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: originNFT.tokenContract, - tokenId: originNFT.tokenId, - }) - - console.log('getAccount', tokenboundAccount) - console.log('preparedExecuteCall', preparedExecution) - console.log('preparedAccount', preparedCreateAccount) - - // if (address) { - // walletClient?.sendTransaction(preparedCreateAccount) - // walletClient?.sendTransaction(preparedExecuteCall) - // } - } - - testTokenboundClass() - }, []) - - const createAccount = useCallback(async () => { - if (!tokenboundClient || !address) return - const createdAccount = await tokenboundClient.createAccount({ - tokenContract: originNFT.tokenContract, - tokenId: originNFT.tokenId, - }) - console.log(`new account: ${createdAccount}`) - alert(`new account: ${createdAccount}`) - }, [tokenboundClient]) - - const execute = useCallback(async () => { - if (!tokenboundClient || !address) return - const executedCall = await tokenboundClient.execute({ - account: sendingTBA, - to: recipientAddress, - value: ethAmountWei, - data: '0x', - }) - executedCall && alert(`Executed: ${executedCall}`) - }, [tokenboundClient]) - - const transferETH = useCallback(async () => { - if (!tokenboundClient || !address) return - const executedTransfer = await tokenboundClient.transferETH({ - account: sendingTBA, - recipientAddress, - amount: ethAmount, - }) - executedTransfer && alert(`Sent ${ethAmount} ETH to ${recipientAddress}`) - }, [tokenboundClient]) - - return ( - <> -

Ethers 5 Signer + ConnectKit + Vite

- - {isConnected && } - {address && ( -
- - - -
- )} - - ) + const { isConnected, address } = useAccount() + const signer = useEthersSigner({ chainId: 5 }) + // or useSigner() from legacy wagmi versions: const { data: signer } = useSigner() + + const tokenboundClient = new TokenboundClient({ + signer, + chainId: 5, + }) + + useEffect(() => { + console.log("signer", signer) + async function testTokenboundClass() { + if (!tokenboundClient) return + + const tokenboundAccount = tokenboundClient.getAccount({ + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, + }) + + const preparedExecution = await tokenboundClient.prepareExecution({ + account: tokenboundAccount, + to: recipientAddress, + value: 0n, + data: "", + }) + + const preparedCreateAccount = await tokenboundClient.prepareCreateAccount( + { + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, + }, + ) + + console.log("getAccount", tokenboundAccount) + console.log("preparedExecuteCall", preparedExecution) + console.log("preparedAccount", preparedCreateAccount) + + // if (address) { + // walletClient?.sendTransaction(preparedCreateAccount) + // walletClient?.sendTransaction(preparedExecuteCall) + // } + } + + testTokenboundClass() + }, [tokenboundClient, signer]) + + const createAccount = useCallback(async () => { + if (!tokenboundClient || !address) return + const createdAccount = await tokenboundClient.createAccount({ + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, + }) + console.log(`new account: ${createdAccount}`) + alert(`new account: ${createdAccount}`) + }, [tokenboundClient, address]) + + const execute = useCallback(async () => { + if (!tokenboundClient || !address) return + const executedCall = await tokenboundClient.execute({ + account: sendingTBA, + to: recipientAddress, + value: ethAmountWei, + data: "0x", + }) + executedCall && alert(`Executed: ${executedCall}`) + }, [tokenboundClient, address]) + + const transferETH = useCallback(async () => { + if (!tokenboundClient || !address) return + const executedTransfer = await tokenboundClient.transferETH({ + account: sendingTBA, + recipientAddress, + amount: ethAmount, + }) + executedTransfer && alert(`Sent ${ethAmount} ETH to ${recipientAddress}`) + }, [tokenboundClient, address]) + + return ( + <> +

Ethers 5 Signer + ConnectKit + Vite

+ + {isConnected && } + {address && ( +
+ + + +
+ )} + + ) } diff --git a/examples/vite-wagmi-ethers/src/main.tsx b/examples/vite-wagmi-ethers/src/main.tsx index 28d5efb..05d45ad 100644 --- a/examples/vite-wagmi-ethers/src/main.tsx +++ b/examples/vite-wagmi-ethers/src/main.tsx @@ -1,22 +1,28 @@ -import { ConnectKitProvider } from 'connectkit' -import * as React from 'react' -import * as ReactDOM from 'react-dom/client' -import { WagmiProvider } from 'wagmi' +import { ConnectKitProvider } from "connectkit" +import * as React from "react" +import * as ReactDOM from "react-dom/client" +import { WagmiProvider } from "wagmi" -import { App } from './App' -import { wagmiConfig } from './wagmi' +import { App } from "./App" +import { wagmiConfig } from "./wagmi" import { QueryClient, QueryClientProvider } from "@tanstack/react-query" const queryClient = new QueryClient() -ReactDOM.createRoot(document.getElementById('root')!).render( - - - - - - - - - -) +const htmlRoot = document.getElementById("root") + +if (htmlRoot) { + ReactDOM.createRoot(htmlRoot).render( + + + + + + + + + , + ) +} else { + console.error("Failed to find the root element") +} diff --git a/examples/vite-wagmi-ethers6/src/App.tsx b/examples/vite-wagmi-ethers6/src/App.tsx index 1a6ebca..d008a60 100644 --- a/examples/vite-wagmi-ethers6/src/App.tsx +++ b/examples/vite-wagmi-ethers6/src/App.tsx @@ -1,116 +1,124 @@ -import { ConnectKitButton } from 'connectkit' -import { useAccount } from 'wagmi' -import { TokenboundClient } from '@tokenbound/sdk' +import { ConnectKitButton } from "connectkit" +import { useAccount } from "wagmi" +import { TokenboundClient } from "@tokenbound/sdk" -import { Account } from './components' +import { Account } from "./components" -import { parseUnits, getAddress } from 'viem' -import { useCallback, useEffect } from 'react' -import { useEthers6Signer } from './hooks' +import { parseUnits, getAddress } from "viem" +import { useCallback, useEffect } from "react" +import { useEthers6Signer } from "./hooks" // Origin NFT: MoonTrees #0 on Base Sepolia const originNFT = { - tokenContract: getAddress('0xcf7ea35b7421a8ff2ff460a939e294ac13a05342'), - tokenId: '0', + tokenContract: getAddress("0xcf7ea35b7421a8ff2ff460a939e294ac13a05342"), + tokenId: "0", } // TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia -const sendingTBA = '0x5F50CAf6244d10C32965354F8c4d84D84503D42D' -const recipientAddress = getAddress('0x9FefE8a875E7a9b0574751E191a2AF205828dEA4') +const sendingTBA = getAddress("0x5F50CAf6244d10C32965354F8c4d84D84503D42D") +const recipientAddress = getAddress( + "0x9FefE8a875E7a9b0574751E191a2AF205828dEA4", +) const ethAmount = 0.005 const ethAmountWei = parseUnits(`${ethAmount}`, 18) export function App() { - const { isConnected, address } = useAccount() - - const signer = useEthers6Signer({ chainId: 5 }) - // or useSigner() from legacy wagmi versions: const { data: signer } = useSigner() - - console.log('SIGNER', signer) - const tokenboundClient = new TokenboundClient({ signer, chainId: 5 }) - - useEffect(() => { - async function testTokenboundClass() { - const account = tokenboundClient.getAccount({ - tokenContract: originNFT.tokenContract, - tokenId: originNFT.tokenId, - }) - - const preparedExecution = await tokenboundClient.prepareExecution({ - account: account, - to: account, - value: 0n, - data: '', - }) - - const preparedAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: '0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb', - tokenId: '1', - }) - - console.log('getAccount', account) - console.log('preparedExecution', preparedExecution) - console.log('preparedAccount', preparedAccount) - - // if (signer) { - // signer?.sendTransaction(preparedAccount) - // signer?.sendTransaction(preparedExecuteCall) - // } - } - - testTokenboundClass() - }, [tokenboundClient]) - - const createAccount = useCallback(async () => { - if (!tokenboundClient || !address) return - const createdAccount = await tokenboundClient.createAccount({ - tokenContract: '0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb', - tokenId: '1', - }) - alert(`new account: ${createdAccount}`) - }, [tokenboundClient]) - - const execute = useCallback(async () => { - if (!tokenboundClient || !address) return - const executedCall = await tokenboundClient.execute({ - account: sendingTBA, - to: recipientAddress, - value: ethAmountWei, - data: '0x', - }) - executedCall && alert(`Executed: ${executedCall}`) - }, [tokenboundClient]) - - const transferETH = useCallback(async () => { - if (!tokenboundClient || !address) return - const executedTransfer = await tokenboundClient.transferETH({ - account: sendingTBA, - recipientAddress, - amount: ethAmount, - }) - executedTransfer && alert(`Sent ${ethAmount} ETH to ${recipientAddress}`) - }, [tokenboundClient]) - - return ( - <> -

Ethers 6 Signer + ConnectKit + Vite

- - {isConnected && } - {address && ( -
- - - -
- )} - - ) + const { isConnected, address } = useAccount() + + const signer = useEthers6Signer({ chainId: 5 }) + // or useSigner() from legacy wagmi versions: const { data: signer } = useSigner() + + console.log("SIGNER", signer) + const tokenboundClient = new TokenboundClient({ signer, chainId: 5 }) + + useEffect(() => { + async function testTokenboundClass() { + const account = tokenboundClient.getAccount({ + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, + }) + + const preparedExecution = await tokenboundClient.prepareExecution({ + account: account, + to: account, + value: 0n, + data: "", + }) + + const preparedAccount = await tokenboundClient.prepareCreateAccount({ + tokenContract: "0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb", + tokenId: "1", + }) + + console.log("getAccount", account) + console.log("preparedExecution", preparedExecution) + console.log("preparedAccount", preparedAccount) + + // if (signer) { + // signer?.sendTransaction(preparedAccount) + // signer?.sendTransaction(preparedExecuteCall) + // } + } + + testTokenboundClass() + }, [tokenboundClient]) + + const createAccount = useCallback(async () => { + if (!tokenboundClient || !address) return + const createdAccount = await tokenboundClient.createAccount({ + tokenContract: "0xe7134a029cd2fd55f678d6809e64d0b6a0caddcb", + tokenId: "1", + }) + alert(`new account: ${createdAccount}`) + }, [tokenboundClient, address]) + + const execute = useCallback(async () => { + if (!tokenboundClient || !address) return + const executedCall = await tokenboundClient.execute({ + account: sendingTBA, + to: recipientAddress, + value: ethAmountWei, + data: "0x", + }) + executedCall && alert(`Executed: ${executedCall}`) + }, [tokenboundClient, address]) + + const transferETH = useCallback(async () => { + if (!tokenboundClient || !address) return + const executedTransfer = await tokenboundClient.transferETH({ + account: sendingTBA, + recipientAddress, + amount: ethAmount, + }) + executedTransfer && alert(`Sent ${ethAmount} ETH to ${recipientAddress}`) + }, [tokenboundClient, address]) + + return ( + <> +

Ethers 6 Signer + ConnectKit + Vite

+ + {isConnected && } + {address && ( +
+ + + +
+ )} + + ) } diff --git a/examples/vite-wagmi-ethers6/src/main.tsx b/examples/vite-wagmi-ethers6/src/main.tsx index cbc654d..537b3d3 100644 --- a/examples/vite-wagmi-ethers6/src/main.tsx +++ b/examples/vite-wagmi-ethers6/src/main.tsx @@ -1,17 +1,14 @@ -import { ConnectKitProvider } from 'connectkit' -import * as React from 'react' -import * as ReactDOM from 'react-dom/client' -import { createConfig, WagmiProvider } from 'wagmi'; +import { ConnectKitProvider } from "connectkit" +import * as React from "react" +import * as ReactDOM from "react-dom/client" +import { createConfig, WagmiProvider } from "wagmi" -import { baseSepolia } from 'wagmi/chains'; -import { - QueryClientProvider, - QueryClient, -} from "@tanstack/react-query"; -import { http } from 'viem'; +import { baseSepolia } from "wagmi/chains" +import { QueryClientProvider, QueryClient } from "@tanstack/react-query" +import { http } from "viem" -import { App } from './App' -const queryClient = new QueryClient(); +import { App } from "./App" +const queryClient = new QueryClient() export const config = createConfig({ chains: [baseSepolia], @@ -20,14 +17,20 @@ export const config = createConfig({ }, }) -ReactDOM.createRoot(document.getElementById('root')!).render( - - - - - - - - - -) +const htmlRoot = document.getElementById("root") + +if (htmlRoot) { + ReactDOM.createRoot(htmlRoot).render( + + + + + + + + + , + ) +} else { + console.error("Failed to find the root element") +} diff --git a/examples/vite-wagmi-viem/src/App.tsx b/examples/vite-wagmi-viem/src/App.tsx new file mode 100644 index 0000000..7858355 --- /dev/null +++ b/examples/vite-wagmi-viem/src/App.tsx @@ -0,0 +1,168 @@ +import { ConnectButton } from "@rainbow-me/rainbowkit" +import { useAccount } from "wagmi" + +import { Account } from "./components" + +import { + createWalletClient, + http, + custom, + parseUnits, + getAddress, + type WalletClient, +} from "viem" +import { baseSepolia, baseGoerli } from "viem/chains" +import { TokenboundClient } from "@tokenbound/sdk" +import { useCallback, useEffect } from "react" + +declare global { + interface Window { + ethereum?: any // CoinbaseWalletSDK also defines window.ethereum, so we have to work around that :( + } +} + +// Origin NFT: MoonTrees #0 on Base Sepolia +const originNFT = { + tokenContract: getAddress("0xcf7ea35b7421a8ff2ff460a939e294ac13a05342"), + tokenId: "0", +} + +// TBA: Tokenbound Account derived from MoonTrees #0 on Base Sepolia +const sendingTBA = getAddress("0x5F50CAf6244d10C32965354F8c4d84D84503D42D") +const recipientAddress = getAddress( + "0x9FefE8a875E7a9b0574751E191a2AF205828dEA4", +) +const ethAmount = 0.005 +const ethAmountWei = parseUnits(`${ethAmount}`, 18) + +export function App() { + const { isConnected, address } = useAccount() + + const walletClient: WalletClient = createWalletClient({ + chain: baseSepolia, + account: address, + transport: window.ethereum ? custom(window.ethereum) : http(), + }) + + const tokenboundClient = new TokenboundClient({ + walletClient, + chainId: baseSepolia.id, + // implementationAddress: '0x2d25602551487c3f3354dd80d76d54383a243358', + }) + + useEffect(() => { + async function testTokenboundClass() { + if (!tokenboundClient) return + + const tokenboundAccount = tokenboundClient.getAccount({ + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, + }) + + const preparedExecution = await tokenboundClient.prepareExecution({ + account: tokenboundAccount, + to: recipientAddress, + value: 0n, + data: "", + }) + + const preparedCreateAccount = await tokenboundClient.prepareCreateAccount( + { + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, + }, + ) + + console.log("getAccount", tokenboundAccount) + console.log("preparedExecution", preparedExecution) + console.log("preparedAccount", preparedCreateAccount) + + // if (address) { + // walletClient?.sendTransaction(preparedCreateAccount) + // walletClient?.sendTransaction(preparedExecuteCall) + // } + } + + testTokenboundClass() + }, [tokenboundClient]) + + const createAccount = useCallback(async () => { + if (!tokenboundClient || !address) return + const createdAccount = await tokenboundClient.createAccount({ + tokenContract: originNFT.tokenContract, + tokenId: originNFT.tokenId, + }) + console.log(`new account: ${createdAccount}`) + alert(`new account: ${createdAccount}`) + }, [tokenboundClient, address]) + + const execute = useCallback(async () => { + if (!tokenboundClient || !address) return + const executedCall = await tokenboundClient.execute({ + account: sendingTBA, + to: recipientAddress, + value: ethAmountWei, + data: "0x", + }) + executedCall && alert(`Executed: ${executedCall}`) + }, [tokenboundClient, address]) + + const transferETH = useCallback(async () => { + if (!tokenboundClient || !address) return + const executedTransfer = await tokenboundClient.transferETH({ + account: sendingTBA, + recipientAddress, + amount: ethAmount, + }) + executedTransfer && alert(`Sent ${ethAmount} ETH to ${recipientAddress}`) + }, [tokenboundClient, address]) + + const crossChainTransferETH = useCallback(async () => { + if (!tokenboundClient || !address) return + + const execution = { + account: sendingTBA, + to: originNFT.tokenContract, + value: 0n, + data: "", + chain: baseGoerli, + } + + const executedCallTxHash = await tokenboundClient.execute(execution) + + executedCallTxHash && + alert(`Sent blank tx on ${baseGoerli.name}: ${executedCallTxHash}`) + }, [tokenboundClient, address]) + + return ( + <> +

viem walletClient + ConnectKit + Vite

+ + {isConnected && } + {address && ( +
+ + + + +
+ )} + + ) +} diff --git a/examples/vite-wagmi-viem/src/main.tsx b/examples/vite-wagmi-viem/src/main.tsx index a569dba..5ce5c68 100644 --- a/examples/vite-wagmi-viem/src/main.tsx +++ b/examples/vite-wagmi-viem/src/main.tsx @@ -1,15 +1,15 @@ -import '@rainbow-me/rainbowkit/styles.css' +import "@rainbow-me/rainbowkit/styles.css" -import { http } from 'viem'; -import { createConfig, WagmiProvider } from 'wagmi'; -import { QueryClient, QueryClientProvider } from '@tanstack/react-query' -import { RainbowKitProvider, lightTheme } from '@rainbow-me/rainbowkit' -import { baseSepolia } from 'wagmi/chains'; +import { http } from "viem" +import { createConfig, WagmiProvider } from "wagmi" +import { QueryClient, QueryClientProvider } from "@tanstack/react-query" +import { RainbowKitProvider, lightTheme } from "@rainbow-me/rainbowkit" +import { baseSepolia } from "wagmi/chains" -import * as React from 'react' -import * as ReactDOM from 'react-dom/client' +import * as React from "react" +import * as ReactDOM from "react-dom/client" -import { App } from './App' +import { App } from "./App" // import { wagmiConfig } from './wagmi' const queryClient = new QueryClient() @@ -21,14 +21,20 @@ export const config = createConfig({ }, }) -ReactDOM.createRoot(document.getElementById('root')!).render( - - - - - - - - - -) +const htmlRoot = document.getElementById("root") + +if (htmlRoot) { + ReactDOM.createRoot(htmlRoot).render( + + + + + + + + + , + ) +} else { + console.error("Failed to find the root element") +} From 161fef87feac63d2653874a46c84e124bf51ab8e Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Tue, 22 Oct 2024 13:40:13 -0700 Subject: [PATCH 7/8] update eth mainnet latest block numbers --- README.md | 2 +- packages/sdk/.env.example | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ddaab6..5c8f548 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ VITE_PRIVATE_ALCHEMY_API_KEY=REPLACE_WITH_YOUR_ALCHEMY_API_KEY # PUBLIC ENV VARS, add to `.env`: VITE_ANVIL_MAINNET_FORK_ENDPOINT=https://eth-mainnet.alchemyapi.io/v2/$VITE_PRIVATE_ALCHEMY_API_KEY -VITE_ANVIL_MAINNET_FORK_BLOCK_NUMBER=19869786 +VITE_ANVIL_MAINNET_FORK_BLOCK_NUMBER=21023556 ``` 2. Build the SDK from `/packages/sdk` diff --git a/packages/sdk/.env.example b/packages/sdk/.env.example index a59c9a5..b34adf4 100644 --- a/packages/sdk/.env.example +++ b/packages/sdk/.env.example @@ -2,7 +2,7 @@ # PUBLIC ENV VARS, add to `.env`: VITE_ANVIL_MAINNET_FORK_ENDPOINT=https://eth-mainnet.alchemyapi.io/v2/$PRIVATE_ALCHEMY_API_KEY -VITE_ANVIL_MAINNET_FORK_BLOCK_NUMBER=19869786 +VITE_ANVIL_MAINNET_FORK_BLOCK_NUMBER=21023556 # PRIVATE KEYS, add to .env.local, do not commit: VITE_PRIVATE_ALCHEMY_API_KEY= From ab5e851e95b5054a944700810bbe75a4f2eb34a1 Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Tue, 22 Oct 2024 13:45:27 -0700 Subject: [PATCH 8/8] add changeset --- examples/vite-wagmi-ethers-rainbowkit/CHANGELOG.md | 7 +++++++ examples/vite-wagmi-ethers-rainbowkit/package.json | 2 +- examples/vite-wagmi-ethers/CHANGELOG.md | 7 +++++++ examples/vite-wagmi-ethers/package.json | 2 +- examples/vite-wagmi-ethers6/CHANGELOG.md | 7 +++++++ examples/vite-wagmi-ethers6/package.json | 2 +- packages/sdk/CHANGELOG.md | 6 ++++++ packages/sdk/package.json | 6 ++++-- 8 files changed, 34 insertions(+), 5 deletions(-) diff --git a/examples/vite-wagmi-ethers-rainbowkit/CHANGELOG.md b/examples/vite-wagmi-ethers-rainbowkit/CHANGELOG.md index f4dbdea..a807148 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/CHANGELOG.md +++ b/examples/vite-wagmi-ethers-rainbowkit/CHANGELOG.md @@ -1,5 +1,12 @@ # vite-wagmi-ethers-rainbowkit +## 0.0.7 + +### Patch Changes + +- Updated dependencies + - @tokenbound/sdk@0.5.5 + ## 0.0.6 ### Patch Changes diff --git a/examples/vite-wagmi-ethers-rainbowkit/package.json b/examples/vite-wagmi-ethers-rainbowkit/package.json index 5c0d79b..f65610a 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/package.json +++ b/examples/vite-wagmi-ethers-rainbowkit/package.json @@ -1,6 +1,6 @@ { "name": "vite-wagmi-ethers-rainbowkit", - "version": "0.0.6", + "version": "0.0.7", "private": true, "scripts": { "dev": "vite", diff --git a/examples/vite-wagmi-ethers/CHANGELOG.md b/examples/vite-wagmi-ethers/CHANGELOG.md index 349909b..8fffbb2 100644 --- a/examples/vite-wagmi-ethers/CHANGELOG.md +++ b/examples/vite-wagmi-ethers/CHANGELOG.md @@ -1,5 +1,12 @@ # vite-wagmi-ethers +## 0.0.7 + +### Patch Changes + +- Updated dependencies + - @tokenbound/sdk@0.5.5 + ## 0.0.6 ### Patch Changes diff --git a/examples/vite-wagmi-ethers/package.json b/examples/vite-wagmi-ethers/package.json index e8f1600..bfec8bc 100644 --- a/examples/vite-wagmi-ethers/package.json +++ b/examples/vite-wagmi-ethers/package.json @@ -1,6 +1,6 @@ { "name": "vite-wagmi-ethers", - "version": "0.0.6", + "version": "0.0.7", "private": true, "scripts": { "dev": "vite", diff --git a/examples/vite-wagmi-ethers6/CHANGELOG.md b/examples/vite-wagmi-ethers6/CHANGELOG.md index f47ab83..b2089cd 100644 --- a/examples/vite-wagmi-ethers6/CHANGELOG.md +++ b/examples/vite-wagmi-ethers6/CHANGELOG.md @@ -1,5 +1,12 @@ # vite-wagmi-ethers6 +## 0.0.7 + +### Patch Changes + +- Updated dependencies + - @tokenbound/sdk@0.5.5 + ## 0.0.6 ### Patch Changes diff --git a/examples/vite-wagmi-ethers6/package.json b/examples/vite-wagmi-ethers6/package.json index afb1c32..b6ee820 100644 --- a/examples/vite-wagmi-ethers6/package.json +++ b/examples/vite-wagmi-ethers6/package.json @@ -1,6 +1,6 @@ { "name": "vite-wagmi-ethers6", - "version": "0.0.6", + "version": "0.0.7", "private": true, "scripts": { "dev": "vite", diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 8d3371e..f99afc6 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,5 +1,11 @@ # @tokenbound/sdk +## 0.5.5 + +### Patch Changes + +- version bump viem + update examples + ## 0.5.4 ### Patch Changes diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 5e5824e..24e2027 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,8 +1,10 @@ { "name": "@tokenbound/sdk", - "version": "0.5.4", + "version": "0.5.5", "type": "module", - "files": ["dist"], + "files": [ + "dist" + ], "types": "./dist/src/index.d.ts", "main": "./dist/tokenbound-sdk.umd.cjs", "module": "./dist/tokenbound-sdk.js",