Interfaces

CreateServerAccountOptions

Defined in: src/client/evm/evm.types.ts:339 Options for creating an EVM server account.

Properties

PropertyTypeDescriptionDefined in
accountPolicy?stringThe policy ID to apply to the account.src/client/evm/evm.types.ts:343
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:345
name?stringThe name of the account.src/client/evm/evm.types.ts:341

CreateSmartAccountOptions

Defined in: src/client/evm/evm.types.ts:502 Options for creating an EVM smart account.

Properties

PropertyTypeDescriptionDefined in
enableSpendPermissions?booleanThe flag to enable spend permissions.src/client/evm/evm.types.ts:510
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:506
name?stringThe name of the account.src/client/evm/evm.types.ts:508
ownerEvmAccountThe owner of the account.src/client/evm/evm.types.ts:504

CreateSwapQuoteOptions

Defined in: src/client/evm/evm.types.ts:116 Options for creating a swap quote between two tokens on an EVM network.

Properties

PropertyTypeDescriptionDefined in
fromAmountbigintThe amount to send in atomic units of the token.src/client/evm/evm.types.ts:124
fromToken`0x${string}`The token to send (source token).src/client/evm/evm.types.ts:122
gasPrice?bigintThe price per unit of gas in wei.src/client/evm/evm.types.ts:132
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:136
networkEvmSwapsNetworkThe network to create a swap quote on.src/client/evm/evm.types.ts:118
signerAddress?`0x${string}`The address signing the swap (only needed if taker is a smart contract, i.e. for smart account swaps).src/client/evm/evm.types.ts:128
slippageBps?numberThe slippage tolerance in basis points (0-10000).src/client/evm/evm.types.ts:134
smartAccount?{ address: `0x${string}`; fund: (options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>; getUserOperation: (options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>; listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>; name?: string; owners: EvmAccount[]; policies: undefined | string[]; quoteFund: (options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>; quoteSwap: (options: SmartAccountQuoteSwapOptions) => Promise<SmartAccountQuoteSwapResult>; requestFaucet: (options: Omit<RequestFaucetOptions, "address">) => Promise<RequestFaucetResult>; sendUserOperation: (options: Omit<SendUserOperationOptions<unknown[]>, "smartAccount">) => Promise<SendUserOperationReturnType>; signTypedData: (options: Omit<SignTypedDataOptions, "address"> & { network: KnownEvmNetworks; }) => Promise<`0x${string}`>; swap: (options: SmartAccountSwapOptions) => Promise<SmartAccountSwapResult>; transfer: (options: SmartAccountTransferOptions) => Promise<SendUserOperationReturnType>; type: "evm-smart"; useNetwork: <Network>(network: Network) => Promise<{ [K in string | number | symbol]: (Omit<EvmSmartAccountProperties, “useNetwork”> & { [K in string | number | symbol]: ({ getUserOperation: …; sendUserOperation: …; waitForUserOperation: … } & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)))[K] } & { network: Network })[K] }>; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>; waitForUserOperation: (options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>; waitForFundOperationReceipt: Promise<WaitForFundOperationResult>; }The smart account object (required for smart account execution context only).src/client/evm/evm.types.ts:130
smartAccount.address`0x${string}`The smart account’s address.src/accounts/evm/types.ts:150
smartAccount.fund(options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>Funds an EVM account with the specified token amount. Example const fundOperation = await account.fund({ network: "base", token: "usdc", amount: 1000000n, });src/actions/evm/types.ts:126
smartAccount.getUserOperation(options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>Gets a user operation by its hash. Example const userOp = await smartAccount.getUserOperation({ userOpHash: "0x1234567890123456789012345678901234567890", });src/actions/evm/types.ts:556
smartAccount.listTokenBalances(options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>List the token balances of an account. Example lines const balances = await account.listTokenBalances({ network: "base-sepolia", });src/actions/evm/types.ts:58
smartAccount.name?stringThe name of the smart account.src/accounts/evm/types.ts:152
smartAccount.ownersEvmAccount[]Array of accounts that own and can sign for the smart account (currently only supports one owner but will be extended to support multiple owners in the future).src/accounts/evm/types.ts:154
smartAccount.policiesundefined | string[]The list of policy IDs that apply to the smart account. This will include both the project-level policy and the account-level policy, if one exists.src/accounts/evm/types.ts:158
smartAccount.quoteFund(options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>Gets a quote to fund an EVM account. Example const quote = await account.quoteFund({ network: "base", token: "usdc", amount: 1000000n, });src/actions/evm/types.ts:103
smartAccount.quoteSwap(options: SmartAccountQuoteSwapOptions) => Promise<SmartAccountQuoteSwapResult>Creates a swap quote without executing the transaction. This is useful when you need to get swap details before executing the swap. The taker is automatically set to the smart account’s address. Example const swapQuote = await smartAccount.quoteSwap({ network: "base", fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC fromAmount: BigInt("1000000000000000000"), // 1 WETH in wei }); if (swapQuote.liquidityAvailable) { console.log(Can swap for $ USDC); }src/actions/evm/types.ts:590
smartAccount.requestFaucet(options: Omit<RequestFaucetOptions, "address">) => Promise<RequestFaucetResult>Requests funds from an EVM faucet. Example const result = await account.requestFaucet({ network: "base-sepolia", token: "eth", });src/actions/evm/types.ts:80
smartAccount.sendUserOperation(options: Omit<SendUserOperationOptions<unknown[]>, "smartAccount">) => Promise<SendUserOperationReturnType>Sends a user operation. Example const userOp = await smartAccount.sendUserOperation({ network: "base-sepolia", calls: [ { to: "0x1234567890123456789012345678901234567890", value: parseEther("0.000001"), data: "0x", }, ], });src/actions/evm/types.ts:504
smartAccount.signTypedData(options: Omit<SignTypedDataOptions, "address"> & { network: KnownEvmNetworks; }) => Promise<`0x${string}`>Signs a typed data message. Example const signature = await smartAccount.signTypedData({ network: "base-sepolia", typedData: { domain: { name: "Test", chainId: 84532, verifyingContract: "0x0000000000000000000000000000000000000000", }, types: { Test: [{ name: "name", type: "string" }], }, primaryType: "Test", message: { name: "John Doe", }, }, });src/actions/evm/types.ts:681
smartAccount.swap(options: SmartAccountSwapOptions) => Promise<SmartAccountSwapResult>Executes a token swap on the specified network via a user operation. This method handles all the steps required for a swap, including Permit2 signatures if needed. The taker is automatically set to the smart account’s address. Throws If liquidity is not available when using inline options. Examples // First create a swap quote const swapQuote = await cdp.evm.createSwapQuote({ network: "base", toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH fromAmount: BigInt("1000000000000000000"), // 1 WETH in wei taker: smartAccount.address, signerAddress: smartAccount.owners[0].address }); // Check if liquidity is available if (!swapQuote.liquidityAvailable) { console.error("Insufficient liquidity for swap"); return; } // Execute the swap const { userOpHash } = await smartAccount.swap({ swapQuote: swapQuote }); console.log(Swap executed with user op hash: userOpHash);//CreateandexecuteswapinonecallconstuserOpHash=awaitsmartAccount.swap(network:"base",toToken:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",//USDCfromToken:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",//WETHfromAmount:BigInt("1000000000000000000"),//1WETHinwei);console.log(Swapexecutedwithuserophash:{userOpHash}`);` `// Create and execute swap in one call const { userOpHash } = await smartAccount.swap({ network: "base", toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH fromAmount: BigInt("1000000000000000000"), // 1 WETH in wei }); console.log(`Swap executed with user op hash: );src/actions/evm/types.ts:649
smartAccount.transfer(options: SmartAccountTransferOptions) => Promise<SendUserOperationReturnType>Transfer an amount of a token from an account to another account. Examples lines const { userOpHash } = await sender.transfer({ to: "0x9F663335Cd6Ad02a37B633602E98866CF944124d", amount: 10000n, // equivalent to 0.01 USDC token: "usdc", network: "base-sepolia", }); Using parseUnits to specify USDC amount lines import { parseUnits } from "viem"; const { userOpHash } = await sender.transfer({ to: "0x9F663335Cd6Ad02a37B633602E98866CF944124d", amount: parseUnits("0.01", 6), // USDC uses 6 decimal places token: "usdc", network: "base-sepolia", }); Transfer ETH lines import { parseEther } from "viem"; const { userOpHash } = await sender.transfer({ to: "0x9F663335Cd6Ad02a37B633602E98866CF944124d", amount: parseEther("0.000001"), token: "eth", network: "base-sepolia", }); Using a contract address lines import { parseEther } from "viem"; const { userOpHash } = await sender.transfer({ to: "0x9F663335Cd6Ad02a37B633602E98866CF944124d", amount: parseEther("0.000001"), token: "0x4200000000000000000000000000000000000006", // WETH on Base Sepolia network: "base-sepolia", }); Transfer to another account lines const sender = await cdp.evm.createAccount({ name: "Sender" }); const receiver = await cdp.evm.createAccount({ name: "Receiver" }); const { userOpHash } = await sender.transfer({ to: receiver, amount: 10000n, // equivalent to 0.01 USDC token: "usdc", network: "base-sepolia", });src/actions/evm/types.ts:476
smartAccount.type"evm-smart"Identifier for the smart account type.src/accounts/evm/types.ts:156
smartAccount.useNetwork<Network>(network: Network) => Promise<{ [K in string | number | symbol]: (Omit<EvmSmartAccountProperties, “useNetwork”> & { [K in string | number | symbol]: ({ getUserOperation: …; sendUserOperation: …; waitForUserOperation: … } & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)))[K] } & { network: Network })[K] }>A function that returns a network-scoped smart account. Example // For known networks, type is inferred automatically: const baseAccount = await smartAccount.useNetwork("base"); // For custom RPC URLs with type hints (requires casting): const typedAccount = await smartAccount.useNetwork<"base">("https://mainnet.base.org" as "base"); // For custom RPC URLs without type hints (only sendTransaction, transfer and waitForTransactionReceipt methods available): const customAccount = await smartAccount.useNetwork("https://mainnet.base.org");src/accounts/evm/types.ts:173
smartAccount.useSpendPermission(options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>Uses a spend permission to execute a transaction via user operation. This allows the smart account to spend tokens that have been approved via a spend permission. Throws If the network doesn’t support spend permissions via CDP API. Example lines const spendPermission = { account: "0x1234...", // Smart account that owns the tokens spender: smartAccount.address, // This smart account that can spend token: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH allowance: parseEther("0.01"), period: 86400, // 1 day start: 0, end: 281474976710655, salt: 0n, extraData: "0x", }; const result = await smartAccount.useSpendPermission({ spendPermission, value: parseEther("0.001"), // Spend 0.001 ETH network: "base-sepolia", });src/actions/evm/types.ts:719
smartAccount.waitForUserOperation(options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>Waits for a user operation to complete or fail. Example // Send a user operation and get the user operation hash const { userOpHash } = await smartAccount.sendUserOperation({ network: "base-sepolia", calls: [ { to: "0x0000000000000000000000000000000000000000", value: parseEther("0.000001"), data: "0x", }, ], }); // Wait for the user operation to complete or fail const result = await smartAccount.waitForUserOperation({ userOpHash: userOp.userOpHash, });src/actions/evm/types.ts:537
smartAccount.waitForFundOperationReceiptPromise<WaitForFundOperationResult>-src/actions/evm/types.ts:143
taker`0x${string}`The address receiving the output of the swap.src/client/evm/evm.types.ts:126
toToken`0x${string}`The token to receive (destination token).src/client/evm/evm.types.ts:120

CreateSwapQuoteResult

Defined in: src/client/evm/evm.types.ts:224 Result of creating a swap quote.

Properties

PropertyTypeDescriptionDefined in
blockNumberbigintThe block number at which the liquidity conditions were examined.src/client/evm/evm.types.ts:240
execute(options?: ExecuteSwapQuoteOptions) => Promise<ExecuteSwapQuoteResult>Execute the swap using the quote.src/client/evm/evm.types.ts:269
feesSwapFeesThe estimated fees for the swap.src/client/evm/evm.types.ts:242
fromAmountbigintThe amount to send in atomic units of the token.src/client/evm/evm.types.ts:234
fromToken`0x${string}`The token to send (source token).src/client/evm/evm.types.ts:232
issuesSwapIssuesPotential issues discovered during validation.src/client/evm/evm.types.ts:244
liquidityAvailabletrueWhether liquidity is available for the swap.src/client/evm/evm.types.ts:226
minToAmountbigintThe minimum amount to receive after slippage in atomic units of the token.src/client/evm/evm.types.ts:238
networkEvmSwapsNetworkThe network for which this swap quote was created.src/client/evm/evm.types.ts:228
permit2?{ eip712: EIP712Message; }Permit2 data if required for the swap.src/client/evm/evm.types.ts:259
permit2.eip712EIP712MessageEIP-712 typed data for signing.src/client/evm/evm.types.ts:261
toAmountbigintThe amount to receive in atomic units of the token.src/client/evm/evm.types.ts:236
toToken`0x${string}`The token to receive (destination token).src/client/evm/evm.types.ts:230
transaction?{ data: `0x${string}`; gas: bigint; gasPrice: bigint; to: `0x${string}`; value: bigint; }The transaction to execute the swap.src/client/evm/evm.types.ts:246
transaction.data`0x${string}`The transaction data.src/client/evm/evm.types.ts:250
transaction.gasbigintThe gas limit for the transaction.src/client/evm/evm.types.ts:254
transaction.gasPricebigintThe gas price for the transaction in Wei.src/client/evm/evm.types.ts:256
transaction.to`0x${string}`The contract address to send the transaction to.src/client/evm/evm.types.ts:248
transaction.valuebigintThe value to send with the transaction in Wei.src/client/evm/evm.types.ts:252

EvmCall

Defined in: src/client/evm/evm.types.ts:299 A call to be executed in a user operation.

Properties

PropertyTypeDescriptionDefined in
data`0x${string}`The call data to send. This is the hex-encoded data of the function call consisting of the method selector and the function arguments.src/client/evm/evm.types.ts:309
to`0x${string}`The address the call is directed to.src/client/evm/evm.types.ts:303
valuebigintThe amount of ETH to send with the call, in wei.src/client/evm/evm.types.ts:305

ExecuteSwapQuoteOptions

Defined in: src/client/evm/evm.types.ts:202 Options for executing a swap quote.

Properties

PropertyTypeDescriptionDefined in
idempotencyKey?stringOptional idempotency key for the request.src/client/evm/evm.types.ts:204

ExecuteSwapQuoteResult

Defined in: src/client/evm/evm.types.ts:210 Result of executing a swap quote.

Properties

PropertyTypeDescriptionDefined in
smartAccountAddress?`0x${string}`The address of the smart account (for smart account swaps).src/client/evm/evm.types.ts:216
status?"broadcast"The status of the user operation (for smart accounts swaps).src/client/evm/evm.types.ts:218
transactionHash?`0x${string}`The transaction hash of the executed swap (for EOA swaps).src/client/evm/evm.types.ts:212
userOpHash?`0x${string}`The user operation hash of the executed swap (for smart account swaps).src/client/evm/evm.types.ts:214

ExportServerAccountOptions

Defined in: src/client/evm/evm.types.ts:365 Options for exporting an EVM server account.

Properties

PropertyTypeDescriptionDefined in
address?`0x${string}`The address of the account.src/client/evm/evm.types.ts:367
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:371
name?stringThe name of the account.src/client/evm/evm.types.ts:369

GetOrCreateServerAccountOptions

Defined in: src/client/evm/evm.types.ts:399 Options for getting an EVM account, or creating one if it doesn’t exist.

Properties

PropertyTypeDescriptionDefined in
namestringThe name of the account.src/client/evm/evm.types.ts:401

GetOrCreateSmartAccountOptions

Defined in: src/client/evm/evm.types.ts:407 Options for getting an EVM account, or creating one if it doesn’t exist.

Properties

PropertyTypeDescriptionDefined in
enableSpendPermissions?booleanThe flag to enable spend permissions.src/client/evm/evm.types.ts:413
namestringThe name of the account.src/client/evm/evm.types.ts:409
ownerEvmAccountThe owner of the account.src/client/evm/evm.types.ts:411

GetServerAccountOptions

Defined in: src/client/evm/evm.types.ts:377 Options for getting an EVM account.

Properties

PropertyTypeDescriptionDefined in
address?`0x${string}`The address of the account.src/client/evm/evm.types.ts:379
name?stringThe name of the account.src/client/evm/evm.types.ts:381

GetSmartAccountOptions

Defined in: src/client/evm/evm.types.ts:387 Options for getting an EVM smart account.

Properties

PropertyTypeDescriptionDefined in
address?`0x${string}`The address of the account.src/client/evm/evm.types.ts:389
name?stringThe name of the account.src/client/evm/evm.types.ts:393
ownerEvmAccountThe owner of the account.src/client/evm/evm.types.ts:391

GetSwapPriceOptions

Defined in: src/client/evm/evm.types.ts:142 Options for getting a swap price.

Properties

PropertyTypeDescriptionDefined in
fromAmountbigintThe amount to send in atomic units of the token.src/client/evm/evm.types.ts:150
fromToken`0x${string}`The token to send (source token).src/client/evm/evm.types.ts:148
gasPrice?bigintThe gas price in Wei.src/client/evm/evm.types.ts:156
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:160
networkEvmSwapsNetworkThe network to get a price from.src/client/evm/evm.types.ts:144
signerAddress?`0x${string}`The signer address (only needed if taker is a smart contract).src/client/evm/evm.types.ts:154
slippageBps?numberThe slippage tolerance in basis points (0-10000).src/client/evm/evm.types.ts:158
taker`0x${string}`The address that will perform the swap.src/client/evm/evm.types.ts:152
toToken`0x${string}`The token to receive (destination token).src/client/evm/evm.types.ts:146

GetSwapPriceResult

Defined in: src/client/evm/evm.types.ts:166 Result of getting a swap price.

Properties

PropertyTypeDescriptionDefined in
blockNumberbigintThe block number at which the liquidity conditions were examined.src/client/evm/evm.types.ts:180
feesSwapFeesThe estimated fees for the swap.src/client/evm/evm.types.ts:182
fromAmountbigintThe amount to send in atomic units of the token.src/client/evm/evm.types.ts:174
fromToken`0x${string}`The token to send (source token).src/client/evm/evm.types.ts:172
gas?bigintThe gas estimate for the swap.src/client/evm/evm.types.ts:186
gasPrice?bigintThe gas price in Wei.src/client/evm/evm.types.ts:188
issuesSwapIssuesPotential issues discovered during validation.src/client/evm/evm.types.ts:184
liquidityAvailabletrueWhether liquidity is available for the swap.src/client/evm/evm.types.ts:168
minToAmountbigintThe minimum amount to receive after slippage in atomic units of the token.src/client/evm/evm.types.ts:178
toAmountbigintThe amount to receive in atomic units of the token.src/client/evm/evm.types.ts:176
toToken`0x${string}`The token to receive (destination token).src/client/evm/evm.types.ts:170

GetUserOperationOptions

Defined in: src/client/evm/evm.types.ts:275 Options for getting a user operation.

Properties

PropertyTypeDescriptionDefined in
smartAccount| `0x${string}` | { address: `0x${string}`; fund: (options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>; getUserOperation: (options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>; listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>; name?: string; owners: EvmAccount[]; policies: undefined | string[]; quoteFund: (options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>; quoteSwap: (options: SmartAccountQuoteSwapOptions) => Promise<SmartAccountQuoteSwapResult>; requestFaucet: (options: Omit<RequestFaucetOptions, "address">) => Promise<RequestFaucetResult>; sendUserOperation: (options: Omit<SendUserOperationOptions<unknown[]>, "smartAccount">) => Promise<SendUserOperationReturnType>; signTypedData: (options: Omit<SignTypedDataOptions, "address"> & { network: KnownEvmNetworks; }) => Promise<`0x${string}`>; swap: (options: SmartAccountSwapOptions) => Promise<SmartAccountSwapResult>; transfer: (options: SmartAccountTransferOptions) => Promise<SendUserOperationReturnType>; type: "evm-smart"; useNetwork: <Network>(network: Network) => Promise<{ [K in string | number | symbol]: (Omit<EvmSmartAccountProperties, “useNetwork”> & { [K in string | number | symbol]: ({ getUserOperation: …; sendUserOperation: …; waitForUserOperation: … } & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)))[K] } & { network: Network })[K] }>; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>; waitForUserOperation: (options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>; waitForFundOperationReceipt: Promise<WaitForFundOperationResult>; } | ReadonlySmartAccountThe smart account.src/client/evm/evm.types.ts:277
userOpHash`0x${string}`The user operation hash.src/client/evm/evm.types.ts:279

ImportServerAccountOptions

Defined in: src/client/evm/evm.types.ts:351 Options for importing an EVM server account.

Properties

PropertyTypeDescriptionDefined in
encryptionPublicKey?stringThe public RSA key used to encrypt the private key when importing an EVM account.src/client/evm/evm.types.ts:353
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:357
name?stringThe name of the account.src/client/evm/evm.types.ts:355
privateKey`0x${string}`The private key of the account.src/client/evm/evm.types.ts:359

ListServerAccountResult

Defined in: src/client/evm/evm.types.ts:477 The result of listing EVM server accounts.

Properties

PropertyTypeDescriptionDefined in
accounts{ address: `0x${string}`; fund: (options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>; listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>; name?: string; policies?: string[]; quoteFund: (options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>; quoteSwap: (options: AccountQuoteSwapOptions) => Promise<AccountQuoteSwapResult>; requestFaucet: (options: Omit<RequestFaucetOptions, "address">) => Promise<RequestFaucetResult>; sendTransaction: (options: Omit<SendTransactionOptions, "address">) => Promise<TransactionResult>; sign: (parameters: { hash: `0x${string}`; }) => Promise<`0x${string}`>; signMessage: (parameters: { message: SignableMessage; }) => Promise<`0x${string}`>; signTransaction: (transaction: TransactionSerializable) => Promise<`0x${string}`>; signTypedData: <typedData, primaryType>(parameters: TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>; swap: (options: AccountSwapOptions) => Promise<SendSwapTransactionResult>; transfer: (options: TransferOptions) => Promise<{ transactionHash: `0x${string}`; }>; type: "evm-server"; useNetwork: <Network>(network: Network) => Promise<{ [K in string | number | symbol]: (Omit<{ address: `0x\{string\}\`; fund: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; listTokenBalances: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; name?: string; policies?: (...)\[\]; quoteFund: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; quoteSwap: (options: AccountQuoteSwapOptions) =\> Promise\<(...)\>; requestFaucet: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; sendTransaction: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; sign: (parameters: \{ hash: ... \}) =\> Promise\<(...)\>; signMessage: (parameters: \{ message: ... \}) =\> Promise\<(...)\>; signTransaction: (transaction: TransactionSerializable) =\> Promise\<(...)\>; signTypedData: (parameters: TypedDataDefinition\<(...), (...)\>) =\> Promise\<(...)\>; swap: (options: AccountSwapOptions) =\> Promise\<(...)\>; transfer: (options: TransferOptions) =\> Promise\<(...)\>; type: "evm-server"; useNetwork: \<Network extends NetworkOrRpcUrl\>(network: Network) =\> Promise\<\{ \[K in keyof (Omit\<\{ address: \`0x{string}`; sign: (parameters: { hash: `0x{string};ˋ})=Promise\<0ˋx\{string\}\`; \}) =\> Promise\<\`0x{string}`>; signMessage: (parameters: { message: SignableMessage; }) => Promise<…>; … 15 more …; useNetwork: …; }, “transfer” | … 5 more …; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<(…)>; waitForFundOperationReceipt: any }, “transfer” | “sendTransaction” | “quoteSwap” | “swap” | “useSpendPermission” | “useNetwork” | (keyof Actions)> & { [K in string | number | symbol]: ({ sendTransaction: …; transfer: …; waitForTransactionReceipt: … } & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)) & ((…) extends (…) ? (…) : (…)))[K] } & { network: Network })[K] }>; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<TransactionResult>; waitForFundOperationReceipt: Promise<WaitForFundOperationResult>; }[]The accounts.src/client/evm/evm.types.ts:479
nextPageToken?stringThe next page token to paginate through the accounts. If undefined, there are no more accounts to paginate through.src/client/evm/evm.types.ts:484

ListServerAccountsOptions

Defined in: src/client/evm/evm.types.ts:419 Options for listing EVM accounts.

Properties

PropertyTypeDescriptionDefined in
pageSize?numberThe page size to paginate through the accounts.src/client/evm/evm.types.ts:421
pageToken?stringThe page token to paginate through the accounts.src/client/evm/evm.types.ts:423

ListSmartAccountResult

Defined in: src/client/evm/evm.types.ts:464 The result of listing EVM smart accounts.

Properties

PropertyTypeDescriptionDefined in
accountsReadonlySmartAccount[]The accounts.src/client/evm/evm.types.ts:466
nextPageToken?stringThe next page token to paginate through the accounts. If undefined, there are no more accounts to paginate through.src/client/evm/evm.types.ts:471

ListSmartAccountsOptions

Defined in: src/client/evm/evm.types.ts:490 Options for listing EVM smart accounts.

Properties

PropertyTypeDescriptionDefined in
name?stringThe name of the account.src/client/evm/evm.types.ts:492
pageSize?numberThe page size to paginate through the accounts.src/client/evm/evm.types.ts:494
pageToken?stringThe page token to paginate through the accounts.src/client/evm/evm.types.ts:496

PrepareUserOperationOptions

Defined in: src/client/evm/evm.types.ts:285 Options for preparing a user operation.

Properties

PropertyTypeDescriptionDefined in
callsreadonly { data: `0x${string}`; to: `0x${string}`; value: bigint; }[]The calls.src/client/evm/evm.types.ts:291
networkEvmUserOperationNetworkThe network.src/client/evm/evm.types.ts:289
paymasterUrl?stringThe paymaster URL.src/client/evm/evm.types.ts:293
smartAccount{ address: `0x${string}`; fund: (options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>; getUserOperation: (options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>; listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>; name?: string; owners: EvmAccount[]; policies: undefined | string[]; quoteFund: (options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>; quoteSwap: (options: SmartAccountQuoteSwapOptions) => Promise<SmartAccountQuoteSwapResult>; requestFaucet: (options: Omit<RequestFaucetOptions, "address">) => Promise<RequestFaucetResult>; sendUserOperation: (options: Omit<SendUserOperationOptions<unknown[]>, "smartAccount">) => Promise<SendUserOperationReturnType>; signTypedData: (options: Omit<SignTypedDataOptions, "address"> & { network: KnownEvmNetworks; }) => Promise<`0x${string}`>; swap: (options: SmartAccountSwapOptions) => Promise<SmartAccountSwapResult>; transfer: (options: SmartAccountTransferOptions) => Promise<SendUserOperationReturnType>; type: "evm-smart"; useNetwork: <Network>(network: Network) => Promise<{ [K in string | number | symbol]: (Omit<EvmSmartAccountProperties, “useNetwork”> & { [K in string | number | symbol]: ({ getUserOperation: (options: …) => …; sendUserOperation: (options: …) => …; waitForUserOperation: (options: …) => … } & (Network extends TransferNetworks ? { transfer: … } : EmptyObject) & (Network extends ListTokenBalancesNetworks ? { listTokenBalances: … } : EmptyObject) & (Network extends RequestFaucetNetworks ? { requestFaucet: … } : EmptyObject) & (Network extends “base” ? { quoteFund: … } : EmptyObject) & (Network extends “base” ? { fund: …; waitForFundOperationReceipt: … } : EmptyObject) & (Network extends QuoteSwapNetworks ? { quoteSwap: … } : EmptyObject) & (Network extends SwapNetworks ? { swap: … } : EmptyObject) & (Network extends SpendPermissionNetwork ? { useSpendPermission: … } : EmptyObject))[K] } & { network: Network })[K] }>; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>; waitForUserOperation: (options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>; waitForFundOperationReceipt: Promise<WaitForFundOperationResult>; }The smart account.src/client/evm/evm.types.ts:287
smartAccount.address`0x${string}`The smart account’s address.src/accounts/evm/types.ts:150
smartAccount.fund(options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>Funds an EVM account with the specified token amount. Example const fundOperation = await account.fund({ network: "base", token: "usdc", amount: 1000000n, });src/actions/evm/types.ts:126
smartAccount.getUserOperation(options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>Gets a user operation by its hash. Example const userOp = await smartAccount.getUserOperation({ userOpHash: "0x1234567890123456789012345678901234567890", });src/actions/evm/types.ts:556
smartAccount.listTokenBalances(options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>List the token balances of an account. Example lines const balances = await account.listTokenBalances({ network: "base-sepolia", });src/actions/evm/types.ts:58
smartAccount.name?stringThe name of the smart account.src/accounts/evm/types.ts:152
smartAccount.ownersEvmAccount[]Array of accounts that own and can sign for the smart account (currently only supports one owner but will be extended to support multiple owners in the future).src/accounts/evm/types.ts:154
smartAccount.policiesundefined | string[]The list of policy IDs that apply to the smart account. This will include both the project-level policy and the account-level policy, if one exists.src/accounts/evm/types.ts:158
smartAccount.quoteFund(options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>Gets a quote to fund an EVM account. Example const quote = await account.quoteFund({ network: "base", token: "usdc", amount: 1000000n, });src/actions/evm/types.ts:103
smartAccount.quoteSwap(options: SmartAccountQuoteSwapOptions) => Promise<SmartAccountQuoteSwapResult>Creates a swap quote without executing the transaction. This is useful when you need to get swap details before executing the swap. The taker is automatically set to the smart account’s address. Example const swapQuote = await smartAccount.quoteSwap({ network: "base", fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC fromAmount: BigInt("1000000000000000000"), // 1 WETH in wei }); if (swapQuote.liquidityAvailable) { console.log(Can swap for $ USDC); }src/actions/evm/types.ts:590
smartAccount.requestFaucet(options: Omit<RequestFaucetOptions, "address">) => Promise<RequestFaucetResult>Requests funds from an EVM faucet. Example const result = await account.requestFaucet({ network: "base-sepolia", token: "eth", });src/actions/evm/types.ts:80
smartAccount.sendUserOperation(options: Omit<SendUserOperationOptions<unknown[]>, "smartAccount">) => Promise<SendUserOperationReturnType>Sends a user operation. Example const userOp = await smartAccount.sendUserOperation({ network: "base-sepolia", calls: [ { to: "0x1234567890123456789012345678901234567890", value: parseEther("0.000001"), data: "0x", }, ], });src/actions/evm/types.ts:504
smartAccount.signTypedData(options: Omit<SignTypedDataOptions, "address"> & { network: KnownEvmNetworks; }) => Promise<`0x${string}`>Signs a typed data message. Example const signature = await smartAccount.signTypedData({ network: "base-sepolia", typedData: { domain: { name: "Test", chainId: 84532, verifyingContract: "0x0000000000000000000000000000000000000000", }, types: { Test: [{ name: "name", type: "string" }], }, primaryType: "Test", message: { name: "John Doe", }, }, });src/actions/evm/types.ts:681
smartAccount.swap(options: SmartAccountSwapOptions) => Promise<SmartAccountSwapResult>Executes a token swap on the specified network via a user operation. This method handles all the steps required for a swap, including Permit2 signatures if needed. The taker is automatically set to the smart account’s address. Throws If liquidity is not available when using inline options. Examples // First create a swap quote const swapQuote = await cdp.evm.createSwapQuote({ network: "base", toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH fromAmount: BigInt("1000000000000000000"), // 1 WETH in wei taker: smartAccount.address, signerAddress: smartAccount.owners[0].address }); // Check if liquidity is available if (!swapQuote.liquidityAvailable) { console.error("Insufficient liquidity for swap"); return; } // Execute the swap const { userOpHash } = await smartAccount.swap({ swapQuote: swapQuote }); console.log(Swap executed with user op hash: userOpHash);//CreateandexecuteswapinonecallconstuserOpHash=awaitsmartAccount.swap(network:"base",toToken:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",//USDCfromToken:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",//WETHfromAmount:BigInt("1000000000000000000"),//1WETHinwei);console.log(Swapexecutedwithuserophash:{userOpHash}`);` `// Create and execute swap in one call const { userOpHash } = await smartAccount.swap({ network: "base", toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH fromAmount: BigInt("1000000000000000000"), // 1 WETH in wei }); console.log(`Swap executed with user op hash: );src/actions/evm/types.ts:649
smartAccount.transfer(options: SmartAccountTransferOptions) => Promise<SendUserOperationReturnType>Transfer an amount of a token from an account to another account. Examples lines const { userOpHash } = await sender.transfer({ to: "0x9F663335Cd6Ad02a37B633602E98866CF944124d", amount: 10000n, // equivalent to 0.01 USDC token: "usdc", network: "base-sepolia", }); Using parseUnits to specify USDC amount lines import { parseUnits } from "viem"; const { userOpHash } = await sender.transfer({ to: "0x9F663335Cd6Ad02a37B633602E98866CF944124d", amount: parseUnits("0.01", 6), // USDC uses 6 decimal places token: "usdc", network: "base-sepolia", }); Transfer ETH lines import { parseEther } from "viem"; const { userOpHash } = await sender.transfer({ to: "0x9F663335Cd6Ad02a37B633602E98866CF944124d", amount: parseEther("0.000001"), token: "eth", network: "base-sepolia", }); Using a contract address lines import { parseEther } from "viem"; const { userOpHash } = await sender.transfer({ to: "0x9F663335Cd6Ad02a37B633602E98866CF944124d", amount: parseEther("0.000001"), token: "0x4200000000000000000000000000000000000006", // WETH on Base Sepolia network: "base-sepolia", }); Transfer to another account lines const sender = await cdp.evm.createAccount({ name: "Sender" }); const receiver = await cdp.evm.createAccount({ name: "Receiver" }); const { userOpHash } = await sender.transfer({ to: receiver, amount: 10000n, // equivalent to 0.01 USDC token: "usdc", network: "base-sepolia", });src/actions/evm/types.ts:476
smartAccount.type"evm-smart"Identifier for the smart account type.src/accounts/evm/types.ts:156
smartAccount.useNetwork<Network>(network: Network) => Promise<{ [K in string | number | symbol]: (Omit<EvmSmartAccountProperties, “useNetwork”> & { [K in string | number | symbol]: ({ getUserOperation: (options: …) => …; sendUserOperation: (options: …) => …; waitForUserOperation: (options: …) => … } & (Network extends TransferNetworks ? { transfer: … } : EmptyObject) & (Network extends ListTokenBalancesNetworks ? { listTokenBalances: … } : EmptyObject) & (Network extends RequestFaucetNetworks ? { requestFaucet: … } : EmptyObject) & (Network extends “base” ? { quoteFund: … } : EmptyObject) & (Network extends “base” ? { fund: …; waitForFundOperationReceipt: … } : EmptyObject) & (Network extends QuoteSwapNetworks ? { quoteSwap: … } : EmptyObject) & (Network extends SwapNetworks ? { swap: … } : EmptyObject) & (Network extends SpendPermissionNetwork ? { useSpendPermission: … } : EmptyObject))[K] } & { network: Network })[K] }>A function that returns a network-scoped smart account. Example // For known networks, type is inferred automatically: const baseAccount = await smartAccount.useNetwork("base"); // For custom RPC URLs with type hints (requires casting): const typedAccount = await smartAccount.useNetwork<"base">("https://mainnet.base.org" as "base"); // For custom RPC URLs without type hints (only sendTransaction, transfer and waitForTransactionReceipt methods available): const customAccount = await smartAccount.useNetwork("https://mainnet.base.org");src/accounts/evm/types.ts:173
smartAccount.useSpendPermission(options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>Uses a spend permission to execute a transaction via user operation. This allows the smart account to spend tokens that have been approved via a spend permission. Throws If the network doesn’t support spend permissions via CDP API. Example lines const spendPermission = { account: "0x1234...", // Smart account that owns the tokens spender: smartAccount.address, // This smart account that can spend token: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH allowance: parseEther("0.01"), period: 86400, // 1 day start: 0, end: 281474976710655, salt: 0n, extraData: "0x", }; const result = await smartAccount.useSpendPermission({ spendPermission, value: parseEther("0.001"), // Spend 0.001 ETH network: "base-sepolia", });src/actions/evm/types.ts:719
smartAccount.waitForUserOperation(options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>Waits for a user operation to complete or fail. Example // Send a user operation and get the user operation hash const { userOpHash } = await smartAccount.sendUserOperation({ network: "base-sepolia", calls: [ { to: "0x0000000000000000000000000000000000000000", value: parseEther("0.000001"), data: "0x", }, ], }); // Wait for the user operation to complete or fail const result = await smartAccount.waitForUserOperation({ userOpHash: userOp.userOpHash, });src/actions/evm/types.ts:537
smartAccount.waitForFundOperationReceiptPromise<WaitForFundOperationResult>-src/actions/evm/types.ts:143

ReadonlySmartAccount

Defined in: src/client/evm/evm.types.ts:429 A smart account that only contains the owner address.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
address`0x${string}`The smart account’s address.Omit.addresssrc/accounts/evm/types.ts:150
name?stringThe name of the smart account.Omit.namesrc/accounts/evm/types.ts:152
owners`0x${string}`[]The owners of the smart account.-src/client/evm/evm.types.ts:432
policiesundefined | string[]The list of policy IDs that apply to the smart account. This will include both the project-level policy and the account-level policy, if one exists.Omit.policiessrc/accounts/evm/types.ts:158
type"evm-smart"Identifier for the smart account type.Omit.typesrc/accounts/evm/types.ts:156

SignatureResult

Defined in: src/client/evm/evm.types.ts:570 A signature result.

Properties

PropertyTypeDescriptionDefined in
signature`0x${string}`The signature.src/client/evm/evm.types.ts:572

SignHashOptions

Defined in: src/client/evm/evm.types.ts:516 Options for signing an EVM hash.

Properties

PropertyTypeDescriptionDefined in
address`0x${string}`The address of the account.src/client/evm/evm.types.ts:518
hash`0x${string}`The hash to sign.src/client/evm/evm.types.ts:520
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:522

SignMessageOptions

Defined in: src/client/evm/evm.types.ts:528 Options for signing an EVM message.

Properties

PropertyTypeDescriptionDefined in
address`0x${string}`The address of the account.src/client/evm/evm.types.ts:530
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:534
messagestringThe message to sign.src/client/evm/evm.types.ts:532

SignTransactionOptions

Defined in: src/client/evm/evm.types.ts:558 Options for signing an EVM transaction.

Properties

PropertyTypeDescriptionDefined in
address`0x${string}`The address of the account.src/client/evm/evm.types.ts:560
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:564
transaction`0x${string}`The RLP-encoded transaction to sign, as a 0x-prefixed hex string.src/client/evm/evm.types.ts:562

SignTypedDataOptions

Defined in: src/client/evm/evm.types.ts:540 Options for signing an EVM typed data message.

Properties

PropertyTypeDescriptionDefined in
address`0x${string}`The address of the account.src/client/evm/evm.types.ts:542
domainEIP712DomainThe domain of the message.src/client/evm/evm.types.ts:544
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:552
messageEIP712MessageMessageThe message to sign. The structure of this message must match the primaryType struct in the types object.src/client/evm/evm.types.ts:550
primaryTypestringThe primary type of the message. This is the name of the struct in the types object that is the root of the message.src/client/evm/evm.types.ts:548
typesEIP712TypesThe types of the message.src/client/evm/evm.types.ts:546

SmartAccountSignAndWrapTypedDataOptions

Defined in: src/client/evm/evm.types.ts:657 Options for signing and wrapping EIP-712 typed data with a smart account. This method handles the full smart account signature flow including replay-safe hashing.

Properties

PropertyTypeDescriptionDefined in
chainIdbigintThe chain ID for the signature (used for replay protection).src/client/evm/evm.types.ts:659
idempotencyKey?stringOptional idempotency key for the signing request.src/client/evm/evm.types.ts:665
ownerIndex?bigintThe index of the owner to sign with (defaults to 0).src/client/evm/evm.types.ts:663
typedDataEIP712MessageThe EIP-712 typed data message to sign.src/client/evm/evm.types.ts:661

SwapAllowanceIssue

Defined in: src/client/evm/evm.types.ts:598 Details of allowance issues for a swap.

Properties

PropertyTypeDescriptionDefined in
currentAllowancebigintThe current allowance of the fromToken by the taker.src/client/evm/evm.types.ts:600
spender`0x${string}`The address to set the allowance on.src/client/evm/evm.types.ts:602

SwapBalanceIssue

Defined in: src/client/evm/evm.types.ts:608 Details of balance issues for a swap.

Properties

PropertyTypeDescriptionDefined in
currentBalancebigintThe current balance of the fromToken by the taker.src/client/evm/evm.types.ts:612
requiredBalancebigintThe amount of the token that the taker must hold.src/client/evm/evm.types.ts:614
token`0x${string}`The contract address of the token.src/client/evm/evm.types.ts:610

SwapFees

Defined in: src/client/evm/evm.types.ts:588 The estimated fees for a swap.

Properties

PropertyTypeDescriptionDefined in
gasFee?TokenFeeThe estimated gas fee for the swap.src/client/evm/evm.types.ts:590
protocolFee?TokenFeeThe estimated protocol fee for the swap.src/client/evm/evm.types.ts:592

SwapIssues

Defined in: src/client/evm/evm.types.ts:620 Potential issues discovered during swap validation.

Properties

PropertyTypeDescriptionDefined in
allowance?SwapAllowanceIssueDetails of the allowances that the taker must set. Null if no allowance is required.src/client/evm/evm.types.ts:622
balance?SwapBalanceIssueDetails of the balance of the fromToken that the taker must hold. Null if sufficient balance.src/client/evm/evm.types.ts:624
simulationIncompletebooleanTrue when the transaction cannot be validated (e.g., insufficient balance).src/client/evm/evm.types.ts:626

SwapUnavailableResult

Defined in: src/client/evm/evm.types.ts:194 Result when liquidity is unavailable for a swap.

Properties

PropertyTypeDescriptionDefined in
liquidityAvailablefalseWhether liquidity is available for the swap.src/client/evm/evm.types.ts:196

TokenFee

Defined in: src/client/evm/evm.types.ts:578 A fee in a specific token.

Properties

PropertyTypeDescriptionDefined in
amountbigintThe amount of the fee in atomic units of the token.src/client/evm/evm.types.ts:580
token`0x${string}`The contract address of the token that the fee is paid in.src/client/evm/evm.types.ts:582

UpdateEvmAccountOptions

Defined in: src/client/evm/evm.types.ts:438 Options for creating an EVM server account.

Properties

PropertyTypeDescriptionDefined in
address`0x${string}`The address of the account.src/client/evm/evm.types.ts:440
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:444
updateUpdateEvmAccountBodyThe updates to apply to the accountsrc/client/evm/evm.types.ts:442

UpdateEvmSmartAccountOptions

Defined in: src/client/evm/evm.types.ts:450 Options for updating an EVM smart account.

Properties

PropertyTypeDescriptionDefined in
address`0x${string}`The address of the account.src/client/evm/evm.types.ts:452
idempotencyKey?stringThe idempotency key.src/client/evm/evm.types.ts:456
ownerEvmAccountThe owner of the account.src/client/evm/evm.types.ts:458
updateUpdateEvmSmartAccountBodyThe updates to apply to the accountsrc/client/evm/evm.types.ts:454

UserOperation

Defined in: src/client/evm/evm.types.ts:315 A user operation.

Properties

PropertyTypeDescriptionDefined in
callsreadonly { data: `0x${string}`; to: `0x${string}`; value: bigint; }[]The list of calls in the user operation.src/client/evm/evm.types.ts:323
networkEvmUserOperationNetworkThe network the user operation is for.src/client/evm/evm.types.ts:317
receipts?UserOperationReceipt[]The receipts associated with the broadcasted user operation.src/client/evm/evm.types.ts:333
statusEvmUserOperationStatusThe status of the user operation.src/client/evm/evm.types.ts:325
transactionHash?`0x${string}`The hash of the transaction that included this particular user operation. This gets set after the user operation is broadcasted and the transaction is included in a block.src/client/evm/evm.types.ts:329
userOpHash`0x${string}`The hash of the user operation. This is not the transaction hash, as a transaction consists of multiple user operations. The user operation hash is the hash of this particular user operation which gets signed by the owner of the Smart Account.src/client/evm/evm.types.ts:321

WaitForUserOperationOptions

Defined in: src/client/evm/evm.types.ts:632 Options for waiting for a user operation.

Properties

PropertyTypeDescriptionDefined in
smartAccountAddress`0x${string}`The smart account address.src/client/evm/evm.types.ts:634
userOpHash`0x${string}`The user operation hash.src/client/evm/evm.types.ts:636
waitOptions?WaitOptionsThe wait options.src/client/evm/evm.types.ts:638

Type Aliases

CreateSwapOptions

type CreateSwapOptions = CreateSwapQuoteOptions;
Defined in: src/client/evm/evm.types.ts:646 Legacy type aliases for backwards compatibility.

Deprecated

Use the new type names instead.

CreateSwapResult

type CreateSwapResult = CreateSwapQuoteResult;
Defined in: src/client/evm/evm.types.ts:647

EvmClientInterface

type EvmClientInterface = Omit<typeof OpenApiEvmMethods, 
  | "createEvmAccount"
  | "createEvmSmartAccount"
  | "createSpendPermission"
  | "listSpendPermissions"
  | "revokeSpendPermission"
  | "importEvmAccount"
  | "exportEvmAccount"
  | "exportEvmAccountByName"
  | "getEvmAccount"
  | "getEvmAccountByName"
  | "getEvmSmartAccount"
  | "getEvmSmartAccountByName"
  | "getEvmSwapPrice"
  | "createEvmSwapQuote"
  | "getUserOperation"
  | "updateEvmAccount"
  | "listEvmAccounts"
  | "listEvmSmartAccounts"
  | "listEvmTokenBalances"
  | "prepareUserOperation"
  | "requestEvmFaucet"
  | "sendUserOperation"
  | "signEvmHash"
  | "signEvmMessage"
  | "signEvmTransaction"
  | "signEvmTypedData"
  | "sendEvmTransaction"
  | "signEvmTypedData"
  | "updateEvmAccount"
  | "exportEvmAccount"
  | "exportEvmAccountByName"
  | "updateEvmSmartAccount"> & {
  createAccount: (options: CreateServerAccountOptions) => Promise<EvmServerAccount>;
  createSmartAccount: (options: CreateSmartAccountOptions) => Promise<EvmSmartAccount>;
  createSwapQuote: (options: CreateSwapQuoteOptions) => Promise<
     | CreateSwapQuoteResult
    | SwapUnavailableResult>;
  exportAccount: (options: ExportServerAccountOptions) => Promise<string>;
  getAccount: (options: GetServerAccountOptions) => Promise<EvmServerAccount>;
  getOrCreateAccount: (options: GetOrCreateServerAccountOptions) => Promise<EvmServerAccount>;
  getSmartAccount: (options: GetSmartAccountOptions) => Promise<EvmSmartAccount>;
  getSwapPrice: (options: GetSwapPriceOptions) => Promise<
     | GetSwapPriceResult
    | SwapUnavailableResult>;
  getUserOperation: (options: GetUserOperationOptions) => Promise<UserOperation>;
  importAccount: (options: ImportServerAccountOptions) => Promise<EvmServerAccount>;
  listAccounts: (options: ListServerAccountsOptions) => Promise<ListServerAccountResult>;
  listSmartAccounts: (options: ListSmartAccountsOptions) => Promise<ListSmartAccountResult>;
  listSpendPermissions: (options: ListSpendPermissionsOptions) => Promise<ListSpendPermissionsResult>;
  listTokenBalances: (options: ListTokenBalancesOptions) => Promise<ListTokenBalancesResult>;
  prepareUserOperation: (options: PrepareUserOperationOptions) => Promise<UserOperation>;
  requestFaucet: (options: RequestFaucetOptions) => Promise<RequestFaucetResult>;
  sendTransaction: (options: SendTransactionOptions) => Promise<TransactionResult>;
  sendUserOperation: (options: SendUserOperationOptions<unknown[]>) => Promise<SendUserOperationReturnType>;
  signHash: (options: SignHashOptions) => Promise<SignatureResult>;
  signMessage: (options: SignMessageOptions) => Promise<SignatureResult>;
  signTransaction: (options: SignTransactionOptions) => Promise<SignatureResult>;
  signTypedData: (options: SignTypedDataOptions) => Promise<SignatureResult>;
  updateAccount: (options: UpdateEvmAccountOptions) => Promise<EvmServerAccount>;
  updateSmartAccount: (options: UpdateEvmSmartAccountOptions) => Promise<EvmSmartAccount>;
};
Defined in: src/client/evm/evm.types.ts:42 The EvmClient type, where all OpenApiEvmMethods methods are wrapped.

Type declaration

createAccount()
createAccount: (options: CreateServerAccountOptions) => Promise<EvmServerAccount>;
Parameters
options
CreateServerAccountOptions
Returns
Promise<EvmServerAccount>
createSmartAccount()
createSmartAccount: (options: CreateSmartAccountOptions) => Promise<EvmSmartAccount>;
Parameters
options
CreateSmartAccountOptions
Returns
Promise<EvmSmartAccount>
createSwapQuote()
createSwapQuote: (options: CreateSwapQuoteOptions) => Promise<
  | CreateSwapQuoteResult
| SwapUnavailableResult>;
Parameters
options
CreateSwapQuoteOptions
Returns
Promise< | CreateSwapQuoteResult | SwapUnavailableResult>
exportAccount()
exportAccount: (options: ExportServerAccountOptions) => Promise<string>;
Parameters
options
ExportServerAccountOptions
Returns
Promise<string>
getAccount()
getAccount: (options: GetServerAccountOptions) => Promise<EvmServerAccount>;
Parameters
options
GetServerAccountOptions
Returns
Promise<EvmServerAccount>
getOrCreateAccount()
getOrCreateAccount: (options: GetOrCreateServerAccountOptions) => Promise<EvmServerAccount>;
Parameters
options
GetOrCreateServerAccountOptions
Returns
Promise<EvmServerAccount>
getSmartAccount()
getSmartAccount: (options: GetSmartAccountOptions) => Promise<EvmSmartAccount>;
Parameters
options
GetSmartAccountOptions
Returns
Promise<EvmSmartAccount>
getSwapPrice()
getSwapPrice: (options: GetSwapPriceOptions) => Promise<
  | GetSwapPriceResult
| SwapUnavailableResult>;
Parameters
options
GetSwapPriceOptions
Returns
Promise< | GetSwapPriceResult | SwapUnavailableResult>
getUserOperation()
getUserOperation: (options: GetUserOperationOptions) => Promise<UserOperation>;
Parameters
options
GetUserOperationOptions
Returns
Promise<UserOperation>
importAccount()
importAccount: (options: ImportServerAccountOptions) => Promise<EvmServerAccount>;
Parameters
options
ImportServerAccountOptions
Returns
Promise<EvmServerAccount>
listAccounts()
listAccounts: (options: ListServerAccountsOptions) => Promise<ListServerAccountResult>;
Parameters
options
ListServerAccountsOptions
Returns
Promise<ListServerAccountResult>
listSmartAccounts()
listSmartAccounts: (options: ListSmartAccountsOptions) => Promise<ListSmartAccountResult>;
Parameters
options
ListSmartAccountsOptions
Returns
Promise<ListSmartAccountResult>
listSpendPermissions()
listSpendPermissions: (options: ListSpendPermissionsOptions) => Promise<ListSpendPermissionsResult>;
Parameters
options
ListSpendPermissionsOptions
Returns
Promise<ListSpendPermissionsResult>
listTokenBalances()
listTokenBalances: (options: ListTokenBalancesOptions) => Promise<ListTokenBalancesResult>;
Parameters
options
ListTokenBalancesOptions
Returns
Promise<ListTokenBalancesResult>
prepareUserOperation()
prepareUserOperation: (options: PrepareUserOperationOptions) => Promise<UserOperation>;
Parameters
options
PrepareUserOperationOptions
Returns
Promise<UserOperation>
requestFaucet()
requestFaucet: (options: RequestFaucetOptions) => Promise<RequestFaucetResult>;
Parameters
options
RequestFaucetOptions
Returns
Promise<RequestFaucetResult>
sendTransaction()
sendTransaction: (options: SendTransactionOptions) => Promise<TransactionResult>;
Parameters
options
SendTransactionOptions
Returns
Promise<TransactionResult>
sendUserOperation()
sendUserOperation: (options: SendUserOperationOptions<unknown[]>) => Promise<SendUserOperationReturnType>;
Parameters
options
SendUserOperationOptions<unknown[]>
Returns
Promise<SendUserOperationReturnType>
signHash()
signHash: (options: SignHashOptions) => Promise<SignatureResult>;
Parameters
options
SignHashOptions
Returns
Promise<SignatureResult>
signMessage()
signMessage: (options: SignMessageOptions) => Promise<SignatureResult>;
Parameters
options
SignMessageOptions
Returns
Promise<SignatureResult>
signTransaction()
signTransaction: (options: SignTransactionOptions) => Promise<SignatureResult>;
Parameters
options
SignTransactionOptions
Returns
Promise<SignatureResult>
signTypedData()
signTypedData: (options: SignTypedDataOptions) => Promise<SignatureResult>;
Parameters
options
SignTypedDataOptions
Returns
Promise<SignatureResult>
updateAccount()
updateAccount: (options: UpdateEvmAccountOptions) => Promise<EvmServerAccount>;
Parameters
options
UpdateEvmAccountOptions
Returns
Promise<EvmServerAccount>
updateSmartAccount()
updateSmartAccount: (options: UpdateEvmSmartAccountOptions) => Promise<EvmSmartAccount>;
Parameters
options
UpdateEvmSmartAccountOptions
Returns
Promise<EvmSmartAccount>

GetSwapQuoteOptions

type GetSwapQuoteOptions = GetSwapPriceOptions;
Defined in: src/client/evm/evm.types.ts:648

GetSwapQuoteResult

type GetSwapQuoteResult = GetSwapPriceResult;
Defined in: src/client/evm/evm.types.ts:649

SwapPriceUnavailableResult

type SwapPriceUnavailableResult = SwapUnavailableResult;
Defined in: src/client/evm/evm.types.ts:651

SwapQuoteUnavailableResult

type SwapQuoteUnavailableResult = SwapUnavailableResult;
Defined in: src/client/evm/evm.types.ts:650

References

ServerAccount

Renames and re-exports EvmServerAccount

SmartAccount

Renames and re-exports EvmSmartAccount