> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# EvmClient

Defined in: [client/evm/evm.ts:107](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L107)

The namespace containing all EVM methods.

## Implements

* [`EvmClientInterface`](/sdks/cdp-sdks-v2/typescript/evm/Types/EvmClientInterface)

## Constructors

### Constructor

```ts theme={null}
new EvmClient(): EvmClient;
```

#### Returns

`EvmClient`

## Methods

### createAccount()

```ts theme={null}
createAccount(options?: CreateServerAccountOptions): Promise<{
  address: `0x${string}`;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  policies?: string[];
  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}`; listTokenBalances: (options: Omit<(...), (...)>) => Promise<(...)>; name?: string; policies?: (...)[]; 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<`0x${string}`>; signMessage: (parameters: { message: SignableMessage; }) => Promise<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & { [K in string | number | symbol]: ({ sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & { network: Network })[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<TransactionResult>;
}>;
```

Defined in: [client/evm/evm.ts:142](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L142)

Creates a new CDP EVM account.

#### Parameters

##### options?

[`CreateServerAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#createserveraccountoptions) = `{}`

Optional parameters for creating the account.

#### Returns

`Promise`\<\{
`address`: `` `0x${string}` ``;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`policies?`: `string`\[];
`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`\<\&#123; \[K in string | number | symbol]: (Omit\<\&#123; address: \`0x$\&#123;string\&#125;\`; listTokenBalances: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; name?: string; policies?: (...)\[\]; 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$\&#123;string\&#125;\`; sign: (parameters: \{ hash: \`0x$\&#123;string\&#125;\`; \}) =\> Promise\<\`0x$\&#123;string\&#125;\`>; signMessage: (parameters: \&#123; message: SignableMessage; \&#125;) => Promise\<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise\<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & \&#123; \[K in string | number | symbol]: (\&#123; sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... \&#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \&#123; network: Network \&#125;)\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`TransactionResult`>;
}>

A promise that resolves to the newly created account.

#### Examples

```ts theme={null}
         const account = await cdp.evm.createAccount();
```

```ts theme={null}
         const account = await cdp.evm.createAccount(&#123; name: "MyAccount" &#125;);
```

```ts theme={null}
         const idempotencyKey = uuidv4();

         // First call
         await cdp.evm.createAccount({
           idempotencyKey,
         });

         // Second call with the same idempotency key will return the same account
         await cdp.evm.createAccount({
           idempotencyKey,
         });
```

#### Implementation of

```ts theme={null}
EvmClientInterface.createAccount
```

***

### createEvmEip7702Delegation()

```ts theme={null}
createEvmEip7702Delegation(options: CreateEvmEip7702DelegationOptions): Promise<CreateEvmEip7702Delegation201>;
```

Defined in: [client/evm/evm.ts:1565](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1565)

Creates an EIP-7702 delegation for an EVM EOA account, upgrading it with smart account capabilities.
The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster.

#### Parameters

##### options

[`CreateEvmEip7702DelegationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#createevmeip7702delegationoptions)

The delegation parameters (address and network required, enableSpendPermissions and idempotencyKey optional).

#### Returns

`Promise`\<`CreateEvmEip7702Delegation201`>

A promise that resolves to the delegation result including the delegation operation ID.

#### Example

```ts theme={null}
const result = await cdp.evm.createEvmEip7702Delegation({
  address: account.address,
  network: "base-sepolia",
  enableSpendPermissions: false,
});
console.log(result.delegationOperationId);
```

#### Implementation of

```ts theme={null}
EvmClientInterface.createEvmEip7702Delegation
```

***

### createSmartAccount()

```ts theme={null}
createSmartAccount(options: CreateSmartAccountOptions): Promise<{
  address: `0x${string}`;
  getUserOperation: (options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  owners: EvmAccount[];
  policies: string[] | undefined;
  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<&#123; [K in string | number | symbol]: (Omit<EvmSmartAccountProperties, "useNetwork"> & &#123; [K in string | number | symbol]: (&#123; getUserOperation: ...; sendUserOperation: ...; signTypedData: ...; waitForUserOperation: ... &#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & &#123; network: Network &#125;)[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>;
  waitForUserOperation: (options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>;
}>;
```

Defined in: [client/evm/evm.ts:363](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L363)

Creates a new CDP EVM smart account.

#### Parameters

##### options

[`CreateSmartAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#createsmartaccountoptions)

Parameters for creating the smart account.

#### Returns

`Promise`\<\{
`address`: `` `0x${string}` ``;
`getUserOperation`: (`options`: `Omit`\<[`GetUserOperationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getuseroperationoptions), `"smartAccount"`>) => `Promise`\<[`UserOperation`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#useroperation)>;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`owners`: [`EvmAccount`](/sdks/cdp-sdks-v2/typescript/evm/Accounts/EvmAccount)\[];
`policies`: `string`\[] | `undefined`;
`quoteSwap`: (`options`: `SmartAccountQuoteSwapOptions`) => `Promise`\<`SmartAccountQuoteSwapResult`>;
`requestFaucet`: (`options`: `Omit`\<`RequestFaucetOptions`, `"address"`>) => `Promise`\<`RequestFaucetResult`>;
`sendUserOperation`: (`options`: `Omit`\<`SendUserOperationOptions`\<`unknown`\[]>, `"smartAccount"`>) => `Promise`\<`SendUserOperationReturnType`>;
`signTypedData`: (`options`: `Omit`\<[`SignTypedDataOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#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: ...; signTypedData: ...; waitForUserOperation: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \{ network: Network })\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`SendUserOperationReturnType`>;
`waitForUserOperation`: (`options`: `Omit`\<`WaitForUserOperationOptions`, `"smartAccountAddress"`>) => `Promise`\<`WaitForUserOperationReturnType`>;
}>

A promise that resolves to the newly created smart account.

#### Examples

```ts theme={null}
         const account = await cdp.evm.createAccount();
         const smartAccount = await cdp.evm.createSmartAccount({
           owner: account,
         });
```

```ts theme={null}
         // See https://viem.sh/docs/accounts/local/privateKeyToAccount
         const privateKey = generatePrivateKey();
         const account = privateKeyToAccount(privateKey);
         const smartAccount = await client.evm.createSmartAccount({
           owner: account,
         });
```

```ts theme={null}
         const idempotencyKey = uuidv4();

         // First call
         await cdp.evm.createSmartAccount({
           owner: account,
           idempotencyKey,
         });

         // Second call with the same idempotency key will return the same smart account
         await cdp.evm.createSmartAccount({
           owner: account,
           idempotencyKey,
```

#### Implementation of

```ts theme={null}
EvmClientInterface.createSmartAccount
```

***

### createSpendPermission()

```ts theme={null}
createSpendPermission(options: CreateSpendPermissionOptions): Promise<UserOperation>;
```

Defined in: [client/evm/evm.ts:394](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L394)

Creates a spend permission for a smart account.

#### Parameters

##### options

`CreateSpendPermissionOptions`

Parameters for creating the spend permission.

#### Returns

`Promise`\<[`UserOperation`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#useroperation)>

A promise that resolves to the spend permission.

#### Example

```ts theme={null}
const userOperation = await cdp.evm.createSpendPermission({
  spendPermission,
  network: "base-sepolia",
});
```

***

### createSwapQuote()

```ts theme={null}
createSwapQuote(options: CreateSwapQuoteOptions): Promise<
  | CreateSwapQuoteResult
| SwapUnavailableResult>;
```

Defined in: [client/evm/evm.ts:722](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L722)

Creates a quote for a swap between two tokens on an EVM network.

#### Parameters

##### options

[`CreateSwapQuoteOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#createswapquoteoptions)

The options for creating a swap quote.

#### Returns

`Promise`\<
\| [`CreateSwapQuoteResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#createswapquoteresult)
\| [`SwapUnavailableResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#swapunavailableresult)>

A promise that resolves to the swap quote result or a response indicating that liquidity is unavailable.

#### Example

```typescript theme={null}
const swapQuote = await cdp.evm.createSwapQuote({
  network: "ethereum",
  toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
  fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
  fromAmount: BigInt("1000000000000000000"), // 1 WETH
  taker: "0x1234567890123456789012345678901234567890"
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.createSwapQuote
```

***

### exportAccount()

```ts theme={null}
exportAccount(options: ExportServerAccountOptions): Promise<string>;
```

Defined in: [client/evm/evm.ts:276](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L276)

Exports a CDP EVM account's private key.
It is important to store the private key in a secure place after it's exported.

#### Parameters

##### options

[`ExportServerAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#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

```ts theme={null}
const privateKey = await cdp.evm.exportAccount({
  address: "0x1234567890123456789012345678901234567890",
});
```

```ts theme={null}
const privateKey = await cdp.evm.exportAccount({
  name: "MyAccount",
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.exportAccount
```

***

### getAccount()

```ts theme={null}
getAccount(options: GetServerAccountOptions): Promise<{
  address: `0x${string}`;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  policies?: string[];
  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}`; listTokenBalances: (options: Omit<(...), (...)>) => Promise<(...)>; name?: string; policies?: (...)[]; 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<`0x${string}`>; signMessage: (parameters: { message: SignableMessage; }) => Promise<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & { [K in string | number | symbol]: ({ sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & { network: Network })[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<TransactionResult>;
}>;
```

Defined in: [client/evm/evm.ts:515](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L515)

Gets a CDP EVM account.

#### Parameters

##### options

[`GetServerAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#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}` ``;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`policies?`: `string`\[];
`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`\<\&#123; \[K in string | number | symbol]: (Omit\<\&#123; address: \`0x$\&#123;string\&#125;\`; listTokenBalances: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; name?: string; policies?: (...)\[\]; 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$\&#123;string\&#125;\`; sign: (parameters: \{ hash: \`0x$\&#123;string\&#125;\`; \}) =\> Promise\<\`0x$\&#123;string\&#125;\`>; signMessage: (parameters: \&#123; message: SignableMessage; \&#125;) => Promise\<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise\<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & \&#123; \[K in string | number | symbol]: (\&#123; sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... \&#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \&#123; network: Network \&#125;)\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`TransactionResult`>;
}>

A promise that resolves to the account.

#### Examples

```ts theme={null}
         const account = await cdp.evm.getAccount({
           address: "0x1234567890123456789012345678901234567890",
         });
```

```ts theme={null}
         const account = await cdp.evm.getAccount({
           name: "MyAccount",
         });
```

#### Implementation of

```ts theme={null}
EvmClientInterface.getAccount
```

***

### getEvmEip7702DelegationOperationById()

```ts theme={null}
getEvmEip7702DelegationOperationById(delegationOperationId: string): Promise<EvmEip7702DelegationOperation>;
```

Defined in: [client/evm/evm.ts:1599](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1599)

Gets the EIP-7702 delegation operation status.

#### Parameters

##### delegationOperationId

`string`

The delegation operation ID returned by createEvmEip7702Delegation.

#### Returns

`Promise`\<`EvmEip7702DelegationOperation`>

A promise that resolves to the delegation operation status.

#### Example

```ts theme={null}
const operation = await cdp.evm.getEvmEip7702DelegationOperationById(
  "delegation-op-123",
);
console.log(operation.status); // "PENDING" | "SUBMITTED" | "COMPLETED" | "FAILED"
```

#### Implementation of

```ts theme={null}
EvmClientInterface.getEvmEip7702DelegationOperationById
```

***

### getOrCreateAccount()

```ts theme={null}
getOrCreateAccount(options: GetOrCreateServerAccountOptions): Promise<{
  address: `0x${string}`;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  policies?: string[];
  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}`; listTokenBalances: (options: Omit<(...), (...)>) => Promise<(...)>; name?: string; policies?: (...)[]; 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<`0x${string}`>; signMessage: (parameters: { message: SignableMessage; }) => Promise<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & { [K in string | number | symbol]: ({ sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & { network: Network })[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<TransactionResult>;
}>;
```

Defined in: [client/evm/evm.ts:579](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L579)

Gets a CDP EVM account, or creates one if it doesn't exist.

#### Parameters

##### options

[`GetOrCreateServerAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getorcreateserveraccountoptions)

Parameters for getting or creating the account.

#### Returns

`Promise`\<\{
`address`: `` `0x${string}` ``;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`policies?`: `string`\[];
`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`\<\&#123; \[K in string | number | symbol]: (Omit\<\&#123; address: \`0x$\&#123;string\&#125;\`; listTokenBalances: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; name?: string; policies?: (...)\[\]; 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$\&#123;string\&#125;\`; sign: (parameters: \{ hash: \`0x$\&#123;string\&#125;\`; \}) =\> Promise\<\`0x$\&#123;string\&#125;\`>; signMessage: (parameters: \&#123; message: SignableMessage; \&#125;) => Promise\<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise\<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & \&#123; \[K in string | number | symbol]: (\&#123; sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... \&#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \&#123; network: Network \&#125;)\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`TransactionResult`>;
}>

A promise that resolves to the account.

#### Example

```ts theme={null}
const account = await cdp.evm.getOrCreateAccount({
  name: "MyAccount",
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.getOrCreateAccount
```

***

### getOrCreateSmartAccount()

```ts theme={null}
getOrCreateSmartAccount(options: GetOrCreateSmartAccountOptions): Promise<{
  address: `0x${string}`;
  getUserOperation: (options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  owners: EvmAccount[];
  policies: string[] | undefined;
  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: ...; signTypedData: ...; waitForUserOperation: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & { network: Network })[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>;
  waitForUserOperation: (options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>;
}>;
```

Defined in: [client/evm/evm.ts:633](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L633)

Gets a CDP EVM smart account, or creates one if it doesn't exist.
This method first attempts to retrieve an existing smart account with the given parameters.
If no account exists, it creates a new one with the specified owner.

#### Parameters

##### options

[`GetOrCreateSmartAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getorcreatesmartaccountoptions)

Configuration options for getting or creating the smart account.

#### Returns

`Promise`\<\{
`address`: `` `0x${string}` ``;
`getUserOperation`: (`options`: `Omit`\<[`GetUserOperationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getuseroperationoptions), `"smartAccount"`>) => `Promise`\<[`UserOperation`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#useroperation)>;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`owners`: [`EvmAccount`](/sdks/cdp-sdks-v2/typescript/evm/Accounts/EvmAccount)\[];
`policies`: `string`\[] | `undefined`;
`quoteSwap`: (`options`: `SmartAccountQuoteSwapOptions`) => `Promise`\<`SmartAccountQuoteSwapResult`>;
`requestFaucet`: (`options`: `Omit`\<`RequestFaucetOptions`, `"address"`>) => `Promise`\<`RequestFaucetResult`>;
`sendUserOperation`: (`options`: `Omit`\<`SendUserOperationOptions`\<`unknown`\[]>, `"smartAccount"`>) => `Promise`\<`SendUserOperationReturnType`>;
`signTypedData`: (`options`: `Omit`\<[`SignTypedDataOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#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`\<\&#123; \[K in string | number | symbol]: (Omit\<EvmSmartAccountProperties, "useNetwork"> & \&#123; \[K in string | number | symbol]: (\&#123; getUserOperation: ...; sendUserOperation: ...; signTypedData: ...; waitForUserOperation: ... \&#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \&#123; network: Network \&#125;)\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`SendUserOperationReturnType`>;
`waitForUserOperation`: (`options`: `Omit`\<`WaitForUserOperationOptions`, `"smartAccountAddress"`>) => `Promise`\<`WaitForUserOperationReturnType`>;
}>

A promise that resolves to the retrieved or newly created smart account.

#### Example

```ts theme={null}
const smartAccount = await cdp.evm.getOrCreateSmartAccount({
  name: "MySmartAccount",
  owner: account,
});
```

***

### getSmartAccount()

```ts theme={null}
getSmartAccount(options: GetSmartAccountOptions): Promise<{
  address: `0x${string}`;
  getUserOperation: (options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  owners: EvmAccount[];
  policies: string[] | undefined;
  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: ...; signTypedData: ...; waitForUserOperation: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & { network: Network })[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>;
  waitForUserOperation: (options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>;
}>;
```

Defined in: [client/evm/evm.ts:551](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L551)

Gets a CDP EVM smart account.

#### Parameters

##### options

[`GetSmartAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#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}` ``;
`getUserOperation`: (`options`: `Omit`\<[`GetUserOperationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getuseroperationoptions), `"smartAccount"`>) => `Promise`\<[`UserOperation`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#useroperation)>;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`owners`: [`EvmAccount`](/sdks/cdp-sdks-v2/typescript/evm/Accounts/EvmAccount)\[];
`policies`: `string`\[] | `undefined`;
`quoteSwap`: (`options`: `SmartAccountQuoteSwapOptions`) => `Promise`\<`SmartAccountQuoteSwapResult`>;
`requestFaucet`: (`options`: `Omit`\<`RequestFaucetOptions`, `"address"`>) => `Promise`\<`RequestFaucetResult`>;
`sendUserOperation`: (`options`: `Omit`\<`SendUserOperationOptions`\<`unknown`\[]>, `"smartAccount"`>) => `Promise`\<`SendUserOperationReturnType`>;
`signTypedData`: (`options`: `Omit`\<[`SignTypedDataOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#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`\<\&#123; \[K in string | number | symbol]: (Omit\<EvmSmartAccountProperties, "useNetwork"> & \&#123; \[K in string | number | symbol]: (\&#123; getUserOperation: ...; sendUserOperation: ...; signTypedData: ...; waitForUserOperation: ... \&#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \&#123; network: Network \&#125;)\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`SendUserOperationReturnType`>;
`waitForUserOperation`: (`options`: `Omit`\<`WaitForUserOperationOptions`, `"smartAccountAddress"`>) => `Promise`\<`WaitForUserOperationReturnType`>;
}>

A promise that resolves to the smart account.

#### Example

```ts theme={null}
const smartAccount = await cdp.evm.getSmartAccount({
  address: "0x1234567890123456789012345678901234567890",
  owner: account,
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.getSmartAccount
```

***

### getSwapPrice()

```ts theme={null}
getSwapPrice(options: GetSwapPriceOptions): Promise<
  | SwapUnavailableResult
| GetSwapPriceResult>;
```

Defined in: [client/evm/evm.ts:686](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L686)

Gets the price for a swap between two tokens on an EVM network.

#### Parameters

##### options

[`GetSwapPriceOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getswappriceoptions)

The options for getting a swap price.

#### Returns

`Promise`\<
\| [`SwapUnavailableResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#swapunavailableresult)
\| [`GetSwapPriceResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getswappriceresult)>

A promise that resolves to the swap price result or a response indicating that liquidity is unavailable.

#### Example

```typescript theme={null}
const price = await cdp.evm.getSwapPrice({
  network: "ethereum-mainnet",
  toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
  fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
  fromAmount: BigInt("1000000000000000000"), // 1 WETH
  taker: "0x1234567890123456789012345678901234567890"
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.getSwapPrice
```

***

### getUserOperation()

```ts theme={null}
getUserOperation(options: GetUserOperationOptions): Promise<UserOperation>;
```

Defined in: [client/evm/evm.ts:757](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L757)

Gets a user operation for a smart account by user operation hash.

#### Parameters

##### options

[`GetUserOperationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getuseroperationoptions)

Parameters for getting the user operation.

#### Returns

`Promise`\<[`UserOperation`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#useroperation)>

A promise that resolves to the user operation.

#### Example

```ts theme={null}
const userOp = await cdp.evm.getUserOperation({
  smartAccount,
  userOpHash: "0x1234567890123456789012345678901234567890123456789012345678901234",
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.getUserOperation
```

***

### importAccount()

```ts theme={null}
importAccount(options: ImportServerAccountOptions): Promise<{
  address: `0x${string}`;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  policies?: string[];
  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}`; listTokenBalances: (options: Omit<(...), (...)>) => Promise<(...)>; name?: string; policies?: (...)[]; 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<`0x${string}`>; signMessage: (parameters: { message: SignableMessage; }) => Promise<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & { [K in string | number | symbol]: ({ sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & { network: Network })[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<TransactionResult>;
}>;
```

Defined in: [client/evm/evm.ts:198](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L198)

Imports a CDP EVM account from an external source.

#### Parameters

##### options

[`ImportServerAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#importserveraccountoptions)

Parameters for importing the account.

#### Returns

`Promise`\<\{
`address`: `` `0x${string}` ``;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`policies?`: `string`\[];
`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`\<\&#123; \[K in string | number | symbol]: (Omit\<\&#123; address: \`0x$\&#123;string\&#125;\`; listTokenBalances: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; name?: string; policies?: (...)\[\]; 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$\&#123;string\&#125;\`; sign: (parameters: \{ hash: \`0x$\&#123;string\&#125;\`; \}) =\> Promise\<\`0x$\&#123;string\&#125;\`>; signMessage: (parameters: \&#123; message: SignableMessage; \&#125;) => Promise\<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise\<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & \&#123; \[K in string | number | symbol]: (\&#123; sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... \&#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \&#123; network: Network \&#125;)\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`TransactionResult`>;
}>

A promise that resolves to the imported account.

#### Examples

```ts theme={null}
         const account = await cdp.evm.importAccount({
           privateKey: "0x123456"
         });
```

```ts theme={null}
         const account = await cdp.evm.importAccount({
           privateKey: "0x123456",
           name: "MyAccount"
         });
```

```ts theme={null}
         const idempotencyKey = uuidv4();

         // First call
         await cdp.evm.importAccount({
           privateKey: "0x123456",
           idempotencyKey,
         });

         // Second call with the same idempotency key will return the same account
         await cdp.evm.importAccount({
           privateKey: "0x123456"
           idempotencyKey,
         });
```

#### Implementation of

```ts theme={null}
EvmClientInterface.importAccount
```

***

### listAccounts()

```ts theme={null}
listAccounts(options?: ListServerAccountsOptions): Promise<ListServerAccountResult>;
```

Defined in: [client/evm/evm.ts:794](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L794)

Lists CDP EVM accounts.

#### Parameters

##### options?

[`ListServerAccountsOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#listserveraccountsoptions) = `{}`

Optional parameters for listing the accounts.

#### Returns

`Promise`\<[`ListServerAccountResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#listserveraccountresult)>

A promise that resolves to an array of accounts, and a token to paginate through the accounts.

#### Examples

```ts theme={null}
const accounts = await cdp.evm.listAccounts();
```

```ts theme={null}
         let page = await cdp.evm.listAccounts();

         while (page.nextPageToken) {
           page = await cdp.evm.listAccounts(&#123; pageToken: page.nextPageToken &#125;);
         }
```

#### Implementation of

```ts theme={null}
EvmClientInterface.listAccounts
```

***

### listSmartAccounts()

```ts theme={null}
listSmartAccounts(options?: ListSmartAccountsOptions): Promise<ListSmartAccountResult>;
```

Defined in: [client/evm/evm.ts:896](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L896)

Lists CDP EVM smart accounts.

#### Parameters

##### options?

[`ListSmartAccountsOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#listsmartaccountsoptions) = `{}`

Parameters for listing the smart accounts.

#### Returns

`Promise`\<[`ListSmartAccountResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#listsmartaccountresult)>

A promise that resolves to an array of smart accounts, and a token to paginate through the smart accounts.

#### Examples

```ts theme={null}
const smartAccounts = await cdp.evm.listSmartAccounts();
```

```ts theme={null}
         let page = await cdp.evm.listSmartAccounts();

         while (page.nextPageToken) {
           page = await cdp.evm.listSmartAccounts({ pageToken: page.nextPageToken });
         }
```

#### Implementation of

```ts theme={null}
EvmClientInterface.listSmartAccounts
```

***

### listSpendPermissions()

```ts theme={null}
listSpendPermissions(options: ListSpendPermissionsOptions): Promise<ListSpendPermissionsResult>;
```

Defined in: [client/evm/evm.ts:932](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L932)

Lists the spend permissions for a smart account.

#### Parameters

##### options

`ListSpendPermissionsOptions`

Parameters for listing the spend permissions.

#### Returns

`Promise`\<`ListSpendPermissionsResult`>

A promise that resolves to the spend permissions.

#### Implementation of

```ts theme={null}
EvmClientInterface.listSpendPermissions
```

***

### listTokenBalances()

```ts theme={null}
listTokenBalances(options: ListTokenBalancesOptions): Promise<ListTokenBalancesResult>;
```

Defined in: [client/evm/evm.ts:856](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L856)

Lists CDP EVM token balances.

#### 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

```ts theme={null}
const tokenBalances = await cdp.evm.listTokenBalances({
  address: "0x1234567890123456789012345678901234567890",
  network: "base-sepolia",
});
```

**With pagination**

````ts theme={null}
let page = await cdp.evm.listTokenBalances({
  address: "0x1234567890123456789012345678901234567890",
  network: "base-sepolia",
});

while (page.nextPageToken) {
  page = await cdp.evm.listTokenBalances({
    address: "0x1234567890123456789012345678901234567890",
    network: "base-sepolia",
    pageToken: page.nextPageToken,
  });
}

#### Implementation of

```ts
EvmClientInterface.listTokenBalances
````

***

### prepareAndSendUserOperation()

```ts theme={null}
prepareAndSendUserOperation(options: PrepareAndSendUserOperationOptions): Promise<PrepareAndSendUserOperationReturnType>;
```

Defined in: [client/evm/evm.ts:1039](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1039)

Prepares and sends a user operation for a smart account.

#### Parameters

##### options

[`PrepareAndSendUserOperationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#prepareandsenduseroperationoptions)

Parameters for preparing and sending the user operation.

#### Returns

`Promise`\<`PrepareAndSendUserOperationReturnType`>

A promise that resolves to the smart account address, user operation hash, and status of the user operation.

#### Example

```ts theme={null}
const { userOpHash } = await cdp.evm.prepareAndSendUserOperation({
  smartAccount,
  network: "base-sepolia",
  calls: [
    {
      to: "0x1234567890123456789012345678901234567890",
      value: parseEther("0.000001"),
      data: "0x",
    },
  ],
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.prepareAndSendUserOperation
```

***

### prepareUserOperation()

```ts theme={null}
prepareUserOperation(options: PrepareUserOperationOptions): Promise<UserOperation>;
```

Defined in: [client/evm/evm.ts:974](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L974)

Prepares a user operation for a smart account.

#### Parameters

##### options

[`PrepareUserOperationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#prepareuseroperationoptions)

Parameters for preparing the user operation.

#### Returns

`Promise`\<[`UserOperation`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#useroperation)>

A promise that resolves to the user operation hash.

#### Example

```ts theme={null}
const userOp = await cdp.evm.prepareUserOperation({
  smartAccount,
  network: "base-sepolia",
  calls: [
    {
      to: "0x1234567890123456789012345678901234567890",
      value: parseEther("0.000001"),
      data: "0x",
    },
  ],
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.prepareUserOperation
```

***

### requestFaucet()

```ts theme={null}
requestFaucet(options: RequestFaucetOptions): Promise<RequestFaucetResult>;
```

Defined in: [client/evm/evm.ts:1096](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1096)

Requests funds from an EVM faucet.

#### Parameters

##### options

`RequestFaucetOptions`

Parameters for requesting funds from the EVM faucet.

#### Returns

`Promise`\<`RequestFaucetResult`>

A promise that resolves to the transaction hash.

#### Example

```ts theme={null}
const result = await cdp.evm.requestFaucet({
  address: "0x1234567890123456789012345678901234567890",
  network: "base-sepolia",
  token: "eth",
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.requestFaucet
```

***

### revokeSpendPermission()

```ts theme={null}
revokeSpendPermission(options: RevokeSpendPermissionOptions): Promise<UserOperation>;
```

Defined in: [client/evm/evm.ts:458](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L458)

Revokes a spend permission for a smart account.

#### Parameters

##### options

`RevokeSpendPermissionOptions`

Parameters for revoking the spend permission.

#### Returns

`Promise`\<[`UserOperation`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#useroperation)>

A promise that resolves to the user operation.

#### Example

```ts theme={null}
const userOperation = await cdp.evm.revokeSpendPermission({
  address: "0x1234567890123456789012345678901234567890",
  permissionHash: "0x1234567890123456789012345678901234567890123456789012345678901234",
  network: "base-sepolia",
});
```

***

### sendTransaction()

```ts theme={null}
sendTransaction(options: SendTransactionOptions): Promise<TransactionResult>;
```

Defined in: [client/evm/evm.ts:1158](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1158)

Signs an EVM transaction and sends it to the specified network using the Coinbase API.
This method handles nonce management and gas estimation automatically.

#### 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 transaction**

```ts theme={null}
import { parseEther, serializeTransaction } from "viem";
import { baseSepolia } from "viem/chains";

const { transactionHash } = await cdp.evm.sendTransaction({
  address: account.address,
  transaction: serializeTransaction({
    to: "0x4252e0c9A3da5A2700e7d91cb50aEf522D0C6Fe8",
    value: parseEther("0.000001"),
    chainId: baseSepolia.id,
    // Fields below are optional, CDP API will populate them if omitted.
    // nonce
    // maxPriorityFeePerGas
    // maxFeePerGas
    // gas
  }),
  network: "base-sepolia",
});
```

**Sending an EIP-1559 transaction request object**

```ts theme={null}
const { transactionHash } = await cdp.evm.sendTransaction({
  address: account.address,
  transaction: {
    to: "0x4252e0c9A3da5A2700e7d91cb50aEf522D0C6Fe8",
    value: parseEther("0.000001"),
    // Fields below are optional, CDP API will populate them if omitted.
    // nonce
    // maxPriorityFeePerGas
    // maxFeePerGas
    // gas
  },
  network: "base-sepolia",
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.sendTransaction
```

***

### sendUserOperation()

```ts theme={null}
sendUserOperation(options: SendUserOperationOptions<unknown[]>): Promise<SendUserOperationReturnType>;
```

Defined in: [client/evm/evm.ts:1202](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1202)

Sends a user operation.

#### 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

```ts theme={null}
const userOp = await cdp.evm.sendUserOperation({
  smartAccount,
  network: "base-sepolia",
  calls: [
    {
      to: "0x1234567890123456789012345678901234567890",
      value: parseEther("0.000001"),
      data: "0x",
    },
  ],
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.sendUserOperation
```

***

### signHash()

```ts theme={null}
signHash(options: SignHashOptions): Promise<SignatureResult>;
```

Defined in: [client/evm/evm.ts:1249](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1249)

Signs an EVM hash.

#### Parameters

##### options

[`SignHashOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#signhashoptions)

Parameters for signing the hash.

#### Returns

`Promise`\<[`SignatureResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#signatureresult)>

A promise that resolves to the signature.

#### Example

```ts theme={null}
// Create a new EVM server account to sign with
const ethAccount = await cdp.createEvmServerAccount({});

const signature = await cdp.evm.signHash({
  address: ethAccount.address,
  hash: "0x1234567890123456789012345678901234567890123456789012345678901234",
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.signHash
```

***

### signMessage()

```ts theme={null}
signMessage(options: SignMessageOptions): Promise<SignatureResult>;
```

Defined in: [client/evm/evm.ts:1293](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1293)

Signs an EIP-191 message.

#### Parameters

##### options

[`SignMessageOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#signmessageoptions)

Parameters for signing the message.

#### Returns

`Promise`\<[`SignatureResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#signatureresult)>

A promise that resolves to the signature.

#### Example

```ts theme={null}
// Create a new EVM server account to sign with
const ethAccount = await cdp.createEvmServerAccount({});

const signature = await cdp.evm.signMessage({
  address: ethAccount.address,
  message: "Hello, world!",
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.signMessage
```

***

### signTransaction()

```ts theme={null}
signTransaction(options: SignTransactionOptions): Promise<SignatureResult>;
```

Defined in: [client/evm/evm.ts:1425](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1425)

Signs an EVM transaction.

#### Parameters

##### options

[`SignTransactionOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#signtransactionoptions)

Configuration options for signing the transaction.

#### Returns

`Promise`\<[`SignatureResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#signatureresult)>

A promise that resolves to the signature.

#### Example

```ts theme={null}
import { parseEther, serializeTransaction } from "viem";
import { baseSepolia } from "viem/chains";

// Create a new EVM server account to sign with
const ethAccount = await cdp.createEvmServerAccount({});

const serializedTx = serializeTransaction(
  {
    chainId: baseSepolia.id,
    data: "0x",
    to: "0x4252e0c9A3da5A2700e7d91cb50aEf522D0C6Fe8",
    type: "eip1559",
    value: parseEther("0.000001"),
  },
);

const signature = await cdp.evm.signTransaction({
  address: ethAccount.address,
  transaction: serializedTx,
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.signTransaction
```

***

### signTypedData()

```ts theme={null}
signTypedData(options: SignTypedDataOptions): Promise<SignatureResult>;
```

Defined in: [client/evm/evm.ts:1361](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1361)

Signs an EIP-712 message.

#### Parameters

##### options

[`SignTypedDataOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#signtypeddataoptions)

Parameters for signing the EIP-712 message.

#### Returns

`Promise`\<[`SignatureResult`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#signatureresult)>

A promise that resolves to the signature.

#### Example

```ts theme={null}
const signature = await cdp.evm.signTypedData({
  address: account.address,
  domain: {
    name: "Permit2",
    chainId: 1,
    verifyingContract: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
  },
  types: {
    EIP712Domain: [
      { name: "name", type: "string" },
      { name: "chainId", type: "uint256" },
      { name: "verifyingContract", type: "address" },
    ],
    PermitTransferFrom: [
      { name: "permitted", type: "TokenPermissions" },
      { name: "spender", type: "address" },
      { name: "nonce", type: "uint256" },
      { name: "deadline", type: "uint256" },
    ],
    TokenPermissions: [
      { name: "token", type: "address" },
      { name: "amount", type: "uint256" },
    ],
  },
  primaryType: "PermitTransferFrom",
  message: {
    permitted: {
      token: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      amount: "1000000",
    },
    spender: "0xFfFfFfFFfFFfFFfFFfFFFFFffFFFffffFfFFFfFf",
    nonce: "0",
    deadline: "1717123200",
  },
});
```

#### Implementation of

```ts theme={null}
EvmClientInterface.signTypedData
```

***

### updateAccount()

```ts theme={null}
updateAccount(options?: UpdateEvmAccountOptions): Promise<{
  address: `0x${string}`;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  policies?: string[];
  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}`; listTokenBalances: (options: Omit<(...), (...)>) => Promise<(...)>; name?: string; policies?: (...)[]; 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<`0x${string}`>; signMessage: (parameters: { message: SignableMessage; }) => Promise<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & { [K in string | number | symbol]: ({ sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & { network: Network })[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<TransactionResult>;
}>;
```

Defined in: [client/evm/evm.ts:1489](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1489)

Updates a CDP EVM account.

#### Parameters

##### options?

[`UpdateEvmAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#updateevmaccountoptions)

Optional parameters for creating the account.

#### Returns

`Promise`\<\{
`address`: `` `0x${string}` ``;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`policies?`: `string`\[];
`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`\<\&#123; \[K in string | number | symbol]: (Omit\<\&#123; address: \`0x$\&#123;string\&#125;\`; listTokenBalances: (options: Omit\<(...), (...)\>) =\> Promise\<(...)\>; name?: string; policies?: (...)\[\]; 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$\&#123;string\&#125;\`; sign: (parameters: \{ hash: \`0x$\&#123;string\&#125;\`; \}) =\> Promise\<\`0x$\&#123;string\&#125;\`>; signMessage: (parameters: \&#123; message: SignableMessage; \&#125;) => Promise\<...>; ... 12 more ...; useNetwork: ...; }, keyof Actions | ... 5 mor...; useSpendPermission: (options: UseSpendPermissionOptions) => Promise\<(...)> }, (keyof Actions) | "transfer" | "sendTransaction" | "quoteSwap" | "swap" | "useSpendPermission" | "useNetwork"> & \&#123; \[K in string | number | symbol]: (\&#123; sendTransaction: ...; transfer: ...; waitForTransactionReceipt: ... \&#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \&#123; network: Network \&#125;)\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`TransactionResult`>;
}>

A promise that resolves to the updated account.

#### Examples

```ts theme={null}
         const account = await cdp.evm.updateAccount({ address: "0x...", update: { name: "New Name" } });
```

```ts theme={null}
         const account = await cdp.evm.updateAccount(&#123; address: "0x...", update: &#123; accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" &#125; });
```

```ts theme={null}
         const idempotencyKey = uuidv4();

         // First call
         await cdp.evm.updateAccount({
           address: "0x...",
           update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" },
           idempotencyKey,
         });

         // Second call with the same idempotency key will not update
         await cdp.evm.updateAccount({
           address: '0x...',
           update: { name: "" },
           idempotencyKey,
         });
```

#### Implementation of

```ts theme={null}
EvmClientInterface.updateAccount
```

***

### updateSmartAccount()

```ts theme={null}
updateSmartAccount(options?: UpdateEvmSmartAccountOptions): Promise<{
  address: `0x${string}`;
  getUserOperation: (options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>;
  listTokenBalances: (options: Omit<ListTokenBalancesOptions, "address">) => Promise<ListTokenBalancesResult>;
  name?: string;
  owners: EvmAccount[];
  policies: string[] | undefined;
  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<&#123; [K in string | number | symbol]: (Omit<EvmSmartAccountProperties, "useNetwork"> & &#123; [K in string | number | symbol]: (&#123; getUserOperation: ...; sendUserOperation: ...; signTypedData: ...; waitForUserOperation: ... &#125; & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))[K] } & &#123; network: Network &#125;)[K] }>;
  useSpendPermission: (options: UseSpendPermissionOptions) => Promise<SendUserOperationReturnType>;
  waitForUserOperation: (options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>;
}>;
```

Defined in: [client/evm/evm.ts:1524](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1524)

Updates a CDP EVM smart account.

#### Parameters

##### options?

[`UpdateEvmSmartAccountOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#updateevmsmartaccountoptions)

Optional parameters for updating the account.

#### Returns

`Promise`\<\{
`address`: `` `0x${string}` ``;
`getUserOperation`: (`options`: `Omit`\<[`GetUserOperationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#getuseroperationoptions), `"smartAccount"`>) => `Promise`\<[`UserOperation`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#useroperation)>;
`listTokenBalances`: (`options`: `Omit`\<`ListTokenBalancesOptions`, `"address"`>) => `Promise`\<`ListTokenBalancesResult`>;
`name?`: `string`;
`owners`: [`EvmAccount`](/sdks/cdp-sdks-v2/typescript/evm/Accounts/EvmAccount)\[];
`policies`: `string`\[] | `undefined`;
`quoteSwap`: (`options`: `SmartAccountQuoteSwapOptions`) => `Promise`\<`SmartAccountQuoteSwapResult`>;
`requestFaucet`: (`options`: `Omit`\<`RequestFaucetOptions`, `"address"`>) => `Promise`\<`RequestFaucetResult`>;
`sendUserOperation`: (`options`: `Omit`\<`SendUserOperationOptions`\<`unknown`\[]>, `"smartAccount"`>) => `Promise`\<`SendUserOperationReturnType`>;
`signTypedData`: (`options`: `Omit`\<[`SignTypedDataOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#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: ...; signTypedData: ...; waitForUserOperation: ... } & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)))\[K] } & \{ network: Network })\[K] }>;
`useSpendPermission`: (`options`: `UseSpendPermissionOptions`) => `Promise`\<`SendUserOperationReturnType`>;
`waitForUserOperation`: (`options`: `Omit`\<`WaitForUserOperationOptions`, `"smartAccountAddress"`>) => `Promise`\<`WaitForUserOperationReturnType`>;
}>

A promise that resolves to the updated account.

#### Implementation of

```ts theme={null}
EvmClientInterface.updateSmartAccount
```

***

### waitForEvmEip7702DelegationOperationStatus()

```ts theme={null}
waitForEvmEip7702DelegationOperationStatus(options: WaitForEvmEip7702DelegationOperationStatusOptions): Promise<EvmEip7702DelegationOperation>;
```

Defined in: [client/evm/evm.ts:1631](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1631)

Polls the EIP-7702 delegation operation status until the status is COMPLETED or a timeout occurs.

#### Parameters

##### options

[`WaitForEvmEip7702DelegationOperationStatusOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#waitforevmeip7702delegationoperationstatusoptions)

Parameters for waiting, including delegationOperationId and optional wait configuration.

#### Returns

`Promise`\<`EvmEip7702DelegationOperation`>

A promise that resolves to the delegation operation once it reaches COMPLETED.

#### Example

```ts theme={null}
const operation = await cdp.evm.waitForEvmEip7702DelegationOperationStatus({
  delegationOperationId: "delegation-op-123",
});
console.log(operation.status); // "COMPLETED"
```

#### Implementation of

```ts theme={null}
EvmClientInterface.waitForEvmEip7702DelegationOperationStatus
```

***

### waitForUserOperation()

```ts theme={null}
waitForUserOperation(options: WaitForUserOperationOptions): Promise<WaitForUserOperationReturnType>;
```

Defined in: [client/evm/evm.ts:1678](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/client/evm/evm.ts#L1678)

Waits for a user operation to complete or fail.

#### Parameters

##### options

[`WaitForUserOperationOptions`](/sdks/cdp-sdks-v2/typescript/evm/Types/index#waitforuseroperationoptions)

Parameters for waiting for the user operation.

#### Returns

`Promise`\<`WaitForUserOperationReturnType`>

A promise that resolves to the transaction receipt.

#### Example

```ts theme={null}
// Send a user operation and get the user operation hash
const &#123; userOpHash &#125; = await cdp.evm.sendUserOperation({
  smartAccount,
  network: "base-sepolia",
  calls: [
    {
      to: "0x0000000000000000000000000000000000000000",
      value: parseEther("0.000001"),
      data: "0x",
    },
  ],
});

// Wait for the user operation to complete or fail
const result = await cdp.evm.waitForUserOperation({
  smartAccountAddress: smartAccount.address,
  userOpHash: userOp.userOpHash,
});
```
