Interfaces
CreateServerAccountOptions
Defined in: src/client/evm/evm.types.ts:339 Options for creating an EVM server account.Properties
accountPolicy?
idempotencyKey?
name?
CreateSmartAccountOptions
Defined in: src/client/evm/evm.types.ts:502 Options for creating an EVM smart account.Properties
enableSpendPermissions?
idempotencyKey?
name?
owner
CreateSwapQuoteOptions
Defined in: src/client/evm/evm.types.ts:116 Options for creating a swap quote between two tokens on an EVM network.Properties
fromAmount
fromToken
gasPrice?
idempotencyKey?
network
signerAddress?
slippageBps?
smartAccount?
address
fund()
Parameters
options
Omit
<EvmFundOptions
, "address"
>
The options for the fund operation.
Returns
Promise
<FundOperationResult
>
A promise that resolves to the fund operation result containing the transfer details.
Example
getUserOperation()
Parameters
options
Omit
<GetUserOperationOptions
, "smartAccount"
>
Parameters for getting the user operation.
Returns
Promise
<UserOperation
>
A promise that resolves to the user operation.
Example
listTokenBalances()
Parameters
options
Omit
<ListTokenBalancesOptions
, "address"
>
The options for the list token balances.
Returns
Promise
<ListTokenBalancesResult
>
The result of the list token balances.
Example
name?
owners
policies
quoteFund()
Parameters
options
Omit
<EvmQuoteFundOptions
, "address"
>
The options for the quote fund.
Returns
Promise
<EvmQuote
>
A promise that resolves to a Quote object containing details about the funding operation.
Example
quoteSwap()
Parameters
options
SmartAccountQuoteSwapOptions
Configuration options for creating the swap quote.
Returns
Promise
<SmartAccountQuoteSwapResult
>
A promise that resolves to the swap quote or a response indicating that liquidity is unavailable.
Example
requestFaucet()
Parameters
options
Omit
<RequestFaucetOptions
, "address"
>
Parameters for requesting funds from the EVM faucet.
Returns
Promise
<RequestFaucetResult
>
A promise that resolves to the transaction hash.
Example
sendUserOperation()
Parameters
options
Omit
<SendUserOperationOptions
<unknown
[]>, "smartAccount"
>
Parameters for sending the user operation.
Returns
Promise
<SendUserOperationReturnType
>
A promise that resolves to an object containing the smart account address,
the user operation hash, and the status of the user operation.
Example
signTypedData()
Parameters
options
Omit
<SignTypedDataOptions
, "address"
> & {
network
: KnownEvmNetworks
;
}
Configuration options for signing the typed data.
Returns
Promise
<`0x${string}`
>
A promise that resolves to the signature.
Example
swap()
Parameters
options
SmartAccountSwapOptions
Configuration options for the swap.
Returns
Promise
<SmartAccountSwapResult
>
A promise that resolves to the user operation result.
Throws
If liquidity is not available when using inline options.Examples
transfer()
Parameters
options
SmartAccountTransferOptions
The options for the transfer.
Returns
Promise
<SendUserOperationReturnType
>
The user operation result.
Examples
type
useNetwork()
Type Parameters
Network
Network
extends KnownEvmNetworks
Parameters
network
Network
The network name or RPC URL
Returns
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] }>
Example
useSpendPermission()
Parameters
options
UseSpendPermissionOptions
Configuration options for using the spend permission.
Returns
Promise
<SendUserOperationReturnType
>
A promise that resolves to the user operation result.
Throws
If the network doesn’t support spend permissions via CDP API.Example
waitForUserOperation()
Parameters
options
Omit
<WaitForUserOperationOptions
, "smartAccountAddress"
>
Parameters for waiting for the user operation.
Returns
Promise
<WaitForUserOperationReturnType
>
A promise that resolves to the transaction receipt.
Example
waitForFundOperationReceipt()
Parameters
options
WaitForFundOperationOptions
The options for the wait for fund operation.
Returns
Promise
<WaitForFundOperationResult
>
A promise that resolves to the completed transfer receipt containing details about the funding operation.
Example
taker
toToken
CreateSwapQuoteResult
Defined in: src/client/evm/evm.types.ts:224 Result of creating a swap quote.Properties
blockNumber
execute()
Parameters
options?
ExecuteSwapQuoteOptions
Options for executing the swap.
Returns
Promise
<ExecuteSwapQuoteResult
>
A promise that resolves to the swap execution result.
fees
fromAmount
fromToken
issues
liquidityAvailable
minToAmount
network
permit2?
eip712
toAmount
toToken
transaction?
data
gas
gasPrice
to
value
EvmCall
Defined in: src/client/evm/evm.types.ts:299 A call to be executed in a user operation.Properties
data
to
value
ExecuteSwapQuoteOptions
Defined in: src/client/evm/evm.types.ts:202 Options for executing a swap quote.Properties
idempotencyKey?
ExecuteSwapQuoteResult
Defined in: src/client/evm/evm.types.ts:210 Result of executing a swap quote.Properties
smartAccountAddress?
status?
transactionHash?
userOpHash?
ExportServerAccountOptions
Defined in: src/client/evm/evm.types.ts:365 Options for exporting an EVM server account.Properties
address?
idempotencyKey?
name?
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
name
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
enableSpendPermissions?
name
owner
GetServerAccountOptions
Defined in: src/client/evm/evm.types.ts:377 Options for getting an EVM account.Properties
address?
name?
GetSmartAccountOptions
Defined in: src/client/evm/evm.types.ts:387 Options for getting an EVM smart account.Properties
address?
name?
owner
GetSwapPriceOptions
Defined in: src/client/evm/evm.types.ts:142 Options for getting a swap price.Properties
fromAmount
fromToken
gasPrice?
idempotencyKey?
network
signerAddress?
slippageBps?
taker
toToken
GetSwapPriceResult
Defined in: src/client/evm/evm.types.ts:166 Result of getting a swap price.Properties
blockNumber
fees
fromAmount
fromToken
gas?
gasPrice?
issues
liquidityAvailable
minToAmount
toAmount
toToken
GetUserOperationOptions
Defined in: src/client/evm/evm.types.ts:275 Options for getting a user operation.Properties
smartAccount
Type declaration
`0x${string}`
address
fund()
Parameters
options
Omit
<EvmFundOptions
, "address"
>
The options for the fund operation.
Returns
Promise
<FundOperationResult
>
A promise that resolves to the fund operation result containing the transfer details.
Example
getUserOperation()
Parameters
options
Omit
<GetUserOperationOptions
, "smartAccount"
>
Parameters for getting the user operation.
Returns
Promise
<UserOperation
>
A promise that resolves to the user operation.
Example
listTokenBalances()
Parameters
options
Omit
<ListTokenBalancesOptions
, "address"
>
The options for the list token balances.
Returns
Promise
<ListTokenBalancesResult
>
The result of the list token balances.
Example
name?
owners
policies
quoteFund()
Parameters
options
Omit
<EvmQuoteFundOptions
, "address"
>
The options for the quote fund.
Returns
Promise
<EvmQuote
>
A promise that resolves to a Quote object containing details about the funding operation.
Example
quoteSwap()
Parameters
options
SmartAccountQuoteSwapOptions
Configuration options for creating the swap quote.
Returns
Promise
<SmartAccountQuoteSwapResult
>
A promise that resolves to the swap quote or a response indicating that liquidity is unavailable.
Example
requestFaucet()
Parameters
options
Omit
<RequestFaucetOptions
, "address"
>
Parameters for requesting funds from the EVM faucet.
Returns
Promise
<RequestFaucetResult
>
A promise that resolves to the transaction hash.
Example
sendUserOperation()
Parameters
options
Omit
<SendUserOperationOptions
<unknown
[]>, "smartAccount"
>
Parameters for sending the user operation.
Returns
Promise
<SendUserOperationReturnType
>
A promise that resolves to an object containing the smart account address,
the user operation hash, and the status of the user operation.
Example
signTypedData()
Parameters
options
Omit
<SignTypedDataOptions
, "address"
> & {
network
: KnownEvmNetworks
;
}
Configuration options for signing the typed data.
Returns
Promise
<`0x${string}`
>
A promise that resolves to the signature.
Example
swap()
Parameters
options
SmartAccountSwapOptions
Configuration options for the swap.
Returns
Promise
<SmartAccountSwapResult
>
A promise that resolves to the user operation result.
Throws
If liquidity is not available when using inline options.Examples
transfer()
Parameters
options
SmartAccountTransferOptions
The options for the transfer.
Returns
Promise
<SendUserOperationReturnType
>
The user operation result.
Examples
type
useNetwork()
Type Parameters
Network
Network
extends KnownEvmNetworks
Parameters
network
Network
The network name or RPC URL
Returns
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] }>
Example
useSpendPermission()
Parameters
options
UseSpendPermissionOptions
Configuration options for using the spend permission.
Returns
Promise
<SendUserOperationReturnType
>
A promise that resolves to the user operation result.
Throws
If the network doesn’t support spend permissions via CDP API.Example
waitForUserOperation()
Parameters
options
Omit
<WaitForUserOperationOptions
, "smartAccountAddress"
>
Parameters for waiting for the user operation.
Returns
Promise
<WaitForUserOperationReturnType
>
A promise that resolves to the transaction receipt.
Example
waitForFundOperationReceipt()
Parameters
options
WaitForFundOperationOptions
The options for the wait for fund operation.
Returns
Promise
<WaitForFundOperationResult
>
A promise that resolves to the completed transfer receipt containing details about the funding operation.
Example
ReadonlySmartAccount
userOpHash
ImportServerAccountOptions
Defined in: src/client/evm/evm.types.ts:351 Options for importing an EVM server account.Properties
encryptionPublicKey?
idempotencyKey?
name?
privateKey
ListServerAccountResult
Defined in: src/client/evm/evm.types.ts:477 The result of listing EVM server accounts.Properties
accounts
address
fund()
Parameters
options
Omit
<EvmFundOptions
, "address"
>
The options for the fund operation.
Returns
Promise
<FundOperationResult
>
A promise that resolves to the fund operation result containing the transfer details.
Example
listTokenBalances()
Parameters
options
Omit
<ListTokenBalancesOptions
, "address"
>
The options for the list token balances.
Returns
Promise
<ListTokenBalancesResult
>
The result of the list token balances.
Example
name?
policies?
quoteFund()
Parameters
options
Omit
<EvmQuoteFundOptions
, "address"
>
The options for the quote fund.
Returns
Promise
<EvmQuote
>
A promise that resolves to a Quote object containing details about the funding operation.
Example
quoteSwap()
Parameters
options
AccountQuoteSwapOptions
Configuration options for creating the swap quote.
Returns
Promise
<AccountQuoteSwapResult
>
A promise that resolves to the swap quote or a response indicating that liquidity is unavailable.
Example
requestFaucet()
Parameters
options
Omit
<RequestFaucetOptions
, "address"
>
Parameters for requesting funds from the EVM faucet.
Returns
Promise
<RequestFaucetResult
>
A promise that resolves to the transaction hash.
Example
sendTransaction()
Parameters
options
Omit
<SendTransactionOptions
, "address"
>
Configuration options for sending the transaction.
Returns
Promise
<TransactionResult
>
A promise that resolves to the transaction hash.
Examples
Sending an RLP-encoded transactionsign()
Parameters
parameters
hash
`0x${string}`
Returns
Promise
<`0x${string}`
>
signMessage()
Parameters
parameters
message
SignableMessage
Returns
Promise
<`0x${string}`
>
signTransaction()
Parameters
transaction
TransactionSerializable
Returns
Promise
<`0x${string}`
>
signTypedData()
Type Parameters
typedData
typedData
extends
| Record
<string
, unknown
>
| {
[key
: string
]: readonly TypedDataParameter
[];
[key
: `string[${string}]`
]: undefined
;
[key
: `function[${string}]`
]: undefined
;
[key
: `address[${string}]`
]: undefined
;
[key
: `bool[${string}]`
]: undefined
;
[key
: `bytes[${string}]`
]: undefined
;
[key
: `bytes1[${string}]`
]: undefined
;
[key
: `bytes2[${string}]`
]: undefined
;
[key
: `bytes3[${string}]`
]: undefined
;
[key
: `bytes32[${string}]`
]: undefined
;
[key
: `bytes16[${string}]`
]: undefined
;
[key
: `bytes4[${string}]`
]: undefined
;
[key
: `bytes6[${string}]`
]: undefined
;
[key
: `bytes18[${string}]`
]: undefined
;
[key
: `bytes5[${string}]`
]: undefined
;
[key
: `bytes7[${string}]`
]: undefined
;
[key
: `bytes8[${string}]`
]: undefined
;
[key
: `bytes9[${string}]`
]: undefined
;
[key
: `bytes10[${string}]`
]: undefined
;
[key
: `bytes11[${string}]`
]: undefined
;
[key
: `bytes12[${string}]`
]: undefined
;
[key
: `bytes13[${string}]`
]: undefined
;
[key
: `bytes14[${string}]`
]: undefined
;
[key
: `bytes15[${string}]`
]: undefined
;
[key
: `bytes17[${string}]`
]: undefined
;
[key
: `bytes19[${string}]`
]: undefined
;
[key
: `bytes20[${string}]`
]: undefined
;
[key
: `bytes21[${string}]`
]: undefined
;
[key
: `bytes22[${string}]`
]: undefined
;
[key
: `bytes23[${string}]`
]: undefined
;
[key
: `bytes24[${string}]`
]: undefined
;
[key
: `bytes25[${string}]`
]: undefined
;
[key
: `bytes26[${string}]`
]: undefined
;
[key
: `bytes27[${string}]`
]: undefined
;
[key
: `bytes28[${string}]`
]: undefined
;
[key
: `bytes29[${string}]`
]: undefined
;
[key
: `bytes30[${string}]`
]: undefined
;
[key
: `bytes31[${string}]`
]: undefined
;
[key
: `int[${string}]`
]: undefined
;
[key
: `int120[${string}]`
]: undefined
;
[key
: `int64[${string}]`
]: undefined
;
[key
: `int32[${string}]`
]: undefined
;
[key
: `int16[${string}]`
]: undefined
;
[key
: `int8[${string}]`
]: undefined
;
[key
: `int24[${string}]`
]: undefined
;
[key
: `int40[${string}]`
]: undefined
;
[key
: `int48[${string}]`
]: undefined
;
[key
: `int56[${string}]`
]: undefined
;
[key
: `int72[${string}]`
]: undefined
;
[key
: `int80[${string}]`
]: undefined
;
[key
: `int88[${string}]`
]: undefined
;
[key
: `int96[${string}]`
]: undefined
;
[key
: `int104[${string}]`
]: undefined
;
[key
: `int112[${string}]`
]: undefined
;
[key
: `int128[${string}]`
]: undefined
;
[key
: `int136[${string}]`
]: undefined
;
[key
: `int144[${string}]`
]: undefined
;
[key
: `int152[${string}]`
]: undefined
;
[key
: `int160[${string}]`
]: undefined
;
[key
: `int168[${string}]`
]: undefined
;
[key
: `int176[${string}]`
]: undefined
;
[key
: `int184[${string}]`
]: undefined
;
[key
: `int192[${string}]`
]: undefined
;
[key
: `int200[${string}]`
]: undefined
;
[key
: `int208[${string}]`
]: undefined
;
[key
: `int216[${string}]`
]: undefined
;
[key
: `int224[${string}]`
]: undefined
;
[key
: `int232[${string}]`
]: undefined
;
[key
: `int240[${string}]`
]: undefined
;
[key
: `int248[${string}]`
]: undefined
;
[key
: `int256[${string}]`
]: undefined
;
[key
: `uint[${string}]`
]: undefined
;
[key
: `uint120[${string}]`
]: undefined
;
[key
: `uint64[${string}]`
]: undefined
;
[key
: `uint32[${string}]`
]: undefined
;
[key
: `uint16[${string}]`
]: undefined
;
[key
: `uint8[${string}]`
]: undefined
;
[key
: `uint24[${string}]`
]: undefined
;
[key
: `uint40[${string}]`
]: undefined
;
[key
: `uint48[${string}]`
]: undefined
;
[key
: `uint56[${string}]`
]: undefined
;
[key
: `uint72[${string}]`
]: undefined
;
[key
: `uint80[${string}]`
]: undefined
;
[key
: `uint88[${string}]`
]: undefined
;
[key
: `uint96[${string}]`
]: undefined
;
[key
: `uint104[${string}]`
]: undefined
;
[key
: `uint112[${string}]`
]: undefined
;
[key
: `uint128[${string}]`
]: undefined
;
[key
: `uint136[${string}]`
]: undefined
;
[key
: `uint144[${string}]`
]: undefined
;
[key
: `uint152[${string}]`
]: undefined
;
[key
: `uint160[${string}]`
]: undefined
;
[key
: `uint168[${string}]`
]: undefined
;
[key
: `uint176[${string}]`
]: undefined
;
[key
: `uint184[${string}]`
]: undefined
;
[key
: `uint192[${string}]`
]: undefined
;
[key
: `uint200[${string}]`
]: undefined
;
[key
: `uint208[${string}]`
]: undefined
;
[key
: `uint216[${string}]`
]: undefined
;
[key
: `uint224[${string}]`
]: undefined
;
[key
: `uint232[${string}]`
]: undefined
;
[key
: `uint240[${string}]`
]: undefined
;
[key
: `uint248[${string}]`
]: undefined
;
[key
: `uint256[${string}]`
]: undefined
;
address?
: undefined
;
bool?
: undefined
;
bytes?
: undefined
;
bytes1?
: undefined
;
bytes10?
: undefined
;
bytes11?
: undefined
;
bytes12?
: undefined
;
bytes13?
: undefined
;
bytes14?
: undefined
;
bytes15?
: undefined
;
bytes16?
: undefined
;
bytes17?
: undefined
;
bytes18?
: undefined
;
bytes19?
: undefined
;
bytes2?
: undefined
;
bytes20?
: undefined
;
bytes21?
: undefined
;
bytes22?
: undefined
;
bytes23?
: undefined
;
bytes24?
: undefined
;
bytes25?
: undefined
;
bytes26?
: undefined
;
bytes27?
: undefined
;
bytes28?
: undefined
;
bytes29?
: undefined
;
bytes3?
: undefined
;
bytes30?
: undefined
;
bytes31?
: undefined
;
bytes32?
: undefined
;
bytes4?
: undefined
;
bytes5?
: undefined
;
bytes6?
: undefined
;
bytes7?
: undefined
;
bytes8?
: undefined
;
bytes9?
: undefined
;
int104?
: undefined
;
int112?
: undefined
;
int120?
: undefined
;
int128?
: undefined
;
int136?
: undefined
;
int144?
: undefined
;
int152?
: undefined
;
int16?
: undefined
;
int160?
: undefined
;
int168?
: undefined
;
int176?
: undefined
;
int184?
: undefined
;
int192?
: undefined
;
int200?
: undefined
;
int208?
: undefined
;
int216?
: undefined
;
int224?
: undefined
;
int232?
: undefined
;
int24?
: undefined
;
int240?
: undefined
;
int248?
: undefined
;
int256?
: undefined
;
int32?
: undefined
;
int40?
: undefined
;
int48?
: undefined
;
int56?
: undefined
;
int64?
: undefined
;
int72?
: undefined
;
int8?
: undefined
;
int80?
: undefined
;
int88?
: undefined
;
int96?
: undefined
;
string?
: undefined
;
uint104?
: undefined
;
uint112?
: undefined
;
uint120?
: undefined
;
uint128?
: undefined
;
uint136?
: undefined
;
uint144?
: undefined
;
uint152?
: undefined
;
uint16?
: undefined
;
uint160?
: undefined
;
uint168?
: undefined
;
uint176?
: undefined
;
uint184?
: undefined
;
uint192?
: undefined
;
uint200?
: undefined
;
uint208?
: undefined
;
uint216?
: undefined
;
uint224?
: undefined
;
uint232?
: undefined
;
uint24?
: undefined
;
uint240?
: undefined
;
uint248?
: undefined
;
uint256?
: undefined
;
uint32?
: undefined
;
uint40?
: undefined
;
uint48?
: undefined
;
uint56?
: undefined
;
uint64?
: undefined
;
uint72?
: undefined
;
uint8?
: undefined
;
uint80?
: undefined
;
uint88?
: undefined
;
uint96?
: undefined
;
}
primaryType
primaryType
extends string
| number
| symbol
= keyof typedData
Parameters
parameters
TypedDataDefinition
<typedData
, primaryType
>
Returns
Promise
<`0x${string}`
>
swap()
Parameters
options
AccountSwapOptions
Configuration options for the swap.
Returns
Promise
<SendSwapTransactionResult
>
A promise that resolves to the transaction hash.
Throws
If liquidity is not available when using inline options.Examples
transfer()
Parameters
options
TransferOptions
The options for the transfer.
Returns
Promise
<{
transactionHash
: `0x${string}`
;
}>
An object containing the transaction hash.
Examples
type
useNetwork()
Type Parameters
Network
Network
extends NetworkOrRpcUrl
Parameters
network
Network
The network name or RPC URL
Returns
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}`>; 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] }>
Example
useSpendPermission()
Parameters
options
UseSpendPermissionOptions
Configuration options for using the spend permission.
Returns
Promise
<TransactionResult
>
A promise that resolves to the transaction result.
Throws
If the network doesn’t support spend permissions via CDP API.Example
waitForFundOperationReceipt()
Parameters
options
WaitForFundOperationOptions
The options for the wait for fund operation.
Returns
Promise
<WaitForFundOperationResult
>
A promise that resolves to the completed transfer receipt containing details about the funding operation.
Example
nextPageToken?
ListServerAccountsOptions
Defined in: src/client/evm/evm.types.ts:419 Options for listing EVM accounts.Properties
pageSize?
pageToken?
ListSmartAccountResult
Defined in: src/client/evm/evm.types.ts:464 The result of listing EVM smart accounts.Properties
accounts
nextPageToken?
ListSmartAccountsOptions
Defined in: src/client/evm/evm.types.ts:490 Options for listing EVM smart accounts.Properties
name?
pageSize?
pageToken?
PrepareUserOperationOptions
Defined in: src/client/evm/evm.types.ts:285 Options for preparing a user operation.Properties
calls
network
paymasterUrl?
smartAccount
address
fund()
Parameters
options
Omit
<EvmFundOptions
, "address"
>
The options for the fund operation.
Returns
Promise
<FundOperationResult
>
A promise that resolves to the fund operation result containing the transfer details.
Example
getUserOperation()
Parameters
options
Omit
<GetUserOperationOptions
, "smartAccount"
>
Parameters for getting the user operation.
Returns
Promise
<UserOperation
>
A promise that resolves to the user operation.
Example
listTokenBalances()
Parameters
options
Omit
<ListTokenBalancesOptions
, "address"
>
The options for the list token balances.
Returns
Promise
<ListTokenBalancesResult
>
The result of the list token balances.
Example
name?
owners
policies
quoteFund()
Parameters
options
Omit
<EvmQuoteFundOptions
, "address"
>
The options for the quote fund.
Returns
Promise
<EvmQuote
>
A promise that resolves to a Quote object containing details about the funding operation.
Example
quoteSwap()
Parameters
options
SmartAccountQuoteSwapOptions
Configuration options for creating the swap quote.
Returns
Promise
<SmartAccountQuoteSwapResult
>
A promise that resolves to the swap quote or a response indicating that liquidity is unavailable.
Example
requestFaucet()
Parameters
options
Omit
<RequestFaucetOptions
, "address"
>
Parameters for requesting funds from the EVM faucet.
Returns
Promise
<RequestFaucetResult
>
A promise that resolves to the transaction hash.
Example
sendUserOperation()
Parameters
options
Omit
<SendUserOperationOptions
<unknown
[]>, "smartAccount"
>
Parameters for sending the user operation.
Returns
Promise
<SendUserOperationReturnType
>
A promise that resolves to an object containing the smart account address,
the user operation hash, and the status of the user operation.
Example
signTypedData()
Parameters
options
Omit
<SignTypedDataOptions
, "address"
> & {
network
: KnownEvmNetworks
;
}
Configuration options for signing the typed data.
Returns
Promise
<`0x${string}`
>
A promise that resolves to the signature.
Example
swap()
Parameters
options
SmartAccountSwapOptions
Configuration options for the swap.
Returns
Promise
<SmartAccountSwapResult
>
A promise that resolves to the user operation result.
Throws
If liquidity is not available when using inline options.Examples
transfer()
Parameters
options
SmartAccountTransferOptions
The options for the transfer.
Returns
Promise
<SendUserOperationReturnType
>
The user operation result.
Examples
type
useNetwork()
Type Parameters
Network
Network
extends KnownEvmNetworks
Parameters
network
Network
The network name or RPC URL
Returns
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] }>
Example
useSpendPermission()
Parameters
options
UseSpendPermissionOptions
Configuration options for using the spend permission.
Returns
Promise
<SendUserOperationReturnType
>
A promise that resolves to the user operation result.
Throws
If the network doesn’t support spend permissions via CDP API.Example
waitForUserOperation()
Parameters
options
Omit
<WaitForUserOperationOptions
, "smartAccountAddress"
>
Parameters for waiting for the user operation.
Returns
Promise
<WaitForUserOperationReturnType
>
A promise that resolves to the transaction receipt.
Example
waitForFundOperationReceipt()
Parameters
options
WaitForFundOperationOptions
The options for the wait for fund operation.
Returns
Promise
<WaitForFundOperationResult
>
A promise that resolves to the completed transfer receipt containing details about the funding operation.
Example
ReadonlySmartAccount
Defined in: src/client/evm/evm.types.ts:429 A smart account that only contains the owner address.Extends
Omit
<EvmSmartAccount
, |"owners"
| keyofSmartAccountActions
|"useNetwork"
>
Properties
address
Inherited from
name?
Inherited from
owners
policies
Inherited from
type
Inherited from
SignatureResult
Defined in: src/client/evm/evm.types.ts:570 A signature result.Properties
signature
SignHashOptions
Defined in: src/client/evm/evm.types.ts:516 Options for signing an EVM hash.Properties
address
hash
idempotencyKey?
SignMessageOptions
Defined in: src/client/evm/evm.types.ts:528 Options for signing an EVM message.Properties
address
idempotencyKey?
message
SignTransactionOptions
Defined in: src/client/evm/evm.types.ts:558 Options for signing an EVM transaction.Properties
address
idempotencyKey?
transaction
SignTypedDataOptions
Defined in: src/client/evm/evm.types.ts:540 Options for signing an EVM typed data message.Properties
address
domain
idempotencyKey?
message
primaryType
struct in the types
object.
primaryType
types
object that is the root of the message.
types
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
chainId
idempotencyKey?
ownerIndex?
typedData
SwapAllowanceIssue
Defined in: src/client/evm/evm.types.ts:598 Details of allowance issues for a swap.Properties
currentAllowance
spender
SwapBalanceIssue
Defined in: src/client/evm/evm.types.ts:608 Details of balance issues for a swap.Properties
currentBalance
requiredBalance
token
SwapFees
Defined in: src/client/evm/evm.types.ts:588 The estimated fees for a swap.Properties
gasFee?
protocolFee?
SwapIssues
Defined in: src/client/evm/evm.types.ts:620 Potential issues discovered during swap validation.Properties
allowance?
balance?
simulationIncomplete
SwapUnavailableResult
Defined in: src/client/evm/evm.types.ts:194 Result when liquidity is unavailable for a swap.Properties
liquidityAvailable
TokenFee
Defined in: src/client/evm/evm.types.ts:578 A fee in a specific token.Properties
amount
token
UpdateEvmAccountOptions
Defined in: src/client/evm/evm.types.ts:438 Options for creating an EVM server account.Properties
address
idempotencyKey?
update
UpdateEvmSmartAccountOptions
Defined in: src/client/evm/evm.types.ts:450 Options for updating an EVM smart account.Properties
address
idempotencyKey?
owner
update
UserOperation
Defined in: src/client/evm/evm.types.ts:315 A user operation.Properties
calls
network
receipts?
status
transactionHash?
userOpHash
WaitForUserOperationOptions
Defined in: src/client/evm/evm.types.ts:632 Options for waiting for a user operation.Properties
smartAccountAddress
userOpHash
waitOptions?
Type Aliases
CreateSwapOptions
Deprecated
Use the new type names instead.CreateSwapResult
EvmClientInterface
Type declaration
createAccount()
Parameters
options
CreateServerAccountOptions
Returns
Promise
<EvmServerAccount
>
createSmartAccount()
Parameters
options
CreateSmartAccountOptions
Returns
Promise
<EvmSmartAccount
>
createSwapQuote()
Parameters
options
CreateSwapQuoteOptions
Returns
Promise
<
| CreateSwapQuoteResult
| SwapUnavailableResult
>
exportAccount()
Parameters
options
ExportServerAccountOptions
Returns
Promise
<string
>
getAccount()
Parameters
options
GetServerAccountOptions
Returns
Promise
<EvmServerAccount
>
getOrCreateAccount()
Parameters
options
GetOrCreateServerAccountOptions
Returns
Promise
<EvmServerAccount
>
getSmartAccount()
Parameters
options
GetSmartAccountOptions
Returns
Promise
<EvmSmartAccount
>
getSwapPrice()
Parameters
options
GetSwapPriceOptions
Returns
Promise
<
| GetSwapPriceResult
| SwapUnavailableResult
>
getUserOperation()
Parameters
options
GetUserOperationOptions
Returns
Promise
<UserOperation
>
importAccount()
Parameters
options
ImportServerAccountOptions
Returns
Promise
<EvmServerAccount
>
listAccounts()
Parameters
options
ListServerAccountsOptions
Returns
Promise
<ListServerAccountResult
>
listSmartAccounts()
Parameters
options
ListSmartAccountsOptions
Returns
Promise
<ListSmartAccountResult
>
listSpendPermissions()
Parameters
options
ListSpendPermissionsOptions
Returns
Promise
<ListSpendPermissionsResult
>
listTokenBalances()
Parameters
options
ListTokenBalancesOptions
Returns
Promise
<ListTokenBalancesResult
>
prepareUserOperation()
Parameters
options
PrepareUserOperationOptions
Returns
Promise
<UserOperation
>
requestFaucet()
Parameters
options
RequestFaucetOptions
Returns
Promise
<RequestFaucetResult
>
sendTransaction()
Parameters
options
SendTransactionOptions
Returns
Promise
<TransactionResult
>
sendUserOperation()
Parameters
options
SendUserOperationOptions
<unknown
[]>
Returns
Promise
<SendUserOperationReturnType
>
signHash()
Parameters
options
SignHashOptions
Returns
Promise
<SignatureResult
>
signMessage()
Parameters
options
SignMessageOptions
Returns
Promise
<SignatureResult
>
signTransaction()
Parameters
options
SignTransactionOptions
Returns
Promise
<SignatureResult
>
signTypedData()
Parameters
options
SignTypedDataOptions
Returns
Promise
<SignatureResult
>
updateAccount()
Parameters
options
UpdateEvmAccountOptions
Returns
Promise
<EvmServerAccount
>
updateSmartAccount()
Parameters
options
UpdateEvmSmartAccountOptions
Returns
Promise
<EvmSmartAccount
>