Classes
EvmClient
Defined in: src/client/evm/evm.ts:97 The namespace containing all EVM methods.Implements
Constructors
Constructor
Returns
EvmClient
Methods
createAccount()
Parameters
options?
CreateServerAccountOptions
= {}
Optional parameters for creating the account.
Returns
Promise
<{
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}`>; 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
>;
}>
A promise that resolves to the newly created account.
Examples
Implementation of
createSmartAccount()
Parameters
options
CreateSmartAccountOptions
Parameters for creating the smart account.
Returns
Promise
<{
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
>;
}>
A promise that resolves to the newly created smart account.
Examples
Implementation of
createSpendPermission()
Parameters
options
CreateSpendPermissionOptions
Parameters for creating the spend permission.
Returns
Promise
<UserOperation
>
A promise that resolves to the spend permission.
Example
createSwapQuote()
Parameters
options
CreateSwapQuoteOptions
The options for creating a swap quote.
Returns
Promise
<
| CreateSwapQuoteResult
| SwapUnavailableResult
>
A promise that resolves to the swap quote result or a response indicating that liquidity is unavailable.
Example
Implementation of
exportAccount()
Parameters
options
ExportServerAccountOptions
Parameters for exporting the account.
Returns
Promise
<string
>
A promise that resolves to the exported account’s 32-byte private key as a hex string, without the “0x” prefix.
Examples
Implementation of
getAccount()
Parameters
options
GetServerAccountOptions
Parameters for getting the account.
Either address
or name
must be provided.
If both are provided, lookup will be done by address
and name
will be ignored.
Returns
Promise
<{
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}`>; 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
>;
}>
A promise that resolves to the account.
Examples
Implementation of
getOrCreateAccount()
Parameters
options
GetOrCreateServerAccountOptions
Parameters for getting or creating the account.
Returns
Promise
<{
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}`>; 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
>;
}>
A promise that resolves to the account.
Example
Implementation of
getOrCreateSmartAccount()
Parameters
options
GetOrCreateSmartAccountOptions
Configuration options for getting or creating the smart account.
Returns
Promise
<{
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
>;
}>
A promise that resolves to the retrieved or newly created smart account.
Example
getSmartAccount()
Parameters
options
GetSmartAccountOptions
Parameters for getting the smart account.
Either address
or name
must be provided.
If both are provided, lookup will be done by address
and name
will be ignored.
Returns
Promise
<{
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
>;
}>
A promise that resolves to the smart account.
Example
Implementation of
getSwapPrice()
Parameters
options
GetSwapPriceOptions
The options for getting a swap price.
Returns
Promise
<
| SwapUnavailableResult
| GetSwapPriceResult
>
A promise that resolves to the swap price result or a response indicating that liquidity is unavailable.
Example
Implementation of
getUserOperation()
Parameters
options
GetUserOperationOptions
Parameters for getting the user operation.
Returns
Promise
<UserOperation
>
A promise that resolves to the user operation.
Example
Implementation of
importAccount()
Parameters
options
ImportServerAccountOptions
Parameters for importing the account.
Returns
Promise
<{
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}`>; 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
>;
}>
A promise that resolves to the imported account.
Examples
Implementation of
listAccounts()
Parameters
options?
ListServerAccountsOptions
= {}
Optional parameters for listing the accounts.
Returns
Promise
<ListServerAccountResult
>
A promise that resolves to an array of accounts, and a token to paginate through the accounts.
Examples
Implementation of
listSmartAccounts()
Parameters
options
ListSmartAccountsOptions
= {}
Parameters for listing the smart accounts.
Returns
Promise
<ListSmartAccountResult
>
A promise that resolves to an array of smart accounts, and a token to paginate through the smart accounts.
Examples
Implementation of
listSpendPermissions()
Parameters
options
ListSpendPermissionsOptions
Parameters for listing the spend permissions.
Returns
Promise
<ListSpendPermissionsResult
>
A promise that resolves to the spend permissions.
Implementation of
listTokenBalances()
Parameters
options
ListTokenBalancesOptions
Parameters for listing the token balances.
Returns
Promise
<ListTokenBalancesResult
>
A promise that resolves to an array of token balances, and a token to paginate through the token balances.
Examples
prepareUserOperation()
Parameters
options
PrepareUserOperationOptions
Parameters for preparing the user operation.
Returns
Promise
<UserOperation
>
A promise that resolves to the user operation hash.
Example
Implementation of
requestFaucet()
Parameters
options
RequestFaucetOptions
Parameters for requesting funds from the EVM faucet.
Returns
Promise
<RequestFaucetResult
>
A promise that resolves to the transaction hash.
Example
Implementation of
revokeSpendPermission()
Parameters
options
RevokeSpendPermissionOptions
Parameters for revoking the spend permission.
Returns
Promise
<UserOperation
>
A promise that resolves to the user operation.
Example
sendTransaction()
Parameters
options
SendTransactionOptions
Configuration options for sending the transaction.
Returns
Promise
<TransactionResult
>
A promise that resolves to the transaction hash.
Examples
Sending an RLP-encoded transactionImplementation of
sendUserOperation()
Parameters
options
SendUserOperationOptions
<unknown
[]>
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
Implementation of
signHash()
Parameters
options
SignHashOptions
Parameters for signing the hash.
Returns
Promise
<SignatureResult
>
A promise that resolves to the signature.
Example
Implementation of
signMessage()
Parameters
options
SignMessageOptions
Parameters for signing the message.
Returns
Promise
<SignatureResult
>
A promise that resolves to the signature.
Example
Implementation of
signTransaction()
Parameters
options
SignTransactionOptions
Configuration options for signing the transaction.
Returns
Promise
<SignatureResult
>
A promise that resolves to the signature.
Example
Implementation of
signTypedData()
Parameters
options
SignTypedDataOptions
Parameters for signing the EIP-712 message.
Returns
Promise
<SignatureResult
>
A promise that resolves to the signature.
Example
Implementation of
updateAccount()
Parameters
options?
UpdateEvmAccountOptions
Optional parameters for creating the account.
Returns
Promise
<{
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}`>; 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
>;
}>
A promise that resolves to the updated account.
Examples
Implementation of
updateSmartAccount()
Parameters
options?
UpdateEvmSmartAccountOptions
Optional parameters for updating the account.
Returns
Promise
<{
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
>;
}>
A promise that resolves to the updated account.
Implementation of
waitForUserOperation()
Parameters
options
WaitForUserOperationOptions
Parameters for waiting for the user operation.
Returns
Promise
<WaitForUserOperationReturnType
>
A promise that resolves to the transaction receipt.