From 9bb3d73a42bd9370bfdee0047c176e53774a8d04 Mon Sep 17 00:00:00 2001 From: Stephanie Egbuonu <100955511+stephanniegb@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:46:49 +0100 Subject: [PATCH 1/3] fix: updated tokenId type in `create_account` func --- package-lock.json | 7 ++-- package.json | 6 ++- src/TokenboundClient.ts | 58 +++++++++++++++++++--------- src/constants/tokenboundAddresses.ts | 36 ++++++++++------- 4 files changed, 68 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 963357e..9f0d499 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "starknet-tokenbound-sdk-v3", + "name": "starknet-tba-sdk", "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "starknet-tokenbound-sdk-v3", + "name": "starknet-tba-sdk", "version": "0.2.0", "dependencies": { "@testing-library/jest-dom": "^5.17.0", @@ -21,7 +21,7 @@ "@types/testing-library__jest-dom": "^5.14.9", "eslint": "^8.50.0", "eslint-config-prettier": "^9.0.0", - "starknet": "^6.1.5", + "starknet": "^6.11.0", "typescript": "^5.2.2", "vite": "^5.2.7", "vite-plugin-dts": "^3.8.1" @@ -17242,7 +17242,6 @@ "resolved": "https://registry.npmjs.org/starknet/-/starknet-6.11.0.tgz", "integrity": "sha512-u50KrGDi9fbu1Ogu7ynwF/tSeFlp3mzOg1/Y5x50tYFICImo3OfY4lOz9OtYDk404HK4eUujKkhov9tG7GAKlg==", "dev": true, - "license": "MIT", "dependencies": { "@noble/curves": "~1.4.0", "@noble/hashes": "^1.4.0", diff --git a/package.json b/package.json index 0ee44b4..2b03e01 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,9 @@ "build": "tsc && vite build", "preview": "vite preview", "test": "react-scripts test", - "clean": "rm -rf node_modules/" + "clean": "rm -rf node_modules/", + "dev": "vite build --watch", + "format": "prettier --write --ignore-unknown" }, "eslintConfig": { "extends": [ @@ -52,11 +54,11 @@ ] }, "devDependencies": { - "starknet": "^6.1.5", "@types/react": "^18.2.21", "@types/testing-library__jest-dom": "^5.14.9", "eslint": "^8.50.0", "eslint-config-prettier": "^9.0.0", + "starknet": "^6.11.0", "typescript": "^5.2.2", "vite": "^5.2.7", "vite-plugin-dts": "^3.8.1" diff --git a/src/TokenboundClient.ts b/src/TokenboundClient.ts index 306a0e4..223ea94 100644 --- a/src/TokenboundClient.ts +++ b/src/TokenboundClient.ts @@ -65,25 +65,32 @@ export class TokenboundClient { this.chain_id = chain_id; this.version = version; - this.registryAddress = registryAddress ?? ERC_6551_DEPLOYMENTS[chain_id][version].REGISTRY.ADDRESS; - this.implementationAddress = implementationAddress ?? ERC_6551_DEPLOYMENTS[chain_id][version].IMPLEMENTATION.ADDRESS; + this.registryAddress = + registryAddress ?? + ERC_6551_DEPLOYMENTS[chain_id][version].REGISTRY.ADDRESS; + this.implementationAddress = + implementationAddress ?? + ERC_6551_DEPLOYMENTS[chain_id][version].IMPLEMENTATION.ADDRESS; this.registryAbi = ERC_6551_DEPLOYMENTS[chain_id][version].REGISTRY.ABI; - this.accountAbi = ERC_6551_DEPLOYMENTS[chain_id][version].IMPLEMENTATION.ABI; + this.accountAbi = + ERC_6551_DEPLOYMENTS[chain_id][version].IMPLEMENTATION.ABI; - const isV2 = (version && version === TBAVersion.V2); + const isV2 = version && version === TBAVersion.V2; if (isV2) { - this.supportsV3 = false + this.supportsV3 = false; } } public async getAccount(params: GetAccountOptions) { - const { tokenContract, tokenId, salt } = params; const provider = getProvider(this.jsonRPC); - const contract = new Contract(this.registryAbi, this.registryAddress, provider); - console.log(this.version) + const contract = new Contract( + this.registryAbi, + this.registryAddress, + provider + ); try { const payload = [ @@ -96,6 +103,7 @@ export class TokenboundClient { if (this.supportsV3) { payload.push(this.chain_id); } + const address: BigNumberish = await contract.get_account(...payload); return address; } catch (error) { @@ -103,30 +111,43 @@ export class TokenboundClient { } } - public async createAccount( - { tokenContract, tokenId, salt }: CreateAccountOptions - ): Promise { - const contract = new Contract(this.registryAbi, this.registryAddress, this.account); + public async createAccount({ + tokenContract, + tokenId, + salt, + }: CreateAccountOptions): Promise { + console.log("SDK Account", this.account); + + const contract = new Contract( + this.registryAbi, + this.registryAddress, + this.account + ); const salt_arg = salt || tokenId; try { const payload = [ this.implementationAddress, tokenContract, - tokenId, + cairo.uint256(tokenId), salt_arg, ]; if (this.supportsV3) { payload.push(this.chain_id); } + const result = await contract.create_account(...payload); - const account = await this.getAccount({ tokenContract, tokenId, salt: salt_arg }); + + const account = await this.getAccount({ + tokenContract, + tokenId, + salt: salt_arg, + }); return { transaction_hash: result?.transaction_hash.toString(), account: num.toHex(account), }; - } catch (error) { throw error; } @@ -245,7 +266,7 @@ export class TokenboundClient { let { tbaAddress, owner, permissionedAddress } = options; const contract = new Contract(this.accountAbi, tbaAddress, this.account); try { - if (!this.supportsV3) return null + if (!this.supportsV3) return null; return await contract.has_permission(owner, permissionedAddress); } catch (error) { throw error; @@ -256,7 +277,7 @@ export class TokenboundClient { let { tbaAddress, permissionedAddresses, permissions } = options; const contract = new Contract(this.accountAbi, tbaAddress, this.account); try { - if (!this.supportsV3) return null + if (!this.supportsV3) return null; return await contract.set_permission(permissionedAddresses, permissions); } catch (error) { throw error; @@ -283,12 +304,11 @@ export class TokenboundClient { } } - public async upgrade(options: UpgradeOptions) { let { tbaAddress, newClassHash } = options; const contract = new Contract(this.accountAbi, tbaAddress, this.account); try { - if (!this.supportsV3) return null + if (!this.supportsV3) return null; return await contract.upgrade(newClassHash); } catch (error) { throw error; diff --git a/src/constants/tokenboundAddresses.ts b/src/constants/tokenboundAddresses.ts index 3609da4..46efdc0 100644 --- a/src/constants/tokenboundAddresses.ts +++ b/src/constants/tokenboundAddresses.ts @@ -1,8 +1,8 @@ -import erc6551AccountAbiV2 from "../abis/v2/account.abi.json" -import erc6551RegistryAbiV2 from "../abis/v2/registry.abi.json" -import erc6551AccountV3ABI from "../abis/v3/account.abi.json" -import erc6551RegistryV3ABI from "../abis/v3/registry.abi.json" -import { Abi } from "starknet" +import erc6551AccountAbiV2 from "../abis/v2/account.abi.json"; +import erc6551RegistryAbiV2 from "../abis/v2/registry.abi.json"; +import erc6551AccountV3ABI from "../abis/v3/account.abi.json"; +import erc6551RegistryV3ABI from "../abis/v3/registry.abi.json"; +import { Abi } from "starknet"; type Standard6551Deployment = { ADDRESS: string; @@ -24,21 +24,25 @@ export const ERC_6551_DEPLOYMENTS: Standard6551Deployments = { SN_MAIN: { V2: { IMPLEMENTATION: { - ADDRESS: '0x45d67b8590561c9b54e14dd309c9f38c4e2c554dd59414021f9d079811621bd', + ADDRESS: + "0x45d67b8590561c9b54e14dd309c9f38c4e2c554dd59414021f9d079811621bd", ABI: erc6551AccountAbiV2 as Abi, }, REGISTRY: { - ADDRESS: '0x7f63abcad960f980c12d650b2cc4c27a8f63ee1f6eb36ea8286a946a2330c1b', + ADDRESS: + "0x7f63abcad960f980c12d650b2cc4c27a8f63ee1f6eb36ea8286a946a2330c1b", ABI: erc6551RegistryAbiV2 as Abi, }, }, V3: { IMPLEMENTATION: { - ADDRESS: '', + ADDRESS: + "0x3d311ba322e1f900d669586b191a2a82c50f6cb850563a8e1c01c7bac9be7b0", ABI: erc6551AccountV3ABI as Abi, }, REGISTRY: { - ADDRESS: '', + ADDRESS: + "0x572a25dbc65462ca99f8f1ea906879a8de3abaeadd2fb935fdb59950c767516", ABI: erc6551RegistryV3ABI as Abi, }, }, @@ -47,23 +51,27 @@ export const ERC_6551_DEPLOYMENTS: Standard6551Deployments = { SN_SEPOLIA: { V2: { IMPLEMENTATION: { - ADDRESS: '0x45d67b8590561c9b54e14dd309c9f38c4e2c554dd59414021f9d079811621bd', + ADDRESS: + "0x45d67b8590561c9b54e14dd309c9f38c4e2c554dd59414021f9d079811621bd", ABI: erc6551AccountAbiV2 as Abi, }, REGISTRY: { - ADDRESS: '0x4101d3fa033024654083dd982273a300cb019b8cb96dd829267a4daf59f7b7e', + ADDRESS: + "0x4101d3fa033024654083dd982273a300cb019b8cb96dd829267a4daf59f7b7e", ABI: erc6551RegistryAbiV2 as Abi, }, }, V3: { IMPLEMENTATION: { - ADDRESS: '0x29d2a1b11dd97289e18042502f11356133a2201dd19e716813fb01fbee9e9a4', + ADDRESS: + "0x29d2a1b11dd97289e18042502f11356133a2201dd19e716813fb01fbee9e9a4", ABI: erc6551AccountV3ABI as Abi, }, REGISTRY: { - ADDRESS: '0x23a6d289a1e5067d905e195056c322381a78a3bc9ab3b0480f542fad87cc580', + ADDRESS: + "0x23a6d289a1e5067d905e195056c322381a78a3bc9ab3b0480f542fad87cc580", ABI: erc6551RegistryV3ABI as Abi, }, }, }, -}; \ No newline at end of file +}; From 30eb0d7cf1e3f7b4447966063f7eac9f66f907fd Mon Sep 17 00:00:00 2001 From: Stephanie Egbuonu <100955511+stephanniegb@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:53:16 +0100 Subject: [PATCH 2/3] refactor: formatted documents and added prettier --- .prettierrc | 6 + README.md | 80 ++- .../README.md | 2 +- .../src/App.tsx | 10 +- .../src/components/StarknetProvider.tsx | 51 +- .../src/index.css | 6 +- .../src/index.tsx | 10 +- .../tailwind.config.js | 2 +- .../tsconfig.json | 38 +- examples/sdk-starknetjs/README.md | 2 +- examples/sdk-starknetjs/src/Address.tsx | 19 +- examples/sdk-starknetjs/src/App.tsx | 106 ++- examples/sdk-starknetjs/src/index.css | 6 +- examples/sdk-starknetjs/src/index.tsx | 10 +- examples/sdk-starknetjs/tailwind.config.js | 2 +- examples/sdk-starknetjs/tsconfig.json | 38 +- package-lock.json | 20 +- package.json | 3 +- src/abis/token.abi.json | 678 +++++++++--------- src/abis/v2/account.abi.json | 301 +++++++- src/abis/v2/registry.abi.json | 99 ++- src/abis/v3/account.abi.json | 488 ++++++++++++- src/abis/v3/registry.abi.json | 88 ++- src/constants/chainId.ts | 6 +- src/constants/index.ts | 6 +- src/constants/version.ts | 6 +- src/index.ts | 70 +- src/types/TokenboundClient.ts | 5 +- src/types/index.ts | 22 +- src/types/walletClient.ts | 6 +- src/utils/account.ts | 20 +- src/utils/index.ts | 4 +- src/utils/provider.ts | 10 +- tsconfig.json | 2 +- vite.config.ts | 16 +- 35 files changed, 1623 insertions(+), 615 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..8707aca --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "singleQuote": false, + "trailingComma": "es5", + "semi": true, + "tabWidth": 2 +} diff --git a/README.md b/README.md index a4f2042..a114393 100644 --- a/README.md +++ b/README.md @@ -20,35 +20,47 @@ Packages `src` - SDK client for all projects, signing enabled via Starknet.js. ## Examples + - `examples/sdk-starknetjs` - An example app using the tokenbound SDK in a react project with starknetjs - `examples/sdk-starknetjs-starknetkit-starknet-react` - An example app using the tokenbound SDK in a react project with starknetjs, starknetkit and starknet-react Development Clone repository and install dependencies: + # clone the repo + ``` git clone ``` + # install dependencies + ``` npm install ``` + # build packages + ``` npm run build ``` + NOTE: Any local changes to SDK methods in `TokenboundClient.ts` require a rebuild to be useable in the example apps in /example ## API Reference + ### TokenboundClient + The TokenboundClient class provides an interface for interacting with tokenbound accounts, enabling operations like account creation, transaction execution, token transfers (including ERC-721, ERC-1155, and ERC-20 tokens), and message signing. The client is instantiated with an object containing two parameters: -#### Parameter -One of `account ` or `walletClient ` is mandatory. +#### Parameter + +One of `account ` or `walletClient ` is mandatory. ### Standard configuration with WalletClient + To configure tokenbound using walletClient: ```js @@ -70,28 +82,31 @@ const options = { const tokenbound = new TokenboundClient(options) ``` -### Standard configuration with Account signer +### Standard configuration with Account signer + Refer to the starknet-react documentation, for notes on configuring your StarknetProvider. ```js -import { useAccount, useConnect } from '@starknet-react/core'; +import { useAccount, useConnect } from "@starknet-react/core"; const options = { account: account, registryAddress: registryAddress, implementationAddress: implementationAddress, - jsonRPC: `https://starknet-mainnet.g.alchemy.com/v2/${process.env.REACT_APP_ALCHEMY_API_KEY}` -} + jsonRPC: `https://starknet-mainnet.g.alchemy.com/v2/${process.env.REACT_APP_ALCHEMY_API_KEY}`, +}; -const tokenbound = new TokenboundClient(options) +const tokenbound = new TokenboundClient(options); ``` For easy reference, we've prepared code examples for a few simple SDK interactions. ## TokenboundClient SDK Methods + The `TokenboundClient` enables creation of and interaction with Tokenbound accounts: ### createAccount + Creates a tokenbound account for an NFT. createAccount adds the account to the registry and initializes it for use. Prior to account creation, the address can already receive assets. Deploying the account allows the NFT's owner to interact with the account. ```js @@ -100,21 +115,22 @@ const deployAccount = async () => { await tokenbound.createAccount({ tokenContract: tokenContract, tokenId: tokenId, - salt: "3000000000" - }) + salt: "3000000000", + }); + } catch (error) { + console.log(error); } - catch (error) { - console.log(error) - } -} +}; ``` -Parameter Description Type -- tokenContract: The address of the token contract. `string` -- tokenId: The token ID. `string` -- salt: The salt used to create a unique account address (optional) `number` +Parameter Description Type + +- tokenContract: The address of the token contract. `string` +- tokenId: The token ID. `string` +- salt: The salt used to create a unique account address (optional) `number` ### getAccount + Gets the tokenbound account address for an NFT. Returns the tokenbound account address for a given token contract and token ID. @@ -124,17 +140,19 @@ const getAccount = async () => { const account = await tokenbound.getAccount({ tokenContract: tokenContract, tokenId: tokenId, - salt: "3000000000" - }) -} + salt: "3000000000", + }); +}; ``` -Parameter Description Type -- tokenContract: The address of the token contract. string -- tokenId: The token ID. string -- salt: The salt used when the account was created (optional) number +Parameter Description Type + +- tokenContract: The address of the token contract. string +- tokenId: The token ID. string +- salt: The salt used when the account was created (optional) number ### checkAccountDeployment + Check if the tokenbound account address has been activated using createAccount. Returns a boolean and classHash indicating if a tokenbound account has been deployed (created) at the accountAddress @@ -144,15 +162,15 @@ const getDeploymentStatus = async () => { const status = await tokenbound.checkAccountDeployment({ tokenContract, tokenId, - salt: "3000000000" - }) - setDeployStatus(status?.deployed) - setAccountClassHash(status?.classHash) -} + salt: "3000000000", + }); + setDeployStatus(status?.deployed); + setAccountClassHash(status?.classHash); +}; ``` -Parameter Description Type +Parameter Description Type + - tokenContract: The token contract address - tokenId: The token ID - salt - diff --git a/examples/sdk-starknetjs-starknetkit-starknet-react/README.md b/examples/sdk-starknetjs-starknetkit-starknet-react/README.md index 9c0e96f..eca0bc6 100644 --- a/examples/sdk-starknetjs-starknetkit-starknet-react/README.md +++ b/examples/sdk-starknetjs-starknetkit-starknet-react/README.md @@ -16,4 +16,4 @@ Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in your browser. The page will reload when you make changes.\ -You may also see any lint errors in the console. \ No newline at end of file +You may also see any lint errors in the console. diff --git a/examples/sdk-starknetjs-starknetkit-starknet-react/src/App.tsx b/examples/sdk-starknetjs-starknetkit-starknet-react/src/App.tsx index c9451f0..ccb5c50 100644 --- a/examples/sdk-starknetjs-starknetkit-starknet-react/src/App.tsx +++ b/examples/sdk-starknetjs-starknetkit-starknet-react/src/App.tsx @@ -1,14 +1,14 @@ -import React from 'react'; -import './App.css'; +import React from "react"; +import "./App.css"; import StarknetProvider from "./components/StarknetProvider"; -import Home from 'components/Home'; +import Home from "components/Home"; function App() { return ( - < Home/> + ); } -export default App; \ No newline at end of file +export default App; diff --git a/examples/sdk-starknetjs-starknetkit-starknet-react/src/components/StarknetProvider.tsx b/examples/sdk-starknetjs-starknetkit-starknet-react/src/components/StarknetProvider.tsx index d9b45cd..7063863 100644 --- a/examples/sdk-starknetjs-starknetkit-starknet-react/src/components/StarknetProvider.tsx +++ b/examples/sdk-starknetjs-starknetkit-starknet-react/src/components/StarknetProvider.tsx @@ -1,28 +1,33 @@ import React from "react"; import { mainnet } from "@starknet-react/chains"; -import { StarknetConfig, publicProvider, useInjectedConnectors, argent, braavos, starkscan } from "@starknet-react/core"; +import { + StarknetConfig, + publicProvider, + useInjectedConnectors, + argent, + braavos, + starkscan, +} from "@starknet-react/core"; function StarknetProvider({ children }: any) { - const { connectors: injected } = useInjectedConnectors({ - recommended: [argent(), braavos()], - includeRecommended: 'always', - }) - - const connectors = [ - ...injected, - ] - - return ( - - {children} - - ) - } + const { connectors: injected } = useInjectedConnectors({ + recommended: [argent(), braavos()], + includeRecommended: "always", + }); - export default StarknetProvider; \ No newline at end of file + const connectors = [...injected]; + + return ( + + {children} + + ); +} + +export default StarknetProvider; diff --git a/examples/sdk-starknetjs-starknetkit-starknet-react/src/index.css b/examples/sdk-starknetjs-starknetkit-starknet-react/src/index.css index dc02072..3900d34 100644 --- a/examples/sdk-starknetjs-starknetkit-starknet-react/src/index.css +++ b/examples/sdk-starknetjs-starknetkit-starknet-react/src/index.css @@ -4,10 +4,10 @@ body { margin: 0; - padding: 0 + padding: 0; } code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; -} \ No newline at end of file +} diff --git a/examples/sdk-starknetjs-starknetkit-starknet-react/src/index.tsx b/examples/sdk-starknetjs-starknetkit-starknet-react/src/index.tsx index 6e41963..e6300ab 100644 --- a/examples/sdk-starknetjs-starknetkit-starknet-react/src/index.tsx +++ b/examples/sdk-starknetjs-starknetkit-starknet-react/src/index.tsx @@ -1,9 +1,9 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import App from './App'; +import React from "react"; +import ReactDOM from "react-dom/client"; +import "./index.css"; +import App from "./App"; -const root = ReactDOM.createRoot(document.getElementById('root')!); +const root = ReactDOM.createRoot(document.getElementById("root")!); root.render( diff --git a/examples/sdk-starknetjs-starknetkit-starknet-react/tailwind.config.js b/examples/sdk-starknetjs-starknetkit-starknet-react/tailwind.config.js index 47a175a..86011d0 100644 --- a/examples/sdk-starknetjs-starknetkit-starknet-react/tailwind.config.js +++ b/examples/sdk-starknetjs-starknetkit-starknet-react/tailwind.config.js @@ -5,4 +5,4 @@ module.exports = { extend: {}, }, plugins: [], -} \ No newline at end of file +}; diff --git a/examples/sdk-starknetjs-starknetkit-starknet-react/tsconfig.json b/examples/sdk-starknetjs-starknetkit-starknet-react/tsconfig.json index ada5872..d4de449 100644 --- a/examples/sdk-starknetjs-starknetkit-starknet-react/tsconfig.json +++ b/examples/sdk-starknetjs-starknetkit-starknet-react/tsconfig.json @@ -1,20 +1,20 @@ { - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "module": "ES2015", - "moduleResolution": "Bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "react", - "baseUrl": "./src", - }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "dist"] -} \ No newline at end of file + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ES2015", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "react", + "baseUrl": "./src" + }, + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["node_modules", "dist"] +} diff --git a/examples/sdk-starknetjs/README.md b/examples/sdk-starknetjs/README.md index c098e72..25d1ca5 100644 --- a/examples/sdk-starknetjs/README.md +++ b/examples/sdk-starknetjs/README.md @@ -16,4 +16,4 @@ Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in your browser. The page will reload when you make changes.\ -You may also see any lint errors in the console. \ No newline at end of file +You may also see any lint errors in the console. diff --git a/examples/sdk-starknetjs/src/Address.tsx b/examples/sdk-starknetjs/src/Address.tsx index 82c9412..0331e01 100644 --- a/examples/sdk-starknetjs/src/Address.tsx +++ b/examples/sdk-starknetjs/src/Address.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React from "react"; interface FormatAddressProps { address: string | undefined; @@ -11,17 +11,24 @@ const FormatAddress: React.FC = ({ address }) => { const copyToClipboard = (): void => { navigator.clipboard.writeText(address ?? ""); - alert('Address copied to clipboard!'); + alert("Address copied to clipboard!"); }; return ( -
- {shortenAddress(address ?? "")} -
); }; -export default FormatAddress; \ No newline at end of file +export default FormatAddress; diff --git a/examples/sdk-starknetjs/src/App.tsx b/examples/sdk-starknetjs/src/App.tsx index aae9ec6..8ea9d0e 100644 --- a/examples/sdk-starknetjs/src/App.tsx +++ b/examples/sdk-starknetjs/src/App.tsx @@ -6,12 +6,11 @@ import { WalletClient, Call, TBAChainID, - TBAVersion + TBAVersion, } from "starknet-tokenbound-sdk"; import FormatAddress from "./Address"; function App() { - const [account, setAccount] = useState(""); const [deployStatus, setDeployStatus] = useState(); const [accountClassHash, setAccountClassHash] = useState(); @@ -25,14 +24,16 @@ function App() { // replace with your address and priv key const walletClient: WalletClient = { - address: "0x07da6cca38Afcf430ea53581F2eFD957bCeDfF798211309812181C555978DCC3", + address: + "0x07da6cca38Afcf430ea53581F2eFD957bCeDfF798211309812181C555978DCC3", privateKey: process.env.REACT_APP_PRIVATE_KEY!, }; - const V2_SALT = "240000000000" + const V2_SALT = "240000000000"; // replace with your own permissioned address - const testPermissionedAddr: string = "0x04F1A720BC8D441139B9C27dff5Be5a740b310c8425abAC8da72C0609014E933" + const testPermissionedAddr: string = + "0x04F1A720BC8D441139B9C27dff5Be5a740b310c8425abAC8da72C0609014E933"; const options = { walletClient: walletClient, @@ -43,11 +44,11 @@ function App() { const tokenbound = new TokenboundClient(options); // replace with your test NFT - const tokenContract = "0x0000003697660a0981d734780731949ecb2b4a38d6a58fc41629ed611e8defda"; + const tokenContract = + "0x0000003697660a0981d734780731949ecb2b4a38d6a58fc41629ed611e8defda"; const tokenId = "50"; const url = `https://sepolia.starkscan.co/contract/${account}`; - const deployAccount = async () => { try { const result = await tokenbound.createAccount({ @@ -138,7 +139,7 @@ function App() { try { await tokenbound.lock({ tbaAddress: account, - lockUntill: 1728057939 + lockUntill: 1728057939, }); alert("Account was locked successfully"); } catch (error) { @@ -150,8 +151,9 @@ function App() { const upgradeAccount = async () => { try { await tokenbound.upgrade({ - newClassHash: "0x45d67b8590561c9b54e14dd309c9f38c4e2c554dd59414021f9d079811621bd", - tbaAddress: account + newClassHash: + "0x45d67b8590561c9b54e14dd309c9f38c4e2c554dd59414021f9d079811621bd", + tbaAddress: account, }); alert("Account was upgraded successfully"); } catch (error) { @@ -159,13 +161,12 @@ function App() { } }; - const setPermissions = async () => { try { await tokenbound.setPermission({ tbaAddress: account, permissionedAddresses: [testPermissionedAddr], - permissions: [true] + permissions: [true], }); alert("Permissions added successfully"); } catch (error) { @@ -173,25 +174,24 @@ function App() { } }; + useEffect(() => { + if (account && deployStatus) { + const getAccountOwner = async () => { + const nftowner = await tokenbound.getOwner({ + tbaAddress: account, + }); + setOwner(num.toHex(nftowner)); + }; + const getNFTOwner = async () => { + const nftowner = await tokenbound.getOwnerNFT(account as string); + setNftOwner(num.toHex(nftowner[0])); + setNftOwnerId(nftowner[1].toString()); + }; - useEffect(() => { - if(account && deployStatus){ - const getAccountOwner = async () => { - const nftowner = await tokenbound.getOwner({ - tbaAddress: account, - }); - setOwner(num.toHex(nftowner)); - }; - const getNFTOwner = async () => { - const nftowner = await tokenbound.getOwnerNFT(account as string); - setNftOwner(num.toHex(nftowner[0])); - setNftOwnerId(nftowner[1].toString()); - }; - - getAccountOwner() - getNFTOwner() - } - }, [account, deployStatus]) + getAccountOwner(); + getNFTOwner(); + } + }, [account, deployStatus]); useEffect(() => { if (account && deployStatus) { @@ -199,28 +199,25 @@ function App() { const isLocked = await tokenbound.isLocked({ tbaAddress: account, }); - setLockStatus(Boolean(isLocked[0])) - setTimeUntilUnlocks(isLocked[1].toString()) + setLockStatus(Boolean(isLocked[0])); + setTimeUntilUnlocks(isLocked[1].toString()); }; const getAccountPermissions = async () => { const permission = await tokenbound.getPermission({ tbaAddress: account, owner: owner, - permissionedAddress: testPermissionedAddr + permissionedAddress: testPermissionedAddr, }); if (permission != null) { - setPermissionStatus(permission) + setPermissionStatus(permission); } - } + }; getAccountPermissions(); getLockStatus(); - - }; + } }, [account, owner, deployStatus]); - - useEffect(() => { const getAccount = async () => { const account = await tokenbound.getAccount({ @@ -228,7 +225,7 @@ function App() { tokenId: tokenId, salt: V2_SALT, }); - + setAccount(num.toHexString(account)); }; @@ -247,25 +244,25 @@ function App() { getDeploymentStatus(); }, [tokenContract]); - - - - return (

Testing Token bound SDK

-

NFT Contract:

+

NFT Contract:

-
-

Token ID: {tokenId}

-
+

+ Token ID: {tokenId} +

+

Tokenbound Account:

- + + {" "} + +

Deployed: [Status: {deployStatus?.toString()}] @@ -275,12 +272,11 @@ function App() {

- Locked Status: [Status: {lockStatus?.toString()}, Time until unlocks:{" "} - {timeUntilUnlocks} secs] + Locked Status: [Status: {lockStatus?.toString()}, Time until + unlocks: {timeUntilUnlocks} secs]

Permission Status: [Status: {permissionStatus?.toString()}] -

Account Owner:

@@ -296,8 +292,6 @@ function App() {

NFT Owner ID:

- -
@@ -328,7 +322,6 @@ function App() { send NFT - -
diff --git a/examples/sdk-starknetjs/src/index.css b/examples/sdk-starknetjs/src/index.css index dc02072..3900d34 100644 --- a/examples/sdk-starknetjs/src/index.css +++ b/examples/sdk-starknetjs/src/index.css @@ -4,10 +4,10 @@ body { margin: 0; - padding: 0 + padding: 0; } code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; -} \ No newline at end of file +} diff --git a/examples/sdk-starknetjs/src/index.tsx b/examples/sdk-starknetjs/src/index.tsx index 6e41963..e6300ab 100644 --- a/examples/sdk-starknetjs/src/index.tsx +++ b/examples/sdk-starknetjs/src/index.tsx @@ -1,9 +1,9 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import App from './App'; +import React from "react"; +import ReactDOM from "react-dom/client"; +import "./index.css"; +import App from "./App"; -const root = ReactDOM.createRoot(document.getElementById('root')!); +const root = ReactDOM.createRoot(document.getElementById("root")!); root.render( diff --git a/examples/sdk-starknetjs/tailwind.config.js b/examples/sdk-starknetjs/tailwind.config.js index 47a175a..86011d0 100644 --- a/examples/sdk-starknetjs/tailwind.config.js +++ b/examples/sdk-starknetjs/tailwind.config.js @@ -5,4 +5,4 @@ module.exports = { extend: {}, }, plugins: [], -} \ No newline at end of file +}; diff --git a/examples/sdk-starknetjs/tsconfig.json b/examples/sdk-starknetjs/tsconfig.json index da40ec8..11b8949 100644 --- a/examples/sdk-starknetjs/tsconfig.json +++ b/examples/sdk-starknetjs/tsconfig.json @@ -1,20 +1,20 @@ { - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "react", - "baseUrl": "./src", - }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "dist"] -} \ No newline at end of file + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "react", + "baseUrl": "./src" + }, + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["node_modules", "dist"] +} diff --git a/package-lock.json b/package-lock.json index 9f0d499..ce0e79f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "starknet-tba-sdk", + "name": "starknet-tokenbound-sdk", "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "starknet-tba-sdk", + "name": "starknet-tokenbound-sdk", "version": "0.2.0", "dependencies": { "@testing-library/jest-dom": "^5.17.0", @@ -21,6 +21,7 @@ "@types/testing-library__jest-dom": "^5.14.9", "eslint": "^8.50.0", "eslint-config-prettier": "^9.0.0", + "prettier": "3.3.3", "starknet": "^6.11.0", "typescript": "^5.2.2", "vite": "^5.2.7", @@ -15777,6 +15778,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/package.json b/package.json index 2b03e01..ec61045 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "test": "react-scripts test", "clean": "rm -rf node_modules/", "dev": "vite build --watch", - "format": "prettier --write --ignore-unknown" + "format": "prettier --write '**/*.{js,jsx,ts,tsx,json,css,md}'" }, "eslintConfig": { "extends": [ @@ -58,6 +58,7 @@ "@types/testing-library__jest-dom": "^5.14.9", "eslint": "^8.50.0", "eslint-config-prettier": "^9.0.0", + "prettier": "3.3.3", "starknet": "^6.11.0", "typescript": "^5.2.2", "vite": "^5.2.7", diff --git a/src/abis/token.abi.json b/src/abis/token.abi.json index 15a7983..50cbbc9 100644 --- a/src/abis/token.abi.json +++ b/src/abis/token.abi.json @@ -1,340 +1,340 @@ [ - { - "members": [ - { - "name": "low", - "offset": 0, - "type": "felt" - }, - { - "name": "high", - "offset": 1, - "type": "felt" - } - ], - "name": "Uint256", - "size": 2, - "type": "struct" - }, - { - "data": [ - { - "name": "from_", - "type": "felt" - }, - { - "name": "to", - "type": "felt" - }, - { - "name": "value", - "type": "Uint256" - } - ], - "keys": [], - "name": "Transfer", - "type": "event" - }, - { - "data": [ - { - "name": "owner", - "type": "felt" - }, - { - "name": "spender", - "type": "felt" - }, - { - "name": "value", - "type": "Uint256" - } - ], - "keys": [], - "name": "Approval", - "type": "event" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "name", - "type": "felt" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "symbol", - "type": "felt" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "totalSupply", - "type": "Uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "decimals", - "type": "felt" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "account", - "type": "felt" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "balance", - "type": "Uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "owner", - "type": "felt" - }, - { - "name": "spender", - "type": "felt" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "remaining", - "type": "Uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "permittedMinter", - "outputs": [ - { - "name": "minter", - "type": "felt" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialized", - "outputs": [ - { - "name": "res", - "type": "felt" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "get_version", - "outputs": [ - { - "name": "version", - "type": "felt" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "get_identity", - "outputs": [ - { - "name": "identity", - "type": "felt" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "init_vector_len", - "type": "felt" - }, - { - "name": "init_vector", - "type": "felt*" - } - ], - "name": "initialize", - "outputs": [], - "type": "function" - }, - { - "inputs": [ - { - "name": "recipient", - "type": "felt" - }, - { - "name": "amount", - "type": "Uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "success", - "type": "felt" - } - ], - "type": "function" - }, - { - "inputs": [ - { - "name": "sender", - "type": "felt" - }, - { - "name": "recipient", - "type": "felt" - }, - { - "name": "amount", - "type": "Uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "success", - "type": "felt" - } - ], - "type": "function" - }, - { - "inputs": [ - { - "name": "spender", - "type": "felt" - }, - { - "name": "amount", - "type": "Uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "success", - "type": "felt" - } - ], - "type": "function" - }, - { - "inputs": [ - { - "name": "spender", - "type": "felt" - }, - { - "name": "added_value", - "type": "Uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "name": "success", - "type": "felt" - } - ], - "type": "function" - }, - { - "inputs": [ - { - "name": "spender", - "type": "felt" - }, - { - "name": "subtracted_value", - "type": "Uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "name": "success", - "type": "felt" - } - ], - "type": "function" - }, - { - "inputs": [ - { - "name": "recipient", - "type": "felt" - }, - { - "name": "amount", - "type": "Uint256" - } - ], - "name": "permissionedMint", - "outputs": [], - "type": "function" - }, - { - "inputs": [ - { - "name": "account", - "type": "felt" - }, - { - "name": "amount", - "type": "Uint256" - } - ], - "name": "permissionedBurn", - "outputs": [], - "type": "function" - } - ] \ No newline at end of file + { + "members": [ + { + "name": "low", + "offset": 0, + "type": "felt" + }, + { + "name": "high", + "offset": 1, + "type": "felt" + } + ], + "name": "Uint256", + "size": 2, + "type": "struct" + }, + { + "data": [ + { + "name": "from_", + "type": "felt" + }, + { + "name": "to", + "type": "felt" + }, + { + "name": "value", + "type": "Uint256" + } + ], + "keys": [], + "name": "Transfer", + "type": "event" + }, + { + "data": [ + { + "name": "owner", + "type": "felt" + }, + { + "name": "spender", + "type": "felt" + }, + { + "name": "value", + "type": "Uint256" + } + ], + "keys": [], + "name": "Approval", + "type": "event" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "name", + "type": "felt" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "symbol", + "type": "felt" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "totalSupply", + "type": "Uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "decimals", + "type": "felt" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "account", + "type": "felt" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "balance", + "type": "Uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "owner", + "type": "felt" + }, + { + "name": "spender", + "type": "felt" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "remaining", + "type": "Uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "permittedMinter", + "outputs": [ + { + "name": "minter", + "type": "felt" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialized", + "outputs": [ + { + "name": "res", + "type": "felt" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "get_version", + "outputs": [ + { + "name": "version", + "type": "felt" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "get_identity", + "outputs": [ + { + "name": "identity", + "type": "felt" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "init_vector_len", + "type": "felt" + }, + { + "name": "init_vector", + "type": "felt*" + } + ], + "name": "initialize", + "outputs": [], + "type": "function" + }, + { + "inputs": [ + { + "name": "recipient", + "type": "felt" + }, + { + "name": "amount", + "type": "Uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "success", + "type": "felt" + } + ], + "type": "function" + }, + { + "inputs": [ + { + "name": "sender", + "type": "felt" + }, + { + "name": "recipient", + "type": "felt" + }, + { + "name": "amount", + "type": "Uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "success", + "type": "felt" + } + ], + "type": "function" + }, + { + "inputs": [ + { + "name": "spender", + "type": "felt" + }, + { + "name": "amount", + "type": "Uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "success", + "type": "felt" + } + ], + "type": "function" + }, + { + "inputs": [ + { + "name": "spender", + "type": "felt" + }, + { + "name": "added_value", + "type": "Uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "name": "success", + "type": "felt" + } + ], + "type": "function" + }, + { + "inputs": [ + { + "name": "spender", + "type": "felt" + }, + { + "name": "subtracted_value", + "type": "Uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "name": "success", + "type": "felt" + } + ], + "type": "function" + }, + { + "inputs": [ + { + "name": "recipient", + "type": "felt" + }, + { + "name": "amount", + "type": "Uint256" + } + ], + "name": "permissionedMint", + "outputs": [], + "type": "function" + }, + { + "inputs": [ + { + "name": "account", + "type": "felt" + }, + { + "name": "amount", + "type": "Uint256" + } + ], + "name": "permissionedBurn", + "outputs": [], + "type": "function" + } +] diff --git a/src/abis/v2/account.abi.json b/src/abis/v2/account.abi.json index eb330e6..91783b3 100644 --- a/src/abis/v2/account.abi.json +++ b/src/abis/v2/account.abi.json @@ -1 +1,300 @@ -[{"type":"impl","name":"UpgradeableImpl","interface_name":"token_bound_accounts::interfaces::IUpgradeable::IUpgradeable"},{"type":"interface","name":"token_bound_accounts::interfaces::IUpgradeable::IUpgradeable","items":[{"type":"function","name":"upgrade","inputs":[{"name":"new_class_hash","type":"core::starknet::class_hash::ClassHash"}],"outputs":[],"state_mutability":"external"}]},{"type":"impl","name":"AccountImpl","interface_name":"token_bound_accounts::interfaces::IAccount::IAccount"},{"type":"struct","name":"core::array::Span::","members":[{"name":"snapshot","type":"@core::array::Array::"}]},{"type":"struct","name":"core::starknet::account::Call","members":[{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"selector","type":"core::felt252"},{"name":"calldata","type":"core::array::Span::"}]},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"enum","name":"core::bool","variants":[{"name":"False","type":"()"},{"name":"True","type":"()"}]},{"type":"interface","name":"token_bound_accounts::interfaces::IAccount::IAccount","items":[{"type":"function","name":"is_valid_signature","inputs":[{"name":"hash","type":"core::felt252"},{"name":"signature","type":"core::array::Span::"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"is_valid_signer","inputs":[{"name":"signer","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"__validate__","inputs":[{"name":"calls","type":"core::array::Array::"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"external"},{"type":"function","name":"__validate_declare__","inputs":[{"name":"class_hash","type":"core::felt252"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"__validate_deploy__","inputs":[{"name":"class_hash","type":"core::felt252"},{"name":"contract_address_salt","type":"core::felt252"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"__execute__","inputs":[{"name":"calls","type":"core::array::Array::"}],"outputs":[{"type":"core::array::Array::>"}],"state_mutability":"external"},{"type":"function","name":"token","inputs":[],"outputs":[{"type":"(core::starknet::contract_address::ContractAddress, core::integer::u256)"}],"state_mutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"lock","inputs":[{"name":"duration","type":"core::integer::u64"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"is_locked","inputs":[],"outputs":[{"type":"(core::bool, core::integer::u64)"}],"state_mutability":"view"},{"type":"function","name":"supports_interface","inputs":[{"name":"interface_id","type":"core::felt252"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"constructor","name":"constructor","inputs":[{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}]},{"type":"event","name":"token_bound_accounts::account::account::AccountComponent::AccountCreated","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"}]},{"type":"event","name":"token_bound_accounts::account::account::AccountComponent::AccountLocked","kind":"struct","members":[{"name":"account","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"locked_at","type":"core::integer::u64","kind":"data"},{"name":"duration","type":"core::integer::u64","kind":"data"}]},{"type":"struct","name":"core::array::Span::>","members":[{"name":"snapshot","type":"@core::array::Array::>"}]},{"type":"event","name":"token_bound_accounts::account::account::AccountComponent::TransactionExecuted","kind":"struct","members":[{"name":"hash","type":"core::felt252","kind":"key"},{"name":"response","type":"core::array::Span::>","kind":"data"}]},{"type":"event","name":"token_bound_accounts::account::account::AccountComponent::Event","kind":"enum","variants":[{"name":"AccountCreated","type":"token_bound_accounts::account::account::AccountComponent::AccountCreated","kind":"nested"},{"name":"AccountLocked","type":"token_bound_accounts::account::account::AccountComponent::AccountLocked","kind":"nested"},{"name":"TransactionExecuted","type":"token_bound_accounts::account::account::AccountComponent::TransactionExecuted","kind":"nested"}]},{"type":"event","name":"token_bound_accounts::upgradeable::upgradeable::UpgradeableComponent::Upgraded","kind":"struct","members":[{"name":"class_hash","type":"core::starknet::class_hash::ClassHash","kind":"data"}]},{"type":"event","name":"token_bound_accounts::upgradeable::upgradeable::UpgradeableComponent::Event","kind":"enum","variants":[{"name":"Upgraded","type":"token_bound_accounts::upgradeable::upgradeable::UpgradeableComponent::Upgraded","kind":"nested"}]},{"type":"event","name":"token_bound_accounts::presets::account::Account::Event","kind":"enum","variants":[{"name":"AccountEvent","type":"token_bound_accounts::account::account::AccountComponent::Event","kind":"flat"},{"name":"UpgradeableEvent","type":"token_bound_accounts::upgradeable::upgradeable::UpgradeableComponent::Event","kind":"flat"}]}] \ No newline at end of file +[ + { + "type": "impl", + "name": "UpgradeableImpl", + "interface_name": "token_bound_accounts::interfaces::IUpgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IUpgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "AccountImpl", + "interface_name": "token_bound_accounts::interfaces::IAccount::IAccount" + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { "name": "snapshot", "type": "@core::array::Array::" } + ] + }, + { + "type": "struct", + "name": "core::starknet::account::Call", + "members": [ + { + "name": "to", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "selector", "type": "core::felt252" }, + { "name": "calldata", "type": "core::array::Span::" } + ] + }, + { + "type": "struct", + "name": "core::integer::u256", + "members": [ + { "name": "low", "type": "core::integer::u128" }, + { "name": "high", "type": "core::integer::u128" } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { "name": "False", "type": "()" }, + { "name": "True", "type": "()" } + ] + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IAccount::IAccount", + "items": [ + { + "type": "function", + "name": "is_valid_signature", + "inputs": [ + { "name": "hash", "type": "core::felt252" }, + { "name": "signature", "type": "core::array::Span::" } + ], + "outputs": [{ "type": "core::felt252" }], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_valid_signer", + "inputs": [ + { + "name": "signer", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [{ "type": "core::felt252" }], + "state_mutability": "view" + }, + { + "type": "function", + "name": "__validate__", + "inputs": [ + { + "name": "calls", + "type": "core::array::Array::" + } + ], + "outputs": [{ "type": "core::felt252" }], + "state_mutability": "external" + }, + { + "type": "function", + "name": "__validate_declare__", + "inputs": [{ "name": "class_hash", "type": "core::felt252" }], + "outputs": [{ "type": "core::felt252" }], + "state_mutability": "view" + }, + { + "type": "function", + "name": "__validate_deploy__", + "inputs": [ + { "name": "class_hash", "type": "core::felt252" }, + { "name": "contract_address_salt", "type": "core::felt252" } + ], + "outputs": [{ "type": "core::felt252" }], + "state_mutability": "view" + }, + { + "type": "function", + "name": "__execute__", + "inputs": [ + { + "name": "calls", + "type": "core::array::Array::" + } + ], + "outputs": [ + { "type": "core::array::Array::>" } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "token", + "inputs": [], + "outputs": [ + { + "type": "(core::starknet::contract_address::ContractAddress, core::integer::u256)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { "type": "core::starknet::contract_address::ContractAddress" } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "lock", + "inputs": [{ "name": "duration", "type": "core::integer::u64" }], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_locked", + "inputs": [], + "outputs": [{ "type": "(core::bool, core::integer::u64)" }], + "state_mutability": "view" + }, + { + "type": "function", + "name": "supports_interface", + "inputs": [{ "name": "interface_id", "type": "core::felt252" }], + "outputs": [{ "type": "core::bool" }], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "token_id", "type": "core::integer::u256" } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::account::account::AccountComponent::AccountCreated", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::account::account::AccountComponent::AccountLocked", + "kind": "struct", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { "name": "locked_at", "type": "core::integer::u64", "kind": "data" }, + { "name": "duration", "type": "core::integer::u64", "kind": "data" } + ] + }, + { + "type": "struct", + "name": "core::array::Span::>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::>" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::account::account::AccountComponent::TransactionExecuted", + "kind": "struct", + "members": [ + { "name": "hash", "type": "core::felt252", "kind": "key" }, + { + "name": "response", + "type": "core::array::Span::>", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::account::account::AccountComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "AccountCreated", + "type": "token_bound_accounts::account::account::AccountComponent::AccountCreated", + "kind": "nested" + }, + { + "name": "AccountLocked", + "type": "token_bound_accounts::account::account::AccountComponent::AccountLocked", + "kind": "nested" + }, + { + "name": "TransactionExecuted", + "type": "token_bound_accounts::account::account::AccountComponent::TransactionExecuted", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::upgradeable::upgradeable::UpgradeableComponent::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::upgradeable::upgradeable::UpgradeableComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "token_bound_accounts::upgradeable::upgradeable::UpgradeableComponent::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::presets::account::Account::Event", + "kind": "enum", + "variants": [ + { + "name": "AccountEvent", + "type": "token_bound_accounts::account::account::AccountComponent::Event", + "kind": "flat" + }, + { + "name": "UpgradeableEvent", + "type": "token_bound_accounts::upgradeable::upgradeable::UpgradeableComponent::Event", + "kind": "flat" + } + ] + } +] diff --git a/src/abis/v2/registry.abi.json b/src/abis/v2/registry.abi.json index 62c51e4..3f95251 100644 --- a/src/abis/v2/registry.abi.json +++ b/src/abis/v2/registry.abi.json @@ -1 +1,98 @@ -[{"type":"impl","name":"IRegistryImpl","interface_name":"token_bound_accounts::interfaces::IRegistry::IRegistry"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"interface","name":"token_bound_accounts::interfaces::IRegistry::IRegistry","items":[{"type":"function","name":"create_account","inputs":[{"name":"implementation_hash","type":"core::felt252"},{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"salt","type":"core::felt252"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"external"},{"type":"function","name":"get_account","inputs":[{"name":"implementation_hash","type":"core::felt252"},{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"salt","type":"core::felt252"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"total_deployed_accounts","inputs":[{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u8"}],"state_mutability":"view"}]},{"type":"event","name":"token_bound_accounts::registry::registry::Registry::AccountCreated","kind":"struct","members":[{"name":"account_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"token_id","type":"core::integer::u256","kind":"data"}]},{"type":"event","name":"token_bound_accounts::registry::registry::Registry::Event","kind":"enum","variants":[{"name":"AccountCreated","type":"token_bound_accounts::registry::registry::Registry::AccountCreated","kind":"nested"}]}] \ No newline at end of file +[ + { + "type": "impl", + "name": "IRegistryImpl", + "interface_name": "token_bound_accounts::interfaces::IRegistry::IRegistry" + }, + { + "type": "struct", + "name": "core::integer::u256", + "members": [ + { "name": "low", "type": "core::integer::u128" }, + { "name": "high", "type": "core::integer::u128" } + ] + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IRegistry::IRegistry", + "items": [ + { + "type": "function", + "name": "create_account", + "inputs": [ + { "name": "implementation_hash", "type": "core::felt252" }, + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "token_id", "type": "core::integer::u256" }, + { "name": "salt", "type": "core::felt252" } + ], + "outputs": [ + { "type": "core::starknet::contract_address::ContractAddress" } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_account", + "inputs": [ + { "name": "implementation_hash", "type": "core::felt252" }, + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "token_id", "type": "core::integer::u256" }, + { "name": "salt", "type": "core::felt252" } + ], + "outputs": [ + { "type": "core::starknet::contract_address::ContractAddress" } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "total_deployed_accounts", + "inputs": [ + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "token_id", "type": "core::integer::u256" } + ], + "outputs": [{ "type": "core::integer::u8" }], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::registry::registry::Registry::AccountCreated", + "kind": "struct", + "members": [ + { + "name": "account_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { "name": "token_id", "type": "core::integer::u256", "kind": "data" } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::registry::registry::Registry::Event", + "kind": "enum", + "variants": [ + { + "name": "AccountCreated", + "type": "token_bound_accounts::registry::registry::Registry::AccountCreated", + "kind": "nested" + } + ] + } +] diff --git a/src/abis/v3/account.abi.json b/src/abis/v3/account.abi.json index 2a34d11..78281cc 100644 --- a/src/abis/v3/account.abi.json +++ b/src/abis/v3/account.abi.json @@ -1 +1,487 @@ -[{"type":"impl","name":"AccountV3","interface_name":"token_bound_accounts::interfaces::IAccountV3::IAccountV3"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"struct","name":"core::array::Span::","members":[{"name":"snapshot","type":"@core::array::Array::"}]},{"type":"interface","name":"token_bound_accounts::interfaces::IAccountV3::IAccountV3","items":[{"type":"function","name":"on_erc721_received","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"context","inputs":[],"outputs":[{"type":"(core::starknet::contract_address::ContractAddress, core::felt252, core::felt252)"}],"state_mutability":"view"}]},{"type":"impl","name":"Signatory","interface_name":"token_bound_accounts::interfaces::ISignatory::ISignatory"},{"type":"enum","name":"core::bool","variants":[{"name":"False","type":"()"},{"name":"True","type":"()"}]},{"type":"interface","name":"token_bound_accounts::interfaces::ISignatory::ISignatory","items":[{"type":"function","name":"is_valid_signer","inputs":[{"name":"signer","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"},{"type":"function","name":"is_valid_signature","inputs":[{"name":"hash","type":"core::felt252"},{"name":"signature","type":"core::array::Span::"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"}]},{"type":"impl","name":"Executable","interface_name":"token_bound_accounts::interfaces::IExecutable::IExecutable"},{"type":"struct","name":"core::starknet::account::Call","members":[{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"selector","type":"core::felt252"},{"name":"calldata","type":"core::array::Span::"}]},{"type":"interface","name":"token_bound_accounts::interfaces::IExecutable::IExecutable","items":[{"type":"function","name":"execute","inputs":[{"name":"calls","type":"core::array::Array::"}],"outputs":[{"type":"core::array::Array::>"}],"state_mutability":"external"}]},{"type":"impl","name":"Upgradeable","interface_name":"token_bound_accounts::interfaces::IUpgradeable::IUpgradeable"},{"type":"interface","name":"token_bound_accounts::interfaces::IUpgradeable::IUpgradeable","items":[{"type":"function","name":"upgrade","inputs":[{"name":"new_class_hash","type":"core::starknet::class_hash::ClassHash"}],"outputs":[],"state_mutability":"external"}]},{"type":"impl","name":"Lockable","interface_name":"token_bound_accounts::interfaces::ILockable::ILockable"},{"type":"interface","name":"token_bound_accounts::interfaces::ILockable::ILockable","items":[{"type":"function","name":"lock","inputs":[{"name":"lock_until","type":"core::integer::u64"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"is_locked","inputs":[],"outputs":[{"type":"(core::bool, core::integer::u64)"}],"state_mutability":"view"}]},{"type":"impl","name":"Permissionable","interface_name":"token_bound_accounts::interfaces::IPermissionable::IPermissionable"},{"type":"interface","name":"token_bound_accounts::interfaces::IPermissionable::IPermissionable","items":[{"type":"function","name":"set_permission","inputs":[{"name":"permissioned_addresses","type":"core::array::Array::"},{"name":"permissions","type":"core::array::Array::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"has_permission","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"permissioned_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"AccountImpl","interface_name":"token_bound_accounts::interfaces::IAccount::IAccount"},{"type":"interface","name":"token_bound_accounts::interfaces::IAccount::IAccount","items":[{"type":"function","name":"owner","inputs":[],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"token","inputs":[],"outputs":[{"type":"(core::starknet::contract_address::ContractAddress, core::integer::u256, core::felt252)"}],"state_mutability":"view"},{"type":"function","name":"state","inputs":[],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"supports_interface","inputs":[{"name":"interface_id","type":"core::felt252"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"constructor","name":"constructor","inputs":[{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"registry","type":"core::starknet::contract_address::ContractAddress"},{"name":"implementation_hash","type":"core::felt252"},{"name":"salt","type":"core::felt252"}]},{"type":"event","name":"token_bound_accounts::components::account::account::AccountComponent::TBACreated","kind":"struct","members":[{"name":"account_address","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"parent_account","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"token_id","type":"core::integer::u256","kind":"data"}]},{"type":"struct","name":"core::array::Span::>","members":[{"name":"snapshot","type":"@core::array::Array::>"}]},{"type":"event","name":"token_bound_accounts::components::account::account::AccountComponent::TransactionExecuted","kind":"struct","members":[{"name":"hash","type":"core::felt252","kind":"key"},{"name":"account_address","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"response","type":"core::array::Span::>","kind":"data"}]},{"type":"event","name":"token_bound_accounts::components::account::account::AccountComponent::Event","kind":"enum","variants":[{"name":"TBACreated","type":"token_bound_accounts::components::account::account::AccountComponent::TBACreated","kind":"nested"},{"name":"TransactionExecuted","type":"token_bound_accounts::components::account::account::AccountComponent::TransactionExecuted","kind":"nested"}]},{"type":"event","name":"token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent::TBAUpgraded","kind":"struct","members":[{"name":"account_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"class_hash","type":"core::starknet::class_hash::ClassHash","kind":"data"}]},{"type":"event","name":"token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent::Event","kind":"enum","variants":[{"name":"TBAUpgraded","type":"token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent::TBAUpgraded","kind":"nested"}]},{"type":"event","name":"token_bound_accounts::components::lockable::lockable::LockableComponent::AccountLocked","kind":"struct","members":[{"name":"account","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"locked_at","type":"core::integer::u64","kind":"data"},{"name":"lock_until","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"token_bound_accounts::components::lockable::lockable::LockableComponent::Event","kind":"enum","variants":[{"name":"AccountLocked","type":"token_bound_accounts::components::lockable::lockable::LockableComponent::AccountLocked","kind":"nested"}]},{"type":"event","name":"token_bound_accounts::components::signatory::signatory::SignatoryComponent::Event","kind":"enum","variants":[]},{"type":"event","name":"token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::PermissionUpdated","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"permissioned_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"has_permission","type":"core::bool","kind":"data"}]},{"type":"event","name":"token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::Event","kind":"enum","variants":[{"name":"PermissionUpdated","type":"token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::PermissionUpdated","kind":"nested"}]},{"type":"event","name":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"enum","variants":[]},{"type":"event","name":"token_bound_accounts::accountV3::accountV3::AccountV3::Event","kind":"enum","variants":[{"name":"AccountEvent","type":"token_bound_accounts::components::account::account::AccountComponent::Event","kind":"flat"},{"name":"UpgradeableEvent","type":"token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent::Event","kind":"flat"},{"name":"LockableEvent","type":"token_bound_accounts::components::lockable::lockable::LockableComponent::Event","kind":"flat"},{"name":"SignatoryEvent","type":"token_bound_accounts::components::signatory::signatory::SignatoryComponent::Event","kind":"flat"},{"name":"PermissionableEvent","type":"token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::Event","kind":"flat"},{"name":"SRC5Event","type":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"flat"}]}] \ No newline at end of file +[ + { + "type": "impl", + "name": "AccountV3", + "interface_name": "token_bound_accounts::interfaces::IAccountV3::IAccountV3" + }, + { + "type": "struct", + "name": "core::integer::u256", + "members": [ + { "name": "low", "type": "core::integer::u128" }, + { "name": "high", "type": "core::integer::u128" } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { "name": "snapshot", "type": "@core::array::Array::" } + ] + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IAccountV3::IAccountV3", + "items": [ + { + "type": "function", + "name": "on_erc721_received", + "inputs": [ + { + "name": "operator", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "from", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "token_id", "type": "core::integer::u256" }, + { "name": "data", "type": "core::array::Span::" } + ], + "outputs": [{ "type": "core::felt252" }], + "state_mutability": "view" + }, + { + "type": "function", + "name": "context", + "inputs": [], + "outputs": [ + { + "type": "(core::starknet::contract_address::ContractAddress, core::felt252, core::felt252)" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "Signatory", + "interface_name": "token_bound_accounts::interfaces::ISignatory::ISignatory" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { "name": "False", "type": "()" }, + { "name": "True", "type": "()" } + ] + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::ISignatory::ISignatory", + "items": [ + { + "type": "function", + "name": "is_valid_signer", + "inputs": [ + { + "name": "signer", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [{ "type": "core::bool" }], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_valid_signature", + "inputs": [ + { "name": "hash", "type": "core::felt252" }, + { "name": "signature", "type": "core::array::Span::" } + ], + "outputs": [{ "type": "core::felt252" }], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "Executable", + "interface_name": "token_bound_accounts::interfaces::IExecutable::IExecutable" + }, + { + "type": "struct", + "name": "core::starknet::account::Call", + "members": [ + { + "name": "to", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "selector", "type": "core::felt252" }, + { "name": "calldata", "type": "core::array::Span::" } + ] + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IExecutable::IExecutable", + "items": [ + { + "type": "function", + "name": "execute", + "inputs": [ + { + "name": "calls", + "type": "core::array::Array::" + } + ], + "outputs": [ + { "type": "core::array::Array::>" } + ], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "Upgradeable", + "interface_name": "token_bound_accounts::interfaces::IUpgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IUpgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "Lockable", + "interface_name": "token_bound_accounts::interfaces::ILockable::ILockable" + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::ILockable::ILockable", + "items": [ + { + "type": "function", + "name": "lock", + "inputs": [{ "name": "lock_until", "type": "core::integer::u64" }], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_locked", + "inputs": [], + "outputs": [{ "type": "(core::bool, core::integer::u64)" }], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "Permissionable", + "interface_name": "token_bound_accounts::interfaces::IPermissionable::IPermissionable" + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IPermissionable::IPermissionable", + "items": [ + { + "type": "function", + "name": "set_permission", + "inputs": [ + { + "name": "permissioned_addresses", + "type": "core::array::Array::" + }, + { "name": "permissions", "type": "core::array::Array::" } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "has_permission", + "inputs": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "permissioned_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [{ "type": "core::bool" }], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "AccountImpl", + "interface_name": "token_bound_accounts::interfaces::IAccount::IAccount" + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IAccount::IAccount", + "items": [ + { + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { "type": "core::starknet::contract_address::ContractAddress" } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "token", + "inputs": [], + "outputs": [ + { + "type": "(core::starknet::contract_address::ContractAddress, core::integer::u256, core::felt252)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "state", + "inputs": [], + "outputs": [{ "type": "core::integer::u256" }], + "state_mutability": "view" + }, + { + "type": "function", + "name": "supports_interface", + "inputs": [{ "name": "interface_id", "type": "core::felt252" }], + "outputs": [{ "type": "core::bool" }], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "token_id", "type": "core::integer::u256" }, + { + "name": "registry", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "implementation_hash", "type": "core::felt252" }, + { "name": "salt", "type": "core::felt252" } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::account::account::AccountComponent::TBACreated", + "kind": "struct", + "members": [ + { + "name": "account_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "parent_account", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { "name": "token_id", "type": "core::integer::u256", "kind": "data" } + ] + }, + { + "type": "struct", + "name": "core::array::Span::>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::>" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::account::account::AccountComponent::TransactionExecuted", + "kind": "struct", + "members": [ + { "name": "hash", "type": "core::felt252", "kind": "key" }, + { + "name": "account_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "response", + "type": "core::array::Span::>", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::account::account::AccountComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "TBACreated", + "type": "token_bound_accounts::components::account::account::AccountComponent::TBACreated", + "kind": "nested" + }, + { + "name": "TransactionExecuted", + "type": "token_bound_accounts::components::account::account::AccountComponent::TransactionExecuted", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent::TBAUpgraded", + "kind": "struct", + "members": [ + { + "name": "account_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "TBAUpgraded", + "type": "token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent::TBAUpgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::lockable::lockable::LockableComponent::AccountLocked", + "kind": "struct", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { "name": "locked_at", "type": "core::integer::u64", "kind": "data" }, + { "name": "lock_until", "type": "core::integer::u64", "kind": "data" } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::lockable::lockable::LockableComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "AccountLocked", + "type": "token_bound_accounts::components::lockable::lockable::LockableComponent::AccountLocked", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::signatory::signatory::SignatoryComponent::Event", + "kind": "enum", + "variants": [] + }, + { + "type": "event", + "name": "token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::PermissionUpdated", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "permissioned_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { "name": "has_permission", "type": "core::bool", "kind": "data" } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "PermissionUpdated", + "type": "token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::PermissionUpdated", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "openzeppelin_introspection::src5::SRC5Component::Event", + "kind": "enum", + "variants": [] + }, + { + "type": "event", + "name": "token_bound_accounts::accountV3::accountV3::AccountV3::Event", + "kind": "enum", + "variants": [ + { + "name": "AccountEvent", + "type": "token_bound_accounts::components::account::account::AccountComponent::Event", + "kind": "flat" + }, + { + "name": "UpgradeableEvent", + "type": "token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent::Event", + "kind": "flat" + }, + { + "name": "LockableEvent", + "type": "token_bound_accounts::components::lockable::lockable::LockableComponent::Event", + "kind": "flat" + }, + { + "name": "SignatoryEvent", + "type": "token_bound_accounts::components::signatory::signatory::SignatoryComponent::Event", + "kind": "flat" + }, + { + "name": "PermissionableEvent", + "type": "token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::Event", + "kind": "flat" + }, + { + "name": "SRC5Event", + "type": "openzeppelin_introspection::src5::SRC5Component::Event", + "kind": "flat" + } + ] + } +] diff --git a/src/abis/v3/registry.abi.json b/src/abis/v3/registry.abi.json index ae6a080..da94984 100644 --- a/src/abis/v3/registry.abi.json +++ b/src/abis/v3/registry.abi.json @@ -1 +1,87 @@ -[{"type":"impl","name":"IRegistryImpl","interface_name":"token_bound_accounts::interfaces::IRegistry::IRegistry"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"interface","name":"token_bound_accounts::interfaces::IRegistry::IRegistry","items":[{"type":"function","name":"create_account","inputs":[{"name":"implementation_hash","type":"core::felt252"},{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"salt","type":"core::felt252"},{"name":"chain_id","type":"core::felt252"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"external"},{"type":"function","name":"get_account","inputs":[{"name":"implementation_hash","type":"core::felt252"},{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"salt","type":"core::felt252"},{"name":"chain_id","type":"core::felt252"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"}]},{"type":"event","name":"token_bound_accounts::registry::registry::Registry::AccountCreated","kind":"struct","members":[{"name":"account_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"token_contract","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"token_id","type":"core::integer::u256","kind":"data"}]},{"type":"event","name":"token_bound_accounts::registry::registry::Registry::Event","kind":"enum","variants":[{"name":"AccountCreated","type":"token_bound_accounts::registry::registry::Registry::AccountCreated","kind":"nested"}]}] \ No newline at end of file +[ + { + "type": "impl", + "name": "IRegistryImpl", + "interface_name": "token_bound_accounts::interfaces::IRegistry::IRegistry" + }, + { + "type": "struct", + "name": "core::integer::u256", + "members": [ + { "name": "low", "type": "core::integer::u128" }, + { "name": "high", "type": "core::integer::u128" } + ] + }, + { + "type": "interface", + "name": "token_bound_accounts::interfaces::IRegistry::IRegistry", + "items": [ + { + "type": "function", + "name": "create_account", + "inputs": [ + { "name": "implementation_hash", "type": "core::felt252" }, + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "token_id", "type": "core::integer::u256" }, + { "name": "salt", "type": "core::felt252" }, + { "name": "chain_id", "type": "core::felt252" } + ], + "outputs": [ + { "type": "core::starknet::contract_address::ContractAddress" } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_account", + "inputs": [ + { "name": "implementation_hash", "type": "core::felt252" }, + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress" + }, + { "name": "token_id", "type": "core::integer::u256" }, + { "name": "salt", "type": "core::felt252" }, + { "name": "chain_id", "type": "core::felt252" } + ], + "outputs": [ + { "type": "core::starknet::contract_address::ContractAddress" } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::registry::registry::Registry::AccountCreated", + "kind": "struct", + "members": [ + { + "name": "account_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "token_contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { "name": "token_id", "type": "core::integer::u256", "kind": "data" } + ] + }, + { + "type": "event", + "name": "token_bound_accounts::registry::registry::Registry::Event", + "kind": "enum", + "variants": [ + { + "name": "AccountCreated", + "type": "token_bound_accounts::registry::registry::Registry::AccountCreated", + "kind": "nested" + } + ] + } +] diff --git a/src/constants/chainId.ts b/src/constants/chainId.ts index 6da5e57..637b4e1 100644 --- a/src/constants/chainId.ts +++ b/src/constants/chainId.ts @@ -1,4 +1,4 @@ export const TBAChainID = { - main: 'SN_MAIN', - sepolia: 'SN_SEPOLIA', - } as const \ No newline at end of file + main: "SN_MAIN", + sepolia: "SN_SEPOLIA", +} as const; diff --git a/src/constants/index.ts b/src/constants/index.ts index e91224c..3ed3caf 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,3 +1,3 @@ -export * from "./chainId" -export * from "./version" -export * from "./tokenboundAddresses" \ No newline at end of file +export * from "./chainId"; +export * from "./version"; +export * from "./tokenboundAddresses"; diff --git a/src/constants/version.ts b/src/constants/version.ts index bfe5f57..d04696c 100644 --- a/src/constants/version.ts +++ b/src/constants/version.ts @@ -1,4 +1,4 @@ export const TBAVersion = { - V2: 'V2', - V3: 'V3', - } as const \ No newline at end of file + V2: "V2", + V3: "V3", +} as const; diff --git a/src/index.ts b/src/index.ts index 08c99a4..fd8ec5e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,43 +1,39 @@ -import { TokenboundClient } from "./TokenboundClient" +import { TokenboundClient } from "./TokenboundClient"; import { - TokenboundClientOptions, - GetAccountOptions, - CreateAccountOptions, - AccountStatus, - Call, - GetOwnerOptions, - ERC20TransferOptions, - NFTTransferOptions, - GetHasPermissionOptions, - SetPermissionOptions, - UpgradeOptions, - LockAccountOptions, - GetIsLockedOptions, -} from "./types/TokenboundClient" + TokenboundClientOptions, + GetAccountOptions, + CreateAccountOptions, + AccountStatus, + Call, + GetOwnerOptions, + ERC20TransferOptions, + NFTTransferOptions, + GetHasPermissionOptions, + SetPermissionOptions, + UpgradeOptions, + LockAccountOptions, + GetIsLockedOptions, +} from "./types/TokenboundClient"; -import { TBAChainID, TBAVersion } from "./constants" -import { WalletClient } from "./types/walletClient" +import { TBAChainID, TBAVersion } from "./constants"; +import { WalletClient } from "./types/walletClient"; -export { - TokenboundClient, - TBAChainID, - TBAVersion -} +export { TokenboundClient, TBAChainID, TBAVersion }; export type { - WalletClient, - TokenboundClientOptions, - GetAccountOptions, - CreateAccountOptions, - AccountStatus, - Call, - GetOwnerOptions, - ERC20TransferOptions, - NFTTransferOptions, - GetHasPermissionOptions, - SetPermissionOptions, - UpgradeOptions, - LockAccountOptions, - GetIsLockedOptions, -} \ No newline at end of file + WalletClient, + TokenboundClientOptions, + GetAccountOptions, + CreateAccountOptions, + AccountStatus, + Call, + GetOwnerOptions, + ERC20TransferOptions, + NFTTransferOptions, + GetHasPermissionOptions, + SetPermissionOptions, + UpgradeOptions, + LockAccountOptions, + GetIsLockedOptions, +}; diff --git a/src/types/TokenboundClient.ts b/src/types/TokenboundClient.ts index d01ba22..1beedb3 100644 --- a/src/types/TokenboundClient.ts +++ b/src/types/TokenboundClient.ts @@ -55,14 +55,12 @@ export interface GetHasPermissionOptions { permissionedAddress: string; } - export interface SetPermissionOptions { tbaAddress: string; permissionedAddresses: string[]; permissions: boolean[]; } - export interface ERC20TransferOptions { tbaAddress: string; contractAddress: string; @@ -87,8 +85,7 @@ export interface LockAccountOptions { lockUntill: number; } - export interface UpgradeOptions { tbaAddress: string; newClassHash: string; -} \ No newline at end of file +} diff --git a/src/types/index.ts b/src/types/index.ts index 9cb2fe9..df42535 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,12 +1,12 @@ -export type { - TokenboundClientOptions, - GetAccountOptions, - CreateAccountOptions, - AccountStatus, - Call, - GetOwnerOptions, - ERC20TransferOptions, - NFTTransferOptions -} from "./TokenboundClient" +export type { + TokenboundClientOptions, + GetAccountOptions, + CreateAccountOptions, + AccountStatus, + Call, + GetOwnerOptions, + ERC20TransferOptions, + NFTTransferOptions, +} from "./TokenboundClient"; -export type { WalletClient } from "./walletClient" \ No newline at end of file +export type { WalletClient } from "./walletClient"; diff --git a/src/types/walletClient.ts b/src/types/walletClient.ts index 9bcf64b..46fab09 100644 --- a/src/types/walletClient.ts +++ b/src/types/walletClient.ts @@ -1,4 +1,4 @@ export interface WalletClient { - address: string - privateKey: string -} \ No newline at end of file + address: string; + privateKey: string; +} diff --git a/src/utils/account.ts b/src/utils/account.ts index f4861cc..5d4ff46 100644 --- a/src/utils/account.ts +++ b/src/utils/account.ts @@ -1,11 +1,15 @@ -import { Account } from "starknet" -import { getProvider } from "./provider" -import { WalletClient } from "../types/walletClient" +import { Account } from "starknet"; +import { getProvider } from "./provider"; +import { WalletClient } from "../types/walletClient"; export function accountClient( - jsonRPC: string, - walletClient?: WalletClient + jsonRPC: string, + walletClient?: WalletClient ): Account { - const account = new Account(getProvider(jsonRPC), walletClient!.address, walletClient!.privateKey) - return account -} \ No newline at end of file + const account = new Account( + getProvider(jsonRPC), + walletClient!.address, + walletClient!.privateKey + ); + return account; +} diff --git a/src/utils/index.ts b/src/utils/index.ts index 75c8d94..b1626c1 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,2 +1,2 @@ -export { accountClient } from "./account" -export { getProvider } from "./provider" \ No newline at end of file +export { accountClient } from "./account"; +export { getProvider } from "./provider"; diff --git a/src/utils/provider.ts b/src/utils/provider.ts index 07a6bd9..0f39882 100644 --- a/src/utils/provider.ts +++ b/src/utils/provider.ts @@ -1,8 +1,8 @@ import { RpcProvider } from "starknet"; export function getProvider(jsonRPC: string) { - const provider = new RpcProvider({ - nodeUrl: jsonRPC - }) - return provider -} \ No newline at end of file + const provider = new RpcProvider({ + nodeUrl: jsonRPC, + }); + return provider; +} diff --git a/tsconfig.json b/tsconfig.json index 50ba8e6..9c10c17 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,4 +20,4 @@ }, "include": ["src"], "exclude": ["src/test"] -} \ No newline at end of file +} diff --git a/vite.config.ts b/vite.config.ts index 8fd7653..7826012 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,16 +1,16 @@ -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: 'starknet-tokenbound-sdk', + fileName: "starknet-tokenbound-sdk", }, rollupOptions: { external: ["starknet"], @@ -18,6 +18,6 @@ export default defineConfig({ }, plugins: [dts()], optimizeDeps: { - exclude: ['**/__test__/**', '**/*.test.ts', '**/*.spec.ts'], + exclude: ["**/__test__/**", "**/*.test.ts", "**/*.spec.ts"], }, -}) \ No newline at end of file +}); From 0318b7ac961231543f85f0dc655b0b1c923b12ce Mon Sep 17 00:00:00 2001 From: Stephanie Egbuonu <100955511+stephanniegb@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:34:21 +0100 Subject: [PATCH 3/3] refactor: removed unwanted lines --- src/TokenboundClient.ts | 8 +------- src/constants/tokenboundAddresses.ts | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/TokenboundClient.ts b/src/TokenboundClient.ts index 223ea94..a29ef03 100644 --- a/src/TokenboundClient.ts +++ b/src/TokenboundClient.ts @@ -37,7 +37,6 @@ export class TokenboundClient { private registryAddress: string; private implementationAddress: string; private chain_id: string; - private version: string; public isInitialized: boolean = false; public registryAbi: Abi; public accountAbi: Abi; @@ -63,7 +62,6 @@ export class TokenboundClient { this.jsonRPC = jsonRPC; this.isInitialized = true; this.chain_id = chain_id; - this.version = version; this.registryAddress = registryAddress ?? @@ -116,8 +114,6 @@ export class TokenboundClient { tokenId, salt, }: CreateAccountOptions): Promise { - console.log("SDK Account", this.account); - const contract = new Contract( this.registryAbi, this.registryAddress, @@ -178,9 +174,7 @@ export class TokenboundClient { let call: MultiCall = { contractAddress: tbaAddress, entrypoint: this.supportsV3 ? "execute" : "__execute__", - calldata: CallData.compile({ - calls, - }), + calldata: CallData.compile({ calls }), }; try { diff --git a/src/constants/tokenboundAddresses.ts b/src/constants/tokenboundAddresses.ts index 46efdc0..06a8107 100644 --- a/src/constants/tokenboundAddresses.ts +++ b/src/constants/tokenboundAddresses.ts @@ -64,12 +64,12 @@ export const ERC_6551_DEPLOYMENTS: Standard6551Deployments = { V3: { IMPLEMENTATION: { ADDRESS: - "0x29d2a1b11dd97289e18042502f11356133a2201dd19e716813fb01fbee9e9a4", + "0xbe8863311f24317dff8af16deb1285ec5b035e57cf9beda545c341c339b925", ABI: erc6551AccountV3ABI as Abi, }, REGISTRY: { ADDRESS: - "0x23a6d289a1e5067d905e195056c322381a78a3bc9ab3b0480f542fad87cc580", + "0x4107f453e68bf4331a31316078bb73ecfcb767dc624ebd78f8c1e15b14c63bd", ABI: erc6551RegistryV3ABI as Abi, }, },