diff --git a/.changeset/grumpy-lies-give.md b/.changeset/grumpy-lies-give.md new file mode 100644 index 0000000..1bb6dd3 --- /dev/null +++ b/.changeset/grumpy-lies-give.md @@ -0,0 +1,5 @@ +--- +'@tokenbound/sdk': patch +--- + +Revised testing pipeline, add signMessage, transferERC20, transferETH methods diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index ad0cda0..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -/** @type {import('eslint').ESLint.ConfigData} */ -module.exports = { - root: true, - extends: ["prettier"], - rules: { - "no-unexpected-multiline": "warn", - "react/display-name": "off", - semi: 0, - "react/no-unescaped-entities": 0, - }, -}; diff --git a/.eslintrc.yaml b/.eslintrc.yaml new file mode 100644 index 0000000..abfef9e --- /dev/null +++ b/.eslintrc.yaml @@ -0,0 +1,15 @@ +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/README.md b/README.md index 89f7b76..e0287b8 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ $ pnpm install $ pnpm --filter "@tokenbound/*" build ``` -NOTE: Any local SDK changes require a rebuild to be useable in the example apps in ```/example``` +NOTE: Any local changes to SDK methods in `TokenboundClient.ts` require a rebuild to be useable in the example apps in ```/example``` 2. Install [Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) to run a local Ethereum node. 3. Configure environment variables. See `.env.example` for instructions @@ -35,30 +35,412 @@ NOTE: Any local SDK changes require a rebuild to be useable in the example apps ## Unit/integration tests -Unit and integration tests are run by [Vitest](https://vitest.dev) and rendered with a [custom `render` function](https://testing-library.com/docs/react-testing-library/setup/#custom-render) from React Testing Library. See usage of ```renderWithWagmiConfig``` in ```packages/sdk/src/tests```. +Tests are using [Vitest](https://vitest.dev), and can be performed via multiple pipelines: -This configuration allows us to use a single wagmi configuration to test the viem walletClient, Ethers 5, and Ethers 6 implementations with [wagmi's Ethers adaptors](https://wagmi.sh/react/ethers-adapters) +- Unit tests spin up a local Anvil instance using [viem/anvil](https://www.npmjs.com/package/@viem/anvil) and transact against a local fork of mainnet. +- Integration tests are rendered with a [custom `render` function](https://testing-library.com/docs/react-testing-library/setup/#custom-render) from React Testing Library that integrates with Anvil. See usage of ```renderWithWagmiConfig``` in ```packages/sdk/src/tests```. + +Both pipelines use [wagmi's Ethers adaptors](https://wagmi.sh/react/ethers-adapters) to convert the viem walletClient to Ethers 5 and Ethers 6 signers so the entire test suite is run against all 3 implementations. These tests require a local Anvil node so test transactions can be run against a mainnet fork. -### Run Anvil +Thanks to [@tmm](https://github.com/tmm) for sharing [testing-wagmi](https://github.com/tmm/testing-wagmi) for reference. +### Run Tests -1. Start Anvil in a terminal session +1. Set up environment variables in `.env.test` -```bash -pnpm anvil +```ts copy +# VITE_ prefix is required for Vite to pick up the env vars + +# PRIVATE KEYS CAN GO HERE +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=17680029 ``` -2. Start Vitest in a different terminal session from the SDK root +2. Spin up an Anvil instance and start Vitest from the SDK root: -```bash +```bash copy pnpm test ``` +All unit tests will be executed. + ### Pre-commit Hooks -Husky has been configured to run a pre-commit hook to ensure tests pass +Husky has been configured to run a pre-commit hook to ensure tests pass. + +## API Reference + +### TokenboundClient + +The TokenboundClient is instantiated with an object containing at most two parameters: +`chainId` (mandatory) +`walletClient` (optional) OR +`signer` (optional) + +Use either a viem `walletClient` [(see walletClient docs)](https://viem.sh/docs/clients/wallet.html) OR an Ethers `signer` [(see signer docs)](https://docs.ethers.org/v5/api/signer/) for transactions that require a user to sign. Note that viem is an SDK dependency, so walletClient is preferable for most use cases. _Use of Ethers signer is recommended only for legacy projects_. +For easy reference, we've prepared [SDK code examples](https://github.com/tokenbound/sdk/tree/main/examples) for a few simple SDK interactions. + +```ts copy +const tokenboundClient = new TokenboundClient({ walletClient, chainId: 1 }) +``` + +**OR** + +```ts copy +const tokenboundClient = new TokenboundClient({ signer, chainId: 1 }) +``` + +| Parameter | | +| ---------------- | --------- | +| **walletClient** | optional | +| **signer** | optional | +| **chainId** | mandatory | + +Then use the TokenboundClient to interact with the Tokenbound contracts and Tokenbound accounts: -#### Thanks +```ts copy +const tokenboundClient = new TokenboundClient({ signer, chainId: 1 }) + +const tokenBoundAccount = tokenboundClient.getAccount({ + tokenContract: "", + tokenId: "", +}) + +console.log(tokenBoundAccount) //0x1a2...3b4cd +``` + +### Custom Account Implementation + +It is possible to implement your own custom implementation of an [account](/contracts/account) and make the SDK point to your custom implementation instead of the default implementation. + +```javascript +import { TokenboundClient } from "@tokenbound/sdk" + +const tokenboundClient = new TokenboundClient({ + signer: "", + chainId: "", + implementationAddress: "", +}) + +// Custom implementation AND custom registry (uncommon for most implementations) +const tokenboundClientWithCustomRegistry = new TokenboundClient({ + signer: "", + chainId: "", + implementationAddress: "", + registryAddress: "", +}) +``` + +Read more [here](/guides/custom-accounts) + +--- + +### getAccount + +**Returns** the tokenbound account address for a given token contract and token ID. + +```typescript +const tokenBoundAccount = tokenboundClient.getAccount({ + tokenContract: "", + tokenId: "", +}) + +console.log(tokenBoundAccount) //0x1a2...3b4cd +``` + +| Parameter | Description | Type | +| ----------------- | ---------------------------------- | ------ | +| **tokenContract** | The address of the token contract. | string | +| **tokenId** | The token ID. | string | + +--- + +### prepareCreateAccount + +**Returns** the prepared transaction to create a Tokenbound account for a given token contract and token ID. + +```typescript +const preparedAccount = await tokenboundClient.prepareCreateAccount({ + tokenContract: "", + tokenId: "", +}) + +console.log(preparedAccount) //0x1a2...3b4cd +``` + +| Parameter | Description | Type | +| ----------------- | ---------------------------------- | ------ | +| **tokenContract** | The address of the token contract. | string | +| **tokenId** | The token ID. | string | + +--- + +### createAccount + +**Returns** the account address of the tokenbound account created. If an account already exists, the existing account is returned. + +```typescript +const account = await tokenboundClient.createAccount({ + tokenContract: "", + tokenId: "", +}) + +console.log(createAccount) //0x1a2...3b4cd +``` + +| Parameter | Description | Type | +| ----------------- | ---------------------------------- | ------ | +| **tokenContract** | The address of the token contract. | string | +| **tokenId** | The token ID. | string | + +--- + +### checkAccountDeployment + +**Returns** a boolean indicating if a tokenbound account has been deployed at the accountAddress + +```ts copy +const SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_0 = + "0x33D622b211C399912eC0feaaf1caFD01AFA53980" as `0x${string}` + +const isAccountDeployed = await tokenboundClient.checkAccountDeployment({ + accountAddress: SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_0, +}) + +console.log("IS SAPIENZ 0 DEPLOYED?", isAccountDeployed) //... +``` + +| Parameter | Description | Type | +| ------------------ | ------------------------------- | ------ | +| **accountAddress** | The Tokenbound account address. | string | + +--- + +### getNFT + +Extracts information about the origin NFT that is paired with the Tokenbound account. + +**Returns** a Promise that resolves to a **TokenboundAccountNFT** object. The TokenboundAccountNFT object contains the following properties: + +- _tokenContract_: The token contract address +- _tokenId_: The token ID +- _chainId_: The chain ID + +```ts +const nft = await client.getNFT({ + accountAddress: "", +}) + +const { tokenContract, tokenId, chainId } = nft + +console.log({ tokenContract, tokenId, chainId }) +``` + +| Parameter | Description | Type | +| ------------------ | ------------------------------- | ------ | +| **accountAddress** | The Tokenbound account address. | string | + +--- + +### prepareExecuteCall + +**Returns** A Promise with prepared transaction to execute a call on a Tokenbound account. Can be sent via `sendTransaction` on an Ethers signer or via WalletClient. + +```typescript +const preparedCall = await tokenboundClient.prepareExecuteCall({ + account: "", + to: "", + value: "", + data: "", +}) + +console.log(preparedCall) //... +``` + +| Parameter | Description | Type | +| ----------- | ------------------------------- | ------ | +| **account** | The Tokenbound account address. | string | +| **to** | The recipient address. | string | +| **value** | The value to send, in wei. | bigint | +| **data** | The data to send. | string | + +--- + +### executeCall + +**Returns** a hash of the transaction that executed a call using a Tokenbound account. + +```ts copy +const executedCall = await tokenboundClient.executeCall({ + account: "", + to: "", + value: "", + data: "", +}) + +console.log(executedCall) //... +``` + +| Parameter | Description | Type | +| ----------- | ------------------------------- | ------ | +| **account** | The Tokenbound account address. | string | +| **to** | The recipient address. | string | +| **value** | The value to send, in wei. | bigint | + +--- + +### transferNFT + +Transfer an NFT to a recipient from a Tokenbound account + +**Returns** a Promise that resolves to the transaction hash of the transfer + +```typescript +const transferNFT = await tokenboundClient.transferNFT({ + account: "", + tokenType: "ERC721", + tokenContract: "", + tokenId: "", + recipientAddress: "", +}) + +console.log(transferNFT) //... +``` + +| Parameter | Description | Type | +| -------------------- | --------------------------------- | ------ | +| **account** | The Tokenbound account address. | string | +| **tokenType** | Token type: 'ERC721' or 'ERC1155' | string | +| **tokenContract** | The recipient address. | string | +| **tokenId** | The tokenId of the NFT. | string | +| **recipientAddress** | The recipient address. | string | + +--- + +### transferERC20 + +Transfer ERC-20 tokens to a recipient from a Tokenbound account + +**Returns** a Promise that resolves to the transaction hash of the transfer + +```typescript +const transferERC20 = await tokenboundClient.transferERC20({ + account: "", + amount: 0.1, + recipientAddress: "", + erc20tokenAddress: "", + erc20tokenDecimals: "", +}) + +console.log(transferERC20) //... +``` + +| Parameter | Description | Type | +| ---------------------- | ---------------------------------------------- | ------ | +| **account** | The Tokenbound account address. | string | +| **amount** | Amount, in decimal form (eg. 0.1 USDC). | number | +| **recipientAddress** | The recipient address. | string | +| **erc20tokenAddress** | The ERC-20 token address. | string | +| **erc20tokenDecimals** | The ERC-20 token decimal specification (1-18). | number | + +--- + +### transferETH + +Transfer ETH to a recipient from a Tokenbound account + +**Returns** a Promise that resolves to the transaction hash of the transfer + +```typescript +const transferETH = await tokenboundClient.transferETH({ + account: "", + amount: 0.01, + recipientAddress: "", +}) + +console.log(transferERC20) //... +``` + +| Parameter | Description | Type | +| -------------------- | --------------------------------------- | ------ | +| **account** | The Tokenbound account address. | string | +| **amount** | Amount, in decimal form (eg. 0.01 ETH). | number | +| **recipientAddress** | The recipient address. | string | + +--- + +### deconstructBytecode + +Deconstructs the bytecode of a Tokenbound account into its constituent parts. + +**Returns** a Promise that resolves to a **SegmentedERC1155Bytecode** object, or null if the account is not deployed. The **SegmentedERC1155Bytecode** object contains the following properties: + +- **_erc1167Header_**: ERC-1167 Header +- **_implementationAddress_**: The ERC-6551 implementation address +- **_erc1167Footer_**: ERC-1167 Footer +- **_salt_**: The salt value +- **_tokenId_**: The token ID +- **_tokenContract_**: The token contract address +- **_chainId_**: The chain ID + +```ts +const segmentedBytecode = await tokenboundClient.deconstructBytecode({ + accountAddress: "", +}) + +console.log(segmentedBytecode) +``` + +| Parameter | Description | Type | +| ------------------ | ------------------------------- | ------ | +| **accountAddress** | The Tokenbound account address. | string | + +--- + +### signMessage + +Gets an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) formatted signature for a message. + +The message to be signed is typed as `UniversalSignableMessage` so that it can elegantly handle Ethers 5, Ethers 6, and viem's expected types for all signable formats. Check the types associated with signMessage for [viem](https://viem.sh/docs/actions/wallet/signMessage.html), [Ethers 5](https://docs.ethers.org/v5/api/signer/#Signer-signMessage), and [Ethers 6](https://docs.ethers.org/v6/api/providers/#Signer-signMessage) as needed. + +```ts +// Ethers 5 +const arrayMessage: ArrayLike = [72, 101, 108, 108, 111] // "Hello" in ASCII + +// Ethers 5 or Ethers 6 +const uint8ArrayMessage: Uint8Array = new Uint8Array([72, 101, 108, 108, 111]) // "Hello" in ASCII +``` + +Note that this method is just for convenience. Since your EOA wallet is responsible for signing, messages can also be signed explicitly using your EOA wallet address in viem or Ethers. + +**Returns** a Promise that resolves to a signed Hex string + +```ts +const signedMessage = await tokenboundClient.signMessage({ + message: "Ice cream so good", +}) + +console.log(signedMessage) + +// Works in Ethers 5 or 6, throws in viem +const signedUint8Message = await tokenboundClient.signMessage({ + message: uint8ArrayMessage, +}) + +console.log(signedUint8Message) + +// Works in viem +const signedRawUint8Message = await tokenboundClient.signMessage({ + message: {raw: uint8ArrayMessage}, +}) + +console.log(signedUint8Message) +``` -Props to [@tmm](https://github.com/tmm) for sharing [testing-wagmi](https://github.com/tmm/testing-wagmi) for reference. \ No newline at end of file +| Parameter | Description | Type | +| ----------- | ------------------------- | ------------------------ | +| **message** | The message to be signed. | UniversalSignableMessage | diff --git a/examples/vite-wagmi-ethers-rainbowkit/package.json b/examples/vite-wagmi-ethers-rainbowkit/package.json index f981b9a..f1087ff 100644 --- a/examples/vite-wagmi-ethers-rainbowkit/package.json +++ b/examples/vite-wagmi-ethers-rainbowkit/package.json @@ -17,8 +17,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "util": "^0.12.5", - "viem": "^1.10.14", - "wagmi": "^1.4.2" + "viem": "^1.15.1", + "wagmi": "^1.4.3" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/vite-wagmi-ethers/package.json b/examples/vite-wagmi-ethers/package.json index 0499fd0..6d90209 100644 --- a/examples/vite-wagmi-ethers/package.json +++ b/examples/vite-wagmi-ethers/package.json @@ -17,8 +17,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "util": "^0.12.5", - "viem": "^1.10.14", - "wagmi": "^1.4.2" + "viem": "^1.15.1", + "wagmi": "^1.4.3" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/vite-wagmi-ethers6/package.json b/examples/vite-wagmi-ethers6/package.json index 6cf9b69..55e73b3 100644 --- a/examples/vite-wagmi-ethers6/package.json +++ b/examples/vite-wagmi-ethers6/package.json @@ -17,8 +17,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "util": "^0.12.5", - "viem": "^1.10.14", - "wagmi": "^1.4.2" + "viem": "^1.15.1", + "wagmi": "^1.4.3" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/vite-wagmi-viem/package.json b/examples/vite-wagmi-viem/package.json index 9cbe4d8..fe89067 100644 --- a/examples/vite-wagmi-viem/package.json +++ b/examples/vite-wagmi-viem/package.json @@ -17,8 +17,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "util": "^0.12.5", - "viem": "^1.10.14", - "wagmi": "^1.4.2" + "viem": "^1.15.1", + "wagmi": "^1.4.3" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/package.json b/package.json index aaf625b..c9ff430 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,16 @@ "license": "ISC", "devDependencies": { "@changesets/cli": "^2.26.2", - "eslint": "^8.45.0", - "eslint-config-prettier": "^8.8.0", + "eslint": "^8.50.0", + "eslint-config-prettier": "^9.0.0", "eslint-plugin-unused-imports": "^3.0.0", - "prettier": "^3.0.3", + "prettier": "^2.8.8", "@ianvs/prettier-plugin-sort-imports": "^4.1.0", "husky": "^8.0.3", "typescript": "^5.2.2", - "lint-staged": "^13.2.3" + "@typescript-eslint/parser": "^6.7.2", + "@typescript-eslint/eslint-plugin": "^6.7.2", + "lint-staged": "^14.0.1" }, "lint-staged": { "./**/*.{js,ts,jsx,tsx}": [ diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 6f51a2b..0b7e6ab 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@tokenbound/sdk", - "version": "0.3.7", + "version": "0.3.8", "type": "module", "files": [ "dist" @@ -25,7 +25,7 @@ "wagmi": "wagmi generate" }, "dependencies": { - "viem": "^1.10.14" + "viem": "^1.14.0" }, "devDependencies": { "@tanstack/react-query": "4.29.1", @@ -45,11 +45,19 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.2.2", - "viem": "^1.10.14", + "viem": "^1.15.1", "@viem/anvil": "^0.0.6", "vite": "^4.4.9", "vite-plugin-dts": "^3.5.1", "vitest": "^0.34.2", - "wagmi": "^1.4.2" + "wagmi": "^1.4.3", + "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", + "@typescript-eslint/parser": "^6.7.2", + "@typescript-eslint/eslint-plugin": "^6.7.2", + "forge-std": "1.1.2" } } diff --git a/packages/sdk/src/TokenboundClient.ts b/packages/sdk/src/TokenboundClient.ts index abf4c64..8dbe757 100644 --- a/packages/sdk/src/TokenboundClient.ts +++ b/packages/sdk/src/TokenboundClient.ts @@ -1,140 +1,98 @@ -import { +import { WalletClient, PublicClient, createPublicClient, http, GetBytecodeReturnType, - hexToNumber, + hexToNumber, getAddress, encodeFunctionData, - // Abi, parseUnits, - BaseError, - ContractFunctionRevertedError, - Abi, -} from "viem" -import { erc6551AccountAbi, erc6551RegistryAbi, erc1155Abi, erc721Abi, erc20Abi } from '../abis' -import { + SignableMessage, +} from 'viem' +import { + erc6551AccountAbi, + erc6551RegistryAbi, + erc1155Abi, + erc721Abi, + erc20Abi, +} from '../abis' +import { getAccount, computeAccount, createAccount, getCreationCode, prepareExecuteCall, executeCall, - prepareCreateAccount + prepareCreateAccount, } from './functions' -import { +import { AbstractEthersSigner, AbstractEthersTransactionResponse, - SegmentedERC6551Bytecode -} from "./types" -import { chainIdToChain, segmentBytecode } from "./utils" -import { normalize } from "viem/ens" - -export const NFTTokenType = { - ERC721: "ERC721", - ERC1155: "ERC1155", -} as const -type TokenType = typeof NFTTokenType[keyof typeof NFTTokenType] - -type NFTParams = { - tokenContract: `0x${string}` - tokenId: string -} - -export type TokenboundAccountNFT = NFTParams & { - chainId: number -} - -interface TokenTypeParams { - tokenType: TokenType -} - -export type NFTTransferParams = TokenTypeParams & NFTParams & { - recipientAddress: `0x${string}` - account: `0x${string}` -} - -export type ETHTransferParams = { - account: `0x${string}` - recipientAddress: `0x${string}` // | `${string}.eth` - amount: number -} - -export type ERC20TransferParams = { - account: `0x${string}` - recipientAddress: `0x${string}` - amount: number - erc20tokenAddress: `0x${string}` - erc20tokenDecimals: number -} - -export type TokenboundClientOptions = { - chainId: number - signer?: any - walletClient?: WalletClient - publicClient?: PublicClient - implementationAddress?: `0x${string}` - registryAddress?: `0x${string}` -} - -type Custom6551Implementation = { - implementationAddress: `0x${string}` - registryAddress?: `0x${string}` -} - -export type TBAccountParams = NFTParams - -export type GetAccountParams = TBAccountParams & Partial -export type PrepareCreateAccountParams = TBAccountParams & Partial -export type CreateAccountParams = TBAccountParams & Partial - -export type ExecuteCallParams = { - account: `0x${string}` - to: `0x${string}` - value: bigint - data: string -} - -export type PrepareExecuteCallParams = ExecuteCallParams - -export type ComputeAccountParams = TBAccountParams & { - chainId: number -} & Partial - -export type GetCreationCodeParams = { - implementation_: `0x${string}` - chainId_: number - tokenContract_: string - tokenId_: string - salt_: string -} - -export type BytecodeParams = { - accountAddress: `0x${string}` -} + BytecodeParams, + CreateAccountParams, + ERC20TransferParams, + SignMessageParams, + ETHTransferParams, + ExecuteCallParams, + GetAccountParams, + NFTTokenType, + NFTTransferParams, + PrepareCreateAccountParams, + PrepareExecuteCallParams, + SegmentedERC6551Bytecode, + TokenboundAccountNFT, + TokenboundClientOptions, + EthersSignableMessage, +} from './types' +import { + chainIdToChain, + segmentBytecode, + normalizeMessage, + isEthers5SignableMessage, + isEthers6SignableMessage, + isViemSignableMessage, +} from './utils' +// import { normalize } from 'viem/ens' class TokenboundClient { private chainId: number public isInitialized: boolean = false - private publicClient: PublicClient + public publicClient: PublicClient private signer?: AbstractEthersSigner private walletClient?: WalletClient private implementationAddress?: `0x${string}` private registryAddress?: `0x${string}` constructor(options: TokenboundClientOptions) { + const { + chainId, + signer, + walletClient, + publicClient, + implementationAddress, + registryAddress, + publicClientRPCUrl, + } = options + + if (!chainId) { + throw new Error('chainId is required.') + } - const { chainId, signer, walletClient, publicClient, implementationAddress, registryAddress } = options + if (signer && walletClient) { + throw new Error('Only one of `signer` or `walletClient` should be provided.') + } - if(!chainId) { - throw new Error("chainId is required.") + if (publicClient && publicClientRPCUrl) { + throw new Error( + 'Only one of `publicClient` or `publicClientRPCUrl` should be provided.' + ) } - if (signer && walletClient) { - throw new Error("Only one of `signer` or `walletClient` should be provided.") + if (signer && publicClient) { + throw new Error('`publicClient` cannot be provided when using Ethers `signer`.') } - + this.chainId = chainId if (signer) { @@ -150,47 +108,53 @@ class TokenboundClient { this.registryAddress = registryAddress } - this.publicClient = publicClient ?? - createPublicClient({ - chain: chainIdToChain(this.chainId), - transport: http(), - }) - - this.isInitialized = true + // + this.publicClient = + publicClient ?? + createPublicClient({ + chain: chainIdToChain(this.chainId), + transport: http(publicClientRPCUrl ?? undefined), + }) + this.isInitialized = true } - -/** - * 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. - * @param {`0x${string}`} [params.implementationAddress] The address of the implementation contract. - * @param {`0x${string}`} [params.registryAddress] The address of the registry contract. - * @returns The tokenbound account address. - */ + /** + * 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. + * @param {`0x${string}`} [params.implementationAddress] The address of the implementation contract. + * @param {`0x${string}`} [params.registryAddress] The address of the registry contract. + * @returns The tokenbound account address. + */ public getAccount(params: GetAccountParams): `0x${string}` { const { tokenContract, tokenId, implementationAddress, registryAddress } = params const implementation = implementationAddress ?? this.implementationAddress const registry = registryAddress ?? this.registryAddress - + try { // Here we call computeAccount rather than getAccount to avoid // making an async contract call via publicClient - return computeAccount(tokenContract, tokenId, this.chainId, implementation, registry) + return computeAccount( + tokenContract, + tokenId, + this.chainId, + implementation, + registry + ) } 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. - * @param {`0x${string}`} [params.implementationAddress] The address of the implementation contract. - * @param {`0x${string}`} [params.registryAddress] The address of the registry contract. - * @returns The prepared transaction to create a tokenbound account. Can be sent via `sendTransaction` on an Ethers signer or viem WalletClient. - */ + /** + * 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. + * @param {`0x${string}`} [params.implementationAddress] The address of the implementation contract. + * @param {`0x${string}`} [params.registryAddress] The address of the registry contract. + * @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<{ to: `0x${string}` value: bigint @@ -200,102 +164,108 @@ class TokenboundClient { const implementation = implementationAddress ?? this.implementationAddress const registry = registryAddress ?? this.registryAddress - return prepareCreateAccount(tokenContract, tokenId, this.chainId, implementation, registry) + return prepareCreateAccount( + tokenContract, + tokenId, + this.chainId, + implementation, + registry + ) } -/** - * 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. - * @param {`0x${string}`} [params.implementationAddress] The address of the implementation contract. - * @param {`0x${string}`} [params.registryAddress] The address of the registry contract. - * @returns a Promise that resolves to the account address of the created token bound account. - */ + /** + * 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. + * @param {`0x${string}`} [params.implementationAddress] The address of the implementation contract. + * @param {`0x${string}`} [params.registryAddress] The address of the registry contract. + * @returns a Promise that resolves to the account address of the created token bound account. + */ public async createAccount(params: CreateAccountParams): Promise<`0x${string}`> { const { tokenContract, tokenId, implementationAddress, registryAddress } = params const implementation = implementationAddress ?? this.implementationAddress const registry = registryAddress ?? this.registryAddress try { - let txHash: `0x${string}` | undefined - if(this.signer) { // Ethers + if (this.signer) { + // Ethers const prepareCreateAccount = await this.prepareCreateAccount({ tokenContract, tokenId, implementationAddress: implementation, - registryAddress: registry + registryAddress: registry, }) - txHash = await this.signer.sendTransaction(prepareCreateAccount).then((tx:AbstractEthersTransactionResponse) => tx.hash) as `0x${string}` - - } - else if(this.walletClient) { + txHash = (await this.signer + .sendTransaction(prepareCreateAccount) + .then((tx: AbstractEthersTransactionResponse) => tx.hash)) as `0x${string}` + } else if (this.walletClient) { txHash = await createAccount(tokenContract, tokenId, this.walletClient) } - - if(txHash){ - return computeAccount(tokenContract, tokenId, this.chainId, implementation, registry) + + if (txHash) { + return computeAccount( + tokenContract, + tokenId, + this.chainId, + implementation, + registry + ) + } else { + throw new Error('No wallet client or signer available.') } - - 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 an Ethers signer or viem WalletClient. - */ + /** + * 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. + */ public async prepareExecuteCall(params: PrepareExecuteCallParams): Promise<{ to: `0x${string}` value: bigint data: `0x${string}` }> { - 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 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 - */ + /** + * 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 + */ public async executeCall(params: ExecuteCallParams): Promise<`0x${string}`> { - const preparedExecuteCall = await this.prepareExecuteCall(params) try { - if(this.signer) { // Ethers - return await this.signer.sendTransaction(preparedExecuteCall).then((tx: AbstractEthersTransactionResponse) => tx.hash) as `0x${string}` - } - else if(this.walletClient) { - + if (this.signer) { + // Ethers + 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: chainIdToChain(this.chainId), account: this.walletClient.account!, - ...preparedExecuteCall + ...preparedExecuteCall, }) - + } else { + throw new Error('No wallet client or signer available.') } - else { - throw new Error("No wallet client or signer available.") - } } catch (error) { throw error } @@ -306,14 +276,18 @@ class TokenboundClient { * @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 { - + public async checkAccountDeployment({ + accountAddress, + }: BytecodeParams): Promise { try { - return await this.publicClient.getBytecode({address: accountAddress}).then((bytecode: GetBytecodeReturnType) => bytecode ? bytecode.length > 2: false) + return await this.publicClient + .getBytecode({ address: accountAddress }) + .then((bytecode: GetBytecodeReturnType) => + bytecode ? bytecode.length > 2 : false + ) } catch (error) { throw error } - } /** @@ -321,13 +295,14 @@ class TokenboundClient { * @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 { - + public async deconstructBytecode({ + accountAddress, + }: BytecodeParams): Promise { try { - const rawBytecode = await this.publicClient.getBytecode({address: accountAddress}) + const rawBytecode = await this.publicClient.getBytecode({ address: accountAddress }) const bytecode = rawBytecode?.slice(2) - if(!bytecode || !rawBytecode || !(rawBytecode.length > 2)) return null + if (!bytecode || !rawBytecode || !(rawBytecode.length > 2)) return null const [ erc1167Header, @@ -336,15 +311,22 @@ class TokenboundClient { rawSalt, rawChainId, rawTokenContract, - rawTokenId + 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 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, @@ -352,13 +334,11 @@ class TokenboundClient { salt, tokenId, tokenContract, - chainId + chainId, } - } catch (error) { throw error } - } /** @@ -366,24 +346,22 @@ class TokenboundClient { * @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 { - + 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 return { tokenContract, tokenId, - chainId + chainId, } } catch (error) { throw error } - } /** @@ -396,12 +374,12 @@ class TokenboundClient { * @returns a Promise that resolves to the transaction hash of the executed call */ public async transferNFT(params: NFTTransferParams): Promise<`0x${string}`> { - const { - account: tbAccountAddress, + const { + account: tbAccountAddress, tokenType, tokenContract, tokenId, - recipientAddress + recipientAddress, } = params const is1155: boolean = tokenType === NFTTokenType.ERC1155 @@ -429,53 +407,17 @@ class TokenboundClient { args: transferArgs, }) - const unencodedExecuteCall = { - abi: erc6551AccountAbi as Abi, - functionName: "executeCall", - args: [ - tokenContract, 0, transferCallData - ], - } - try { - - // return await this.executeCall({ - // account: tbAccountAddress, - // to: tokenContract, - // value: BigInt(0), - // data: transferCallData - // }) - - if(this.signer) { // Ethers - - const preparedNFTTransfer = { - to: tbAccountAddress, - value: BigInt(0), - data: encodeFunctionData(unencodedExecuteCall), - } - - return await this.signer.sendTransaction(preparedNFTTransfer).then((tx:AbstractEthersTransactionResponse) => tx.hash) as `0x${string}` - - } - else if(this.walletClient) { - - const { request } = await this.publicClient.simulateContract({ - address: getAddress(tbAccountAddress), - account: this.walletClient.account, - ...unencodedExecuteCall - }) - - return await this.walletClient.writeContract(request) - } - else { - throw new Error("No wallet client or signer available.") - } - + return await this.executeCall({ + account: tbAccountAddress, + to: tokenContract, + value: BigInt(0), + data: transferCallData, + }) } catch (error) { console.log(error) throw error } - } /** @@ -486,15 +428,11 @@ class TokenboundClient { * @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 - } = params + const { account: tbAccountAddress, amount, recipientAddress } = params const weiValue = parseUnits(`${amount}`, 18) // convert ETH to wei let recipient = getAddress(recipientAddress) - + // @BJ todo: debug // const isENS = recipientAddress.endsWith(".eth") // if (isENS) { @@ -510,23 +448,12 @@ class TokenboundClient { account: tbAccountAddress, to: recipient, value: weiValue, - data: '0x' + data: '0x', }) - - } catch(err) { + } catch (err) { console.log(err) - if (err instanceof BaseError) { - const revertError = err.walk(err => err instanceof ContractFunctionRevertedError) - if (revertError instanceof ContractFunctionRevertedError) { - const errorName = revertError.data?.errorName ?? '' - console.log('ERROR NAME', errorName) - console.log('REVERT ERROR DATA', revertError) - // do something with `errorName` - } - } throw err } - } /** @@ -539,7 +466,7 @@ class TokenboundClient { * @returns a Promise that resolves to the transaction hash of the executed call */ public async transferERC20(params: ERC20TransferParams): Promise<`0x${string}`> { - const { + const { account: tbAccountAddress, amount, recipientAddress, @@ -547,68 +474,75 @@ class TokenboundClient { erc20tokenDecimals, } = params - if(erc20tokenDecimals < 0 || erc20tokenDecimals > 18) throw new Error("Decimal value out of range. Should be between 0 and 18.") + if (erc20tokenDecimals < 0 || erc20tokenDecimals > 18) + throw new Error('Decimal value out of range. Should be between 0 and 18.') const amountBaseUnit = parseUnits(`${amount}`, erc20tokenDecimals) - const recipient = recipientAddress.endsWith(".eth") - ? await this.publicClient.getEnsResolver({name: normalize(recipientAddress)}) - : recipientAddress + // const recipient = recipientAddress.endsWith('.eth') + // ? await this.publicClient.getEnsResolver({ name: normalize(recipientAddress) }) + // : recipientAddress const callData = encodeFunctionData({ abi: erc20Abi, functionName: 'transfer', - args: [recipient, amountBaseUnit], + args: [recipientAddress, amountBaseUnit], }) - const unencodedTransferERC20ExecuteCall = { - abi: erc6551AccountAbi, - functionName: 'executeCall', - args: [erc20tokenAddress, 0, callData], - } - try { + return await this.executeCall({ + account: tbAccountAddress, + to: erc20tokenAddress, + value: 0n, + data: callData, + }) + } catch (error) { + console.log(error) + throw error + } + } - if(this.signer) { // Ethers + /** + * 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 - const preparedERC20Transfer = { - to: tbAccountAddress, - value: BigInt(0), - data: encodeFunctionData(unencodedTransferERC20ExecuteCall), + try { + if (this.signer) { + // Normalize message so it'll be compatible with Ethers 5 and 6 + if (!isEthers5SignableMessage && !isEthers6SignableMessage) { + throw new Error('Message is not a valid Ethers signable message.') } - - return await this.signer.sendTransaction(preparedERC20Transfer).then((tx:AbstractEthersTransactionResponse) => tx.hash) as `0x${string}` - - } - else if(this.walletClient) { - const { request } = await this.publicClient.simulateContract({ - address: getAddress(tbAccountAddress), - account: this.walletClient.account, - ...unencodedTransferERC20ExecuteCall + 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, }) - - return await this.walletClient.writeContract(request) } - else { - 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 } } - } -export { +export { TokenboundClient, - erc6551AccountAbi, + erc6551AccountAbi, erc6551RegistryAbi, getAccount, createAccount, getCreationCode, computeAccount, prepareExecuteCall, - executeCall -} \ No newline at end of file + executeCall, +} diff --git a/packages/sdk/src/functions/viem.ts b/packages/sdk/src/functions/viem.ts index 3b8d0bd..efaf1ce 100644 --- a/packages/sdk/src/functions/viem.ts +++ b/packages/sdk/src/functions/viem.ts @@ -7,12 +7,15 @@ import { encodeFunctionData, encodeAbiParameters, pad, - getAddress -} from "viem" + getAddress, +} from 'viem' import { erc6551AccountAbi, erc6551RegistryAbi } from '../../abis' -import { erc6551AccountImplementationAddressV1, erc6551RegistryAddressV1 } from "../constants" -import { addressToUint8Array } from "../utils" +import { + erc6551AccountImplementationAddressV1, + erc6551RegistryAddressV1, +} from '../constants' +import { addressToUint8Array } from '../utils' export { erc6551AccountAbi, erc6551RegistryAbi } @@ -25,10 +28,11 @@ export async function getAccount( tokenId: string, client: PublicClient, implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, + registryAddress?: `0x${string}` ): Promise<`0x${string}`> { - - const erc6551registry = registryAddress ? getAddress(registryAddress) : erc6551RegistryAddressV1 + const erc6551registry = registryAddress + ? getAddress(registryAddress) + : erc6551RegistryAddressV1 const registry = getContract({ address: erc6551registry, @@ -39,7 +43,9 @@ export async function getAccount( const chainId = await client.getChainId() const account = await registry.read.account([ - implementationAddress ? getAddress(implementationAddress) : erc6551AccountImplementationAddressV1, + implementationAddress + ? getAddress(implementationAddress) + : erc6551AccountImplementationAddressV1, chainId, tokenContract, tokenId, @@ -58,27 +64,30 @@ export async function prepareCreateAccount( tokenId: string, chainId: number, implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, + registryAddress?: `0x${string}` ): Promise<{ to: `0x${string}` value: bigint data: `0x${string}` }> { - - const implementation = implementationAddress ? getAddress(implementationAddress): erc6551AccountImplementationAddressV1 - const erc6551registry = registryAddress ? getAddress(registryAddress) : erc6551RegistryAddressV1 + const implementation = implementationAddress + ? getAddress(implementationAddress) + : erc6551AccountImplementationAddressV1 + const erc6551registry = registryAddress + ? getAddress(registryAddress) + : erc6551RegistryAddressV1 const initData = encodeFunctionData({ abi: [ { inputs: [], - name: "initialize", + name: 'initialize', outputs: [], - stateMutability: "nonpayable", - type: "function", + stateMutability: 'nonpayable', + type: 'function', }, ], - functionName: "initialize", + functionName: 'initialize', }) return { @@ -86,7 +95,7 @@ export async function prepareCreateAccount( value: BigInt(0), data: encodeFunctionData({ abi: erc6551RegistryAbi, - functionName: "createAccount", + functionName: 'createAccount', args: [ implementation, chainId, @@ -97,7 +106,6 @@ export async function prepareCreateAccount( ], }), } - } /** @@ -109,11 +117,14 @@ export async function createAccount( tokenId: string, client: WalletClient, implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, + registryAddress?: `0x${string}` ): Promise<`0x${string}`> { - - const implementation = implementationAddress ? getAddress(implementationAddress): erc6551AccountImplementationAddressV1 - const erc6551registry = registryAddress ? getAddress(registryAddress) : erc6551RegistryAddressV1 + const implementation = implementationAddress + ? getAddress(implementationAddress) + : erc6551AccountImplementationAddressV1 + const erc6551registry = registryAddress + ? getAddress(registryAddress) + : erc6551RegistryAddressV1 const registry = getContract({ address: erc6551registry, @@ -127,13 +138,13 @@ export async function createAccount( abi: [ { inputs: [], - name: "initialize", + name: 'initialize', outputs: [], - stateMutability: "nonpayable", - type: "function", + stateMutability: 'nonpayable', + type: 'function', }, ], - functionName: "initialize", + functionName: 'initialize', }) return registry.write.createAccount([ @@ -165,12 +176,8 @@ export async function prepareExecuteCall( value: 0n, data: encodeFunctionData({ abi: erc6551AccountAbi, - functionName: "executeCall", - args: [ - to as `0x${string}`, - value, - data as `0x${string}` - ], + functionName: 'executeCall', + args: [to as `0x${string}`, value, data as `0x${string}`], }), } } @@ -192,11 +199,7 @@ export async function executeCall( walletClient: 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}`]) } /** @@ -208,30 +211,26 @@ export function computeAccount( tokenId: string, chainId: number, implementationAddress?: `0x${string}`, - registryAddress?: `0x${string}`, + registryAddress?: `0x${string}` ): `0x${string}` { + const implementation = implementationAddress + ? getAddress(implementationAddress) + : erc6551AccountImplementationAddressV1 + const erc6551registry = registryAddress + ? getAddress(registryAddress) + : erc6551RegistryAddressV1 - const implementation = implementationAddress ? getAddress(implementationAddress): erc6551AccountImplementationAddressV1 - const erc6551registry = registryAddress ? getAddress(registryAddress) : erc6551RegistryAddressV1 + const code = getCreationCode(implementation, chainId, tokenContract, tokenId, '0') - const code = getCreationCode( - implementation, - chainId, - tokenContract, - tokenId, - "0" - ) - - const bigIntZero = BigInt("0").toString(16) as `0x${string}` + const bigIntZero = BigInt('0').toString(16) as `0x${string}` const saltHex = pad(bigIntZero, { size: 32 }) - + return getContractAddress({ bytecode: code, from: erc6551registry, opcode: 'CREATE2', salt: saltHex, }) - } /** @@ -243,26 +242,26 @@ export function getCreationCode( chainId_: number, tokenContract_: string, tokenId_: string, - salt_: string, + salt_: string ): Uint8Array { const types = [ - { type: 'uint256'}, - { type: 'uint256'}, - { type: 'address'}, - { type: 'uint256'} + { 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", + '0x3d60ad80600a3d3981f3363d3d373d3d3d363d73', hexImplementation, - "0x5af43d82803e903d91602b57fd5bf3", - encodedABI - ]); + '0x5af43d82803e903d91602b57fd5bf3', + encodedABI, + ]) const creationCode = addressToUint8Array(hexCreationCode) return creationCode -} \ No newline at end of file +} diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 19175cf..b6308a0 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -1,6 +1,6 @@ import { erc6551AccountAbi, erc6551RegistryAbi } from '../abis' -import { +import { getAccount, computeAccount, createAccount, @@ -11,7 +11,6 @@ import { } from './functions' import { - TokenboundClient, TokenboundAccountNFT, TokenboundClientOptions, GetAccountParams, @@ -20,13 +19,20 @@ import { CreateAccountParams, PrepareExecuteCallParams, ExecuteCallParams, + SignMessageParams, ComputeAccountParams, GetCreationCodeParams, -} from './TokenboundClient' + ERC20TransferParams, + ETHTransferParams, + NFTTransferParams, + BytecodeParams, +} from './types' + +import { TokenboundClient } from './TokenboundClient' -export { +export { TokenboundClient, - erc6551AccountAbi, + erc6551AccountAbi, erc6551RegistryAbi, getAccount, computeAccount, @@ -47,5 +53,10 @@ export type { PrepareExecuteCallParams, ExecuteCallParams, ComputeAccountParams, - GetCreationCodeParams -} \ No newline at end of file + GetCreationCodeParams, + BytecodeParams, + SignMessageParams, + ERC20TransferParams, + ETHTransferParams, + NFTTransferParams, +} diff --git a/packages/sdk/src/test/TestAll.test.ts b/packages/sdk/src/test/TestAll.test.ts index 230823b..ae94393 100644 --- a/packages/sdk/src/test/TestAll.test.ts +++ b/packages/sdk/src/test/TestAll.test.ts @@ -1,9 +1,10 @@ -import { describe, expect, it } from 'vitest' -import { mainnet } from 'viem/chains' +// This test suite is for testing the SDK methods with +// viem walletClient + publicClient and with Ethers 5/6. + +import { describe, expect, it, vi } from 'vitest' import { providers } from 'ethers' -import { zora721DropABI } from './wagmi-cli-hooks/generated' -import { waitFor} from './mockWallet' -import { createAnvil, CreateAnvilOptions } from '@viem/anvil' +import { waitFor } from './mockWallet' +import { createAnvil } from '@viem/anvil' import { WalletClient, PublicClient, @@ -14,334 +15,350 @@ import { Log, parseUnits, formatEther, - encodeAbiParameters, - parseAbiParameters, + getContract, + // encodeAbiParameters, + // parseAbiParameters, } from 'viem' import { privateKeyToAccount } from 'viem/accounts' -import { - CreateAccountParams, - TokenboundClient -} from '@tokenbound/sdk' -import { ADDRESS_REGEX, ANVIL_ACCOUNTS, ANVIL_RPC_URL } from './constants' -import { getPublicClient } from './utils' +import { CreateAccountParams, TokenboundClient } from '@tokenbound/sdk' +import { + ADDRESS_REGEX, + ANVIL_ACCOUNTS, + ANVIL_RPC_URL, + WETH_CONTRACT_ADDRESS, +} from './constants' import { walletClientToEthers5Signer, walletClientToEthers6Signer } from '../utils' +import { + ethToWei, + getPublicClient, + getWETHBalance, + // debugTransaction, + // getZora1155Balance, + getZora721Balance, +} from './utils' +import { + ANVIL_CONFIG, + CREATE_ANVIL_OPTIONS, + zora721, + // zora1155 +} from './config' +import { + wethABI, + // zora1155ABI +} from './wagmi-cli-hooks/generated' -const ACTIVE_CHAIN = mainnet const TIMEOUT = 60000 // default 10000 - -const ANVIL_CONFIG: CreateAnvilOptions = { - forkChainId: ACTIVE_CHAIN.id, - // gasLimit: 1000000000000, - // disableBlockGasLimit: true, - // blockBaseFeePerGas: 300000000, - forkUrl: import.meta.env.VITE_ANVIL_MAINNET_FORK_ENDPOINT, - forkBlockNumber: import.meta.env.VITE_ANVIL_MAINNET_FORK_BLOCK_NUMBER? parseInt(import.meta.env.VITE_ANVIL_MAINNET_FORK_BLOCK_NUMBER): undefined, -} - const ANVIL_USER_0 = getAddress(ANVIL_ACCOUNTS[0].address) const ANVIL_USER_1 = getAddress(ANVIL_ACCOUNTS[1].address) -// const ANVIL_COMMAND = { -// // 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` -// } - -// Zora Webb's First Deep Field: https://zora.co/collect/eth:0x28ee638f2fcb66b4106acab7efd225aeb2bd7e8d -const ZORA_WEBB_TOKEN_PROXY_ADDRESS = getAddress('0x28ee638f2fcb66b4106acab7efd225aeb2bd7e8d') - -const ZORA_WEBB_TOKEN_TBA: `0x${string}` = getAddress('0xc33f0A7FcD69Ba00b4e980463199CD38E30d0E5c') - -const TOKENID_IN_EOA: string = '10010' -const TOKENID_IN_TBA: string = '10011' - -async function getZora721Balance({publicClient, walletAddress}:{publicClient: PublicClient, walletAddress: `0x${string}`}) { - return await publicClient.readContract({ - address: ZORA_WEBB_TOKEN_PROXY_ADDRESS, - abi: zora721DropABI, - functionName: 'balanceOf', - args: [walletAddress] - }) -} - -describe('ComboTester', () => { - - const walletClient = createWalletClient({ - transport: http(ANVIL_RPC_URL), - chain: ACTIVE_CHAIN, - account: privateKeyToAccount(ANVIL_ACCOUNTS[0].privateKey), - pollingInterval: 100, - }) +const walletClient = createWalletClient({ + transport: http(ANVIL_RPC_URL), + chain: ANVIL_CONFIG.ACTIVE_CHAIN, + account: privateKeyToAccount(ANVIL_ACCOUNTS[0].privateKey), + pollingInterval: 100, +}) +// Create Ethers 5/6 signers from the walletClient + run tests +describe('Test SDK methods - viem + Ethers', () => { const ethers5Signer = walletClientToEthers5Signer(walletClient) const ethers6Signer = walletClientToEthers6Signer(walletClient) - runTxTests({ testName: 'Viem Tests', walletClient}) + runTxTests({ testName: 'Viem Tests', walletClient }) - const ENABLE_ETHERS_TESTS = false + const ENABLE_ETHERS_TESTS = true - if(ENABLE_ETHERS_TESTS) { - runTxTests({ testName: 'Ethers 5 Tests', signer: ethers5Signer}) - runTxTests({ testName: 'Ethers 6 Tests', signer: ethers6Signer}) + if (ENABLE_ETHERS_TESTS) { + runTxTests({ testName: 'Ethers 5 Tests', signer: ethers5Signer }) + runTxTests({ testName: 'Ethers 6 Tests', signer: ethers6Signer }) } }) - function runTxTests({ testName, walletClient, - signer -} : { - testName: string, - walletClient?: WalletClient, + signer, +}: { + testName: string + walletClient?: WalletClient signer?: any }) { - describe(testName, () => { - - const anvil = createAnvil( - {...ANVIL_CONFIG} - ) + // Skip tests that are non-functional in Ethers + const testInViemOnly = walletClient ? it : it.skip + describe(testName, () => { + // Set up Anvil instance + clients + const anvil = createAnvil({ ...CREATE_ANVIL_OPTIONS }) let tokenboundClient: TokenboundClient let publicClient: PublicClient + let NFT_IN_EOA: CreateAccountParams + let TOKENID_IN_EOA: string + let TOKENID_IN_TBA: string + let ZORA721_TBA_ADDRESS: `0x${string}` - let ZORA_WEBB_TOKEN: CreateAccountParams - + // Spin up a fresh anvil instance each time we run the test suite against a different signer beforeAll(async () => { - try { - - publicClient = getPublicClient({ chainId: ACTIVE_CHAIN.id }) + publicClient = getPublicClient({ chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id }) // Pass in the Anvil test walletClient + publicClient tokenboundClient = new TokenboundClient({ - chainId: ACTIVE_CHAIN.id, + chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, walletClient, signer, - publicClient + publicClient: signer ? undefined : publicClient, // No publicClient if using Ethers }) await anvil.start() - console.log(`\x1b[94m ${testName}-----> anvil.start() \x1b[0m`) - + console.log(`START → \x1b[94m ${testName} \x1b[0m`) } catch (err) { - console.error('Error during setup:', err) + console.error('Error during setup:', err) } - }, TIMEOUT) afterAll(async () => { await anvil.stop() - console.log(`\x1b[94m ${testName} -----> anvil.stop() \x1b[0m`) + console.log(`END → \x1b[94m ${testName} \x1b[0m`) }) - it('can mint 2 Zora 721 NFTs', async () => { - - let mintLogs: Log[] = [] - - // Set up observer for mint event so we can get the tokenId - const unwatch = publicClient.watchContractEvent({ - address: ZORA_WEBB_TOKEN_PROXY_ADDRESS, - abi: zora721DropABI, - eventName: 'Transfer', - args: { - to: ANVIL_USER_0 - }, - onLogs: (logs) => { - mintLogs = logs - const mintArgs = logs[0].args - const { tokenId } = mintArgs + // 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: tbaTokenId } = logs[1].args + + if (eoaTokenId && tbaTokenId) { + TOKENID_IN_EOA = eoaTokenId.toString() + TOKENID_IN_TBA = tbaTokenId.toString() + + NFT_IN_EOA = { + tokenContract: zora721.proxyContractAddress, + tokenId: TOKENID_IN_EOA, + } + } + }, + }) - ZORA_WEBB_TOKEN = { - tokenContract: ZORA_WEBB_TOKEN_PROXY_ADDRESS, - tokenId: tokenId!.toString() - } + // 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, } - }) - // Prepare mint transaction - const mintPrice = BigInt(0) - const mintQuantity = 2 - const encodedMintFunctionData = encodeFunctionData({ - abi: zora721DropABI, - functionName: 'purchase', - args: [BigInt(mintQuantity)] - }) - - const prepared721Mint = { - to: ZORA_WEBB_TOKEN_PROXY_ADDRESS, - value: mintPrice * BigInt(mintQuantity), - 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) + } - if (walletClient) { - mintTxHash = await walletClient.sendTransaction({ - chain: ACTIVE_CHAIN, - account: ANVIL_USER_0, - ...prepared721Mint + const zoraBalanceInAnvilWallet = await getZora721Balance({ + publicClient, + walletAddress: ANVIL_USER_0, }) - } - else if (signer) { - mintTxHash = await signer.sendTransaction({ - chainId: ACTIVE_CHAIN.id, - ...prepared721Mint - }).then((tx: providers.TransactionResponse) => tx.hash) - } - const zoraBalanceInAnvilWallet = await getZora721Balance({publicClient, walletAddress: ANVIL_USER_0}) - - await waitFor(() => { - expect(mintLogs.length).toBe(mintQuantity) - expect(mintTxHash).toMatch(ADDRESS_REGEX) - expect(ZORA_WEBB_TOKEN.tokenId).toBe(TOKENID_IN_EOA) - expect(zoraBalanceInAnvilWallet).toBe(2n) - unwatch() - }) - - }, TIMEOUT) - - it('can transfer one of the minted NFTs to the TBA', async () => { - - const transferCallData = encodeFunctionData({ - abi: zora721DropABI, - functionName: 'safeTransferFrom', - args: [ - ANVIL_USER_0, // from - ZORA_WEBB_TOKEN_TBA, // to - BigInt(TOKENID_IN_TBA), // tokenId - ], - }) - - const preparedNFTTransfer = { - to: ZORA_WEBB_TOKEN_PROXY_ADDRESS, - value: 0n, - data: transferCallData, - } - - let transferHash: `0x${string}` - - if (walletClient) { - transferHash = await walletClient.sendTransaction({ - chain: ACTIVE_CHAIN, - account: walletClient.account!.address, - ...preparedNFTTransfer + await waitFor(() => { + expect(mintLogs.length).toBe(zora721.quantity) + expect(mintTxHash).toMatch(ADDRESS_REGEX) + expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA) + expect(zoraBalanceInAnvilWallet).toBe(2n) + unwatch() }) - } - else { - transferHash = await signer.sendTransaction({ - chainId: ACTIVE_CHAIN.id, - ...preparedNFTTransfer - }).then((tx: providers.TransactionResponse) => tx.hash) - } - - const transactionReceipt = await publicClient.getTransactionReceipt({ - hash: transferHash - }) - - const tbaNFTBalance = await getZora721Balance({publicClient, walletAddress: ZORA_WEBB_TOKEN_TBA}) - console.log('# of NFTs in TBA: ', tbaNFTBalance) - - await waitFor(() => { - expect(transferHash).toMatch(ADDRESS_REGEX) - expect(transactionReceipt.status).toBe('success') - expect(tbaNFTBalance).toBe(1n) - }) - - }, TIMEOUT) + }, + 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 createdAccount = await tokenboundClient.createAccount(ZORA_WEBB_TOKEN) + const createdAccount = await tokenboundClient.createAccount(NFT_IN_EOA) + ZORA721_TBA_ADDRESS = createdAccount await waitFor(() => { expect(createdAccount).toMatch(ADDRESS_REGEX) - expect(createdAccount).toEqual(ZORA_WEBB_TOKEN_TBA) }) }) it('can getAccount', async () => { - const getAccount = tokenboundClient.getAccount(ZORA_WEBB_TOKEN) + const getAccount = tokenboundClient.getAccount(NFT_IN_EOA) await waitFor(() => { expect(getAccount).toMatch(ADDRESS_REGEX) - expect(getAccount).toEqual(ZORA_WEBB_TOKEN_TBA) + expect(getAccount).toEqual(ZORA721_TBA_ADDRESS) }) }) - it('can transfer ETH to the TBA', async () => { + // 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 () => { + const transferCallData = encodeFunctionData({ + abi: zora721.abi, + functionName: 'safeTransferFrom', + args: [ + ANVIL_USER_0, // from + ZORA721_TBA_ADDRESS, // to + BigInt(TOKENID_IN_TBA), // tokenId + ], + }) - const ethAmount = 1 - const ethAmountWei = parseUnits(`${ethAmount}`, 18) + const preparedNFTTransfer = { + to: zora721.proxyContractAddress, + value: 0n, + data: transferCallData, + } - const preparedETHTransfer = { - to: ZORA_WEBB_TOKEN_TBA, - 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, + ...preparedNFTTransfer, + }) + } else { + transferHash = await signer + .sendTransaction({ + chainId: ANVIL_CONFIG.ACTIVE_CHAIN.id, + ...preparedNFTTransfer, + }) + .then((tx: providers.TransactionResponse) => tx.hash) + } - let transferHash: `0x${string}` - if (walletClient) { - transferHash = await walletClient.sendTransaction({ - chain: ACTIVE_CHAIN, - account: walletClient.account!.address, - ...preparedETHTransfer + const transactionReceipt = await publicClient.getTransactionReceipt({ + hash: transferHash, }) - } else { - transferHash = await signer.sendTransaction({ - chainId: ACTIVE_CHAIN.id, - ...preparedETHTransfer - }).then((tx: providers.TransactionResponse) => tx.hash) - } - const balanceAfter = await publicClient.getBalance({ - address: ZORA_WEBB_TOKEN_TBA, - }) + const tbaNFTBalance = await getZora721Balance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }) + console.log('# of NFTs in TBA: ', tbaNFTBalance.toString()) - await waitFor(() => { - expect(transferHash).toMatch(ADDRESS_REGEX) - expect(balanceAfter).toBe(ethAmountWei) - }) - - }, TIMEOUT) + await waitFor(() => { + expect(transferHash).toMatch(ADDRESS_REGEX) + expect(transactionReceipt.status).toBe('success') + expect(tbaNFTBalance).toBe(1n) + }) + }, + TIMEOUT + ) - it('can executeCall with the TBA', async () => { + // 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 + } - const executedCallTxHash = await tokenboundClient.executeCall({ - account: ZORA_WEBB_TOKEN_TBA, - to: ZORA_WEBB_TOKEN_PROXY_ADDRESS, - value: 0n, - data: '', - }) + 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 transactionReceipt = await publicClient.getTransactionReceipt({ - hash: executedCallTxHash - }) + const balanceAfter = await publicClient.getBalance({ + address: ZORA721_TBA_ADDRESS, + }) - await waitFor(() => { - expect(executedCallTxHash).toMatch(ADDRESS_REGEX) - expect(transactionReceipt.status).toMatch('success') - }) - }, TIMEOUT) + await waitFor(() => { + expect(transferHash).toMatch(ADDRESS_REGEX) + expect(balanceAfter).toBe(ethAmountWei) + }) + }, + TIMEOUT + ) - it('can transferETH with the TBA', async () => { + // Execute a basic call with no value with the TBA to see if it works. + it( + 'can executeCall with the TBA', + async () => { + const executedCallTxHash = await tokenboundClient.executeCall({ + account: ZORA721_TBA_ADDRESS, + to: zora721.proxyContractAddress, + value: 0n, + data: '', + }) + + const transactionReceipt = await publicClient.getTransactionReceipt({ + hash: executedCallTxHash, + }) + await waitFor(() => { + expect(executedCallTxHash).toMatch(ADDRESS_REGEX) + expect(transactionReceipt.status).toMatch('success') + }) + }, + TIMEOUT + ) + + // The other methods in the SDK implement executeCall, + // so they provide further reinforcement that executeCall works. + it('can transferETH with the TBA', async () => { const EXPECTED_BALANCE_BEFORE = parseUnits('1', 18) const EXPECTED_BALANCE_AFTER = parseUnits('0.5', 18) - const balanceBefore = await publicClient.getBalance({ - address: ZORA_WEBB_TOKEN_TBA, + const balanceBefore = await publicClient.getBalance({ + address: ZORA721_TBA_ADDRESS, }) const ethTransferHash = await tokenboundClient.transferETH({ - account: ZORA_WEBB_TOKEN_TBA, + account: ZORA721_TBA_ADDRESS, amount: 0.5, - recipientAddress: ANVIL_USER_1 + recipientAddress: ANVIL_USER_1, }) - const balanceAfter = await publicClient.getBalance({ - address: ZORA_WEBB_TOKEN_TBA, + const balanceAfter = await publicClient.getBalance({ + address: ZORA721_TBA_ADDRESS, }) - console.log('BEFORE: ', formatEther(balanceBefore), 'AFTER: ', formatEther(balanceAfter)) + console.log( + 'BEFORE: ', + formatEther(balanceBefore), + 'AFTER: ', + formatEther(balanceAfter) + ) await waitFor(() => { expect(ethTransferHash).toMatch(ADDRESS_REGEX) @@ -352,14 +369,17 @@ function runTxTests({ it('can transferNFT with the TBA', async () => { const transferNFTHash = await tokenboundClient.transferNFT({ - account: ZORA_WEBB_TOKEN_TBA, + account: ZORA721_TBA_ADDRESS, tokenType: 'ERC721', - tokenContract: ZORA_WEBB_TOKEN_PROXY_ADDRESS, + tokenContract: zora721.proxyContractAddress, tokenId: TOKENID_IN_TBA, recipientAddress: ANVIL_USER_1, }) - const anvilAccount1NFTBalance = await getZora721Balance({publicClient, walletAddress: ANVIL_USER_1}) + const anvilAccount1NFTBalance = await getZora721Balance({ + publicClient, + walletAddress: ANVIL_USER_1, + }) await waitFor(() => { expect(transferNFTHash).toMatch(ADDRESS_REGEX) @@ -367,53 +387,263 @@ function runTxTests({ }) }) - // it('can mint an 1155', async () => { + it('can mint 2 Zora 721 NFTs with the TBA', async () => { + const encodedMintFunctionData = encodeFunctionData({ + abi: zora721.abi, + functionName: 'purchase', + args: [BigInt(zora721.quantity)], + }) + + const mintToTBATxHash = await tokenboundClient.executeCall({ + account: ZORA721_TBA_ADDRESS, + to: zora721.proxyContractAddress, + value: zora721.mintPrice * BigInt(zora721.quantity), + data: encodedMintFunctionData, + }) - // const ethToWei = function (eth: number) { - // return parseUnits(eth.toString(), 18) - // } + const zoraBalanceInTBA = await getZora721Balance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }) + + console.log('721s MINTED TO TBA: ', zoraBalanceInTBA.toString()) + + await waitFor(() => { + expect(mintToTBATxHash).toMatch(ADDRESS_REGEX) + expect(NFT_IN_EOA.tokenId).toBe(TOKENID_IN_EOA) + expect(zoraBalanceInTBA).toBe(2n) + }) + }) - // // Stapleverse 'Pidge in Hand' drop: https://zora.co/collect/eth:0xafd7b9edc5827f7e39dcd425d8de8d4e1cb292c1/3 - // const zora1155MinterAddress = getAddress('0x8A1DBE9b1CeB1d17f92Bebf10216FCFAb5C3fbA7') // IMinter1155 minter contract is FIXED_PRICE_SALE_STRATEGY from https://github.com/ourzora/zora-1155-contracts/blob/main/addresses/1.json - // // proxyContractAddress: `0x${string}` = '0xafd7b9edc5827f7e39dcd425d8de8d4e1cb292c1' - // const stapleversePidgeInHandDrop = { - // proxyContractAddress: getAddress('0xafd7b9edc5827f7e39dcd425d8de8d4e1cb292c1'), // proxy address - // tokenId: BigInt(3), - // mintFee: ethToWei(0.025), // 0.025 ETH - // quantity: BigInt(1), - // } + // it('can mint an 1155 with the TBA', async () => { + // const mintingAccount: `0x${string}` = ZORA721_TBA_ADDRESS + // // const mintAddress: `0x${string}` = ANVIL_USER_0 // const minterArguments: `0x${string}` = encodeAbiParameters( // parseAbiParameters('address'), - // [address] + // [mintingAccount] // ) - // // const { - // // config, - // // // error - // // } = usePrepareContractWrite({ - // // chainId: 1, - // // account: address, - // // abi: zora1155ABI, - // // address: stapleversePidgeInHandDrop.proxyContractAddress, - // // functionName: 'mint', - // // walletClient, - // // value: stapleversePidgeInHandDrop.mintFee, - // // args: [ - // // zora1155MinterAddress, - // // stapleversePidgeInHandDrop.tokenId, - // // stapleversePidgeInHandDrop.quantity, - // // minterArguments, - // // ], - // // }) + // const mint1155TxHash = await tokenboundClient.executeCall({ + // account: mintingAccount, + // to: zora1155.proxyContractAddress, + // value: zora1155.mintFee * zora1155.quantity, + // data: encodeFunctionData({ + // abi: zora1155ABI, + // functionName: 'mint', + // args: [ + // zora1155.fixedPriceSalesStrategy, + // zora1155.tokenId, + // zora1155.quantity, + // minterArguments, + // ], + // }), + // }) + + // await debugTransaction({ publicClient, hash: mint1155TxHash }) + + // const zora1155BalanceInTBA = await getZora1155Balance({ + // publicClient, + // walletAddress: mintingAccount, + // }) + + // console.log('1155 Balance', zora1155BalanceInTBA) + + // await waitFor(() => { + // expect(mint1155TxHash).toMatch(ADDRESS_REGEX) + // expect(zora1155BalanceInTBA).toBe(5n) + // expect(true).toBe(true) + // }) + // }) + // Test signing in viem only. + // Ethers 5/6 don't appear to support signing messages via personal_sign with this testing configuration. + testInViemOnly('can sign a message', async () => { + const signedMessageHash = await tokenboundClient.signMessage({ + message: 'Sign me', + }) - // }) + console.log('SIGNED MESSAGE: ', signedMessageHash) - - test.todo('can transferNFT with an 1155', async () => {}) - test.todo('can transferERC20', async () => {}) + await waitFor(() => { + expect(signedMessageHash).toMatch(ADDRESS_REGEX) + }) + }) + + // Test signing hex message in viem only. + testInViemOnly('can sign a hexified message', async () => { + const hexSignedMessageHash = await tokenboundClient.signMessage({ + message: { raw: '0x68656c6c6f20776f726c64' }, + }) + + console.log('HEX SIGNED MESSAGE: ', hexSignedMessageHash) + + await waitFor(() => { + expect(hexSignedMessageHash).toMatch(ADDRESS_REGEX) + }) + }) + + // Test signing Uint8Array message as raw in viem only. + testInViemOnly('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 waitFor(() => { + expect(rawUint8Hash).toMatch(ADDRESS_REGEX) + }) + }) + + // Test signing ArrayLike message in viem only. + testInViemOnly( + '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. + testInViemOnly( + '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.25 + const depositWeiValue = ethToWei(depositEthValue) + 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, + 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: depositEthValue, + recipientAddress: ANVIL_USER_1, + erc20tokenAddress: WETH_CONTRACT_ADDRESS, + erc20tokenDecimals: 18, + }) + + const tbaWETHFinal = await getWETHBalance({ + publicClient, + walletAddress: ZORA721_TBA_ADDRESS, + }) + + const anvilUser1WETHBalance = await getWETHBalance({ + publicClient, + walletAddress: ANVIL_USER_1, + }) + + console.log( + 'TBA WETH INITIAL: ', + formatEther(tbaWETHInitial), + 'TBA RECEIVED: ', + formatEther(tbaWETHReceived), + 'AFTER: ', + formatEther(tbaWETHFinal), + 'ANVIL USER 1 BALANCE: ', + formatEther(anvilUser1WETHBalance) + ) + await waitFor(() => { + expect(wethDepositHash).toMatch(ADDRESS_REGEX) + expect(wethTransferHash).toMatch(ADDRESS_REGEX) + expect(transferredERC20Hash).toMatch(ADDRESS_REGEX) + expect(tbaWETHReceived).toBe(depositWeiValue) + expect(anvilUser1WETHBalance).toBe(depositWeiValue) + }) + }) + + test.todo('can transferNFT with an 1155', async () => {}) + test.todo('can transfer with ENS', async () => {}) }) } +describe('Custom publicClient RPC URL', () => { + it('can use a custom publicClient RPC URL', async () => { + const customPublicClientRPCUrl = 'https://cloudflare-eth.com' + const tokenboundClient = new TokenboundClient({ + chainId: 1, + walletClient, + publicClientRPCUrl: customPublicClientRPCUrl, + }) + + await waitFor(() => { + expect(tokenboundClient.publicClient?.transport?.url).toBe(customPublicClientRPCUrl) + }) + }) +}) diff --git a/packages/sdk/src/test/config/anvil.ts b/packages/sdk/src/test/config/anvil.ts new file mode 100644 index 0000000..45af93e --- /dev/null +++ b/packages/sdk/src/test/config/anvil.ts @@ -0,0 +1,18 @@ +import { CreateAnvilOptions } from '@viem/anvil' +import { mainnet } from 'viem/chains' + +const ACTIVE_CHAIN = mainnet + +export const ANVIL_CONFIG = { + TIMEOUT: 60000, // default 10000 + ACTIVE_CHAIN: ACTIVE_CHAIN, + } + +export const CREATE_ANVIL_OPTIONS: CreateAnvilOptions = { + forkChainId: ACTIVE_CHAIN.id, + forkUrl: import.meta.env.VITE_ANVIL_MAINNET_FORK_ENDPOINT, + forkBlockNumber: import.meta.env.VITE_ANVIL_MAINNET_FORK_BLOCK_NUMBER + ? parseInt(import.meta.env.VITE_ANVIL_MAINNET_FORK_BLOCK_NUMBER) + : undefined, +} + diff --git a/packages/sdk/src/test/config/index.ts b/packages/sdk/src/test/config/index.ts index 1af7f03..e67f313 100644 --- a/packages/sdk/src/test/config/index.ts +++ b/packages/sdk/src/test/config/index.ts @@ -1 +1,3 @@ -export * from './base' \ No newline at end of file +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 new file mode 100644 index 0000000..2a66268 --- /dev/null +++ b/packages/sdk/src/test/config/mints.ts @@ -0,0 +1,20 @@ +import { getAddress } from 'viem' +import { ethToWei } from '../utils' +import { zora721DropABI } 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: 2, +} + +// https://zora.co/collect/eth:0x373075bab7d668ed2473d8233ebdebcf49eb758e/1 +export const zora1155 = { + fixedPriceSalesStrategy: getAddress('0x8A1DBE9b1CeB1d17f92Bebf10216FCFAb5C3fbA7'), // IMinter1155 minter contract from https://github.com/ourzora/zora-1155-contracts/blob/main/addresses/1.json + proxyContractAddress: getAddress('0x373075bab7d668ed2473d8233ebdebcf49eb758e'), // proxied Zora 1155 contract + tokenId: BigInt(1), + mintFee: ethToWei(0.000777), // 0.000777 ETH + quantity: BigInt(5), +} diff --git a/packages/sdk/src/test/config/shell.ts b/packages/sdk/src/test/config/shell.ts new file mode 100644 index 0000000..3796a69 --- /dev/null +++ b/packages/sdk/src/test/config/shell.ts @@ -0,0 +1,8 @@ + +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`, +} diff --git a/packages/sdk/src/test/constants/addresses.ts b/packages/sdk/src/test/constants/addresses.ts new file mode 100644 index 0000000..2d8dd73 --- /dev/null +++ b/packages/sdk/src/test/constants/addresses.ts @@ -0,0 +1,5 @@ +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 0adebb2..ca0db7c 100644 --- a/packages/sdk/src/test/constants/anvil.ts +++ b/packages/sdk/src/test/constants/anvil.ts @@ -6,45 +6,45 @@ 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) - - // Private Keys - // ================== - // (0) 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - // (1) 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d - // (2) 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a - // (3) 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6 - // (4) 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a - // (5) 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba - // (6) 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e - // (7) 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356 - // (8) 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 - // (9) 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 + // 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 ] diff --git a/packages/sdk/src/test/constants/index.ts b/packages/sdk/src/test/constants/index.ts index fe3e7eb..9547428 100644 --- a/packages/sdk/src/test/constants/index.ts +++ b/packages/sdk/src/test/constants/index.ts @@ -1,2 +1,3 @@ +export * from './addresses' export * from './anvil' -export * from './regexes' \ No newline at end of file +export * from './regexes' diff --git a/packages/sdk/src/test/customImplementations.test.ts b/packages/sdk/src/test/customImplementations.test.ts index 2122a27..fc376ec 100644 --- a/packages/sdk/src/test/customImplementations.test.ts +++ b/packages/sdk/src/test/customImplementations.test.ts @@ -1,60 +1,51 @@ -import { test, expect } from "vitest" -import { - isHex, - isAddress -} from "viem" +import { test, expect } from 'vitest' +import { isHex, isAddress } from 'viem' import { TokenboundClient } from '../TokenboundClient' -import { TEST_CONFIG } from "./config" +import { TEST_CONFIG } from './config' - -const tokenboundClient = new TokenboundClient({ - // signer, - chainId: TEST_CONFIG.CHAIN_ID, - implementationAddress: TEST_CONFIG.CUSTOM_IMPLEMENTATION_ADDRESS, +const tokenboundClient = new TokenboundClient({ + // signer, + chainId: TEST_CONFIG.CHAIN_ID, + implementationAddress: TEST_CONFIG.CUSTOM_IMPLEMENTATION_ADDRESS, }) -test("tokenboundClient.getAccount → customImplementation", () => { - const result = tokenboundClient.getAccount({ - tokenContract: TEST_CONFIG.TOKEN_CONTRACT, - tokenId: TEST_CONFIG.TOKEN_ID, - }) - expect(result).toEqual(TEST_CONFIG.CUSTOM_IMPLEMENTATION_TB_ACCOUNT) +test('tokenboundClient.getAccount → customImplementation', () => { + const result = tokenboundClient.getAccount({ + tokenContract: TEST_CONFIG.TOKEN_CONTRACT, + tokenId: TEST_CONFIG.TOKEN_ID, + }) + expect(result).toEqual(TEST_CONFIG.CUSTOM_IMPLEMENTATION_TB_ACCOUNT) }) -test("tokenboundClient.getAccount → override customImplementation", () => { - const result = tokenboundClient.getAccount({ - tokenContract: TEST_CONFIG.TOKEN_CONTRACT, - tokenId: TEST_CONFIG.TOKEN_ID, - implementationAddress: TEST_CONFIG.CUSTOM_IMPLEMENTATION_ADDRESS_OVERRIDE, - - }) - expect(result).toEqual(TEST_CONFIG.CUSTOM_IMPLEMENTATION_OVERRIDDEN_TB_ACCOUNT) +test('tokenboundClient.getAccount → override customImplementation', () => { + const result = tokenboundClient.getAccount({ + tokenContract: TEST_CONFIG.TOKEN_CONTRACT, + tokenId: TEST_CONFIG.TOKEN_ID, + implementationAddress: TEST_CONFIG.CUSTOM_IMPLEMENTATION_ADDRESS_OVERRIDE, + }) + expect(result).toEqual(TEST_CONFIG.CUSTOM_IMPLEMENTATION_OVERRIDDEN_TB_ACCOUNT) }) -test("tokenboundClient.prepareCreateAccount → customImplementation", async () => { - - const preparedAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: TEST_CONFIG.TOKEN_CONTRACT, - tokenId: TEST_CONFIG.TOKEN_ID - } - ) +test('tokenboundClient.prepareCreateAccount → customImplementation', async () => { + const preparedAccount = await tokenboundClient.prepareCreateAccount({ + tokenContract: TEST_CONFIG.TOKEN_CONTRACT, + tokenId: TEST_CONFIG.TOKEN_ID, + }) - 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) }) -test("tokenboundClient.prepareCreateAccount → customRegistry", async () => { - - const preparedAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: TEST_CONFIG.TOKEN_CONTRACT, - tokenId: TEST_CONFIG.TOKEN_ID, - registryAddress: TEST_CONFIG.CUSTOM_REGISTRY_ADDRESS_OVERRIDE - } - ) - - expect(isAddress(preparedAccount.to)).toEqual(true) - expect(typeof preparedAccount.value).toEqual('bigint') - expect(isHex(preparedAccount.data)).toEqual(true) +test('tokenboundClient.prepareCreateAccount → customRegistry', async () => { + const preparedAccount = await tokenboundClient.prepareCreateAccount({ + tokenContract: TEST_CONFIG.TOKEN_CONTRACT, + tokenId: TEST_CONFIG.TOKEN_ID, + registryAddress: TEST_CONFIG.CUSTOM_REGISTRY_ADDRESS_OVERRIDE, + }) + + expect(isAddress(preparedAccount.to)).toEqual(true) + expect(typeof preparedAccount.value).toEqual('bigint') + expect(isHex(preparedAccount.data)).toEqual(true) }) -test.todo(".createAccount") \ No newline at end of file +test.todo('.createAccount') diff --git a/packages/sdk/src/test/tokenboundClient.test.ts b/packages/sdk/src/test/tokenboundClient.test.ts index c6b7922..a2cec8d 100644 --- a/packages/sdk/src/test/tokenboundClient.test.ts +++ b/packages/sdk/src/test/tokenboundClient.test.ts @@ -1,113 +1,98 @@ -import { test, expect } from "vitest" -import { - isHex, - isAddress -} from "viem" +import { test, expect } from 'vitest' +import { isHex, isAddress } from 'viem' import { TokenboundClient } from '../TokenboundClient' -import { TEST_CONFIG } from "./config" -import { erc6551AccountImplementationAddressV1 } from "../constants" - -const tokenboundClient = new TokenboundClient({ - chainId: TEST_CONFIG.CHAIN_ID - }) - -test("tokenboundClient.getAccount", () => { - const result = tokenboundClient.getAccount({ - tokenContract: TEST_CONFIG.TOKEN_CONTRACT, - tokenId: TEST_CONFIG.TOKEN_ID - }) - expect(result).toEqual(TEST_CONFIG.TB_ACCOUNT) +import { TEST_CONFIG } from './config' +import { erc6551AccountImplementationAddressV1 } from '../constants' + +const tokenboundClient = new TokenboundClient({ + chainId: TEST_CONFIG.CHAIN_ID, }) -test.todo("tokenboundClient.getCreationCode") +test('tokenboundClient.getAccount', () => { + const result = tokenboundClient.getAccount({ + tokenContract: TEST_CONFIG.TOKEN_CONTRACT, + tokenId: TEST_CONFIG.TOKEN_ID, + }) + expect(result).toEqual(TEST_CONFIG.TB_ACCOUNT) +}) -test("tokenboundClient.prepareExecuteCall", async () => { +test.todo('tokenboundClient.getCreationCode') - const preparedCall = await tokenboundClient.prepareExecuteCall({ - account: TEST_CONFIG.TB_ACCOUNT, - to: TEST_CONFIG.RECIPIENT_ADDRESS, - value: 0n, - data: TEST_CONFIG.EXAMPLE_DATA - }) +test('tokenboundClient.prepareExecuteCall', async () => { + const preparedCall = await tokenboundClient.prepareExecuteCall({ + account: TEST_CONFIG.TB_ACCOUNT, + to: TEST_CONFIG.RECIPIENT_ADDRESS, + value: 0n, + data: TEST_CONFIG.EXAMPLE_DATA, + }) - 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) }) -test.todo("tokenboundClient.executeCall") +test.todo('tokenboundClient.executeCall') -test("tokenboundClient.prepareCreateAccount", async () => { +test('tokenboundClient.prepareCreateAccount', async () => { + const preparedAccount = await tokenboundClient.prepareCreateAccount({ + tokenContract: TEST_CONFIG.TOKEN_CONTRACT, + tokenId: TEST_CONFIG.TOKEN_ID, + }) - const preparedAccount = await tokenboundClient.prepareCreateAccount({ - tokenContract: TEST_CONFIG.TOKEN_CONTRACT, - tokenId: TEST_CONFIG.TOKEN_ID, - } - ) - - 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) }) -test("tokenboundClient.checkAccountDeployment", async () => { +test('tokenboundClient.checkAccountDeployment', async () => { + const isSapienz0Deployed = await tokenboundClient.checkAccountDeployment({ + accountAddress: TEST_CONFIG.SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_0, + }) + const isSapienz1Deployed = await tokenboundClient.checkAccountDeployment({ + accountAddress: TEST_CONFIG.SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_1, + }) - const isSapienz0Deployed = await tokenboundClient.checkAccountDeployment({ - accountAddress: TEST_CONFIG.SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_0, - }) - const isSapienz1Deployed = await tokenboundClient.checkAccountDeployment({ - accountAddress: TEST_CONFIG.SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_1, - }) + expect(isSapienz0Deployed).toEqual(true) + expect(isSapienz1Deployed).toEqual(false) +}) - expect(isSapienz0Deployed).toEqual(true) - expect(isSapienz1Deployed).toEqual(false) +test('tokenboundClient.deconstructBytecode', async () => { + const bytecode = await tokenboundClient.deconstructBytecode({ + accountAddress: TEST_CONFIG.SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_0, + }) + + if (!bytecode) throw new Error('Bytecode is undefined') + + const { + chainId, + implementationAddress, + tokenContract, + tokenId, + salt, + erc1167Header, + erc1167Footer, + } = bytecode + + expect(chainId).toEqual(TEST_CONFIG.CHAIN_ID) + expect(erc1167Header).toEqual(TEST_CONFIG.ERC1167_HEADER) + expect(implementationAddress).toEqual(erc6551AccountImplementationAddressV1) + expect(erc1167Footer).toEqual(TEST_CONFIG.ERC1167_FOOTER) + expect(tokenContract).toEqual(TEST_CONFIG.SAPIENZ_GOERLI_CONTRACT) + expect(tokenId).toEqual('0') + expect(salt).toEqual(0) }) -test("tokenboundClient.deconstructBytecode", async () => { - - const bytecode = await tokenboundClient.deconstructBytecode({ - accountAddress: TEST_CONFIG.SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_0, - }) - - if(!bytecode) throw new Error("Bytecode is undefined") - - const { - chainId, - implementationAddress, - tokenContract, - tokenId, - salt, - erc1167Header, - erc1167Footer - } = bytecode - - expect(chainId).toEqual(TEST_CONFIG.CHAIN_ID) - expect(erc1167Header).toEqual(TEST_CONFIG.ERC1167_HEADER) - expect(implementationAddress).toEqual(erc6551AccountImplementationAddressV1) - expect(erc1167Footer).toEqual(TEST_CONFIG.ERC1167_FOOTER) - expect(tokenContract).toEqual(TEST_CONFIG.SAPIENZ_GOERLI_CONTRACT) - expect(tokenId).toEqual('0') - expect(salt).toEqual(0) +test('tokenboundClient.getNFT', async () => { + const nft = await tokenboundClient.getNFT({ + accountAddress: TEST_CONFIG.SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_0, + }) -}) + if (!nft) throw new Error('Bytecode is undefined') + + const { chainId, tokenContract, tokenId } = nft -test("tokenboundClient.getNFT", async () => { - - const nft = await tokenboundClient.getNFT({ - accountAddress: TEST_CONFIG.SAPIENZ_GOERLI_TOKEN_TBA_TOKENID_0, - }) - - if(!nft) throw new Error("Bytecode is undefined") - - const { - chainId, - tokenContract, - tokenId, - } = nft - - expect(chainId).toEqual(TEST_CONFIG.CHAIN_ID) - expect(tokenContract).toEqual(TEST_CONFIG.SAPIENZ_GOERLI_CONTRACT) - expect(tokenId).toEqual('0') - -}) \ No newline at end of file + expect(chainId).toEqual(TEST_CONFIG.CHAIN_ID) + expect(tokenContract).toEqual(TEST_CONFIG.SAPIENZ_GOERLI_CONTRACT) + expect(tokenId).toEqual('0') +}) diff --git a/packages/sdk/src/test/utils/clients.ts b/packages/sdk/src/test/utils/clients.ts index 194a361..1b36468 100644 --- a/packages/sdk/src/test/utils/clients.ts +++ b/packages/sdk/src/test/utils/clients.ts @@ -1,4 +1,10 @@ -import { createPublicClient, WalletClient, PublicClient, createWalletClient, http } from 'viem' +import { + createPublicClient, + WalletClient, + PublicClient, + createWalletClient, + http, +} from 'viem' import { foundry } from 'viem/chains' import { chainIdToChain } from '../../utils' import { ANVIL_RPC_URL, ANVIL_ACCOUNTS } from '../constants' @@ -10,14 +16,13 @@ export const getMockWalletClient = () => account: ANVIL_ACCOUNTS[0].address as `0x${string}`, key: ANVIL_ACCOUNTS[0].privateKey, pollingInterval: 100, -}) as WalletClient + }) as WalletClient export const getPublicClient = ({ chainId = foundry.id, }: { chainId?: number }): PublicClient => { - const chain = chainIdToChain(chainId) if (!chain) throw new Error(`Chain ${chainId} not found`) @@ -27,4 +32,4 @@ export const getPublicClient = ({ chain, pollingInterval: 100, }) -} \ No newline at end of file +} diff --git a/packages/sdk/src/test/utils/debug.ts b/packages/sdk/src/test/utils/debug.ts index cf81e55..a9de0e7 100644 --- a/packages/sdk/src/test/utils/debug.ts +++ b/packages/sdk/src/test/utils/debug.ts @@ -13,6 +13,10 @@ export async function debugTransaction({publicClient, hash}:{publicClient: Publi 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 diff --git a/packages/sdk/src/test/utils/ethToWei.ts b/packages/sdk/src/test/utils/ethToWei.ts new file mode 100644 index 0000000..faf4b31 --- /dev/null +++ b/packages/sdk/src/test/utils/ethToWei.ts @@ -0,0 +1,5 @@ +import { parseUnits } from 'viem' + +export function ethToWei(eth: number) { + return parseUnits(eth.toString(), 18) +} diff --git a/packages/sdk/src/test/utils/getWETHBalance.ts b/packages/sdk/src/test/utils/getWETHBalance.ts new file mode 100644 index 0000000..e06d994 --- /dev/null +++ b/packages/sdk/src/test/utils/getWETHBalance.ts @@ -0,0 +1,18 @@ +import { PublicClient } from 'viem' +import { erc20ABI } from 'wagmi' +import { WETH_CONTRACT_ADDRESS } from '../constants' + +export async function getWETHBalance({ + publicClient, + walletAddress, +}: { + publicClient: PublicClient + walletAddress: `0x${string}` +}) { + return await publicClient.readContract({ + address: WETH_CONTRACT_ADDRESS, + abi: erc20ABI, + functionName: 'balanceOf', + args: [walletAddress], + }) +} diff --git a/packages/sdk/src/test/utils/getZora1155Balance.ts b/packages/sdk/src/test/utils/getZora1155Balance.ts new file mode 100644 index 0000000..6bf4079 --- /dev/null +++ b/packages/sdk/src/test/utils/getZora1155Balance.ts @@ -0,0 +1,18 @@ +import { PublicClient } from 'viem' +import { zora1155 } from '../config' +import { zora1155ABI } from '../wagmi-cli-hooks/generated' + +export async function getZora1155Balance({ + publicClient, + walletAddress, +}: { + publicClient: PublicClient + walletAddress: `0x${string}` +}) { + return await publicClient.readContract({ + address: zora1155.proxyContractAddress, + abi: zora1155ABI, + functionName: 'balanceOf', + args: [walletAddress, zora1155.tokenId], + }) +} diff --git a/packages/sdk/src/test/utils/getZora721Balance.ts b/packages/sdk/src/test/utils/getZora721Balance.ts new file mode 100644 index 0000000..1d6f8bc --- /dev/null +++ b/packages/sdk/src/test/utils/getZora721Balance.ts @@ -0,0 +1,18 @@ +import { PublicClient } from 'viem' +import { zora721 } from '../config' +import { zora721DropABI } from '../wagmi-cli-hooks/generated' + +export async function getZora721Balance({ + publicClient, + walletAddress, +}: { + publicClient: PublicClient + walletAddress: `0x${string}` +}) { + return await publicClient.readContract({ + address: zora721.proxyContractAddress, + abi: zora721DropABI, + functionName: 'balanceOf', + args: [walletAddress], + }) +} diff --git a/packages/sdk/src/test/utils/index.ts b/packages/sdk/src/test/utils/index.ts index 54622db..9bac954 100644 --- a/packages/sdk/src/test/utils/index.ts +++ b/packages/sdk/src/test/utils/index.ts @@ -1,2 +1,7 @@ export * from './clients' -export * from './shellCommand' \ No newline at end of file +export * from './debug' +export * from './shellCommand' +export * from './ethToWei' +export * from './getWETHBalance' +export * from './getZora1155Balance' +export * from './getZora721Balance' diff --git a/packages/sdk/src/test/viem.test.ts b/packages/sdk/src/test/viem.test.ts index 1346b07..85d2d99 100644 --- a/packages/sdk/src/test/viem.test.ts +++ b/packages/sdk/src/test/viem.test.ts @@ -1,65 +1,65 @@ -import { test, expect } from "vitest" +import { test, expect } from 'vitest' import { goerli } from 'viem/chains' -import { - isHex, - createPublicClient, - http, - isAddress -} from "viem" +import { isHex, createPublicClient, http, isAddress } from 'viem' import { - computeAccount, - getAccount, - prepareCreateAccount, - prepareExecuteCall, + computeAccount, + getAccount, + prepareCreateAccount, + prepareExecuteCall, +} from '../index' -} from "../index"; +import { TEST_CONFIG } from './config' -import { TEST_CONFIG } from "./config" +test('.getAccount', async () => { + const publicClient = createPublicClient({ + chain: goerli, + transport: http(), + }) -test(".getAccount", async () => { - const publicClient = createPublicClient({ - chain: goerli, - transport: http() - }) - - const result = await getAccount(TEST_CONFIG.TOKEN_CONTRACT, TEST_CONFIG.TOKEN_ID, publicClient) - expect(result).toEqual(TEST_CONFIG.TB_ACCOUNT) + const result = await getAccount( + TEST_CONFIG.TOKEN_CONTRACT, + TEST_CONFIG.TOKEN_ID, + publicClient + ) + expect(result).toEqual(TEST_CONFIG.TB_ACCOUNT) }) -test(".computeAccount", async () => { - const result = computeAccount(TEST_CONFIG.TOKEN_CONTRACT, TEST_CONFIG.TOKEN_ID, TEST_CONFIG.CHAIN_ID) - expect(result).toEqual(TEST_CONFIG.TB_ACCOUNT) +test('.computeAccount', async () => { + const result = computeAccount( + TEST_CONFIG.TOKEN_CONTRACT, + TEST_CONFIG.TOKEN_ID, + TEST_CONFIG.CHAIN_ID + ) + expect(result).toEqual(TEST_CONFIG.TB_ACCOUNT) }) -test.todo(".getCreationCode") - -test(".prepareExecuteCall", async () => { +test.todo('.getCreationCode') - const preparedCall = await prepareExecuteCall( - TEST_CONFIG.TB_ACCOUNT, - TEST_CONFIG.RECIPIENT_ADDRESS, - TEST_CONFIG.EXAMPLE_AMOUNT, - TEST_CONFIG.EXAMPLE_DATA - ) +test('.prepareExecuteCall', async () => { + const preparedCall = await prepareExecuteCall( + TEST_CONFIG.TB_ACCOUNT, + TEST_CONFIG.RECIPIENT_ADDRESS, + TEST_CONFIG.EXAMPLE_AMOUNT, + TEST_CONFIG.EXAMPLE_DATA + ) - 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) }) -test.todo(".executeCall") - -test(".prepareCreateAccount", async () => { +test.todo('.executeCall') - const preparedAccount = await prepareCreateAccount( - TEST_CONFIG.TOKEN_CONTRACT, - TEST_CONFIG.TOKEN_ID, - TEST_CONFIG.CHAIN_ID - ) +test('.prepareCreateAccount', async () => { + const preparedAccount = await prepareCreateAccount( + TEST_CONFIG.TOKEN_CONTRACT, + TEST_CONFIG.TOKEN_ID, + TEST_CONFIG.CHAIN_ID + ) - 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) }) -test.todo(".createAccount") \ No newline at end of file +test.todo('.createAccount') diff --git a/packages/sdk/src/test/wagmi-cli-hooks/generated.ts b/packages/sdk/src/test/wagmi-cli-hooks/generated.ts index 4b87e79..2dbd0e3 100644 --- a/packages/sdk/src/test/wagmi-cli-hooks/generated.ts +++ b/packages/sdk/src/test/wagmi-cli-hooks/generated.ts @@ -15,12 +15,185 @@ import { PrepareWriteContractResult, } from 'wagmi/actions' +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// WETH_ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +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 + +/** + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export const wethAddress = { + 1: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', +} as const + +/** + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export const wethConfig = { address: wethAddress, abi: wethABI } as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Zora1155_ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export const zora1155ABI = [ { @@ -29,6 +202,7 @@ export const zora1155ABI = [ inputs: [ { name: '_mintFeeAmount', internalType: 'uint256', type: 'uint256' }, { name: '_mintFeeRecipient', internalType: 'address', type: 'address' }, + { name: '_factory', internalType: 'address', type: 'address' }, ], }, { @@ -39,6 +213,11 @@ export const zora1155ABI = [ ], name: 'Burn_NotOwnerOrApproved', }, + { + type: 'error', + inputs: [{ name: 'reason', internalType: 'bytes', type: 'bytes' }], + name: 'CallFailed', + }, { type: 'error', inputs: [ @@ -95,19 +274,12 @@ export const zora1155ABI = [ inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], name: 'NoRendererForToken', }, - { type: 'error', inputs: [], name: 'NotAllowedContractBaseIDUpdate' }, { type: 'error', inputs: [{ name: 'renderer', internalType: 'address', type: 'address' }], name: 'RendererNotValid', }, - { - type: 'error', - inputs: [{ name: 'reason', internalType: 'bytes', type: 'bytes' }], - name: 'Renderer_CallFailed', - }, { type: 'error', inputs: [], name: 'Renderer_NotValidRendererContract' }, - { type: 'error', inputs: [], name: 'Sale_CallFailed' }, { type: 'error', inputs: [{ name: 'targetContract', internalType: 'address', type: 'address' }], @@ -565,6 +737,7 @@ export const zora1155ABI = [ stateMutability: 'nonpayable', type: 'function', inputs: [ + { name: 'contractName', internalType: 'string', type: 'string' }, { name: 'newContractURI', internalType: 'string', type: 'string' }, { name: 'defaultRoyaltyConfiguration', @@ -774,7 +947,6 @@ export const zora1155ABI = [ inputs: [ { name: 'tokenId', internalType: 'uint256', type: 'uint256' }, { name: 'renderer', internalType: 'contract IRenderer1155', type: 'address' }, - { name: 'setupData', internalType: 'bytes', type: 'bytes' }, ], name: 'setTokenMetadataRenderer', outputs: [], @@ -903,14 +1075,14 @@ export const zora1155ABI = [ ] as const /** - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export const zora1155Address = { - 1: '0xD0561AEF1D5cd30a1779f01B41B3436027177d9A', + 1: '0x4482c5929618b848a46E3DA830A3D71085A5DE07', } as const /** - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export const zora1155Config = { address: zora1155Address, abi: zora1155ABI } as const @@ -1725,10 +1897,548 @@ export const zora721DropConfig = { // React ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethRead< + TFunctionName extends string, + TSelectData = ReadContractResult +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractRead({ + abi: wethABI, + address: wethAddress[1], + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"name"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethName< + TFunctionName extends 'name', + TSelectData = ReadContractResult +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractRead({ + abi: wethABI, + address: wethAddress[1], + functionName: 'name', + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"totalSupply"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethTotalSupply< + TFunctionName extends 'totalSupply', + TSelectData = ReadContractResult +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractRead({ + abi: wethABI, + address: wethAddress[1], + functionName: 'totalSupply', + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"decimals"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethDecimals< + TFunctionName extends 'decimals', + TSelectData = ReadContractResult +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractRead({ + abi: wethABI, + address: wethAddress[1], + functionName: 'decimals', + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"balanceOf"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethBalanceOf< + TFunctionName extends 'balanceOf', + TSelectData = ReadContractResult +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractRead({ + abi: wethABI, + address: wethAddress[1], + functionName: 'balanceOf', + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"symbol"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethSymbol< + TFunctionName extends 'symbol', + TSelectData = ReadContractResult +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractRead({ + abi: wethABI, + address: wethAddress[1], + functionName: 'symbol', + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"allowance"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethAllowance< + TFunctionName extends 'allowance', + TSelectData = ReadContractResult +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractRead({ + abi: wethABI, + address: wethAddress[1], + functionName: 'allowance', + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethWrite< + TFunctionName extends string, + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof wethAddress +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult['request']['abi'], + TFunctionName, + TMode + > & { address?: Address; chainId?: TChainId } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + } = {} as any +) { + return useContractWrite({ + abi: wethABI, + address: wethAddress[1], + ...config, + } as any) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"approve"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethApprove< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof wethAddress +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult['request']['abi'], + 'approve', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'approve' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'approve' + } = {} as any +) { + return useContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'approve', + ...config, + } as any) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"transferFrom"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethTransferFrom< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof wethAddress +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult['request']['abi'], + 'transferFrom', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'transferFrom' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'transferFrom' + } = {} as any +) { + return useContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'transferFrom', + ...config, + } as any) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"withdraw"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethWithdraw< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof wethAddress +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult['request']['abi'], + 'withdraw', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'withdraw' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'withdraw' + } = {} as any +) { + return useContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'withdraw', + ...config, + } as any) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"transfer"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethTransfer< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof wethAddress +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult['request']['abi'], + 'transfer', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'transfer' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'transfer' + } = {} as any +) { + return useContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'transfer', + ...config, + } as any) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"deposit"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethDeposit< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof wethAddress +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult['request']['abi'], + 'deposit', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'deposit' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'deposit' + } = {} as any +) { + return useContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'deposit', + ...config, + } as any) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function usePrepareWethWrite( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return usePrepareContractWrite({ + abi: wethABI, + address: wethAddress[1], + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"approve"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function usePrepareWethApprove( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return usePrepareContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'approve', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"transferFrom"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function usePrepareWethTransferFrom( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return usePrepareContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'transferFrom', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"withdraw"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function usePrepareWethWithdraw( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return usePrepareContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'withdraw', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"transfer"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function usePrepareWethTransfer( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return usePrepareContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'transfer', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"deposit"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function usePrepareWethDeposit( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return usePrepareContractWrite({ + abi: wethABI, + address: wethAddress[1], + functionName: 'deposit', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethEvent( + config: Omit, 'abi' | 'address'> & { + chainId?: keyof typeof wethAddress + } = {} as any +) { + return useContractEvent({ + abi: wethABI, + address: wethAddress[1], + ...config, + } as UseContractEventConfig) +} + +/** + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__ and `eventName` set to `"Approval"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethApprovalEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractEvent({ + abi: wethABI, + address: wethAddress[1], + eventName: 'Approval', + ...config, + } as UseContractEventConfig) +} + +/** + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__ and `eventName` set to `"Transfer"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethTransferEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractEvent({ + abi: wethABI, + address: wethAddress[1], + eventName: 'Transfer', + ...config, + } as UseContractEventConfig) +} + +/** + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__ and `eventName` set to `"Deposit"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethDepositEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractEvent({ + abi: wethABI, + address: wethAddress[1], + eventName: 'Deposit', + ...config, + } as UseContractEventConfig) +} + +/** + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__ and `eventName` set to `"Withdrawal"`. + * + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + */ +export function useWethWithdrawalEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof wethAddress } = {} as any +) { + return useContractEvent({ + abi: wethABI, + address: wethAddress[1], + eventName: 'Withdrawal', + ...config, + } as UseContractEventConfig) +} + /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Read< TFunctionName extends string, @@ -1749,7 +2459,7 @@ export function useZora1155Read< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"CONTRACT_BASE_ID"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155ContractBaseId< TFunctionName extends 'CONTRACT_BASE_ID', @@ -1771,7 +2481,7 @@ export function useZora1155ContractBaseId< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"PERMISSION_BIT_ADMIN"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155PermissionBitAdmin< TFunctionName extends 'PERMISSION_BIT_ADMIN', @@ -1793,7 +2503,7 @@ export function useZora1155PermissionBitAdmin< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"PERMISSION_BIT_FUNDS_MANAGER"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155PermissionBitFundsManager< TFunctionName extends 'PERMISSION_BIT_FUNDS_MANAGER', @@ -1815,7 +2525,7 @@ export function useZora1155PermissionBitFundsManager< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"PERMISSION_BIT_METADATA"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155PermissionBitMetadata< TFunctionName extends 'PERMISSION_BIT_METADATA', @@ -1837,7 +2547,7 @@ export function useZora1155PermissionBitMetadata< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"PERMISSION_BIT_MINTER"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155PermissionBitMinter< TFunctionName extends 'PERMISSION_BIT_MINTER', @@ -1859,7 +2569,7 @@ export function useZora1155PermissionBitMinter< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"PERMISSION_BIT_SALES"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155PermissionBitSales< TFunctionName extends 'PERMISSION_BIT_SALES', @@ -1881,7 +2591,7 @@ export function useZora1155PermissionBitSales< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"assumeLastTokenIdMatches"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155AssumeLastTokenIdMatches< TFunctionName extends 'assumeLastTokenIdMatches', @@ -1903,7 +2613,7 @@ export function useZora1155AssumeLastTokenIdMatches< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"balanceOf"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155BalanceOf< TFunctionName extends 'balanceOf', @@ -1925,7 +2635,7 @@ export function useZora1155BalanceOf< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"balanceOfBatch"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155BalanceOfBatch< TFunctionName extends 'balanceOfBatch', @@ -1947,7 +2657,7 @@ export function useZora1155BalanceOfBatch< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"contractURI"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155ContractUri< TFunctionName extends 'contractURI', @@ -1969,7 +2679,7 @@ export function useZora1155ContractUri< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"contractVersion"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155ContractVersion< TFunctionName extends 'contractVersion', @@ -1991,7 +2701,7 @@ export function useZora1155ContractVersion< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"customRenderers"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155CustomRenderers< TFunctionName extends 'customRenderers', @@ -2013,7 +2723,7 @@ export function useZora1155CustomRenderers< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"getCustomRenderer"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155GetCustomRenderer< TFunctionName extends 'getCustomRenderer', @@ -2035,7 +2745,7 @@ export function useZora1155GetCustomRenderer< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"getPermissions"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155GetPermissions< TFunctionName extends 'getPermissions', @@ -2057,7 +2767,7 @@ export function useZora1155GetPermissions< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"getRoyalties"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155GetRoyalties< TFunctionName extends 'getRoyalties', @@ -2079,7 +2789,7 @@ export function useZora1155GetRoyalties< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"getTokenInfo"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155GetTokenInfo< TFunctionName extends 'getTokenInfo', @@ -2101,7 +2811,7 @@ export function useZora1155GetTokenInfo< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"isAdminOrRole"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155IsAdminOrRole< TFunctionName extends 'isAdminOrRole', @@ -2123,7 +2833,7 @@ export function useZora1155IsAdminOrRole< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"isApprovedForAll"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155IsApprovedForAll< TFunctionName extends 'isApprovedForAll', @@ -2145,7 +2855,7 @@ export function useZora1155IsApprovedForAll< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"metadataRendererContract"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155MetadataRendererContract< TFunctionName extends 'metadataRendererContract', @@ -2167,7 +2877,7 @@ export function useZora1155MetadataRendererContract< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"mintFee"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155MintFee< TFunctionName extends 'mintFee', @@ -2189,7 +2899,7 @@ export function useZora1155MintFee< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"mintFeeRecipient"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155MintFeeRecipient< TFunctionName extends 'mintFeeRecipient', @@ -2211,7 +2921,7 @@ export function useZora1155MintFeeRecipient< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"name"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Name< TFunctionName extends 'name', @@ -2233,7 +2943,7 @@ export function useZora1155Name< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"nextTokenId"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155NextTokenId< TFunctionName extends 'nextTokenId', @@ -2255,7 +2965,7 @@ export function useZora1155NextTokenId< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"owner"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Owner< TFunctionName extends 'owner', @@ -2277,7 +2987,7 @@ export function useZora1155Owner< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"permissions"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Permissions< TFunctionName extends 'permissions', @@ -2299,7 +3009,7 @@ export function useZora1155Permissions< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"proxiableUUID"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155ProxiableUuid< TFunctionName extends 'proxiableUUID', @@ -2321,7 +3031,7 @@ export function useZora1155ProxiableUuid< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"royalties"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Royalties< TFunctionName extends 'royalties', @@ -2343,7 +3053,7 @@ export function useZora1155Royalties< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"royaltyInfo"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155RoyaltyInfo< TFunctionName extends 'royaltyInfo', @@ -2365,7 +3075,7 @@ export function useZora1155RoyaltyInfo< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"supplyRoyaltyInfo"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SupplyRoyaltyInfo< TFunctionName extends 'supplyRoyaltyInfo', @@ -2387,7 +3097,7 @@ export function useZora1155SupplyRoyaltyInfo< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"supportsInterface"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SupportsInterface< TFunctionName extends 'supportsInterface', @@ -2409,7 +3119,7 @@ export function useZora1155SupportsInterface< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"symbol"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Symbol< TFunctionName extends 'symbol', @@ -2431,7 +3141,7 @@ export function useZora1155Symbol< /** * Wraps __{@link useContractRead}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"uri"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Uri< TFunctionName extends 'uri', @@ -2453,7 +3163,7 @@ export function useZora1155Uri< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Write< TFunctionName extends string, @@ -2482,7 +3192,7 @@ export function useZora1155Write< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"addPermission"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155AddPermission< TMode extends WriteContractMode = undefined, @@ -2512,7 +3222,7 @@ export function useZora1155AddPermission< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"adminMint"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155AdminMint< TMode extends WriteContractMode = undefined, @@ -2542,7 +3252,7 @@ export function useZora1155AdminMint< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"adminMintBatch"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155AdminMintBatch< TMode extends WriteContractMode = undefined, @@ -2575,7 +3285,7 @@ export function useZora1155AdminMintBatch< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"burnBatch"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155BurnBatch< TMode extends WriteContractMode = undefined, @@ -2605,7 +3315,7 @@ export function useZora1155BurnBatch< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"callRenderer"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155CallRenderer< TMode extends WriteContractMode = undefined, @@ -2635,7 +3345,7 @@ export function useZora1155CallRenderer< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"callSale"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155CallSale< TMode extends WriteContractMode = undefined, @@ -2665,7 +3375,7 @@ export function useZora1155CallSale< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"initialize"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Initialize< TMode extends WriteContractMode = undefined, @@ -2695,7 +3405,7 @@ export function useZora1155Initialize< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"mint"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Mint< TMode extends WriteContractMode = undefined, @@ -2725,7 +3435,7 @@ export function useZora1155Mint< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"multicall"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Multicall< TMode extends WriteContractMode = undefined, @@ -2755,7 +3465,7 @@ export function useZora1155Multicall< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"removePermission"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155RemovePermission< TMode extends WriteContractMode = undefined, @@ -2788,7 +3498,7 @@ export function useZora1155RemovePermission< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"safeBatchTransferFrom"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SafeBatchTransferFrom< TMode extends WriteContractMode = undefined, @@ -2825,7 +3535,7 @@ export function useZora1155SafeBatchTransferFrom< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"safeTransferFrom"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SafeTransferFrom< TMode extends WriteContractMode = undefined, @@ -2858,7 +3568,7 @@ export function useZora1155SafeTransferFrom< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setApprovalForAll"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SetApprovalForAll< TMode extends WriteContractMode = undefined, @@ -2891,7 +3601,7 @@ export function useZora1155SetApprovalForAll< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setFundsRecipient"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SetFundsRecipient< TMode extends WriteContractMode = undefined, @@ -2924,7 +3634,7 @@ export function useZora1155SetFundsRecipient< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setOwner"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SetOwner< TMode extends WriteContractMode = undefined, @@ -2954,7 +3664,7 @@ export function useZora1155SetOwner< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setTokenMetadataRenderer"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SetTokenMetadataRenderer< TMode extends WriteContractMode = undefined, @@ -2991,7 +3701,7 @@ export function useZora1155SetTokenMetadataRenderer< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setTransferHook"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SetTransferHook< TMode extends WriteContractMode = undefined, @@ -3024,7 +3734,7 @@ export function useZora1155SetTransferHook< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setupNewToken"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SetupNewToken< TMode extends WriteContractMode = undefined, @@ -3054,7 +3764,7 @@ export function useZora1155SetupNewToken< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"updateContractMetadata"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpdateContractMetadata< TMode extends WriteContractMode = undefined, @@ -3091,7 +3801,7 @@ export function useZora1155UpdateContractMetadata< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"updateRoyaltiesForToken"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpdateRoyaltiesForToken< TMode extends WriteContractMode = undefined, @@ -3128,7 +3838,7 @@ export function useZora1155UpdateRoyaltiesForToken< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"updateTokenURI"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpdateTokenUri< TMode extends WriteContractMode = undefined, @@ -3161,7 +3871,7 @@ export function useZora1155UpdateTokenUri< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"upgradeTo"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpgradeTo< TMode extends WriteContractMode = undefined, @@ -3191,7 +3901,7 @@ export function useZora1155UpgradeTo< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"upgradeToAndCall"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpgradeToAndCall< TMode extends WriteContractMode = undefined, @@ -3224,7 +3934,7 @@ export function useZora1155UpgradeToAndCall< /** * Wraps __{@link useContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"withdraw"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Withdraw< TMode extends WriteContractMode = undefined, @@ -3254,7 +3964,7 @@ export function useZora1155Withdraw< /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155Write( config: Omit< @@ -3272,7 +3982,7 @@ export function usePrepareZora1155Write( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"addPermission"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155AddPermission( config: Omit< @@ -3291,7 +4001,7 @@ export function usePrepareZora1155AddPermission( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"adminMint"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155AdminMint( config: Omit< @@ -3310,7 +4020,7 @@ export function usePrepareZora1155AdminMint( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"adminMintBatch"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155AdminMintBatch( config: Omit< @@ -3329,7 +4039,7 @@ export function usePrepareZora1155AdminMintBatch( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"burnBatch"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155BurnBatch( config: Omit< @@ -3348,7 +4058,7 @@ export function usePrepareZora1155BurnBatch( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"callRenderer"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155CallRenderer( config: Omit< @@ -3367,7 +4077,7 @@ export function usePrepareZora1155CallRenderer( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"callSale"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155CallSale( config: Omit< @@ -3386,7 +4096,7 @@ export function usePrepareZora1155CallSale( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"initialize"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155Initialize( config: Omit< @@ -3405,7 +4115,7 @@ export function usePrepareZora1155Initialize( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"mint"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155Mint( config: Omit< @@ -3424,7 +4134,7 @@ export function usePrepareZora1155Mint( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"multicall"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155Multicall( config: Omit< @@ -3443,7 +4153,7 @@ export function usePrepareZora1155Multicall( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"removePermission"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155RemovePermission( config: Omit< @@ -3462,7 +4172,7 @@ export function usePrepareZora1155RemovePermission( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"safeBatchTransferFrom"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155SafeBatchTransferFrom( config: Omit< @@ -3481,7 +4191,7 @@ export function usePrepareZora1155SafeBatchTransferFrom( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"safeTransferFrom"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155SafeTransferFrom( config: Omit< @@ -3500,7 +4210,7 @@ export function usePrepareZora1155SafeTransferFrom( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setApprovalForAll"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155SetApprovalForAll( config: Omit< @@ -3519,7 +4229,7 @@ export function usePrepareZora1155SetApprovalForAll( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setFundsRecipient"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155SetFundsRecipient( config: Omit< @@ -3538,7 +4248,7 @@ export function usePrepareZora1155SetFundsRecipient( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setOwner"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155SetOwner( config: Omit< @@ -3557,7 +4267,7 @@ export function usePrepareZora1155SetOwner( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setTokenMetadataRenderer"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155SetTokenMetadataRenderer( config: Omit< @@ -3576,7 +4286,7 @@ export function usePrepareZora1155SetTokenMetadataRenderer( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setTransferHook"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155SetTransferHook( config: Omit< @@ -3595,7 +4305,7 @@ export function usePrepareZora1155SetTransferHook( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"setupNewToken"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155SetupNewToken( config: Omit< @@ -3614,7 +4324,7 @@ export function usePrepareZora1155SetupNewToken( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"updateContractMetadata"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155UpdateContractMetadata( config: Omit< @@ -3633,7 +4343,7 @@ export function usePrepareZora1155UpdateContractMetadata( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"updateRoyaltiesForToken"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155UpdateRoyaltiesForToken( config: Omit< @@ -3652,7 +4362,7 @@ export function usePrepareZora1155UpdateRoyaltiesForToken( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"updateTokenURI"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155UpdateTokenUri( config: Omit< @@ -3671,7 +4381,7 @@ export function usePrepareZora1155UpdateTokenUri( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"upgradeTo"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155UpgradeTo( config: Omit< @@ -3690,7 +4400,7 @@ export function usePrepareZora1155UpgradeTo( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"upgradeToAndCall"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155UpgradeToAndCall( config: Omit< @@ -3709,7 +4419,7 @@ export function usePrepareZora1155UpgradeToAndCall( /** * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link zora1155ABI}__ and `functionName` set to `"withdraw"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function usePrepareZora1155Withdraw( config: Omit< @@ -3728,7 +4438,7 @@ export function usePrepareZora1155Withdraw( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155Event( config: Omit< @@ -3746,7 +4456,7 @@ export function useZora1155Event( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"AdminChanged"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155AdminChangedEvent( config: Omit< @@ -3765,7 +4475,7 @@ export function useZora1155AdminChangedEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"ApprovalForAll"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155ApprovalForAllEvent( config: Omit< @@ -3784,7 +4494,7 @@ export function useZora1155ApprovalForAllEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"BeaconUpgraded"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155BeaconUpgradedEvent( config: Omit< @@ -3803,7 +4513,7 @@ export function useZora1155BeaconUpgradedEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"ConfigUpdated"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155ConfigUpdatedEvent( config: Omit< @@ -3822,7 +4532,7 @@ export function useZora1155ConfigUpdatedEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"ContractMetadataUpdated"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155ContractMetadataUpdatedEvent( config: Omit< @@ -3841,7 +4551,7 @@ export function useZora1155ContractMetadataUpdatedEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"ContractRendererUpdated"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155ContractRendererUpdatedEvent( config: Omit< @@ -3860,7 +4570,7 @@ export function useZora1155ContractRendererUpdatedEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"Initialized"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155InitializedEvent( config: Omit< @@ -3879,7 +4589,7 @@ export function useZora1155InitializedEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"OwnershipTransferred"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155OwnershipTransferredEvent( config: Omit< @@ -3898,7 +4608,7 @@ export function useZora1155OwnershipTransferredEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"Purchased"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155PurchasedEvent( config: Omit< @@ -3917,7 +4627,7 @@ export function useZora1155PurchasedEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"RendererUpdated"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155RendererUpdatedEvent( config: Omit< @@ -3936,7 +4646,7 @@ export function useZora1155RendererUpdatedEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"SetupNewToken"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155SetupNewTokenEvent( config: Omit< @@ -3955,7 +4665,7 @@ export function useZora1155SetupNewTokenEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"TransferBatch"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155TransferBatchEvent( config: Omit< @@ -3974,7 +4684,7 @@ export function useZora1155TransferBatchEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"TransferSingle"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155TransferSingleEvent( config: Omit< @@ -3993,7 +4703,7 @@ export function useZora1155TransferSingleEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"URI"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UriEvent( config: Omit< @@ -4012,7 +4722,7 @@ export function useZora1155UriEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"UpdatedPermissions"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpdatedPermissionsEvent( config: Omit< @@ -4031,7 +4741,7 @@ export function useZora1155UpdatedPermissionsEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"UpdatedRoyalties"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpdatedRoyaltiesEvent( config: Omit< @@ -4050,7 +4760,7 @@ export function useZora1155UpdatedRoyaltiesEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"UpdatedToken"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpdatedTokenEvent( config: Omit< @@ -4069,7 +4779,7 @@ export function useZora1155UpdatedTokenEvent( /** * Wraps __{@link useContractEvent}__ with `abi` set to __{@link zora1155ABI}__ and `eventName` set to `"Upgraded"`. * - * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0xD0561AEF1D5cd30a1779f01B41B3436027177d9A) + * [__View Contract on Ethereum Etherscan__](https://etherscan.io/address/0x4482c5929618b848a46e3da830a3d71085a5de07) */ export function useZora1155UpgradedEvent( config: Omit< diff --git a/packages/sdk/src/types/abstractEthersSigner.ts b/packages/sdk/src/types/abstractEthersSigner.ts index e999134..8e26ab4 100644 --- a/packages/sdk/src/types/abstractEthersSigner.ts +++ b/packages/sdk/src/types/abstractEthersSigner.ts @@ -1,9 +1,7 @@ - // To determine whether the signer is an Ethers signer without first importing the Ethers package, // we check for the existence of the _isSigner property on the signer object. // This AbstractEthersSigner 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 + readonly _isSigner: boolean } & Record diff --git a/packages/sdk/src/types/index.ts b/packages/sdk/src/types/index.ts index 1c1bbcb..691ca0f 100644 --- a/packages/sdk/src/types/index.ts +++ b/packages/sdk/src/types/index.ts @@ -2,4 +2,7 @@ export * from './abstractBigNumber' export * from './abstractEthersSigner' export * from './abstractEthersTransactionResponse' export * from './anvilAccount' -export * from './erc1155Bytecode' \ No newline at end of file +export * from './erc1155Bytecode' +export * from './messages' +export * from './params' +export * from './prettify' diff --git a/packages/sdk/src/types/messages.ts b/packages/sdk/src/types/messages.ts new file mode 100644 index 0000000..8407f3b --- /dev/null +++ b/packages/sdk/src/types/messages.ts @@ -0,0 +1,10 @@ +import { SignableMessage } from 'viem' +import { Prettify } from './prettify' + +export type Bytes = ArrayLike +export type Ethers5SignableMessage = Bytes | string +export type Ethers6SignableMessage = string | Uint8Array + +export type EthersSignableMessage = Ethers5SignableMessage | Ethers6SignableMessage + +export type UniversalSignableMessage = Prettify // SignableMessage is string | { raw: Hex | ByteArray } // where ByteArray = Uint8Array diff --git a/packages/sdk/src/types/params.ts b/packages/sdk/src/types/params.ts new file mode 100644 index 0000000..51b3c7b --- /dev/null +++ b/packages/sdk/src/types/params.ts @@ -0,0 +1,105 @@ +import { WalletClient, PublicClient } from 'viem' +import { Prettify } from './prettify' +import { UniversalSignableMessage } from './messages' + +export const NFTTokenType = { + ERC721: 'ERC721', + ERC1155: 'ERC1155', +} as const + +type TokenType = (typeof NFTTokenType)[keyof typeof NFTTokenType] + +type NFTParams = Prettify<{ + tokenContract: `0x${string}` + tokenId: string +}> + +export type TokenboundAccountNFT = Prettify< + NFTParams & { + chainId: number + } +> + +interface TokenTypeParams { + tokenType: TokenType +} + +export type NFTTransferParams = Prettify< + TokenTypeParams & + NFTParams & { + recipientAddress: `0x${string}` + account: `0x${string}` + } +> + +export type ETHTransferParams = Prettify<{ + account: `0x${string}` + recipientAddress: `0x${string}` // | `${string}.eth` + amount: number +}> + +export type ERC20TransferParams = Prettify<{ + account: `0x${string}` + recipientAddress: `0x${string}` + amount: number + erc20tokenAddress: `0x${string}` + erc20tokenDecimals: number +}> + +export type TokenboundClientOptions = Prettify<{ + chainId: number + signer?: any + walletClient?: WalletClient + publicClient?: PublicClient + publicClientRPCUrl?: string + implementationAddress?: `0x${string}` + registryAddress?: `0x${string}` +}> + +type Custom6551Implementation = Prettify<{ + implementationAddress: `0x${string}` + registryAddress?: `0x${string}` +}> + +export type TBAccountParams = NFTParams + +export type GetAccountParams = Prettify< + TBAccountParams & Partial +> +export type PrepareCreateAccountParams = Prettify< + TBAccountParams & Partial +> +export type CreateAccountParams = Prettify< + TBAccountParams & Partial +> + +export type ExecuteCallParams = Prettify<{ + account: `0x${string}` + to: `0x${string}` + value: bigint + data: string +}> + +export type PrepareExecuteCallParams = ExecuteCallParams + +export type ComputeAccountParams = Prettify< + TBAccountParams & { + chainId: number + } & Partial +> + +export type GetCreationCodeParams = Prettify<{ + implementation_: `0x${string}` + chainId_: number + tokenContract_: string + tokenId_: string + salt_: string +}> + +export type BytecodeParams = Prettify<{ + accountAddress: `0x${string}` +}> + +export type SignMessageParams = Prettify<{ + message: UniversalSignableMessage +}> diff --git a/packages/sdk/src/types/prettify.ts b/packages/sdk/src/types/prettify.ts new file mode 100644 index 0000000..7ebc71e --- /dev/null +++ b/packages/sdk/src/types/prettify.ts @@ -0,0 +1,3 @@ +export type Prettify = { + [K in keyof T]: T[K] +} & {} diff --git a/packages/sdk/src/utils/index.ts b/packages/sdk/src/utils/index.ts index 4c4f0d5..db82735 100644 --- a/packages/sdk/src/utils/index.ts +++ b/packages/sdk/src/utils/index.ts @@ -2,4 +2,6 @@ export * from './addressToUint8Array' export * from './isAbstractBigNumber' export * from './chainIdToChain' export * from './segmentBytecode' -export * from './ethersAdaptors' \ No newline at end of file +export * from './ethersAdaptors' +export * from './normalizeEthersMessage' +export * from './messageTypeguards' diff --git a/packages/sdk/src/utils/messageTypeguards.ts b/packages/sdk/src/utils/messageTypeguards.ts new file mode 100644 index 0000000..7cf3b28 --- /dev/null +++ b/packages/sdk/src/utils/messageTypeguards.ts @@ -0,0 +1,28 @@ +import { SignableMessage } from 'viem' +import { + Ethers5SignableMessage, + Ethers6SignableMessage, + UniversalSignableMessage, +} from '../types' + +export function isEthers5SignableMessage( + message: UniversalSignableMessage +): message is Ethers5SignableMessage { + return ( + 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 +} + +export function isViemSignableMessage( + message: UniversalSignableMessage +): message is SignableMessage { + return typeof message === 'string' || 'raw' in message +} diff --git a/packages/sdk/src/utils/normalizeEthersMessage.ts b/packages/sdk/src/utils/normalizeEthersMessage.ts new file mode 100644 index 0000000..4905c2e --- /dev/null +++ b/packages/sdk/src/utils/normalizeEthersMessage.ts @@ -0,0 +1,19 @@ +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 +): string | Uint8Array { + if (typeof message === 'string') { + return message + } + + if (message instanceof Uint8Array) { + return message + } + + // Convert ArrayLike to Uint8Array + return new Uint8Array(Array.from(message)) +} diff --git a/packages/sdk/tsconfig.json b/packages/sdk/tsconfig.json index d5037f0..ac03663 100644 --- a/packages/sdk/tsconfig.json +++ b/packages/sdk/tsconfig.json @@ -16,5 +16,6 @@ "noImplicitReturns": true, "skipLibCheck": true }, - "include": ["src"] + "include": ["src"], + "exclude": ["src/test"] } diff --git a/packages/sdk/vite.config.ts b/packages/sdk/vite.config.ts index 19e969a..4132eaf 100644 --- a/packages/sdk/vite.config.ts +++ b/packages/sdk/vite.config.ts @@ -1,30 +1,32 @@ -import { resolve } from "path"; -import { defineConfig } from "vite"; -import dts from "vite-plugin-dts"; +import { resolve } from 'path' +import { defineConfig } from 'vite' +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", + entry: resolve(__dirname, 'src/index.ts'), + name: 'tokenbound-sdk', // the proper extensions will be added - fileName: "tokenbound-sdk", + fileName: 'tokenbound-sdk', }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled // into your library - external: ["viem"], + external: ['viem'], output: { // Provide global variables to use in the UMD build // for externalized deps globals: { - // vue: "Vue", - viem: "viem", + viem: 'viem', }, }, }, }, plugins: [dts()], -}); + optimizeDeps: { + exclude: ['**/__test__/**', '**/*.test.ts', '**/*.spec.ts'], + }, +}) diff --git a/packages/sdk/wagmi.config.ts b/packages/sdk/wagmi.config.ts index f640925..f5e7280 100644 --- a/packages/sdk/wagmi.config.ts +++ b/packages/sdk/wagmi.config.ts @@ -2,40 +2,45 @@ import { defineConfig } from '@wagmi/cli' import { etherscan, react } from '@wagmi/cli/plugins' import { mainnet } from 'viem/chains' -export default defineConfig({ out: 'src/test/wagmi-cli-hooks/generated.ts', - contracts: [], - plugins: [ - etherscan({ - apiKey: '6RMAZFTCW43SGRY935CIEQ58D3ZP7S5BQX', // Tokenbound SDK, user bjfutureprimitive - chainId: mainnet.id, +export default defineConfig({ + out: 'src/test/wagmi-cli-hooks/generated.ts', + contracts: [], + plugins: [ + etherscan({ + apiKey: '6RMAZFTCW43SGRY935CIEQ58D3ZP7S5BQX', // Tokenbound SDK, user bjfutureprimitive + chainId: mainnet.id, - contracts: [ - { - name: 'Zora1155_', - address: { - // [1]: '0xd2b35974aedd3286629971ba956e9c4873a85e08', - [1]: '0xD0561AEF1D5cd30a1779f01B41B3436027177d9A', - // Sapienz drop: 0xafd7b9edc5827f7e39dcd425d8de8d4e1cb292c1 // https://zora.co/collect/eth:0xafd7b9edc5827f7e39dcd425d8de8d4e1cb292c1/3 - }, - }, - { - name: 'Zora721Drop_', - address: { - [1]: '0x7c74dfe39976dc395529c14e54a597809980e01c', - }, - }, - ], - }), - react({ - // useContract: false, - // useContractEvent: false, - // useContractItemEvent: false, - // useContractRead: false, - // useContractFunctionWrite: true, - // usePrepareContractFunctionWrite: true, - // useContractFunctionRead: false, - // useContractWrite: false, - // usePrepareContractWrite: false, - }), - ] + contracts: [ + { + name: 'Zora1155_', + address: { + [1]: '0x4482c5929618b848a46e3da830a3d71085a5de07', // ZoraCreator1155Impl + }, + }, + { + name: 'Zora721Drop_', + address: { + [1]: '0x7c74dfe39976dc395529c14e54a597809980e01c', + }, + }, + { + name: 'WETH_', + address: { + [1]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + }, + }, + ], + }), + react({ + // useContract: false, + // useContractEvent: false, + // useContractItemEvent: false, + // useContractRead: false, + // useContractFunctionWrite: true, + // usePrepareContractFunctionWrite: true, + // useContractFunctionRead: false, + // useContractWrite: false, + // usePrepareContractWrite: false, + }), + ], }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ee520d4..12b2a98 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,25 +13,31 @@ importers: version: 2.26.2 '@ianvs/prettier-plugin-sort-imports': specifier: ^4.1.0 - version: 4.1.0(prettier@3.0.3) + version: 4.1.0(prettier@2.8.8) + '@typescript-eslint/eslint-plugin': + specifier: ^6.7.2 + version: 6.7.2(@typescript-eslint/parser@6.7.2)(eslint@8.50.0)(typescript@5.2.2) + '@typescript-eslint/parser': + specifier: ^6.7.2 + version: 6.7.2(eslint@8.50.0)(typescript@5.2.2) eslint: - specifier: ^8.45.0 - version: 8.45.0 + specifier: ^8.50.0 + version: 8.50.0 eslint-config-prettier: - specifier: ^8.8.0 - version: 8.8.0(eslint@8.45.0) + specifier: ^9.0.0 + version: 9.0.0(eslint@8.50.0) eslint-plugin-unused-imports: specifier: ^3.0.0 - version: 3.0.0(eslint@8.45.0) + version: 3.0.0(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.50.0) husky: specifier: ^8.0.3 version: 8.0.3 lint-staged: - specifier: ^13.2.3 - version: 13.2.3 + specifier: ^14.0.1 + version: 14.0.1 prettier: - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^2.8.8 + version: 2.8.8 typescript: specifier: ^5.2.2 version: 5.2.2 @@ -46,7 +52,7 @@ importers: version: 6.0.3 connectkit: specifier: ^1.5.3 - version: 1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.10.14)(wagmi@1.4.2) + version: 1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.15.1)(wagmi@1.4.3) ethers: specifier: ^5.7.2 version: 5.7.2 @@ -63,11 +69,11 @@ importers: specifier: ^0.12.5 version: 0.12.5 viem: - specifier: ^1.10.14 - version: 1.10.14(typescript@5.2.2)(zod@3.21.4) + specifier: ^1.15.1 + version: 1.15.1(typescript@5.2.2) wagmi: - specifier: ^1.4.2 - version: 1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + specifier: ^1.4.3 + version: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1) devDependencies: '@types/react': specifier: ^18.2.21 @@ -89,7 +95,7 @@ importers: dependencies: '@rainbow-me/rainbowkit': specifier: ^1.0.11 - version: 1.0.11(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(viem@1.10.14)(wagmi@1.4.2) + version: 1.0.11(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(viem@1.15.1)(wagmi@1.4.3) '@tokenbound/sdk': specifier: workspace:^ version: link:../../packages/sdk @@ -112,11 +118,11 @@ importers: specifier: ^0.12.5 version: 0.12.5 viem: - specifier: ^1.10.14 - version: 1.10.14(typescript@5.2.2)(zod@3.21.4) + specifier: ^1.15.1 + version: 1.15.1(typescript@5.2.2) wagmi: - specifier: ^1.4.2 - version: 1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + specifier: ^1.4.3 + version: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1) devDependencies: '@types/react': specifier: ^18.2.21 @@ -144,7 +150,7 @@ importers: version: 6.0.3 connectkit: specifier: ^1.5.3 - version: 1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.10.14)(wagmi@1.4.2) + version: 1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.15.1)(wagmi@1.4.3) ethers: specifier: ^6.7.0 version: 6.7.0 @@ -161,11 +167,11 @@ importers: specifier: ^0.12.5 version: 0.12.5 viem: - specifier: ^1.10.14 - version: 1.10.14(typescript@5.2.2)(zod@3.21.4) + specifier: ^1.15.1 + version: 1.15.1(typescript@5.2.2) wagmi: - specifier: ^1.4.2 - version: 1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + specifier: ^1.4.3 + version: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1) devDependencies: '@types/react': specifier: ^18.2.21 @@ -193,7 +199,7 @@ importers: version: 6.0.3 connectkit: specifier: ^1.5.3 - version: 1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.10.14)(wagmi@1.4.2) + version: 1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.15.1)(wagmi@1.4.3) ethers: specifier: ^5.7.2 version: 5.7.2 @@ -210,11 +216,11 @@ importers: specifier: ^0.12.5 version: 0.12.5 viem: - specifier: ^1.10.14 - version: 1.10.14(typescript@5.2.2)(zod@3.21.4) + specifier: ^1.15.1 + version: 1.15.1(typescript@5.2.2) wagmi: - specifier: ^1.4.2 - version: 1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + specifier: ^1.4.3 + version: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1) devDependencies: '@types/react': specifier: ^18.2.21 @@ -265,9 +271,12 @@ importers: packages/sdk: dependencies: viem: - specifier: ^1.10.14 - version: 1.10.14(typescript@5.2.2)(zod@3.21.4) + specifier: ^1.14.0 + version: 1.14.0(typescript@5.2.2)(zod@3.21.4) devDependencies: + '@ianvs/prettier-plugin-sort-imports': + specifier: ^4.1.0 + version: 4.1.0(prettier@2.8.8) '@tanstack/react-query': specifier: 4.29.1 version: 4.29.1(react-dom@18.2.0)(react@18.2.0) @@ -292,6 +301,12 @@ importers: '@types/testing-library__jest-dom': specifier: ^5.14.9 version: 5.14.9 + '@typescript-eslint/eslint-plugin': + specifier: ^6.7.2 + version: 6.7.2(@typescript-eslint/parser@6.7.2)(eslint@8.50.0)(typescript@5.2.2) + '@typescript-eslint/parser': + specifier: ^6.7.2 + version: 6.7.2(eslint@8.50.0)(typescript@5.2.2) '@viem/anvil': specifier: ^0.0.6 version: 0.0.6 @@ -300,19 +315,34 @@ importers: version: 0.33.0(vitest@0.34.2) '@wagmi/cli': specifier: ^1.5.0 - version: 1.5.0(typescript@5.2.2)(wagmi@1.4.2) + version: 1.5.0(typescript@5.2.2)(wagmi@1.4.3) connectkit: specifier: ^1.5.3 - version: 1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.10.14)(wagmi@1.4.2) + version: 1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.14.0)(wagmi@1.4.3) + eslint: + specifier: ^8.50.0 + version: 8.50.0 + eslint-config-prettier: + specifier: ^9.0.0 + version: 9.0.0(eslint@8.50.0) + eslint-plugin-unused-imports: + specifier: ^3.0.0 + version: 3.0.0(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.50.0) ethers: specifier: ^5.7.2 version: 5.7.2 ethers6: specifier: npm:ethers@^6.7.1 version: /ethers@6.7.1 + forge-std: + specifier: 1.1.2 + version: 1.1.2 jsdom: specifier: ^22.1.0 version: 22.1.0 + prettier: + specifier: ^2.8.8 + version: 2.8.8 react: specifier: ^18.2.0 version: 18.2.0 @@ -332,8 +362,8 @@ importers: specifier: ^0.34.2 version: 0.34.2(jsdom@22.1.0) wagmi: - specifier: ^1.4.2 - version: 1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + specifier: ^1.4.3 + version: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.14.0) packages: @@ -1369,23 +1399,23 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.45.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.50.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.45.0 - eslint-visitor-keys: 3.4.1 + eslint: 8.50.0 + eslint-visitor-keys: 3.4.3 dev: true - /@eslint-community/regexpp@4.5.1: - resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} + /@eslint-community/regexpp@4.8.1: + resolution: {integrity: sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.1.0: - resolution: {integrity: sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==} + /@eslint/eslintrc@2.1.2: + resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 @@ -1401,8 +1431,8 @@ packages: - supports-color dev: true - /@eslint/js@8.44.0: - resolution: {integrity: sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==} + /@eslint/js@8.50.0: + resolution: {integrity: sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -1691,8 +1721,8 @@ packages: '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - /@humanwhocodes/config-array@0.11.10: - resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} + /@humanwhocodes/config-array@0.11.11: + resolution: {integrity: sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -1711,7 +1741,7 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true - /@ianvs/prettier-plugin-sort-imports@4.1.0(prettier@3.0.3): + /@ianvs/prettier-plugin-sort-imports@4.1.0(prettier@2.8.8): resolution: {integrity: sha512-IAXeTLU24k6mRPa6mFbW1qZJ/j0m3OeH44wyijWyr+YqqdNtBnfHxAntOAATS9iDfrT01NesKGsdzqnXdDQa/A==} peerDependencies: '@vue/compiler-sfc': '>=3.0.0' @@ -1725,7 +1755,7 @@ packages: '@babel/parser': 7.22.5 '@babel/traverse': 7.22.5 '@babel/types': 7.22.5 - prettier: 3.0.3 + prettier: 2.8.8 semver: 7.5.4 transitivePeerDependencies: - supports-color @@ -2057,7 +2087,7 @@ packages: resolution: {integrity: sha512-HaW78NszGzRZd9SeoI3JD11JqY+lubnaOx7Pewj5pfjqWXOEATpeKIFb9Z4t2WBUK2iryiXX3lzWwmYWgUL0Ug==} dev: true - /@rainbow-me/rainbowkit@1.0.11(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(viem@1.10.14)(wagmi@1.4.2): + /@rainbow-me/rainbowkit@1.0.11(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(viem@1.15.1)(wagmi@1.4.3): resolution: {integrity: sha512-+cm6+WUPG9iPgkfJKbvlowcrSHu266Zk20LVRsYLcmb6v29gVMHcWQvyI4T6EVC9TxNjnyq/jIlen++uiUBmmQ==} engines: {node: '>=12.4'} peerDependencies: @@ -2074,8 +2104,8 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-remove-scroll: 2.5.4(@types/react@18.2.21)(react@18.2.0) - viem: 1.10.14(typescript@5.2.2)(zod@3.21.4) - wagmi: 1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + viem: 1.15.1(typescript@5.2.2) + wagmi: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1) transitivePeerDependencies: - '@types/react' dev: false @@ -2210,7 +2240,7 @@ packages: resolution: {integrity: sha512-gYw0ki/EAuV1oSyMxpqandHjnthZjYYy+YWpTAzf8BqfXM3ItcZLpjxfg+3+mXW8HIO+3jw6T9iiqEXsqHaMMw==} dependencies: '@safe-global/safe-gateway-typescript-sdk': 3.7.0 - viem: 1.10.14(typescript@5.2.2)(zod@3.21.4) + viem: 1.15.1(typescript@5.2.2) transitivePeerDependencies: - bufferutil - encoding @@ -2569,6 +2599,10 @@ packages: pretty-format: 29.6.2 dev: true + /@types/json-schema@7.0.13: + resolution: {integrity: sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==} + dev: true + /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -2646,6 +2680,137 @@ packages: '@types/yargs-parser': 21.0.0 dev: true + /@typescript-eslint/eslint-plugin@6.7.2(@typescript-eslint/parser@6.7.2)(eslint@8.50.0)(typescript@5.2.2): + resolution: {integrity: sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q==} + 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.8.1 + '@typescript-eslint/parser': 6.7.2(eslint@8.50.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.7.2 + '@typescript-eslint/type-utils': 6.7.2(eslint@8.50.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.7.2(eslint@8.50.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.7.2 + debug: 4.3.4(supports-color@5.5.0) + eslint: 8.50.0 + graphemer: 1.4.0 + ignore: 5.2.4 + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@6.7.2(eslint@8.50.0)(typescript@5.2.2): + resolution: {integrity: sha512-KA3E4ox0ws+SPyxQf9iSI25R6b4Ne78ORhNHeVKrPQnoYsb9UhieoiRoJgrzgEeKGOXhcY1i8YtOeCHHTDa6Fw==} + 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.7.2 + '@typescript-eslint/types': 6.7.2 + '@typescript-eslint/typescript-estree': 6.7.2(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.7.2 + debug: 4.3.4(supports-color@5.5.0) + eslint: 8.50.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/scope-manager@6.7.2: + resolution: {integrity: sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.7.2 + '@typescript-eslint/visitor-keys': 6.7.2 + dev: true + + /@typescript-eslint/type-utils@6.7.2(eslint@8.50.0)(typescript@5.2.2): + resolution: {integrity: sha512-36F4fOYIROYRl0qj95dYKx6kybddLtsbmPIYNK0OBeXv2j9L5nZ17j9jmfy+bIDHKQgn2EZX+cofsqi8NPATBQ==} + 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.7.2(typescript@5.2.2) + '@typescript-eslint/utils': 6.7.2(eslint@8.50.0)(typescript@5.2.2) + debug: 4.3.4(supports-color@5.5.0) + eslint: 8.50.0 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/types@6.7.2: + resolution: {integrity: sha512-flJYwMYgnUNDAN9/GAI3l8+wTmvTYdv64fcH8aoJK76Y+1FCZ08RtI5zDerM/FYT5DMkAc+19E4aLmd5KqdFyg==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + + /@typescript-eslint/typescript-estree@6.7.2(typescript@5.2.2): + resolution: {integrity: sha512-kiJKVMLkoSciGyFU0TOY0fRxnp9qq1AzVOHNeN1+B9erKFCJ4Z8WdjAkKQPP+b1pWStGFqezMLltxO+308dJTQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.7.2 + '@typescript-eslint/visitor-keys': 6.7.2 + debug: 4.3.4(supports-color@5.5.0) + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@6.7.2(eslint@8.50.0)(typescript@5.2.2): + resolution: {integrity: sha512-ZCcBJug/TS6fXRTsoTkgnsvyWSiXwMNiPzBUani7hDidBdj1779qwM1FIAmpH4lvlOZNF3EScsxxuGifjpLSWQ==} + 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.50.0) + '@types/json-schema': 7.0.13 + '@types/semver': 7.5.0 + '@typescript-eslint/scope-manager': 6.7.2 + '@typescript-eslint/types': 6.7.2 + '@typescript-eslint/typescript-estree': 6.7.2(typescript@5.2.2) + eslint: 8.50.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@6.7.2: + resolution: {integrity: sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.7.2 + eslint-visitor-keys: 3.4.3 + dev: true + /@vanilla-extract/css@1.9.1: resolution: {integrity: sha512-pu2SFiff5jRhPwvGoj8cM5l/qIyLvigOmy22ss5DGjwV5pJYezRjDLxWumi2luIwioMWvh9EozCjyfH8nq+7fQ==} dependencies: @@ -2900,7 +3065,7 @@ packages: - utf-8-validate dev: true - /@wagmi/cli@1.5.0(typescript@5.2.2)(wagmi@1.4.2): + /@wagmi/cli@1.5.0(typescript@5.2.2)(wagmi@1.4.3): resolution: {integrity: sha512-3L1b/zgdkYPYsnBbtalRcEmSJWGy9hnZjCmkjAj5FDXfaslMmJFTJiNDDYpkpxCtL9iqjbYj0y3ECW7mDfJr7A==} engines: {node: '>=14'} hasBin: true @@ -2937,8 +3102,8 @@ packages: picocolors: 1.0.0 prettier: 2.8.8 typescript: 5.2.2 - viem: 1.10.14(typescript@5.2.2)(zod@3.21.4) - wagmi: 1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + viem: 1.14.0(typescript@5.2.2)(zod@3.21.4) + wagmi: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.14.0) zod: 3.21.4 transitivePeerDependencies: - bufferutil @@ -3018,7 +3183,7 @@ packages: - zod dev: true - /@wagmi/connectors@3.1.2(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14): + /@wagmi/connectors@3.1.2(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.14.0): resolution: {integrity: sha512-IlLKErqCzQRBUcCvXGPowcczbWcvJtEG006gPsAoePNJEXCHEWoKASghgu+L/bqD7006Z6mW6zlTNjcSQJvFAg==} peerDependencies: typescript: '>=5.0.4' @@ -3038,7 +3203,7 @@ packages: abitype: 0.8.7(typescript@5.2.2)(zod@3.21.4) eventemitter3: 4.0.7 typescript: 5.2.2 - viem: 1.10.14(typescript@5.2.2)(zod@3.21.4) + viem: 1.14.0(typescript@5.2.2)(zod@3.21.4) transitivePeerDependencies: - '@react-native-async-storage/async-storage' - '@types/react' @@ -3049,6 +3214,40 @@ packages: - supports-color - utf-8-validate - zod + dev: true + + /@wagmi/connectors@3.1.2(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1): + resolution: {integrity: sha512-IlLKErqCzQRBUcCvXGPowcczbWcvJtEG006gPsAoePNJEXCHEWoKASghgu+L/bqD7006Z6mW6zlTNjcSQJvFAg==} + peerDependencies: + typescript: '>=5.0.4' + viem: '>=0.3.35' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@coinbase/wallet-sdk': 3.6.6 + '@ledgerhq/connect-kit-loader': 1.1.0 + '@safe-global/safe-apps-provider': 0.17.1(typescript@5.2.2) + '@safe-global/safe-apps-sdk': 8.0.0(typescript@5.2.2) + '@walletconnect/ethereum-provider': 2.10.1(@walletconnect/modal@2.6.2) + '@walletconnect/legacy-provider': 2.0.0 + '@walletconnect/modal': 2.6.2(@types/react@18.2.21)(react@18.2.0) + '@walletconnect/utils': 2.10.1 + abitype: 0.8.7(typescript@5.2.2)(zod@3.21.4) + eventemitter3: 4.0.7 + typescript: 5.2.2 + viem: 1.15.1(typescript@5.2.2) + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - '@types/react' + - bufferutil + - encoding + - lokijs + - react + - supports-color + - utf-8-validate + - zod + dev: false /@wagmi/core@0.10.0(ethers@5.7.2)(react@18.2.0)(typescript@4.9.4): resolution: {integrity: sha512-biDjKhN9H/hEsbdWfIXovV90nHdwnO3urUTlZVX8fsntg8d9TFQFxhjRCgspHfXcznfRGbUHVslPyQoup1wvrg==} @@ -3111,8 +3310,36 @@ packages: - zod dev: true - /@wagmi/core@1.4.2(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14): - resolution: {integrity: sha512-szgNs2DCbBXKsq3wdm/YD8FWkg7lfmTRAv25b2nJYJUTQN59pVXznlWfq8VCJLamhKOYjeYHlTQxXkAeUAJdhw==} + /@wagmi/core@1.4.3(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.14.0): + resolution: {integrity: sha512-CIV9jwv5ue+WpqmA3FvwGa+23cppe7oIaz6TRnlGm0Hm0wDImSaQSWqcsFyOPvleD29oOIJ8e3KnHINEvI64AA==} + peerDependencies: + typescript: '>=5.0.4' + viem: '>=0.3.35' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@wagmi/connectors': 3.1.2(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.14.0) + abitype: 0.8.7(typescript@5.2.2)(zod@3.21.4) + eventemitter3: 4.0.7 + typescript: 5.2.2 + viem: 1.14.0(typescript@5.2.2)(zod@3.21.4) + zustand: 4.3.7(react@18.2.0) + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - '@types/react' + - bufferutil + - encoding + - immer + - lokijs + - react + - supports-color + - utf-8-validate + - zod + dev: true + + /@wagmi/core@1.4.3(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1): + resolution: {integrity: sha512-CIV9jwv5ue+WpqmA3FvwGa+23cppe7oIaz6TRnlGm0Hm0wDImSaQSWqcsFyOPvleD29oOIJ8e3KnHINEvI64AA==} peerDependencies: typescript: '>=5.0.4' viem: '>=0.3.35' @@ -3120,11 +3347,11 @@ packages: typescript: optional: true dependencies: - '@wagmi/connectors': 3.1.2(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + '@wagmi/connectors': 3.1.2(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1) abitype: 0.8.7(typescript@5.2.2)(zod@3.21.4) eventemitter3: 4.0.7 typescript: 5.2.2 - viem: 1.10.14(typescript@5.2.2)(zod@3.21.4) + viem: 1.15.1(typescript@5.2.2) zustand: 4.3.7(react@18.2.0) transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -3137,6 +3364,7 @@ packages: - supports-color - utf-8-validate - zod + dev: false /@walletconnect/core@2.10.0: resolution: {integrity: sha512-Z8pdorfIMueuiBXLdnf7yloiO9JIiobuxN3j0OTal+MYc4q5/2O7d+jdD1DAXbLi1taJx3x60UXT/FPVkjIqIQ==} @@ -3927,14 +4155,6 @@ packages: transitivePeerDependencies: - supports-color - /aggregate-error@3.1.0: - resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} - engines: {node: '>=8'} - dependencies: - clean-stack: 2.2.0 - indent-string: 4.0.0 - dev: true - /ahocorasick@1.0.2: resolution: {integrity: sha512-hCOfMzbFx5IDutmWLAt6MZwOUjIfSM9G9FyVxytmE4Rs/5YDPWQrD/+IR1w+FweD9H2oOZEnv36TmkjhNURBVA==} dev: false @@ -3958,11 +4178,11 @@ packages: engines: {node: '>=6'} dev: true - /ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} + /ansi-escapes@5.0.0: + resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==} + engines: {node: '>=12'} dependencies: - type-fest: 0.21.3 + type-fest: 1.4.0 dev: true /ansi-regex@5.0.1: @@ -4074,11 +4294,6 @@ packages: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true - /astral-regex@2.0.0: - resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} - engines: {node: '>=8'} - dev: true - /async-mutex@0.2.6: resolution: {integrity: sha512-Hs4R+4SPgamu6rSGW8C7cV9gaWUKEHykfzCCvIRuaVv636Ju10ZdeUbvb4TBEW0INuq2DHZqXbK4Nd3yG4RaRw==} dependencies: @@ -4395,6 +4610,11 @@ packages: engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true + /chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + dev: true + /change-case@4.1.2: resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==} dependencies: @@ -4440,18 +4660,6 @@ packages: engines: {node: '>=8'} dev: true - /clean-stack@2.2.0: - resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} - engines: {node: '>=6'} - dev: true - - /cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - dependencies: - restore-cursor: 3.1.0 - dev: true - /cli-cursor@4.0.0: resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -4464,14 +4672,6 @@ packages: engines: {node: '>=6'} dev: true - /cli-truncate@2.1.0: - resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==} - engines: {node: '>=8'} - dependencies: - slice-ansi: 3.0.0 - string-width: 4.2.3 - dev: true - /cli-truncate@3.1.0: resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -4555,9 +4755,9 @@ packages: delayed-stream: 1.0.0 dev: true - /commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} + /commander@11.0.0: + resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==} + engines: {node: '>=16'} dev: true /commander@2.20.3: @@ -4574,7 +4774,7 @@ packages: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true - /connectkit@1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.10.14)(wagmi@1.4.2): + /connectkit@1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.14.0)(wagmi@1.4.3): resolution: {integrity: sha512-vXneVOa+oit5Migoxca2QkgVBHaROItzb2kW13o7aUrcEcecYIGZjsizsVM2YvIdKihyWs+zJFrlED4g8zAMew==} engines: {node: '>=12.4'} peerDependencies: @@ -4593,10 +4793,36 @@ packages: react-use-measure: 2.1.1(react-dom@18.2.0)(react@18.2.0) resize-observer-polyfill: 1.5.1 styled-components: 5.3.9(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0) - viem: 1.10.14(typescript@5.2.2)(zod@3.21.4) - wagmi: 1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + viem: 1.14.0(typescript@5.2.2)(zod@3.21.4) + wagmi: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.14.0) transitivePeerDependencies: - react-is + dev: true + + /connectkit@1.5.3(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.15.1)(wagmi@1.4.3): + resolution: {integrity: sha512-vXneVOa+oit5Migoxca2QkgVBHaROItzb2kW13o7aUrcEcecYIGZjsizsVM2YvIdKihyWs+zJFrlED4g8zAMew==} + engines: {node: '>=12.4'} + peerDependencies: + react: 17.x || 18.x + react-dom: 17.x || 18.x + viem: ^1.0.0 + wagmi: ^1.1.1 + dependencies: + buffer: 6.0.3 + detect-browser: 5.3.0 + framer-motion: 6.5.1(react-dom@18.2.0)(react@18.2.0) + qrcode: 1.5.3 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-transition-state: 1.1.5(react-dom@18.2.0)(react@18.2.0) + react-use-measure: 2.1.1(react-dom@18.2.0)(react@18.2.0) + resize-observer-polyfill: 1.5.1 + styled-components: 5.3.9(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0) + viem: 1.15.1(typescript@5.2.2) + wagmi: 1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1) + transitivePeerDependencies: + - react-is + dev: false /constant-case@3.0.4: resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==} @@ -5429,16 +5655,16 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier@8.8.0(eslint@8.45.0): - resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} + /eslint-config-prettier@9.0.0(eslint@8.50.0): + resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.45.0 + eslint: 8.50.0 dev: true - /eslint-plugin-unused-imports@3.0.0(eslint@8.45.0): + /eslint-plugin-unused-imports@3.0.0(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.50.0): resolution: {integrity: sha512-sduiswLJfZHeeBJ+MQaG+xYzSWdRXoSw61DpU13mzWumCkR0ufD0HmO4kdNokjrkluMHpj/7PJeN35pgbhW3kw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -5448,7 +5674,8 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - eslint: 8.45.0 + '@typescript-eslint/eslint-plugin': 6.7.2(@typescript-eslint/parser@6.7.2)(eslint@8.50.0)(typescript@5.2.2) + eslint: 8.50.0 eslint-rule-composer: 0.3.0 dev: true @@ -5457,29 +5684,29 @@ packages: engines: {node: '>=4.0.0'} dev: true - /eslint-scope@7.2.0: - resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} + /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-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} + /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@8.45.0: - resolution: {integrity: sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==} + /eslint@8.50.0: + resolution: {integrity: sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) - '@eslint-community/regexpp': 4.5.1 - '@eslint/eslintrc': 2.1.0 - '@eslint/js': 8.44.0 - '@humanwhocodes/config-array': 0.11.10 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.50.0) + '@eslint-community/regexpp': 4.8.1 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.50.0 + '@humanwhocodes/config-array': 0.11.11 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -5488,8 +5715,8 @@ packages: debug: 4.3.4(supports-color@5.5.0) doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.0 - eslint-visitor-keys: 3.4.1 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 @@ -5522,7 +5749,7 @@ packages: dependencies: acorn: 8.10.0 acorn-jsx: 5.3.2(acorn@8.10.0) - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.3 dev: true /esprima@4.0.1: @@ -5668,6 +5895,10 @@ packages: /eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} + /eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + dev: true + /events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -5883,6 +6114,10 @@ packages: signal-exit: 3.0.7 dev: true + /forge-std@1.1.2: + resolution: {integrity: sha512-Wfb0iAS9PcfjMKtGpWQw9mXzJxrWD62kJCUqqLcyuI0+VRtJ3j20XembjF3kS20qELYdXft1vD/SPFVWVKMFOw==} + dev: true + /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -6850,46 +7085,41 @@ packages: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /lint-staged@13.2.3: - resolution: {integrity: sha512-zVVEXLuQIhr1Y7R7YAWx4TZLdvuzk7DnmrsTNL0fax6Z3jrpFcas+vKbzxhhvp6TA55m1SQuWkpzI1qbfDZbAg==} - engines: {node: ^14.13.1 || >=16.0.0} + /lint-staged@14.0.1: + resolution: {integrity: sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==} + engines: {node: ^16.14.0 || >=18.0.0} hasBin: true dependencies: - chalk: 5.2.0 - cli-truncate: 3.1.0 - commander: 10.0.1 + 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: 5.0.8 + listr2: 6.6.1 micromatch: 4.0.5 - normalize-path: 3.0.0 - object-inspect: 1.12.3 pidtree: 0.6.0 - string-argv: 0.3.1 + string-argv: 0.3.2 yaml: 2.3.1 transitivePeerDependencies: - enquirer - supports-color dev: true - /listr2@5.0.8: - resolution: {integrity: sha512-mC73LitKHj9w6v30nLNGPetZIlfpUniNSsxxrbaPcWOjDb92SHPzJPi/t+v1YC/lxKz/AJ9egOjww0qUuFxBpA==} - engines: {node: ^14.13.1 || >=16.0.0} + /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: 2.1.0 + cli-truncate: 3.1.0 colorette: 2.0.20 - log-update: 4.0.0 - p-map: 4.0.0 + eventemitter3: 5.0.1 + log-update: 5.0.1 rfdc: 1.3.0 - rxjs: 7.8.1 - through: 2.3.8 - wrap-ansi: 7.0.0 + wrap-ansi: 8.1.0 dev: true /lit-element@3.3.1: @@ -6998,14 +7228,15 @@ packages: is-unicode-supported: 1.3.0 dev: true - /log-update@4.0.0: - resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} - engines: {node: '>=10'} + /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: 4.3.2 - cli-cursor: 3.1.0 - slice-ansi: 4.0.0 - wrap-ansi: 6.2.0 + ansi-escapes: 5.0.0 + cli-cursor: 4.0.0 + slice-ansi: 5.0.0 + strip-ansi: 7.0.1 + wrap-ansi: 8.1.0 dev: true /loose-envify@1.4.0: @@ -7522,13 +7753,6 @@ packages: engines: {node: '>=6'} dev: true - /p-map@4.0.0: - resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} - engines: {node: '>=10'} - dependencies: - aggregate-error: 3.1.0 - dev: true - /p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} @@ -7741,12 +7965,6 @@ packages: hasBin: true dev: true - /prettier@3.0.3: - resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} - engines: {node: '>=14'} - hasBin: true - dev: true - /pretty-format@27.5.1: resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -8098,14 +8316,6 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - dev: true - /restore-cursor@4.0.0: resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -8165,12 +8375,6 @@ packages: dependencies: tslib: 1.14.1 - /rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - dependencies: - tslib: 2.5.0 - dev: true - /safe-array-concat@1.0.1: resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} engines: {node: '>=0.4'} @@ -8319,24 +8523,6 @@ packages: engines: {node: '>=12'} dev: true - /slice-ansi@3.0.0: - resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} - engines: {node: '>=8'} - dependencies: - ansi-styles: 4.3.0 - astral-regex: 2.0.0 - is-fullwidth-code-point: 3.0.0 - dev: true - - /slice-ansi@4.0.0: - resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - astral-regex: 2.0.0 - is-fullwidth-code-point: 3.0.0 - dev: true - /slice-ansi@5.0.0: resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} engines: {node: '>=12'} @@ -8474,6 +8660,11 @@ packages: engines: {node: '>=0.6.19'} dev: true + /string-argv@0.3.2: + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} + engines: {node: '>=0.6.19'} + dev: true + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -8719,6 +8910,15 @@ packages: engines: {node: '>=8'} dev: true + /ts-api-utils@1.0.3(typescript@5.2.2): + resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.2.2 + dev: true + /ts-morph@17.0.1: resolution: {integrity: sha512-10PkHyXmrtsTvZSL+cqtJLTgFXkU43Gd0JCc0Rw6GchWbqKe0Rwgt1v3ouobTZwQzF1mGhDeAlWYBMGRV7y+3g==} dependencies: @@ -8802,11 +9002,6 @@ packages: engines: {node: '>=10'} dev: true - /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - dev: true - /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} @@ -8817,6 +9012,11 @@ 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.0: resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} engines: {node: '>= 0.4'} @@ -9097,8 +9297,31 @@ packages: - zod dev: true - /viem@1.10.14(typescript@5.2.2)(zod@3.21.4): - resolution: {integrity: sha512-GRwFXLFr+/7+7nYYkABgHom3zMIE3DdxZ/DP78QlYWUanpjUV5IebxMOm6pfKD+ZAj3vf9YPAmz+WogjiUgDWw==} + /viem@1.14.0(typescript@5.2.2)(zod@3.21.4): + resolution: {integrity: sha512-4d+4/H3lnbkSAbrpQ15i1nBA7hne06joLFy3L3m0ZpMc+g+Zr3D4nuSTyeiqbHAYs9m2P9Kjap0HlyGkehasgg==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.9.4 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + '@types/ws': 8.5.5 + abitype: 0.9.8(typescript@5.2.2)(zod@3.21.4) + isomorphic-ws: 5.0.0(ws@8.13.0) + typescript: 5.2.2 + ws: 8.13.0(bufferutil@4.0.7)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + + /viem@1.15.1(typescript@5.2.2): + resolution: {integrity: sha512-lxk8wwUK7ZivYAUZ6pH+9Y6jjrfXXjafCOoASa4lw3ULUCT2BajU4SELarlxJQimpsFd7OZD4m4iEXYLF/bt6w==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -9386,8 +9609,41 @@ packages: - zod dev: true - /wagmi@1.4.2(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14): - resolution: {integrity: sha512-Cxu0LatB44stqHoqdc6dgsTb9woYH1bEquJFq9PbTkePmnRCvceAD4aFUREUTaBWzIBcouhFlanWweDzEnb3mg==} + /wagmi@1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.14.0): + resolution: {integrity: sha512-3LjbqqVRe6WW/WD07QCd5Itmo4nUfLsXuoc8F7nw9NslNUg8SFEb+g/jZ4665V0xh5ZRqPBJ7XOXASpdM2Y/5Q==} + peerDependencies: + react: '>=17.0.0' + typescript: '>=5.0.4' + viem: '>=0.3.35' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@tanstack/query-sync-storage-persister': 4.29.1 + '@tanstack/react-query': 4.29.1(react-dom@18.2.0)(react@18.2.0) + '@tanstack/react-query-persist-client': 4.29.1(@tanstack/react-query@4.29.1) + '@wagmi/core': 1.4.3(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.14.0) + abitype: 0.8.7(typescript@5.2.2)(zod@3.21.4) + react: 18.2.0 + typescript: 5.2.2 + use-sync-external-store: 1.2.0(react@18.2.0) + viem: 1.14.0(typescript@5.2.2)(zod@3.21.4) + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - '@types/react' + - bufferutil + - encoding + - immer + - lokijs + - react-dom + - react-native + - supports-color + - utf-8-validate + - zod + dev: true + + /wagmi@1.4.3(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1): + resolution: {integrity: sha512-3LjbqqVRe6WW/WD07QCd5Itmo4nUfLsXuoc8F7nw9NslNUg8SFEb+g/jZ4665V0xh5ZRqPBJ7XOXASpdM2Y/5Q==} peerDependencies: react: '>=17.0.0' typescript: '>=5.0.4' @@ -9399,12 +9655,12 @@ packages: '@tanstack/query-sync-storage-persister': 4.29.1 '@tanstack/react-query': 4.29.1(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query-persist-client': 4.29.1(@tanstack/react-query@4.29.1) - '@wagmi/core': 1.4.2(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.10.14) + '@wagmi/core': 1.4.3(@types/react@18.2.21)(react@18.2.0)(typescript@5.2.2)(viem@1.15.1) abitype: 0.8.7(typescript@5.2.2)(zod@3.21.4) react: 18.2.0 typescript: 5.2.2 use-sync-external-store: 1.2.0(react@18.2.0) - viem: 1.10.14(typescript@5.2.2)(zod@3.21.4) + viem: 1.15.1(typescript@5.2.2) transitivePeerDependencies: - '@react-native-async-storage/async-storage' - '@types/react' @@ -9417,6 +9673,7 @@ packages: - supports-color - utf-8-validate - zod + dev: false /wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} @@ -9560,6 +9817,15 @@ packages: strip-ansi: 6.0.1 dev: true + /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.0.1 + dev: true + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..a439461 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,20 @@ +{ + "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": ["packages", "examples"] +}