import { PublicClient } from 'viem'; import { getAccount, computeAccount, createAccount, getCreationCode, prepareExecuteCall, executeCall } from './functions'; import { BytecodeParams, CreateAccountParams, ERC20TransferParams, SignMessageParams, ETHTransferParams, ExecuteCallParams, GetAccountParams, NFTTransferParams, PrepareCreateAccountParams, PrepareExecuteCallParams, SegmentedERC6551Bytecode, TokenboundAccountNFT, TokenboundClientOptions, ExecuteParams, PrepareExecutionParams, ValidSignerParams, MultiCallTx, CallData } from './types'; declare global { interface Window { tokenboundSDK?: string; } } declare class TokenboundClient { private chainId; private chain; isInitialized: boolean; publicClient: PublicClient; private supportsV3; private signer?; private walletClient?; private implementationAddress; private registryAddress; constructor(options: TokenboundClientOptions); /** * Returns the SDK's package version. * @returns The version of the SDK. */ getSDKVersion(): string; /** * Returns the tokenbound account address for a given token contract and token ID. * @param {`0x${string}`} params.tokenContract The address of the token contract. * @param {string} params.tokenId The token ID. * @returns The tokenbound account address. */ getAccount(params: GetAccountParams): `0x${string}`; /** * Returns the prepared transaction to create a tokenbound account for a given token contract and token ID. * @param {`0x${string}`} params.tokenContract The address of the token contract. * @param {string} params.tokenId The token ID. * @returns The prepared transaction to create a tokenbound account. Can be sent via `sendTransaction` on an Ethers signer or viem WalletClient. */ prepareCreateAccount(params: PrepareCreateAccountParams): Promise; /** * Returns the transaction hash of the transaction that created the tokenbound account for a given token contract and token ID. * @param {`0x${string}`} params.tokenContract The address of the token contract. * @param {string} params.tokenId The token ID. * @returns a Promise that resolves to the account address of the created tokenbound account. */ createAccount(params: CreateAccountParams): Promise<{ account: `0x${string}`; txHash: `0x${string}`; }>; /** * Returns prepared transaction to execute a call on a tokenbound account * @param {string} params.account The tokenbound account address * @param {string} params.to The recipient address * @param {bigint} params.value The value to send, in wei * @param {string} params.data The data to send * @returns a Promise with prepared transaction to execute a call on a tokenbound account. Can be sent via `sendTransaction` on a viem WalletClient or Ethers signer. * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use prepareExecution() instead. */ prepareExecuteCall(params: PrepareExecuteCallParams): Promise; /** * Executes a transaction call on a tokenbound account * @param {string} params.account The tokenbound account address * @param {string} params.to The recipient contract address * @param {bigint} params.value The value to send, in wei * @param {string} params.data The data to send * @returns a Promise that resolves to the transaction hash of the executed call * @deprecated this method is deprecated, but still available for use with legacy V2 deployments. Use execute() instead. */ executeCall(params: ExecuteCallParams): Promise<`0x${string}`>; /** * Returns prepared transaction to execute on a tokenbound account * @param {string} params.account The tokenbound account address * @param {string} params.to The contract address to execute the call on * @param {bigint} params.value The value to send, in wei * @param {string} params.data The encoded operation calldata to send * @returns a Promise with prepared transaction to execute on a tokenbound account. Can be sent via `sendTransaction` on a viem WalletClient or Ethers signer. */ prepareExecution(params: PrepareExecutionParams): Promise; /** * Executes a transaction call on a tokenbound account * @param {string} params.account The tokenbound account address * @param {string} params.to The contract address to execute the call on * @param {bigint} params.value The value to send, in wei * @param {string} params.data The encoded operation calldata to send * @returns a Promise that resolves to the transaction hash of the executed call */ execute(params: ExecuteParams): Promise<`0x${string}`>; /** * Check if a tokenbound account is a valid signer for a transaction * @param {string} params.account The tokenbound account address * @returns a Promise that resolves to true if the account is a valid signer, otherwise false */ isValidSigner({ account }: ValidSignerParams): Promise; /** * Check if a tokenbound account has been deployed * @param {string} params.accountAddress The tokenbound account address * @returns a Promise that resolves to true if the account is deployed, otherwise false */ checkAccountDeployment({ accountAddress, }: BytecodeParams): Promise; /** * Deconstructs the bytecode of a tokenbound account into its constituent parts. * @param {`0x${string}`} params.accountAddress The address of the tokenbound account. * @returns a Promise that resolves to a SegmentedERC6551Bytecode object, or null if the account is not deployed */ deconstructBytecode({ accountAddress, }: BytecodeParams): Promise; /** * Get NFT information from a tokenbound account * @param {`0x${string}`} params.accountAddress The address of the tokenbound account. * @returns a Promise that resolves to an object containing the token contract address, token ID, and chain ID */ getNFT({ accountAddress, }: BytecodeParams): Promise; /** * Executes a transaction call on a tokenbound account * @param {string} params.account The tokenbound account address * @param {string} params.tokenType The type of token, either 'ERC721' or 'ERC1155' * @param {string} params.tokenContract The address of the token contract * @param {string} params.tokenId The token ID * @param {string} params.recipientAddress The address to which the token should be transferred * @param {string} params.amount The amount of tokens to transfer, (eg. 1 NFT = 1). Defaults to 1. 1155 only. * @returns a Promise that resolves to the transaction hash of the executed call */ transferNFT(params: NFTTransferParams): Promise<`0x${string}`>; /** * Executes an ETH transfer call on a tokenbound account * @param {string} params.account The tokenbound account address * @param {number} params.amount The amount of ETH to transfer, in decimal format (eg. 0.1 ETH = 0.1) * @param {string} params.recipientAddress The address to which the ETH should be transferred * @returns a Promise that resolves to the transaction hash of the executed call */ transferETH(params: ETHTransferParams): Promise<`0x${string}`>; /** * Executes an ERC-20 transfer call on a tokenbound account * @param {string} params.account The tokenbound account address * @param {number} params.amount The amount of ERC-20 to transfer, in decimal format (eg. 0.1 USDC = 0.1) * @param {string} params.recipientAddress The address to which the ETH should be transferred * @param {string} params.erc20tokenAddress The address of the ERC-20 token contract * @param {string} params.erc20tokenDecimals The decimal specification of the ERC-20 token * @returns a Promise that resolves to the transaction hash of the executed call */ transferERC20(params: ERC20TransferParams): Promise<`0x${string}`>; /** * Calculates an Ethereum-specific signature * @param {string} params.message The message to be signed * @returns a Promise that resolves to a signed Hex string */ signMessage(params: SignMessageParams): Promise<`0x${string}`>; } declare const erc6551AccountAbiV2: import('viem').Abi; declare const erc6551RegistryAbiV2: import('viem').Abi; declare const erc6551AccountAbiV3: import('viem').Abi; declare const erc6551AccountProxyAbiV3: import('viem').Abi | undefined; declare const erc6551RegistryAbiV3: import('viem').Abi; export { TokenboundClient, erc6551AccountAbiV2, erc6551RegistryAbiV2, erc6551AccountAbiV3, erc6551AccountProxyAbiV3, erc6551RegistryAbiV3, getAccount, createAccount, getCreationCode, computeAccount, prepareExecuteCall, executeCall, };