openapi: 3.0.3
info:
title: Coinbase Developer Platform APIs
description: The Coinbase Developer Platform APIs - leading the world's transition onchain.
license:
name: MIT
url: https://opensource.org/licenses/MIT
version: 2.0.0
contact:
name: Coinbase Developer Platform
email: cdp@coinbase.com
url: https://cdp.coinbase.com
servers:
- url: https://api.cdp.coinbase.com/platform
description: The production server of the CDP APIs.
security:
- apiKeyAuth: []
tags:
- name: EVM Accounts
x-audience: public
description: |-
The EVM Account APIs enable you to create and use accounts across blockchains that are compatible with the Ethereum Virtual Machine (EVM).
An **account** is a private/public key pair that is used to sign transactions and messages. The private key is generated and used only in CDP's Trusted Execution Environment (TEE), and never exposed to Coinbase or the developer.
An EVM account is identified by its **address**, which is a 0x-prefixed hexadecimal string. The same address can be used across multiple EVM networks.
Accounts can optionally be assigned an **account name** at creation time for easier identification in subsequent API calls. EVM account names must be globally unique across all EVM accounts in the developer's CDP Project.
## Authentication
The EVM Account API uses two layers of authentication to ensure the security of your accounts' private keys:
- **CDP Secret API Key**: This key is used to authenticate all requests to the entire suite of
REST APIs offered on Coinbase Developer Platform.
- **Wallet Secret**: This secret is used specifically to authenticate sensitive wallet operations
to `POST` and `DELETE` endpoints in the EVM and Solana Account APIs.
To learn more about creating and using using these keys, visit our [Authentication docs](https://docs.cdp.coinbase.com/api-reference/v2/authentication).
**Use our SDK**
The [CDP SDK](https://github.com/coinbase/cdp-sdk) automatically authenticates requests using your CDP Secret API Key and Wallet Secret. Use the CDP SDK for a more convenient access to our APIs.
- name: EVM Smart Accounts
x-audience: public
description: |-
The EVM Smart Account APIs enable you to create and manage Smart Account wallets across EVM-compatible blockchains.
A **Smart Account** is an EVM account that enables enhanced functionality such as account abstraction, batched transactions, and gas sponsorship through [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337). Smart Accounts allow users to create and manage "user operations" instead of traditional EVM transactions.
Smart Accounts are identified by their **address**, which is a 0x-prefixed hexadecimal string.
Smart Accounts can be assigned an optional **name** at creation time for easier identification in subsequent API calls.
A Smart Account has a single owner, which is another EVM Account which signs the Smart Account's transactions. The owner can be a CDP EVM account, or an account managed solely by the developer.
- name: EVM Swaps
x-audience: public
description: |-
A swap refers to the act of exchanging one token for another. The EVM Swap APIs enable you to create and manage swaps. A swap process involves:
1. A user approves token spending via smart contract.
2. The smart contract determines the exchange rate and facilitates the swap between the two tokens.
3. The transaction is completed atomically and the tokens are transferred to the user's wallet.
The Swap API supports:
- **Getting a price**: Estimate the amount of tokens you will receive for a given amount of exchanged tokens.
- **Creating a swap quote**: Return a swap transaction payload that you can use to sign and submit in order to execute the swap.
For the easiest experience creating, signing, and submitting a swap, we recommend using the [CDP SDK](https://github.com/coinbase/cdp-sdk/).
- [Python SDK examples](https://github.com/coinbase/cdp-sdk/tree/main/python#evm-swaps)
- [TypeScript SDK examples](https://github.com/coinbase/cdp-sdk/tree/main/typescript#evm-swaps)
To read more about using the EVM Swap APIs, please see our [Swap API docs](https://docs.cdp.coinbase.com/swaps/docs/welcome).
- name: EVM Token Balances
x-audience: public
description: |-
The EVM Token Balances APIs enable you to retrieve the balances of EVM addresses.
This includes tokens (i.e. ERC-20s) and the native gas token of the network.
## Denomination
- 'amount' is denominated in the smallest indivisible unit of the token. For ETH, the smallest indivisible unit is Wei (10^-18 ETH). For ERC-20s, the smallest unit is the unit returned from `function totalSupply() public view returns (uint256)`.
- 'decimals' is the exponential value N that satisfies the equation `amount * 10^-N = standard_denomination`. The standard denomination is the most commonly used denomination for the token.
- In the case of the native gas token, `decimals` is defined via convention. As an example, for ETH of Ethereum mainnet, the standard denomination is 10^-18 the smallest denomination (Wei). As such, for ETH on Ethereum mainnet, `decimals` is 18.
- In the case of ERC-20 tokens, `decimals` is defined via configuration. `decimals` will be the number returned by `function decimals() public view returns (uint8)` on the underlying token contract.
- name: Faucets
x-audience: public
description: The Faucet APIs enable you to request funds on supported test networks. Faucets are for testing purposes and make development easier by providing a source of funds.
- name: Payments (Alpha)
x-audience: public
description: |-
The Payments APIs enable you to create and manage payment transfers.
The Payments APIs are currently in alpha and are subject to change. The following payment apis are supported.
### API Reference
- `GET /v2/payments/rails/payment-methods`: Get fiat payment methods.
- `GET /v2/payments/rails/crypto`: Get crypto rails.
- `POST /v2/payments/transfers`: Create a transfer quote.
- `POST /v2/payments/transfers/{transferId}/execute`: Execute a transfer quote.
- `GET /v2/payments/transfers/{transferId}`: Get a transfer by transferId.
### Payment Rails
Payment rails are the the source or the target of a transfer.
We support the following payment rails:
- Crypto rails: Onchain currency and networks to send and receive crypto (e.g. Currency: USDC, Network: Ethereum, Solana, Bitcoin, Polygon, Avalanche).
- Payment methods: Payment methods that are previously added in your account (e.g Debit Card).
### Transfer
A Transfer is a money movement between two payment rails. we support the following transfer types:
- Fiat to Crypto transfer
- Source: a payment method (payment method that is already added in your account. e.g. Card)
- Target: onchain address to receive crypto
### Create a Transfer
1. Use `/v2/payments/rails/payment-methods` and `/v2/payments/rails/crypto` to get all available payment rails.
2. Choose the payment rails to use as source and target, and the amount to transfer.
- Use `/v2/payments/transfers` to create a transfer quote.
- Optionally, you can set `execute` to true to execute the transfer quote immediately.
3. Once you have a transfer quote, use `/v2/payments/transfers/{transferId}/execute` to execute a transfer quote.
4. Use `/v2/payments/transfers/{transferId}` to get a transfer by transferId.
- name: Policy Engine
x-audience: public
description: |-
The Policy Engine APIs evaluate policies (a set of rules) to govern the behavior of accounts or projects, such as enforce allowlists and denylists.
- A **policy** is a collection of `rules` with defined criteria.
- Each **rule** contains a specified `action`, `operation`, and `criteria`:
- An `action` can either `accept` or `reject` a transaction if the criteria in the rule are met.
- `criteria` is an array of logical expressions. All parameters must evaluate to true for the action to be applied.
- An `operation` corresponds to a CDP v2 API:
- `signEvmTransaction` or `signSolTransaction` for signing transactions (to set a transaction limit)
- `sendEvmTransaction` for signing a transaction, and sending it to a supported network
- `signEvmHash` for signing an arbitrary 32 byte hash.
- `signEvmMessage` for signing an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message.
- A **rule** indicates how an operation should behave, specifying whether a request with defined criteria should be accepted or rejected. Only `signEvmTransaction` and `signSolTransaction` operations are currently supported.
## Policy Scope
Policies can be applied at the project and/or account level:
- **Project-level policy**: A `project`-level policy applies to all accounts in a CDP Project. Only one project-level policy can be applied to accounts within a CDP Project at any given time.
- **Account-level policy**: An `account`-level policy applies to one or more accounts. An account
can have at most one account-level policy at any given time.
Thus, a single account can be assigned at most two policies at any given time: one project-level policy and one account-level policy.
Scope is specified in the `scope` field of a policy:
```json {
"description": "Project-level policy",
"scope": "account",
...
```
## Policy Evaluation
**Project-level policies** are evaluated first, followed by **account-level policies**.
The Policy Engine will process the request against each rule in the order it is defined within the `rules` array:
1. If the rule's `criteria` (processed as a logical **AND** operation applied to a list of independently evaluated boolean expressions) are met, `accept` or `reject` behavior is applied immediately and the engine stops further evaluation of the policy.
1. If after policy evaluation, no rule's `criteria` are met, the engine moves to processing the next policy (i.e., an `account`-level policy).
1. If no further policies exist, the request is rejected.
For example, the following policy is a project-level policy with two rules. The Policy Engine will:
1. **Evaluate the first rule:** For a `signEvmTransaction` request, accept the request if the transaction is less than or equal to 1000000000000000000 wei OR
1. **Evaluate the second rule:** if the request is a `signEvmTransaction` request, accept the request if the transaction is less than or equal to 2000000000000000000 wei AND the request is made to the address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`.
1. **If the request does not meet the criteria of either rule**, the engine will move on to evaluate an `account`-level policy (if one exists).
1. Otherwise, the request is rejected.
Rules are processed in the order they are defined. Once a rule applies to an operation, subsequent rules are ignored.
```json
{
"description": "Project-level policy",
"scope": "project",
"rules": [
{
"action": "accept",
"operation": "signEvmTransaction",
"criteria": [
{
"type": "ethValue",
"ethValue": "1000000000000000000",
"operator": "<="
}
]
},
{
"action": "accept",
"operation": "signEvmTransaction",
"criteria": [
{
"type": "ethValue",
"ethValue": "2000000000000000000",
"operator": "<="
},
{
"type": "evmAddress",
"addresses": [
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
],
"operator": "in"
}
]
}
]
}
```
## Policy Application
Project-level policies are applied to all accounts in a CDP Project. They will apply retroactively even if the project-level policy is created after the account was created. To disable a project-level policy, you must remove the project-level policy from the CDP Project using the `deletePolicy` operation.
Account-level policies can be applied in two ways:
- By specifying the `accountPolicy` field in the request body of the `createEvmAccount` and
`createSolAccount` operations.
- By specifying the `accountPolicy` field in the request body of the `updateEvmAccount` and
`updateSolanaAccount` operations.
## Criteria
The following criteria are supported:
### SignEvmTransaction Criteria
#### ethValue
A criterion based on the value of the transaction. The transaction's `value` field is compared to the criterion's `ethValue` field using the `operator` field.
#### evmAddress
A criterion based on the recipient address of the transaction. The transaction's `to` field is compared to the criterion's `addresses` field using the `operator` field.
#### evmData
A criterion based on encoded transaction data that evaluates the function being called, as well as any number of arguments accessed by either name or index. Currently this criterion only supports primitive types; `string`, `bool`, `uint(8,16,32,64,256)`, `int(8,16,32,64,256)`, `address`, and both fixed and dynamic length `bytes`.
### SendEvmTransaction Criteria
#### ethValue
A criterion based on the value of the transaction. The transaction's `value` field is compared to the criterion's `ethValue` field using the `operator` field.
#### evmAddress
A criterion based on the recipient address of the transaction. The transaction's `to` field is compared to the criterion's `addresses` field using the `operator` field.
#### evmNetwork
A criterion based on the intended network of the transaction. The `network` field in the `sendEvmTransaction` request body is compared to the criterion's `networks` field using the `operator` field.
#### evmData
A criterion based on encoded transaction data that evaluates the function being called, as well as any number of arguments accessed by either name or index. Currently this criterion only supports primitive types; `string`, `bool`, `uint(8,16,32,64,256)`, `int(8,16,32,64,256)`, `address`, and both fixed and dynamic length `bytes`.
### SignEvmHash Criteria
The `signEvmHash` operation does not accept any criteria. To prevent this operation from being executed by any account, specify a rule with `signEvmHash` as the operation, and `reject` as its action.
### SignEvmMessage Criteria
#### evmMessage
A criterion based on the intended message to be signed. The `match` field in the criteria is a [RE2](https://github.com/google/re2/wiki/Syntax) compliant regular expression that will be executed against the message in the API request.
### SignSolTransaction Criteria
#### solAddress
A criterion based on the recipient addresses of the transaction. The criterion's `address` field is compared to the list of addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array using the `operator` field.
## Restricting Contract Interactions on Ethereum
Smart contract function restrictions serve as a critical security and governance mechanism in decentralized applications, allowing developers and organizations to implement fine-grained access controls over their protocol interactions.
One of the primary use cases for function restrictions is protecting high-risk operations from unauthorized access such as:
- Fund transfers - Contract upgrades - Parameter modifications - Emergency pauses
Policy Engine supports such restrictions that evaluate against transaction data with the `evmData` criterion for the `signEvmTransaction`, and `sendEvmTransaction` operations.
## Examples
### Limiting USDC Spend
This policy restricts USDC transactions on the Base network to transfers of 10,000 tokens or less. It applies to both signing and sending transactions to the USDC contract address, using the ERC20 ABI to validate that only `transfer` function calls with a `value` parameter under the specified limit are permitted.
```json {
"description": "Limit USDC Spend",
"scope": "account",
"rules": [
{
"action": "accept",
"operation": "sendEvmTransaction",
"criteria": [
{
"type": "evmNetwork",
"networks": ["base"],
"operator": "in"
},
{
"type": "evmAddress",
"addresses": ["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"],
"operator": "in"
},
{
"type": "evmData",
"abi": "erc20",
"conditions": [
{
"function": "transfer",
"params": [
{
"name": "value",
"operator": "<=",
"value": "10000"
}
]
}
]
}
]
},
{
"action": "accept",
"operation": "signEvmTransaction",
"criteria": [
{
"type": "evmAddress",
"addresses": ["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"],
"operator": "in"
},
{
"type": "evmData",
"abi": "erc20",
"conditions": [
{
"function": "transfer",
"params": [
{
"name": "value",
"operator": "<=",
"value": "10000"
}
]
}
]
}
]
}
]
} ```.
- name: Solana Accounts
x-audience: public
description: |-
The Solana Account APIs enable you to create and use Solana accounts across SVM-compatible blockchains.
An **account** is a private/public key pair that is used to sign transactions and messages. The private key is generated and used only in CDP's Trusted Execution Environment (TEE), and never exposed to Coinbase or the developer.
A Solana account is identified by its **address**, which is a base-58 encoded string.
Accounts can optionally be assigned an **account name** at creation time for easier identification in subsequent API calls. Solana account names must be globally unique across all Solana accounts in the developer's CDP Project.
## Authentication
The Solana Account APIs use two layers of authentication to ensure the security of your accounts' private keys:
- **CDP Secret API Key**: This key is used to authenticate all requests to the entire suite of
REST APIs offered on Coinbase Developer Platform.
- **Wallet Secret**: This secret is used specifically to authenticate sensitive wallet operations
to `POST` and `DELETE` endpoints in the EVM and Solana Account APIs.
To learn more about creating and using using these keys, visit our [Authentication docs](https://docs.cdp.coinbase.com/api-reference/v2/authentication).
**Use our SDK**
The [CDP SDK](https://github.com/coinbase/cdp-sdk) automatically authenticates requests using your CDP Secret API Key and Wallet Secret. Use the CDP SDK for a more convenient access to our APIs.
- name: x402 Facilitator
x-audience: public
description: |-
The x402 payment protocol is an HTTP-based payment protocol that enables developers running resource servers to accept payments from users using a variety of payment methods.
For more details on the x402 payment protocol, please see the [x402 specification](https://www.x402.org/).
The x402 Facilitator APIs enable you to facilitate payments using the x402 payment protocol by exposing two APIs:
- `POST /v2/x402/verify`: Verify a payment with a supported scheme and network.
- `POST /v2/x402/settle`: Settle a payment with a supported scheme and network.
paths:
/v2/evm/accounts:
get:
x-audience: public
summary: List EVM accounts
description: |-
Lists the EVM accounts belonging to the developer's CDP Project.
The response is paginated, and by default, returns 20 accounts per page.
operationId: listEvmAccounts
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- name: pageSize
description: The number of accounts to return per page.
in: query
required: false
schema:
type: integer
default: 20
example: 10
- name: pageToken
description: The token for the next page of accounts, if any.
in: query
required: false
schema:
type: string
example: eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ==
responses:
'200':
description: Successfully listed EVM accounts.
content:
application/json:
schema:
allOf:
- type: object
properties:
accounts:
type: array
items:
$ref: '#/components/schemas/EvmAccount'
description: The list of EVM accounts.
required:
- accounts
- $ref: '#/components/schemas/ListResponse'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
post:
x-audience: public
summary: Create an EVM account
description: Creates a new EVM account.
operationId: createEvmAccount
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names must be unique across all EVM accounts in the developer's CDP Project.
example: my-wallet
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
accountPolicy:
type: string
x-audience: public
description: The ID of the account-level policy to apply to the account.
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'201':
description: Successfully created EVM account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Project has no secret. Please register a secret with the project.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'409':
description: Resource already exists.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
already_exists:
value:
errorType: already_exists
errorMessage: EVM account with the given name already exists.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/{address}:
get:
x-audience: public
summary: Get an EVM account by address
description: Gets an EVM account by its address.
operationId: getEvmAccount
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- name: address
description: The 0x-prefixed address of the EVM account. The address does not need to be checksummed.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
responses:
'200':
description: Successfully got EVM account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'request body has an error: doesn''t match schema: Error at "name": string doesn''t match the regular expression "^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given address not found.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
put:
x-audience: public
summary: Update an EVM account
description: Updates an existing EVM account. Use this to update the account's name or account-level policy.
operationId: updateEvmAccount
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The 0x-prefixed address of the EVM account. The address does not need to be checksummed.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names must be unique across all EVM accounts in the developer's CDP Project.
example: my-wallet
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
accountPolicy:
type: string
x-audience: public
description: The ID of the account-level policy to apply to the account, or an empty string to unset attached policy.
pattern: (^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)|(^$)
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'200':
description: Successfully updated EVM account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'request body has an error: doesn''t match schema: Error at "/name": string doesn''t match the regular expression "^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"'
'404':
description: EVM account not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/by-name/{name}:
get:
x-audience: public
summary: Get an EVM account by name
description: Gets an EVM account by its name.
operationId: getEvmAccountByName
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- name: name
description: The name of the EVM account.
in: path
required: true
schema:
type: string
example: my-account
responses:
'200':
description: Successfully got EVM account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'error: parameter "name" must be a string'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given name not found.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/{address}/send/transaction:
post:
x-audience: public
summary: Send a transaction
description: |-
Signs a transaction with the given EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/).
The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md).
**Transaction fields and API behavior**
- `to` *(Required)*: The address of the contract or account to send the transaction to.
- `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored.
The transaction will be sent to the network indicated by the `network` field in the request body.
- `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign
a nonce to the transaction based on the current state of the account.
- `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction.
If not provided, the API will estimate a value based on current network conditions.
- `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction.
If not provided, the API will estimate a value based on current network conditions.
- `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value
based on the `to` and `data` fields of the transaction.
- `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction.
- `data` *(Optional)*: The data to send with the transaction; only used for contract calls.
- `accessList` *(Optional)*: The access list to use for the transaction.
operationId: sendEvmTransaction
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The 0x-prefixed address of the Ethereum account.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
type: object
properties:
network:
type: string
description: The network to send the transaction to.
enum:
- base
- base-sepolia
- ethereum
- ethereum-sepolia
example: base-sepolia
transaction:
type: string
description: The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string.
example: '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080'
required:
- transaction
- network
responses:
'200':
description: Successfully signed and sent transaction.
content:
application/json:
schema:
type: object
properties:
transactionHash:
type: string
description: The hash of the transaction, as a 0x-prefixed hex string.
example: '0xf8f98fb6726fc936f24b2007df5cb20e2b8444ff3dfaa2a929335f432a9be2e7'
required:
- transactionHash
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
malformed_transaction:
value:
errorType: malformed_transaction
errorMessage: Malformed unsigned transaction.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'403':
description: Access to resource forbidden.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Unable to sign transaction for this address.
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/{address}/sign/transaction:
post:
x-audience: public
summary: Sign a transaction
description: |-
Signs a transaction with the given EVM account.
The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/).
The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction.
operationId: signEvmTransaction
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The 0x-prefixed address of the EVM account.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
type: object
properties:
transaction:
type: string
description: The RLP-encoded transaction to sign, as a 0x-prefixed hex string.
example: '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080'
required:
- transaction
responses:
'200':
description: Successfully signed transaction.
content:
application/json:
schema:
type: object
properties:
signedTransaction:
type: string
description: The RLP-encoded signed transaction, as a 0x-prefixed hex string.
example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b'
required:
- signedTransaction
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
malformed_transaction:
value:
errorType: malformed_transaction
errorMessage: Malformed unsigned transaction.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'403':
description: Access to resource forbidden.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Unable to sign transaction for this address.
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/{address}/sign:
post:
x-audience: public
summary: Sign a hash
description: Signs an arbitrary 32 byte hash with the given EVM account.
operationId: signEvmHash
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The 0x-prefixed address of the EVM account.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
type: object
properties:
hash:
type: string
description: The arbitrary 32 byte hash to sign.
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
required:
- hash
responses:
'200':
description: Successfully signed hash.
content:
application/json:
schema:
type: object
properties:
signature:
type: string
description: The signature of the hash, as a 0x-prefixed hex string.
example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b'
required:
- signature
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Request body must be specified.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/{address}/sign/message:
post:
x-audience: public
summary: Sign an EIP-191 message
description: |-
Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given EVM account.
Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> ` before being signed.
operationId: signEvmMessage
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The 0x-prefixed address of the EVM account.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: The message to sign.
example: Hello, world!
required:
- message
responses:
'200':
description: Successfully signed message.
content:
application/json:
schema:
type: object
properties:
signature:
type: string
description: The signature of the message, as a 0x-prefixed hex string.
example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b'
required:
- signature
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/{address}/sign/typed-data:
post:
x-audience: public
summary: Sign EIP-712 typed data
description: Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given EVM account.
operationId: signEvmTypedData
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The 0x-prefixed address of the EVM account.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EIP712Message'
responses:
'200':
description: Successfully signed typed data.
content:
application/json:
schema:
type: object
properties:
signature:
type: string
description: The signature of the typed data, as a 0x-prefixed hex string.
example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b'
required:
- signature
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid request. Please check the request body and parameters.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given address not found.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/smart-accounts:
get:
summary: List Smart Accounts
description: |-
Lists the Smart Accounts belonging to the developer's CDP Project.
The response is paginated, and by default, returns 20 accounts per page.
operationId: listEvmSmartAccounts
tags:
- EVM Smart Accounts
security:
- apiKeyAuth: []
parameters:
- name: pageSize
description: The number of accounts to return per page.
in: query
required: false
schema:
type: integer
default: 20
example: 10
- name: pageToken
description: The token for the next page of accounts, if any.
in: query
required: false
schema:
type: string
example: eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ==
responses:
'200':
description: Successfully listed Smart Accounts.
content:
application/json:
schema:
allOf:
- type: object
properties:
accounts:
type: array
items:
$ref: '#/components/schemas/EvmSmartAccount'
description: The list of Smart Accounts.
required:
- accounts
- $ref: '#/components/schemas/ListResponse'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid request. Please check the request body and parameters.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
post:
summary: Create a Smart Account
description: Creates a new Smart Account.
operationId: createEvmSmartAccount
security:
- apiKeyAuth: []
tags:
- EVM Smart Accounts
requestBody:
content:
application/json:
schema:
type: object
properties:
owners:
type: array
description: Today, only a single owner can be set for a Smart Account, but this is an array to allow setting multiple owners in the future.
items:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example:
- '0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a'
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names must be unique across all EVM accounts in the developer's CDP Project.
example: my-smart-wallet
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
required:
- owners
responses:
'201':
description: Successfully created Smart Account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmSmartAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid owner address or account name provided.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/smart-accounts/by-name/{name}:
get:
x-audience: public
summary: Get a Smart Account by name
description: Gets a Smart Account by its name.
operationId: getEvmSmartAccountByName
security:
- apiKeyAuth: []
tags:
- EVM Smart Accounts
parameters:
- name: name
description: The name of the Smart Account.
in: path
required: true
schema:
type: string
example: my-account
responses:
'200':
description: Successfully got Smart Account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmSmartAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'error: parameter "name" must be a string'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Smart Account with the given name not found.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/import:
post:
x-audience: public
summary: Import an EVM account
description: Import an existing EVM account into the developer's CDP Project. This API should be called from the [CDP SDK](https://github.com/coinbase/cdp-sdk) to ensure that the associated private key is properly encrypted.
operationId: importEvmAccount
tags:
- EVM Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
content:
application/json:
schema:
type: object
properties:
encryptedPrivateKey:
type: string
description: The base64-encoded, encrypted private key of the EVM account. The private key must be encrypted using the CDP SDK's encryption scheme.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names must be unique across all EVM accounts in the developer's CDP Project.
example: my-wallet
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
accountPolicy:
type: string
x-audience: public
description: The ID of the account-level policy to apply to the account.
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
required:
- encryptedPrivateKey
responses:
'201':
description: Successfully imported EVM account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: The encrypted private key is invalid.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'409':
description: Resource already exists.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
already_exists:
value:
errorType: already_exists
errorMessage: EVM account with the given address already exists.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/{address}/export:
post:
x-audience: public
summary: Export an EVM account
description: Export an existing EVM account's private key. It is important to store the private key in a secure place after it's exported.
operationId: exportEvmAccount
tags:
- EVM Accounts
security:
- apiKeyAuth: []
x-required-api-auth-scopes:
- accounts#export
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The 0x-prefixed address of the EVM account. The address does not need to be checksummed.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
type: object
properties:
exportEncryptionKey:
type: string
description: The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
required:
- exportEncryptionKey
responses:
'200':
description: Successfully exported EVM account.
content:
application/json:
schema:
type: object
properties:
encryptedPrivateKey:
type: string
description: The base64-encoded, encrypted private key of the EVM account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
required:
- encryptedPrivateKey
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: EVM account with the given address not found.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given address not found.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/accounts/export/by-name/{name}:
post:
x-audience: public
summary: Export an EVM account by name
description: Export an existing EVM account's private key by its name. It is important to store the private key in a secure place after it's exported.
operationId: exportEvmAccountByName
tags:
- EVM Accounts
security:
- apiKeyAuth: []
x-required-api-auth-scopes:
- accounts#export
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: name
description: The name of the EVM account.
in: path
required: true
schema:
type: string
example: my-account
requestBody:
content:
application/json:
schema:
type: object
properties:
exportEncryptionKey:
type: string
description: The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
required:
- exportEncryptionKey
responses:
'200':
description: Successfully exported EVM account.
content:
application/json:
schema:
type: object
properties:
encryptedPrivateKey:
type: string
description: The base64-encoded, encrypted private key of the EVM account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
required:
- encryptedPrivateKey
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'error: parameter "name" must be a string'
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM account with the given name not found.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/smart-accounts/{address}:
get:
summary: Get a Smart Account by address
description: Gets a Smart Account by its address.
operationId: getEvmSmartAccount
security:
- apiKeyAuth: []
tags:
- EVM Smart Accounts
parameters:
- name: address
description: The 0x-prefixed address of the Smart Account.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
responses:
'200':
description: Successfully got Smart Account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmSmartAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid address provided.
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Smart Account with the given address not found.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
put:
x-audience: public
summary: Update an EVM Smart Account
description: Updates an existing EVM smart account. Use this to update the smart account's name.
operationId: updateEvmSmartAccount
tags:
- EVM Smart Accounts
security:
- apiKeyAuth: []
parameters:
- name: address
description: The 0x-prefixed address of the EVM smart account. The address does not need to be checksummed.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: |-
An optional name for the smart account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names must be unique across all EVM smart accounts in the developer's CDP Project.
example: my-smart-account
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
responses:
'200':
description: Successfully updated EVM smart account.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmSmartAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'request body has an error: doesn''t match schema: Error at "/name": string doesn''t match the regular expression "^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"'
'404':
description: EVM account not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM smart account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/smart-accounts/{address}/user-operations:
post:
summary: Prepare a user operation
description: Prepares a new user operation on a Smart Account for a specific network.
operationId: prepareUserOperation
tags:
- EVM Smart Accounts
security:
- apiKeyAuth: []
parameters:
- name: address
description: The address of the Smart Account to create the user operation on.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
requestBody:
content:
application/json:
schema:
type: object
properties:
network:
type: string
description: The network to prepare the user operation for.
enum:
- base-sepolia
- base
example: base-sepolia
calls:
type: array
description: The list of calls to make from the Smart Account.
items:
$ref: '#/components/schemas/EvmCall'
paymasterUrl:
type: string
description: The URL of the paymaster to use for the user operation.
example: https://api.developer.coinbase.com/rpc/v1/base/
required:
- network
- calls
responses:
'201':
description: The prepared user operation.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmUserOperation'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Field "network" is required.
'403':
description: Access to resource forbidden.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Unable to sign transaction for this address.
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: EVM smart account with the given address not found.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/smart-accounts/{address}/user-operations/{userOpHash}:
get:
summary: Get a user operation
description: Gets a user operation by its hash.
operationId: getUserOperation
tags:
- EVM Smart Accounts
security:
- apiKeyAuth: []
parameters:
- name: address
description: The address of the Smart Account the user operation belongs to.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
- name: userOpHash
description: The hash of the user operation to fetch.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{64}$
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
responses:
'200':
description: Successfully retrieved the user operation.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmUserOperation'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid request. Please check the request body and parameters.
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: User operation not found.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/smart-accounts/{address}/user-operations/{userOpHash}/send:
post:
summary: Send a user operation
description: |-
Sends a user operation with a signature.
The payload to sign must be the `userOpHash` field of the user operation. This hash should be signed directly (not using `personal_sign` or EIP-191 message hashing).
The signature must be 65 bytes in length, consisting of: - 32 bytes for the `r` value - 32 bytes for the `s` value - 1 byte for the `v` value (must be 27 or 28)
If using the CDP Paymaster, the user operation must be signed and sent within 2 minutes of being prepared.
operationId: sendUserOperation
tags:
- EVM Smart Accounts
security:
- apiKeyAuth: []
parameters:
- name: address
description: The address of the Smart Account to send the user operation from.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
- name: userOpHash
description: The hash of the user operation to send.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{64}$
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
requestBody:
content:
application/json:
schema:
type: object
properties:
signature:
type: string
description: The hex-encoded signature of the user operation. This should be a 65-byte signature consisting of the `r`, `s`, and `v` values of the ECDSA signature. Note that the `v` value should conform to the `personal_sign` standard, which means it should be 27 or 28.
example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b'
required:
- signature
responses:
'200':
description: The sent user operation.
content:
application/json:
schema:
$ref: '#/components/schemas/EvmUserOperation'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_signature:
value:
errorType: invalid_signature
errorMessage: Invalid signature.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'403':
description: Access to resource forbidden.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Unable to sign transaction for this address.
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: User operation not found.
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
rate_limit_exceeded:
value:
errorType: rate_limit_exceeded
errorMessage: Max concurrent user operations reached.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/swaps/quote:
get:
x-audience: public
summary: Get a price estimate for a swap
description: Get a price estimate for a swap between two tokens on an EVM network.
operationId: getEvmSwapPrice
tags:
- EVM Swaps
security:
- apiKeyAuth: []
parameters:
- in: query
name: network
required: true
schema:
$ref: '#/components/schemas/EvmSwapsNetwork'
- in: query
name: toToken
required: true
schema:
$ref: '#/components/schemas/toToken'
- in: query
name: fromToken
required: true
schema:
$ref: '#/components/schemas/fromToken'
- in: query
name: fromAmount
required: true
schema:
$ref: '#/components/schemas/fromAmount'
- in: query
name: taker
required: true
schema:
$ref: '#/components/schemas/taker'
- in: query
name: signerAddress
required: false
schema:
$ref: '#/components/schemas/signerAddress'
- in: query
name: gasPrice
required: false
schema:
$ref: '#/components/schemas/gasPrice'
- in: query
name: slippageBps
required: false
schema:
$ref: '#/components/schemas/slippageBps'
responses:
'200':
description: A price estimate for the swap.
content:
application/json:
schema:
$ref: '#/components/schemas/GetSwapPriceResponseWrapper'
examples:
success:
summary: Successful swap price retrieval
value:
blockNumber: '17038723'
toAmount: '1000000000000000000'
toToken: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'
fees:
gasFee:
amount: '1000000000000000000'
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
protocolFee:
amount: '1000000000000000000'
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
issues:
allowance:
currentAllowance: '1000000000'
spender: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
balance:
token: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
currentBalance: '1000000000000000000'
requiredBalance: '1000000000000000000'
simulationIncomplete: false
liquidityAvailable: true
minToAmount: '900000000000000000'
fromAmount: '1000000000000000000'
fromToken: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
gas: '100000'
gasPrice: '1000000000'
unavailable:
summary: Swap with unavailable liquidity
value:
liquidityAvailable: false
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid request. Please check the request body and parameters.
'403':
description: Taker not permitted to perform swap.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Taker not permitted to perform swap.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/swaps:
post:
x-audience: public
summary: Create a swap quote
description: Create a swap quote, which includes the payload to sign as well as the transaction data needed to execute the swap. The developer is responsible for signing the payload and submitting the transaction to the network in order to execute the swap.
operationId: createEvmSwapQuote
tags:
- EVM Swaps
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
network:
$ref: '#/components/schemas/EvmSwapsNetwork'
toToken:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed contract address of the token to receive.
example: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'
fromToken:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed contract address of the token to send.
example: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
fromAmount:
type: string
pattern: ^\d+$
description: The amount of the `fromToken` to send in atomic units of the token. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc.
example: '1000000000000000000'
taker:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed address that holds the `fromToken` balance and has the `Permit2` allowance set for the swap.
example: '0xAc0974bec39a17e36ba4a6b4d238ff944bacb478'
signerAddress:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed Externally Owned Account (EOA) address that will sign the `Permit2` EIP-712 permit message. This is only needed if `taker` is a smart contract.
example: '0x922f49447d8a07e3bd95bd0d56f35241523fbab8'
gasPrice:
type: string
pattern: ^\d+$
description: The target gas price for the swap transaction, in Wei. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. If not provided, the API will use an estimate based on the current network conditions.
example: '1000000000'
slippageBps:
type: integer
minimum: 0
maximum: 10000
description: The maximum acceptable slippage of the `toToken` in basis points. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100 bps (i.e., 1%).
default: 100
example: 100
required:
- network
- toToken
- fromToken
- fromAmount
- taker
responses:
'201':
description: Successfully created swap quote.
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSwapQuoteResponseWrapper'
examples:
success:
summary: Successful swap quote creation
value:
blockNumber: '17038723'
toAmount: '1000000000000000000'
toToken: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'
fees:
gasFee:
amount: '1000000000000000000'
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
protocolFee:
amount: '1000000000000000000'
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
issues:
allowance:
currentAllowance: '1000000000'
spender: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
balance:
token: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
currentBalance: '1000000000000000000'
requiredBalance: '1000000000000000000'
simulationIncomplete: false
liquidityAvailable: true
minToAmount: '900000000000000000'
fromAmount: '1000000000000000000'
fromToken: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
permit2:
hash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
eip712:
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: '123456'
deadline: '1717123200'
transaction:
to: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
data: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
gas: '100000'
gasPrice: '1000000000'
value: '1000000000000000000'
unavailable:
summary: Swap with unavailable liquidity
value:
liquidityAvailable: false
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid request. Please check the request body and parameters.
'403':
description: Taker not permitted to perform swap.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Taker not permitted to perform swap.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/token-balances/{network}/{address}:
get:
summary: List EVM token balances
x-audience: public
description: |-
Lists the token balances of an EVM address on a given network. The balances include ERC-20 tokens and the native gas token (usually ETH). The response is paginated, and by default, returns 20 balances per page.
**Note:** This endpoint is still under development and does not yet provide strong freshness guarantees. Specifically, balances of new tokens can, on occasion, take up to ~30 seconds to appear, while balances of tokens already belonging to an address will generally be close to chain tip. Freshness of new token balances will improve over the coming weeks.
operationId: listEvmTokenBalances
tags:
- EVM Token Balances
security:
- apiKeyAuth: []
parameters:
- name: address
description: The 0x-prefixed EVM address to get balances for. The address does not need to be checksummed.
in: path
required: true
schema:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
- name: network
description: The human-readable network name to get the balances for.
in: path
required: true
schema:
$ref: '#/components/schemas/ListEvmTokenBalancesNetwork'
example: base
- name: pageSize
description: The number of balances to return per page.
in: query
required: false
schema:
type: integer
default: 20
example: 10
- name: pageToken
description: The token for the next page of balances. Will be empty if there are no more balances to fetch.
in: query
required: false
schema:
type: string
example: eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ==
responses:
'200':
description: Successfully listed token balances.
content:
application/json:
schema:
allOf:
- type: object
required:
- balances
properties:
balances:
type: array
items:
$ref: '#/components/schemas/TokenBalance'
description: The list of EVM token balances.
example:
- amount:
amount: '1250000000000000000'
decimals: 18
token:
network: base
symbol: ETH
name: ether
contractAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
- amount:
amount: '123456'
decimals: 6
token:
network: base
symbol: USDC
name: USD Coin
contractAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
- $ref: '#/components/schemas/ListResponse'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: string doesn't match the regular expression "^0x[0-9a-fA-F]{40}$"
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Address not found, or no balances found for the given address on this chain.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/evm/faucet:
post:
x-audience: public
summary: Request funds on EVM test networks
description: |
Request funds from the CDP Faucet on supported EVM test networks.
Faucets are available for ETH, USDC, EURC, and cbBTC on Base Sepolia and Ethereum Sepolia, and for ETH only on Ethereum Hoodi.
To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.
These limits are applied at both the CDP User level and the blockchain address level.
A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address.
| Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits|
|:-----:|:-------------------------:|:--------------------------------:|
| ETH | 0.0001 ETH | 0.1 ETH |
| USDC | 1 USDC | 10 USDC |
| EURC | 1 EURC | 10 EURC |
| cbBTC | 0.0001 cbBTC | 0.001 cbBTC |
operationId: requestEvmFaucet
tags:
- Faucets
security:
- apiKeyAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
network:
type: string
description: The network to request funds from.
enum:
- base-sepolia
- ethereum-sepolia
- ethereum-hoodi
example: base-sepolia
address:
type: string
description: The address to request funds to, which is a 0x-prefixed hexadecimal string.
pattern: ^0x[0-9a-fA-F]{40}$
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
token:
type: string
description: The token to request funds for.
enum:
- eth
- usdc
- eurc
- cbbtc
example: eth
required:
- network
- address
- token
responses:
'200':
description: Successfully requested funds.
content:
application/json:
schema:
type: object
properties:
transactionHash:
type: string
description: |-
The hash of the transaction that requested the funds.
**Note:** In rare cases, when gas conditions are unusually high, the transaction may not confirm, and the system may issue a replacement transaction to complete the faucet request. In these rare cases, the `transactionHash` will be out of sync with the actual faucet transaction that was confirmed onchain.
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
required:
- transactionHash
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'request body has an error: doesn''t match schema: Error at "address": string doesn''t match the regular expression "^0x[0-9a-fA-F]{40}$"'
'403':
description: Access to resource forbidden.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Unable to request faucet funds for this address.
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
faucet_limit_exceeded:
value:
errorType: faucet_limit_exceeded
errorMessage: Faucet limit reached for this address. Please try again later.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/policy-engine/policies:
get:
summary: List policies
x-audience: public
description: |-
Lists the policies belonging to the developer's CDP Project. Use the `scope` parameter to filter the policies by scope.
The response is paginated, and by default, returns 20 policies per page.
operationId: listPolicies
tags:
- Policy Engine
security:
- apiKeyAuth: []
parameters:
- name: pageSize
description: The number of policies to return per page.
in: query
required: false
schema:
type: integer
default: 20
example: 10
- name: pageToken
description: The token for the next page of policies, if any.
in: query
required: false
schema:
type: string
example: eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ==
- name: scope
description: The scope of the policies to return. If `project`, the response will include exactly one policy, which is the project-level policy. If `account`, the response will include all account-level policies for the developer's CDP Project.
in: query
required: false
schema:
type: string
enum:
- project
- account
example: project
responses:
'200':
description: Successfully listed policies.
content:
application/json:
schema:
allOf:
- type: object
properties:
policies:
type: array
items:
$ref: '#/components/schemas/Policy'
description: The list of policies.
required:
- policies
- $ref: '#/components/schemas/ListResponse'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
post:
summary: Create a policy
x-audience: public
description: Create a policy that can be used to govern the behavior of accounts.
operationId: createPolicy
tags:
- Policy Engine
security:
- apiKeyAuth: []
x-required-api-auth-scopes:
- policies#manage
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
scope:
type: string
description: The scope of the policy.
enum:
- project
- account
example: project
description:
type: string
description: |-
An optional human-readable description for the policy.
Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less.
pattern: ^[A-Za-z0-9 ,.]{1,50}$
example: Default policy
rules:
type: array
description: A list of rules that comprise the policy. There is a limit of 10 rules per policy.
items:
$ref: '#/components/schemas/Rule'
required:
- scope
- rules
responses:
'201':
description: Successfully created policy.
content:
application/json:
schema:
$ref: '#/components/schemas/Policy'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Policy name must be between 1 and 50 characters
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/policy-engine/policies/{policyId}:
get:
summary: Get a policy by ID
x-audience: public
description: Get a policy by its ID.
operationId: getPolicyById
tags:
- Policy Engine
security:
- apiKeyAuth: []
parameters:
- name: policyId
description: The ID of the policy to get.
in: path
required: true
schema:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'200':
description: Successfully retrieved policy.
content:
application/json:
schema:
$ref: '#/components/schemas/Policy'
'404':
description: Policy not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Policy not found
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
delete:
summary: Delete a policy
x-audience: public
description: Delete a policy by its ID. This will have the effect of removing the policy from all accounts that are currently using it.
operationId: deletePolicy
tags:
- Policy Engine
security:
- apiKeyAuth: []
x-required-api-auth-scopes:
- policies#manage
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
- name: policyId
description: The ID of the policy to delete.
in: path
required: true
schema:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'204':
description: Successfully deleted policy.
'400':
description: Unable to delete policy.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: policy_in_use
errorMessage: Policy in use
'404':
description: Policy not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Policy not found
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
put:
summary: Update a policy
x-audience: public
description: Updates a policy by its ID. This will have the effect of applying the updated policy to all accounts that are currently using it.
operationId: updatePolicy
tags:
- Policy Engine
security:
- apiKeyAuth: []
x-required-api-auth-scopes:
- policies#manage
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
- name: policyId
description: The ID of the policy to update.
in: path
required: true
schema:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
description:
type: string
description: |-
An optional human-readable description for the policy.
Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less.
pattern: ^[A-Za-z0-9 ,.]{1,50}$
example: Default policy
rules:
type: array
description: A list of rules that comprise the policy. There is a limit of 10 rules per policy.
items:
$ref: '#/components/schemas/Rule'
required:
- rules
responses:
'200':
description: Successfully updated policy.
content:
application/json:
schema:
$ref: '#/components/schemas/Policy'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Policy name must be between 1 and 50 characters
'404':
description: Policy not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Policy not found
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/accounts:
get:
x-audience: public
summary: List Solana accounts or get account by name
description: |-
Lists the Solana accounts belonging to the developer.
The response is paginated, and by default, returns 20 accounts per page.
If a name is provided, the response will contain only the account with that name.
operationId: listSolanaAccounts
tags:
- Solana Accounts
security:
- apiKeyAuth: []
parameters:
- name: pageSize
description: The number of accounts to return per page.
in: query
required: false
schema:
type: integer
default: 20
example: 10
- name: pageToken
description: The token for the next page of accounts, if any.
in: query
required: false
schema:
type: string
example: eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ==
responses:
'200':
description: Successfully listed Solana accounts.
content:
application/json:
schema:
allOf:
- type: object
properties:
accounts:
type: array
items:
$ref: '#/components/schemas/SolanaAccount'
description: The list of Solana accounts.
required:
- accounts
- $ref: '#/components/schemas/ListResponse'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
post:
x-audience: public
summary: Create a Solana account
description: Creates a new Solana account.
operationId: createSolanaAccount
tags:
- Solana Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names must be unique across all Solana accounts in the developer's CDP Project.
example: my-wallet
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
accountPolicy:
type: string
x-audience: public
description: The ID of the account-level policy to apply to the account.
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'201':
description: Successfully created Solana account.
content:
application/json:
schema:
$ref: '#/components/schemas/SolanaAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Project has no secret. Please register a secret with the project.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'409':
description: Resource already exists.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
already_exists:
value:
errorType: already_exists
errorMessage: Solana account with the given name already exists.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/accounts/{address}:
get:
x-audience: public
summary: Get a Solana account by address
description: Gets a Solana account by its address.
operationId: getSolanaAccount
tags:
- Solana Accounts
security:
- apiKeyAuth: []
parameters:
- name: address
description: The base58 encoded address of the Solana account.
in: path
required: true
schema:
type: string
pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
responses:
'200':
description: Successfully got Solana account.
content:
application/json:
schema:
$ref: '#/components/schemas/SolanaAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'request body has an error: doesn''t match schema: Error at "address": string doesn''t match the regular expression "^[1-9A-HJ-NP-Za-km-z]{32,44}$"'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Solana account with the given address not found.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
put:
x-audience: public
summary: Update a Solana account
description: Updates an existing Solana account. Use this to update the account's name or account-level policy.
operationId: updateSolanaAccount
tags:
- Solana Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The base58 encoded address of the Solana account.
in: path
required: true
schema:
type: string
pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: |-
An optional name for the account. Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names must be unique across all Solana accounts in the developer's CDP Project.
example: my-wallet
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
accountPolicy:
type: string
x-audience: public
description: The ID of the account-level policy to apply to the account, or an empty string to unset attached policy.
pattern: (^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)|(^$)
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'200':
description: Successfully updated Solana account.
content:
application/json:
schema:
$ref: '#/components/schemas/SolanaAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'request body has an error: doesn''t match schema: Error at "name": string doesn''t match the regular expression "^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"'
'404':
description: Solana account not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Solana account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/accounts/by-name/{name}:
get:
x-audience: public
summary: Get a Solana account by name
description: Gets a Solana account by its name.
operationId: getSolanaAccountByName
tags:
- Solana Accounts
security:
- apiKeyAuth: []
parameters:
- name: name
description: The name of the Solana account.
in: path
required: true
schema:
type: string
example: my-account
responses:
'200':
description: Successfully got Solana account.
content:
application/json:
schema:
$ref: '#/components/schemas/SolanaAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'error: parameter "name" must be a string'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Solana account with the given name not found.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/accounts/import:
post:
x-audience: public
summary: Import a Solana account
description: Import an existing Solana account into the developer's CDP Project. This API should be called from the [CDP SDK](https://github.com/coinbase/cdp-sdk) to ensure that the associated private key is properly encrypted.
operationId: importSolanaAccount
tags:
- Solana Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
content:
application/json:
schema:
type: object
properties:
encryptedPrivateKey:
type: string
description: The base64-encoded, encrypted 32-byte private key of the Solana account. The private key must be encrypted using the CDP SDK's encryption scheme.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names must be unique across all EVM accounts in the developer's CDP Project.
example: my-solana-wallet
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
required:
- encryptedPrivateKey
responses:
'201':
description: Successfully imported Solana account.
content:
application/json:
schema:
$ref: '#/components/schemas/SolanaAccount'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: The encrypted private key is invalid.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'409':
description: Resource already exists.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
already_exists:
value:
errorType: already_exists
errorMessage: Solana account with the given address already exists.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/accounts/{address}/export:
post:
x-audience: public
summary: Export an Solana account
description: Export an existing Solana account's private key. It is important to store the private key in a secure place after it's exported.
operationId: exportSolanaAccount
tags:
- Solana Accounts
security:
- apiKeyAuth: []
x-required-api-auth-scopes:
- accounts#export
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The base58 encoded address of the Solana account.
in: path
required: true
schema:
type: string
pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
requestBody:
content:
application/json:
schema:
type: object
properties:
exportEncryptionKey:
type: string
description: The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
required:
- exportEncryptionKey
responses:
'200':
description: Successfully exported Solana account.
content:
application/json:
schema:
type: object
properties:
encryptedPrivateKey:
type: string
description: The base64-encoded, encrypted private key of the Solana account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
required:
- encryptedPrivateKey
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Solana account with the given address not found.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Solana account with the given address not found.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/accounts/export/by-name/{name}:
post:
x-audience: public
summary: Export a Solana account by name
description: Export an existing Solana account's private key by its name. It is important to store the private key in a secure place after it's exported.
operationId: exportSolanaAccountByName
tags:
- Solana Accounts
security:
- apiKeyAuth: []
x-required-api-auth-scopes:
- accounts#export
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: name
description: The name of the Solana account.
in: path
required: true
schema:
type: string
example: my-account
requestBody:
content:
application/json:
schema:
type: object
properties:
exportEncryptionKey:
type: string
description: The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
required:
- exportEncryptionKey
responses:
'200':
description: Successfully exported Solana account.
content:
application/json:
schema:
type: object
properties:
encryptedPrivateKey:
type: string
description: The base64-encoded, encrypted private key of the Solana account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request.
example: U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=
required:
- encryptedPrivateKey
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'error: parameter "name" must be a string'
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Solana account with the given name not found.
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/accounts/{address}/sign/transaction:
post:
x-audience: public
summary: Sign a transaction
description: |-
Signs a transaction with the given Solana account.
The unsigned transaction should be serialized into a byte array and then encoded as base64.
**Transaction types**
The following transaction types are supported:
* [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html)
* [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html)
The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction.
operationId: signSolanaTransaction
tags:
- Solana Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The base58 encoded address of the Solana account.
in: path
required: true
schema:
type: string
pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
requestBody:
content:
application/json:
schema:
type: object
properties:
transaction:
type: string
description: The base64 encoded transaction to sign.
example: AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=
required:
- transaction
responses:
'200':
description: Successfully signed transaction.
content:
application/json:
schema:
type: object
properties:
signedTransaction:
type: string
description: The base64 encoded signed transaction.
example: AQACAdSOvpk0UJXs/rQRXYKSI9hcR0bkGp24qGv6t0/M1XjcQpHf6AHwLcPjEtKQI7p/U0Zo98lnJ5/PZMfVq/0BAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=
required:
- signedTransaction
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
malformed_transaction:
value:
errorType: malformed_transaction
errorMessage: Malformed unsigned transaction.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'403':
description: Access to resource forbidden.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Unable to sign transaction for this address.
'404':
description: Solana account not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Solana account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/accounts/{address}/sign/message:
post:
x-audience: public
summary: Sign a message
description: |-
Signs an arbitrary message with the given Solana account.
**WARNING:** Never sign a message that you didn't generate, as it can be an arbitrary transaction. For example, it might send all of your funds to an attacker.
operationId: signSolanaMessage
tags:
- Solana Accounts
security:
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/XWalletAuth'
- $ref: '#/components/parameters/IdempotencyKey'
- name: address
description: The base58 encoded address of the Solana account.
in: path
required: true
schema:
type: string
pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
requestBody:
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: The arbitrary message to sign.
example: Hello, world!
required:
- message
responses:
'200':
description: Successfully signed message.
content:
application/json:
schema:
type: object
properties:
signature:
type: string
description: The signature of the message, as a base58 encoded string.
example: 4YecmNqVT9QFqzuSvE9Zih3toZzNAijjXpj8xupgcC6E4VzwzFjuZBk5P99yz9JQaLRLm1K4L4FpMjxByFxQBe2h
required:
- signature
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: 'request body has an error: doesn''t match schema: Error at "message": string doesn''t match the regular expression "^0x[0-9a-fA-F]{40}$"'
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Wallet authentication error.
'402':
$ref: '#/components/responses/PaymentMethodRequiredError'
'404':
description: Solana account not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Solana account with the given address not found.
'409':
$ref: '#/components/responses/AlreadyExistsError'
'422':
$ref: '#/components/responses/IdempotencyError'
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/solana/faucet:
post:
x-audience: public
summary: Request funds on Solana devnet
description: |
Request funds from the CDP Faucet on Solana devnet.
Faucets are available for SOL.
To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.
These limits are applied at both the CDP User level and the blockchain address level.
A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address.
| Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits|
|:-----:|:-------------------------:|:--------------------------------:|
| SOL | 0.00125 SOL | 0.0125 SOL |
| USDC | 1 USDC | 10 USDC |
operationId: requestSolanaFaucet
tags:
- Faucets
security:
- apiKeyAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
address:
type: string
description: The address to request funds to, which is a base58-encoded string.
pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
token:
type: string
description: The token to request funds for.
enum:
- sol
- usdc
example: sol
required:
- address
- token
responses:
'200':
description: Successfully requested funds.
content:
application/json:
schema:
type: object
properties:
transactionSignature:
type: string
description: The signature identifying the transaction that requested the funds.
example: 4dje1d24iG2FfxwxTJJt8VSTtYXNc6AAuJwngtL97TJSqqPD3pgRZ7uh4szoU6WDrKyFTBgaswkDrCr7BqWjQqqK
required:
- transactionSignature
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_address_format:
value:
errorType: invalid_request
errorMessage: 'request body has an error: doesn''t match schema: Error at "address": string doesn''t match the regular expression "^[1-9A-HJ-NP-Za-km-z]{32,44}$"'
invalid_request:
value:
errorType: invalid_request
errorMessage: Unable to request faucet funds for this address.
'403':
description: Access to resource forbidden.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
forbidden:
value:
errorType: forbidden
errorMessage: Unable to request faucet funds for this address.
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
faucet_limit_exceeded:
value:
errorType: faucet_limit_exceeded
errorMessage: Faucet limit reached for this address. Please try again later.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/payments/rails/payment-methods:
get:
summary: Get the fiat payment methods
description: Gets the fiat payment methods that can be used to send funds or receive funds. This is the list of payment methods configured for your account.
operationId: getPaymentMethods
tags:
- Payments (Alpha)
security:
- apiKeyAuth: []
responses:
'200':
description: Successfully retrieved the payment methods.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PaymentMethod'
example:
- id: 8e03978e-40d5-43e8-bc93-6894a57f9324
type: card
currency: USD
actions:
- source
- target
limits:
sourceLimit:
amount: '100'
currency: USD
targetLimit:
amount: '100'
currency: USD
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Authentication error.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/payments/rails/crypto:
get:
summary: Get the crypto rails
description: Gets the crypto rails that can be used to send funds or receive funds.
operationId: getCryptoRails
tags:
- Payments (Alpha)
security:
- apiKeyAuth: []
parameters:
- name: networks
description: Comma separated list of networks to filter the rails by.
in: query
required: false
schema:
type: string
example: base,ethereum
responses:
'200':
description: Successfully retrieved crypto rails.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CryptoRail'
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Authentication error.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/payments/transfers:
post:
summary: Create a transfer quote
description: Creates a new transfer quote, which can then be executed using the Execute a transfer quote endpoint. If you want to automatically execute the transfer without needing to confirm, specify execute as true.
operationId: createPaymentTransferQuote
tags:
- Payments (Alpha)
security:
- apiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
sourceType:
type: string
enum:
- payment_method
description: The type of the source of the transfer.
source:
$ref: '#/components/schemas/TransferSource'
targetType:
type: string
enum:
- crypto_rail
description: The type of the target of the transfer.
target:
$ref: '#/components/schemas/TransferTarget'
amount:
type: string
description: The amount of the transfer, which is either for the source currency to buy, or the target currency to receive.
currency:
type: string
description: The currency of the transfer. This can be specified as the source currency, which would be used to buy, or else the target currency, which is how much will be received.
execute:
type: boolean
default: false
description: Whether to execute the transfer. If true, the transfer will be committed and executed. If false, the quote will be generated and returned.
required:
- sourceType
- source
- targetType
- target
- amount
- currency
responses:
'201':
description: Successfully created a transfer.
content:
application/json:
schema:
type: object
properties:
transfer:
$ref: '#/components/schemas/Transfer'
required:
- transfer
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid fiat rail.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Authentication error.
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
rate_limit_exceeded:
value:
errorType: rate_limit_exceeded
errorMessage: Rate limit exceeded.
'500':
$ref: '#/components/responses/InternalServerError'
/v2/payments/transfers/{transferId}/execute:
post:
summary: Execute a transfer quote
description: Executes a transfer quote which was created using the Create a transfer quote endpoint.
operationId: executePaymentTransferQuote
tags:
- Payments (Alpha)
security:
- apiKeyAuth: []
parameters:
- name: transferId
description: The ID of the transfer.
in: path
required: true
schema:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'200':
description: Successfully committed a transfer.
content:
application/json:
schema:
$ref: '#/components/schemas/Transfer'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid transfer ID.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Authentication error.
'404':
description: Transfer not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Transfer with the given ID does not exist.
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
rate_limit_exceeded:
value:
errorType: rate_limit_exceeded
errorMessage: Rate limit exceeded.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
/v2/payments/transfers/{transferId}:
get:
summary: Get a transfer by ID
description: Gets a transfer by ID.
operationId: getPaymentTransfer
tags:
- Payments (Alpha)
security:
- apiKeyAuth: []
parameters:
- name: transferId
description: The ID of the transfer.
in: path
required: true
schema:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'200':
description: Successfully got a transfer by ID.
content:
application/json:
schema:
$ref: '#/components/schemas/Transfer'
'400':
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_request:
value:
errorType: invalid_request
errorMessage: Invalid transfer ID.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unauthorized:
value:
errorType: unauthorized
errorMessage: Authentication error.
'404':
description: Transfer not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
not_found:
value:
errorType: not_found
errorMessage: Transfer with the given ID does not exist.
'500':
$ref: '#/components/responses/InternalServerError'
'502':
$ref: '#/components/responses/BadGatewayError'
'503':
$ref: '#/components/responses/ServiceUnavailableError'
components:
securitySchemes:
apiKeyAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: A JWT signed using your CDP API Key Secret, encoded in base64. Refer to the [Generate Bearer Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-bearer-token) section of our Authentication docs for information on how to generate your Bearer Token.
schemas:
EvmAccount:
type: object
properties:
address:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
description: The 0x-prefixed, checksum EVM address.
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names are guaranteed to be unique across all EVM accounts in the developer's CDP Project.
example: my-account
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
policies:
type: array
x-audience: public
description: The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists.
items:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example:
- 123e4567-e89b-12d3-a456-426614174000
createdAt:
type: string
description: The UTC ISO 8601 timestamp at which the account was created.
example: '2025-03-25T12:00:00Z'
format: date-time
updatedAt:
type: string
description: The UTC ISO 8601 timestamp at which the account was last updated.
example: '2025-03-26T12:00:00Z'
format: date-time
required:
- address
ListResponse:
type: object
properties:
nextPageToken:
type: string
description: The token for the next page of items, if any.
example: eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ==
ErrorType:
description: The code that indicates the type of error that occurred. These error codes can be used to determine how to handle the error.
type: string
example: invalid_request
enum:
- already_exists
- bad_gateway
- faucet_limit_exceeded
- forbidden
- idempotency_error
- internal_server_error
- invalid_request
- invalid_signature
- malformed_transaction
- not_found
- payment_method_required
- rate_limit_exceeded
- request_canceled
- service_unavailable
- timed_out
- unauthorized
- policy_violation
- policy_in_use
- account_limit_exceeded
x-error-instructions:
already_exists: |-
This error occurs when trying to create a resource that already exists.
**Steps to resolve:**
1. Check if the resource exists before creation
2. Use GET endpoints to verify resource state
3. Use unique identifiers/names for resources
bad_gateway: |-
This error occurs when the CDP API is unable to connect to the backend service.
**Steps to resolve:**
1. Retry your request after a short delay
2. If persistent, contact CDP support with:
- The timestamp of the error
- Request details
3. Consider implementing retry logic with an exponential backoff
**Note:** These errors are automatically logged and monitored by CDP.
faucet_limit_exceeded: |-
This error occurs when you've exceeded the faucet request limits.
**Steps to resolve:**
1. Wait for the time window to reset
2. Use funds more efficiently in your testing
For more information on faucet limits, please visit the [EVM Faucet endpoint](../reference/requestEvmFaucet) or the [Solana Faucet endpoint](../reference/requestSolanaFaucet).
forbidden: |-
This error occurs when you don't have permission to access the resource.
**Steps to resolve:**
1. Verify your permissions to access the resource
2. Ensure that you are the owner of the requested resource
idempotency_error: |-
This error occurs when an idempotency key is reused with different parameters.
**Steps to resolve:**
1. Generate a new UUID v4 for each unique request
2. Only reuse idempotency keys for exact request duplicates
3. Track used keys within your application
**Example idempotency key implementation:**
```typescript
import { v4 as uuidv4 } from 'uuid';
function createIdempotencyKey() {
return uuidv4();
}
```
internal_server_error: |-
This indicates an unexpected error that occurred on the CDP servers.
**Important**: If you encounter this error, please note that your operation's status should be treated as unknown by your application, as it could have been a success within the CDP back-end.
**Steps to resolve:**
1. Retry your request after a short delay
2. If persistent, contact CDP support with:
- Your correlation ID
- Timestamp of the error
- Request details
3. Consider implementing retry logic with an exponential backoff
**Note:** These errors are automatically logged and monitored by CDP.
invalid_request: |-
This error occurs when the request is malformed or contains invalid data, including issues with the request body, query parameters, path parameters, or headers.
**Steps to resolve:**
1. Check all required fields and parameters are present
2. Ensure request body (if applicable) follows the correct schema
3. Verify all parameter formats match the API specification:
- Query parameters
- Path parameters
- Request headers
4. Validate any addresses, IDs, or other formatted strings meet requirements
**Common validation issues:**
- Missing required parameters
- Invalid parameter types or formats
- Malformed JSON in request body
- Invalid enum values
invalid_signature: |-
This error occurs when the signature provided for the given user operation is invalid.
**Steps to resolve:**
1. Verify the signature was generated by the correct owner account
2. Ensure the signature corresponds to the exact user operation hash
3. Check that the signature format matches the expected format
4. Confirm you're using the correct network for the Smart Account
**Common causes:**
- Using wrong owner account to sign
- Signing modified/incorrect user operation data
- Malformed signature encoding
- Network mismatch between signature and broadcast
malformed_transaction: |-
This error occurs when the transaction data provided is not properly formatted or is invalid.
**Steps to resolve:**
1. Verify transaction encoding:
- **EVM networks**: Check RLP encoding is correct
- **Solana**: Validate base64 encoding
2. Ensure all required transaction fields are present
3. Validate transaction parameters are within acceptable ranges
4. Check that the transaction type is supported on the target network (see our [Supported Networks](https://docs.cdp.coinbase.com/cdp-apis/docs/networks) page for more details)
**Common causes:**
- Invalid hex encoding for EVM transactions
- Missing required transaction fields
- Incorrect parameter formats
- Unsupported transaction types
- Network-specific transaction format mismatches
not_found: |-
This error occurs when the resource specified in your request doesn't exist or you don't have access to it.
**Steps to resolve:**
1. Verify the resource ID/address/account exists
2. Check your permissions to access the resource
3. Ensure you're using the correct network/environment
4. Confirm the resource hasn't been deleted
**Common causes:**
- Mistyped addresses
- Accessing resources from the wrong CDP project
- Resource was deleted or hasn't been created yet
payment_method_required: |-
This error occurs when a payment method is required to complete the requested operation but none is configured or available.
**Steps to resolve:**
1. Add a valid payment method to your account using the [CDP Portal](https://portal.cdp.coinbase.com)
2. Ensure your payment method is valid and not expired
**Common causes:**
- No payment method configured on the account
- Payment method is expired
rate_limit_exceeded: |-
This error occurs when you've exceeded the API rate limits.
**Steps to resolve:**
1. Implement exponential backoff
2. Cache responses where possible
3. Wait for rate limit window to reset
**Best practices:**
```typescript
async function withRetry(fn: () => Promise) {
let delay = 1000;
while (true) {
try {
return await fn();
} catch (e) {
if (e.errorType === "rate_limit_exceeded") {
await sleep(delay);
delay *= 2;
continue;
}
throw e;
}
}
}
```
request_canceled: |-
This error occurs when the client cancels an in-progress request before it completes.
**Steps to resolve:**
1. Check client-side timeout configurations
2. Review request cancellation logic in your code
3. Consider increasing timeout thresholds for long-running operations
4. Implement request tracking to identify premature cancellations
**Best practices:**
```typescript
async function withTimeout(promise: Promise, timeoutMs: number): Promise {
const timeout = new Promise((_, reject) => {
setTimeout(() => {
reject(new Error("Operation timed out"));
}, timeoutMs);
});
try {
return await Promise.race([promise, timeout]);
} catch (error) {
// Handle timeout or cancellation
throw error;
}
}
```
service_unavailable: |-
This error occurs when the CDP API is temporarily unable to handle requests due to maintenance or high load.
**Steps to resolve:**
1. Retry your request after a short delay
2. If persistent, contact CDP support with:
- The timestamp of the error
- Request details
3. Consider implementing retry logic with an exponential backoff
**Note:** These errors are automatically logged and monitored by CDP.
timed_out: |-
This error occurs when a request exceeds the maximum allowed processing time.
**Steps to resolve:**
1. Break down large requests into smaller chunks (if applicable)
2. Implement retry logic with exponential backoff
3. Use streaming endpoints for large data sets
**Example retry implementation:**
```typescript
async function withRetryAndTimeout(
operation: () => Promise,
maxRetries = 3,
timeout = 30000,
): Promise {
let attempts = 0;
while (attempts < maxRetries) {
try {
return await Promise.race([
operation(),
new Promise((_, reject) =>
setTimeout(() => reject(new Error("Timeout")), timeout)
),
]);
} catch (error) {
attempts++;
if (attempts === maxRetries) throw error;
// Exponential backoff
await new Promise(resolve =>
setTimeout(resolve, Math.pow(2, attempts) * 1000)
);
}
}
throw new Error("Max retries exceeded");
}
```
unauthorized: |-
This error occurs when authentication fails.
**Steps to resolve:**
1. Verify your CDP API credentials:
- Check that your API key is valid
- Check that your Wallet Secret is properly configured
2. Validate JWT token:
- Not expired
- Properly signed
- Contains required claims
3. Check request headers:
- Authorization header present
- X-Wallet-Auth header included when required
**Security note:** Never share your Wallet Secret or API keys.
policy_in_use: |-
This error occurs when trying to delete a Policy that is currently in use by at least one project or account.
**Steps to resolve:**
1. Update project or accounts to remove references to the Policy in question.
2. Retry your delete request.
Error:
description: An error response including the code for the type of error and a human-readable message describing the error.
type: object
properties:
errorType:
$ref: '#/components/schemas/ErrorType'
errorMessage:
description: The error message.
type: string
example: Unable to create EVM account
correlationId:
description: A unique identifier for the request that generated the error. This can be used to help debug issues with the API.
type: string
example: 41deb8d59a9dc9a7-IAD
errorLink:
description: A link to the corresponding error documentation.
type: string
example: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid_request
required:
- errorType
- errorMessage
example:
errorType: invalid_request
errorMessage: Invalid request.
correlationId: 41deb8d59a9dc9a7-IAD
errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid_request
EIP712Domain:
type: object
description: The domain of the EIP-712 typed data.
properties:
name:
type: string
description: The name of the DApp or protocol.
example: Permit2
version:
type: string
description: The version of the DApp or protocol.
example: '1'
chainId:
type: integer
format: int64
description: The chain ID of the EVM network.
example: 1
verifyingContract:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed EVM address of the verifying smart contract.
example: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
salt:
type: string
pattern: ^0x[a-fA-F0-9]{64}$
description: The optional 32-byte 0x-prefixed hex salt for domain separation.
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
example:
name: Permit2
chainId: 1
verifyingContract: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
EIP712Types:
type: object
description: |
A mapping of struct names to an array of type objects (name + type).
Each key corresponds to a type name (e.g., "`EIP712Domain`", "`PermitTransferFrom`").
example:
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
EIP712Message:
type: object
description: The message to sign using EIP-712.
properties:
domain:
$ref: '#/components/schemas/EIP712Domain'
types:
$ref: '#/components/schemas/EIP712Types'
primaryType:
type: string
description: The primary type of the message. This is the name of the struct in the `types` object that is the root of the message.
example: PermitTransferFrom
message:
type: object
description: The message to sign. The structure of this message must match the `primaryType` struct in the `types` object.
example:
permitted:
token: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
amount: '1000000'
spender: '0x1111111254EEB25477B68fb85Ed929f73A960582'
nonce: '0'
deadline: '1716239020'
required:
- domain
- types
- primaryType
- message
example:
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: '123456'
deadline: '1717123200'
EvmSmartAccount:
type: object
properties:
address:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
description: The 0x-prefixed, checksum address of the Smart Account.
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
owners:
type: array
items:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
description: Today, only a single owner can be set for a Smart Account, but this is an array to allow having multiple owners in the future. The address is a 0x-prefixed, checksum address.
example:
- '0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a'
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names are guaranteed to be unique across all Smart Accounts in the developer's CDP Project.
example: my-smart-account
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
createdAt:
type: string
description: The UTC ISO 8601 timestamp at which the account was created.
example: '2025-03-25T12:00:00Z'
format: date-time
updatedAt:
type: string
description: The UTC ISO 8601 timestamp at which the account was last updated.
example: '2025-03-26T12:00:00Z'
format: date-time
required:
- address
- owners
EvmCall:
type: object
properties:
to:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
description: The address the call is directed to.
example: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
value:
type: string
description: The amount of ETH to send with the call, in wei.
example: '0'
data:
type: string
pattern: ^0x[0-9a-fA-F]*$
description: The call data to send. This is the hex-encoded data of the function call consisting of the method selector and the function arguments.
example: '0xa9059cbb000000000000000000000000fc807d1be4997e5c7b33e4d8d57e60c5b0f02b1a0000000000000000000000000000000000000000000000000000000000000064'
required:
- to
- value
- data
EvmUserOperation:
type: object
properties:
network:
type: string
description: The network the user operation is for.
enum:
- base-sepolia
- base
example: base-sepolia
userOpHash:
type: string
pattern: ^0x[0-9a-fA-F]{64}$
description: The hash of the user operation. This is not the transaction hash, as a transaction consists of multiple user operations. The user operation hash is the hash of this particular user operation which gets signed by the owner of the Smart Account.
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
calls:
type: array
description: The list of calls in the user operation.
items:
$ref: '#/components/schemas/EvmCall'
example:
- to: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
value: '0'
data: '0xa9059cbb000000000000000000000000fc807d1be4997e5c7b33e4d8d57e60c5b0f02b1a0000000000000000000000000000000000000000000000000000000000000064'
- to: '0xdac17f958d2ee523a2206206994597c13d831ec7'
value: '1000000000000000'
data: 0x
status:
type: string
description: The status of the user operation.
enum:
- pending
- signed
- broadcast
- complete
- dropped
- failed
example: pending
transactionHash:
type: string
pattern: ^0x[0-9a-fA-F]{64}$|^$
description: The hash of the transaction that included this particular user operation. This gets set after the user operation is broadcasted and the transaction is included in a block.
example: '0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'
required:
- network
- userOpHash
- calls
- status
EvmSwapsNetwork:
type: string
enum:
- base
- ethereum
description: The network on which to perform the swap.
example: base
toToken:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed contract address of the token to receive.
example: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'
fromToken:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed contract address of the token to send.
example: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
fromAmount:
type: string
pattern: ^\d+$
description: The amount of the `fromToken` to send in atomic units of the token. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc.
example: '1000000000000000000'
taker:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed address that holds the `fromToken` balance and has the `Permit2` allowance set for the swap.
example: '0xAc0974bec39a17e36ba4a6b4d238ff944bacb478'
signerAddress:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed Externally Owned Account (EOA) address that will sign the `Permit2` EIP-712 permit message. This is only needed if `taker` is a smart contract.
example: '0x922f49447d8a07e3bd95bd0d56f35241523fbab8'
gasPrice:
type: string
pattern: ^\d+$
description: The target gas price for the swap transaction, in Wei. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. If not provided, the API will use an estimate based on the current network conditions.
example: '1000000000'
slippageBps:
type: integer
minimum: 0
maximum: 10000
description: The maximum acceptable slippage of the `toToken` in basis points. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100 bps (i.e., 1%).
default: 100
example: 100
TokenFee:
type: object
properties:
amount:
type: string
pattern: ^\d+$
description: The estimated amount of the fee in atomic units of the `token`. For example, `1000000000000000` if the fee is in ETH equates to 0.001 ETH, `10000` if the fee is in USDC equates to 0.01 USDC, etc.
example: '1000000000000000000'
token:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The contract address of the token that the fee is paid in. The address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` is used for the native token of the network (e.g. ETH).
example: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
required:
- amount
- token
CommonSwapResponse:
type: object
properties:
blockNumber:
type: string
pattern: ^[1-9]\d*$
description: The block number at which the liquidity conditions were examined.
example: '17038723'
toAmount:
type: string
pattern: ^(0|[1-9]\d*)$
description: The amount of the `toToken` that will be received in atomic units of the `toToken`. For example, `1000000000000000000` when receiving ETH equates to 1 ETH, `1000000` when receiving USDC equates to 1 USDC, etc.
example: '1000000000000000000'
toToken:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed contract address of the token that will be received.
example: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'
fees:
type: object
description: The estimated fees for the swap.
properties:
gasFee:
type: object
nullable: true
description: The estimated gas fee for the swap.
allOf:
- $ref: '#/components/schemas/TokenFee'
protocolFee:
type: object
nullable: true
description: The estimated protocol fee for the swap.
allOf:
- $ref: '#/components/schemas/TokenFee'
required:
- gasFee
- protocolFee
example:
gasFee:
amount: '1000000000000000000'
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
protocolFee:
amount: '1000000000000000000'
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
issues:
type: object
description: An object containing potential issues discovered during validation that could prevent the swap from being executed successfully.
properties:
allowance:
type: object
nullable: true
description: Details of the allowances that the taker must set in order to execute the swap successfully. Null if no allowance is required.
properties:
currentAllowance:
type: string
pattern: ^\d+$
description: The current allowance of the `fromToken` by the `taker`.
example: '1000000000'
spender:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed address of to set the allowance on.
example: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
required:
- currentAllowance
- spender
example:
currentAllowance: '1000000000'
spender: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
balance:
type: object
nullable: true
description: Details of the balance of the `fromToken` that the `taker` must hold. Null if the `taker` has a sufficient balance.
properties:
token:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed contract address of the token.
currentBalance:
type: string
pattern: ^\d+$
description: The current balance of the `fromToken` by the `taker`.
example: '10000000'
requiredBalance:
type: string
pattern: ^\d+$
description: The amount of the token that the `taker` must hold.
example: '1000000000000000000'
required:
- token
- currentBalance
- requiredBalance
example:
token: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
currentBalance: '1000000000000000000'
requiredBalance: '1000000000000000000'
simulationIncomplete:
type: boolean
description: This is set to true when the transaction cannot be validated. This can happen when the taker has an insufficient balance of the `fromToken`. Note that this does not necessarily mean that the trade will revert.
example: false
required:
- allowance
- balance
- simulationIncomplete
example:
allowance:
currentAllowance: '1000000000'
spender: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
balance:
token: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
currentBalance: '900000000000000000'
requiredBalance: '1000000000000000000'
simulationIncomplete: false
liquidityAvailable:
type: boolean
enum:
- true
description: Whether sufficient liquidity is available to settle the swap. All other fields in the response will be empty if this is false.
example: true
minToAmount:
type: string
pattern: ^(0|[1-9]\d*)$
description: The minimum amount of the `toToken` that must be received for the swap to succeed, in atomic units of the `toToken`. For example, `1000000000000000000` when receiving ETH equates to 1 ETH, `1000000` when receiving USDC equates to 1 USDC, etc. This value is influenced by the `slippageBps` parameter.
example: '900000000000000000'
fromAmount:
type: string
pattern: ^(0|[1-9]\d*)$
description: The amount of the `fromToken` that will be sent in this swap, in atomic units of the `fromToken`. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc.
example: '1000000000000000000'
fromToken:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed contract address of the token that will be sent.
example: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
required:
- blockNumber
- toAmount
- toToken
- fees
- issues
- liquidityAvailable
- minToAmount
- fromAmount
- fromToken
example:
blockNumber: '17038723'
toAmount: '1000000000000000000'
toToken: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'
fees:
gasFee:
amount: '1000000000000000000'
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
protocolFee:
amount: '1000000000000000000'
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
issues:
allowance:
currentAllowance: '1000000000'
spender: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
balance:
token: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
currentBalance: '1000000000000000000'
requiredBalance: '1000000000000000000'
simulationIncomplete: false
liquidityAvailable: true
minToAmount: '900000000000000000'
fromAmount: '1000000000000000000'
fromToken: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
GetSwapPriceResponse:
allOf:
- $ref: '#/components/schemas/CommonSwapResponse'
- type: object
properties:
gas:
type: string
nullable: true
pattern: ^\d+$
description: The estimated gas limit that should be used to send the transaction to guarantee settlement.
example: '100000'
gasPrice:
type: string
pattern: ^\d+$
description: The gas price, in Wei, that should be used to send the transaction. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. The transaction should be sent with this gas price to guarantee settlement.
example: '1000000000'
required:
- gas
- gasPrice
SwapUnavailableResponse:
type: object
properties:
liquidityAvailable:
type: boolean
enum:
- false
description: Whether sufficient liquidity is available to settle the swap. All other fields in the response will be empty if this is false.
example: false
required:
- liquidityAvailable
example:
liquidityAvailable: false
GetSwapPriceResponseWrapper:
description: A wrapper for the response of a swap price operation.
oneOf:
- $ref: '#/components/schemas/GetSwapPriceResponse'
- $ref: '#/components/schemas/SwapUnavailableResponse'
CreateSwapQuoteResponse:
allOf:
- type: object
properties:
permit2:
type: object
nullable: true
description: The approval object which contains the necessary fields to submit an approval for this transaction. Null if the `fromToken` is the native token or the transaction is a native token wrap / unwrap.
properties:
hash:
type: string
pattern: ^0x[a-fA-F0-9]{64}$
description: The hash for the approval according to [EIP-712](https://eips.ethereum.org/EIPS/eip-712). Computing the hash of the `eip712` field should match the value of this field.
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
eip712:
$ref: '#/components/schemas/EIP712Message'
required:
- hash
- eip712
transaction:
type: object
description: The details of the transaction to be signed and submitted to execute the swap.
properties:
to:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: The 0x-prefixed address of the contract to call.
example: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
data:
type: string
description: The hex-encoded call data to send to the contract.
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
gas:
type: string
pattern: ^\d+$
description: The estimated gas limit that should be used to send the transaction to guarantee settlement.
example: '100000'
gasPrice:
type: string
pattern: ^\d+$
description: The gas price, in Wei, that should be used to send the transaction. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. The transaction should be sent with this gas price to guarantee settlement.
example: '1000000000'
value:
type: string
pattern: ^\d+$
description: The value of the transaction in Wei.
example: '1000000000000000000'
required:
- to
- data
- gas
- gasPrice
- value
required:
- permit2
- transaction
- $ref: '#/components/schemas/CommonSwapResponse'
CreateSwapQuoteResponseWrapper:
description: A wrapper for the response of a swap quote operation.
oneOf:
- $ref: '#/components/schemas/CreateSwapQuoteResponse'
- $ref: '#/components/schemas/SwapUnavailableResponse'
ListEvmTokenBalancesNetwork:
type: string
enum:
- base
- base-sepolia
- ethereum
description: The name of the supported EVM networks in human-readable format.
example: base
TokenAmount:
type: object
description: Amount of a given token.
example:
amount: '125000000000000000000'
decimals: 18
properties:
amount:
type: string
pattern: ^[0-9]+$
description: The amount is denominated in the smallest indivisible unit of the token. For ETH, the smallest indivisible unit is Wei (10^-18 ETH). For ERC-20s, the smallest unit is the unit returned from `function totalSupply() public view returns (uint256)`.
example: '1250000000000000000'
decimals:
type: integer
format: int64
description: |-
'decimals' is the exponential value N that satisfies the equation `amount * 10^-N = standard_denomination`. The standard denomination is the most commonly used denomination for the token.
- In the case of the native gas token, `decimals` is defined via convention. As an example, for ETH of Ethereum mainnet, the standard denomination is 10^-18 the smallest denomination (Wei). As such, for ETH on Ethereum mainnet, `decimals` is 18. - In the case of ERC-20 tokens, `decimals` is defined via configuration. `decimals` will be the number returned by `function decimals() public view returns (uint8)` on the underlying token contract.
Not all tokens have a `decimals` field, as this function is [optional in the ERC-20 specification](https://eips.ethereum.org/EIPS/eip-20#decimals). This field will be left empty if the underlying token contract doesn't implement `decimals`.
Further, this endpoint will only populate this value for a small subset of whitelisted ERC-20 tokens at this time. We intend to improve coverage in the future.
example: 18
required:
- amount
- decimals
Token:
type: object
description: General information about a token. Includes the type, the network, and other identifying information.
example:
network: base
symbol: ETH
name: Ether
contractAddress: '0x1234567890123456789012345678901234567890'
properties:
network:
$ref: '#/components/schemas/ListEvmTokenBalancesNetwork'
symbol:
type: string
description: |-
The symbol of this token (ex: SOL, ETH, USDC).
The token symbol is not unique. It is possible for two different tokens to have the same symbol.
For native gas tokens, this symbol is defined via convention. As an example, for ETH on Ethereum mainnet, the symbol is "ETH". For ERC-20 tokens, this symbol is defined via configuration. `symbol` will be the string returned by `function symbol() public view returns (string)` on the underlying token contract.
Not all tokens have a symbol, as this function is [optional in the ERC-20 specification](https://eips.ethereum.org/EIPS/eip-20#symbol). This field will only be populated when the token's underlying ERC-20 contract has a `symbol()` function.
Further, this endpoint will only populate this value for a small subset of whitelisted ERC-20 tokens at this time. We intend to improve coverage in the future.
example: ETH
name:
type: string
description: |-
The name of this token (ex: "Solana", "Ether", "USD Coin").
The token name is not unique. It is possible for two different tokens to have the same name.
For native gas tokens, this name is defined via convention. As an example, for ETH on Ethereum mainnet, the name is "Ether". For ERC-20 tokens, this name is defined via configuration. `name` will be the string returned by `function name() public view returns (string)` on the underlying token contract.
Not all tokens have a name, as this function is [optional in the ERC-20 specification](https://eips.ethereum.org/EIPS/eip-20#name). This field will only be populated when the token's underlying ERC-20 contract has a `name()` function.
Further, this endpoint will only populate this value for a small subset of whitelisted ERC-20 tokens at this time. We intend to improve coverage in the future.
example: Ether
contractAddress:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
description: |-
The contract address of the token.
For Ether, the contract address is `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` per [EIP-7528](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7528.md). For ERC-20 tokens, this is the contract address where the token is deployed.
example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
required:
- network
- contractAddress
TokenBalance:
type: object
properties:
amount:
$ref: '#/components/schemas/TokenAmount'
token:
$ref: '#/components/schemas/Token'
required:
- amount
- token
EthValueCriterion:
type: object
description: A schema for specifying a criterion for the `value` field of an EVM transaction.
properties:
type:
type: string
description: The type of criterion to use. This should be `ethValue`.
example: ethValue
enum:
- ethValue
ethValue:
type: string
pattern: ^[0-9]+$
description: The amount of ETH, in wei, that the transaction's `value` field should be compared to.
example: '1000000000000000000'
operator:
type: string
description: The operator to use for the comparison. The transaction's `value` field will be on the left-hand side of the operator, and the `ethValue` field will be on the right-hand side.
enum:
- '>'
- '>='
- <
- <=
- '=='
example: <=
required:
- type
- ethValue
- operator
EvmAddressCriterion:
type: object
x-audience: public
description: A schema for specifying a criterion for the `to` field of an EVM transaction.
properties:
type:
type: string
description: The type of criterion to use. This should be `evmAddress`.
example: evmAddress
enum:
- evmAddress
addresses:
type: array
description: A list of 0x-prefixed EVM addresses that the transaction's `to` field should be compared to. There is a limit of 100 addresses per criterion.
items:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
description: The 0x-prefixed EVM address that the transaction's `to` field should be compared to.
example:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
- '0x1234567890123456789012345678901234567890'
operator:
type: string
description: The operator to use for the comparison. The transaction's `to` field will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side.
enum:
- in
- not in
example: in
required:
- type
- addresses
- operator
KnownAbiType:
type: string
description: |-
A reference to an established EIP standard. When referencing a `KnownAbiType` within a policy rule configuring an `EvmDataCriterion`, criteria will only decode function data officially documented in the standard. For more information on supported token standards, see the links below.
- [erc20 - Token Standard](https://eips.ethereum.org/EIPS/eip-20).
- [erc721 - Non-Fungible Token Standard](https://eips.ethereum.org/EIPS/eip-721).
- [erc1155 - Multi Token Standard](https://eips.ethereum.org/EIPS/eip-1155).
enum:
- erc20
- erc721
- erc1155
AbiParameter:
x-audience: public
type: object
description: Parameter definition for ABI functions, errors, and constructors.
required:
- type
properties:
name:
type: string
description: The name of the parameter.
example: tokenId
type:
type: string
description: The canonical type of the parameter.
example: uint256
internalType:
type: string
description: The internal Solidity type used by the compiler.
example: uint256
components:
type: array
description: Used for tuple types.
items:
$ref: '#/components/schemas/AbiParameter'
example:
- name: x
type: uint256
example:
name: tokenId
type: uint256
internalType: uint256
AbiStateMutability:
x-audience: public
type: string
description: State mutability of a function in Solidity.
enum:
- pure
- view
- nonpayable
- payable
example: view
AbiFunction:
x-audience: public
type: object
description: ABI function type for contract functions.
required:
- type
- name
- inputs
- outputs
- stateMutability
properties:
type:
description: The type of the ABI item, must be `function`.
type: string
enum:
- function
example: function
name:
type: string
description: The name of the ABI function.
example: approve
inputs:
type: array
description: The list of ABI parameters used for this function.
items:
$ref: '#/components/schemas/AbiParameter'
example:
- name: spender
type: address
internalType: address
outputs:
type: array
description: The values returned by this function.
items:
$ref: '#/components/schemas/AbiParameter'
example:
name: ''
type: bool
internalType: bool
constant:
type: boolean
description: Deprecated. Use pure or view from stateMutability instead.
example: false
payable:
type: boolean
description: Deprecated. Use payable or nonpayable from `stateMutability` instead.
example: false
stateMutability:
$ref: '#/components/schemas/AbiStateMutability'
gas:
type: integer
description: Deprecated. Vyper used to provide gas estimates.
example: 0
example:
type: function
name: balanceOf
inputs:
- name: owner
type: address
internalType: address
outputs:
- name: null
type: uint256
internalType: uint256
stateMutability: view
AbiInput:
x-audience: public
type: object
description: Generic ABI item type encapsulating all other types besides `function`.
required:
- type
properties:
type:
description: The type of the ABI item.
type: string
enum:
- constructor
- error
- event
- fallback
- receive
example: constructor
additionalProperties:
description: For additional information on the ABI JSON specification, see [the Solidity documentation](https://docs.soliditylang.org/en/latest/abi-spec.html#json).
example:
type: error
name: ERC20InvalidSpender
inputs:
- name: spender
type: address
internalType: address
Abi:
x-audience: public
type: array
description: Contract ABI Specification following Solidity's external JSON interface format.
items:
oneOf:
- $ref: '#/components/schemas/AbiFunction'
- $ref: '#/components/schemas/AbiInput'
example:
- type: function
name: approve
inputs:
- name: spender
type: address
internalType: address
- name: amount
type: uint256
internalType: uint256
outputs:
- name: null
type: bool
internalType: bool
stateMutability: nonpayable
- type: event
name: Transfer
inputs:
- name: from
type: address
indexed: true
internalType: address
anonymous: false
- type: error
name: ERC20InvalidSpender
inputs:
- name: spender
type: address
internalType: address
EvmDataParameterCondition:
x-audience: public
type: object
properties:
name:
type: string
example: to
description: The name of the parameter to check against a transaction's calldata. If name is unknown, or is not named, you may supply an array index, e.g., `0` for first parameter.
operator:
type: string
enum:
- '>'
- '>='
- <
- <=
- '=='
description: The operator to use for the comparison. The value resolved at the `name` will be on the left-hand side of the operator, and the `value` field will be on the right-hand side.
example: '=='
value:
type: string
example: '100000'
description: A single value to compare the value resolved at `name` to. All values are encoded as strings. Refer to the table in the documentation for how values should be encoded, and which operators are supported for each type.
required:
- name
- operator
- value
EvmDataParameterConditionList:
x-audience: public
type: object
properties:
name:
type: string
example: to
description: The name of the parameter to check against a transaction's calldata. If name is unknown, or is not named, you may supply an array index, e.g., `0` for first parameter.
operator:
type: string
enum:
- in
- not in
description: The operator to use for the comparison. The value resolved at the `name` will be on the left-hand side of the operator, and the `values` field will be on the right-hand side.
example: in
values:
type: array
items:
type: string
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
description: A single potential value to compare against the resolved `name` value. All values are encoded as strings. Refer to the table in the documentation for how values should be encoded, and which operators are supported for each type.
description: Values to compare against the resolved `name` value. All values are encoded as strings. Refer to the table in the documentation for how values should be encoded, and which operators are supported for each type.
example:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
required:
- name
- operator
- values
EvmDataCondition:
type: object
x-audience: public
description: A single condition to apply against the function and encoded arguments in the transaction's `data` field. Each `parameter` configuration must be successfully evaluated against the corresponding function argument in order for a policy to be accepted.
properties:
function:
type: string
example: transfer
description: The name of a smart contract function being called.
params:
type: array
description: An optional list of parameter conditions to apply against encoded arguments in the transaction's `data` field.
items:
description: A list of parameter conditions to apply against encoded arguments in the transaction's `data` field.
oneOf:
- $ref: '#/components/schemas/EvmDataParameterCondition'
- $ref: '#/components/schemas/EvmDataParameterConditionList'
example:
- name: value
operator: <=
value: '10000'
- name: to
operator: in
values:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
example:
function: transfer
params:
- name: value
operator: <=
value: '10000'
- name: to
operator: in
values:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
required:
- function
EvmDataCriterion:
type: object
x-audience: public
description: A schema for specifying a criterion for the `data` field of an EVM transaction.
properties:
type:
type: string
description: The type of criterion to use. This should be `evmData`.
example: evmData
enum:
- evmData
abi:
description: The ABI of the smart contract being called. This can be a partial structure with only specific functions.
oneOf:
- $ref: '#/components/schemas/KnownAbiType'
- $ref: '#/components/schemas/Abi'
example: erc20
conditions:
type: array
description: A list of conditions to apply against the function and encoded arguments in the transaction's `data` field. Each condition must be met in order for this policy to be accepted or rejected.
items:
$ref: '#/components/schemas/EvmDataCondition'
example:
- function: approve
- function: transfer
params:
- name: value
operator: <=
value: '10000'
- name: to
operator: in
values:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
required:
- type
- abi
- conditions
SignEvmTransactionCriteria:
type: array
description: A schema for specifying criteria for the SignEvmTransaction operation.
items:
oneOf:
- $ref: '#/components/schemas/EthValueCriterion'
- $ref: '#/components/schemas/EvmAddressCriterion'
- $ref: '#/components/schemas/EvmDataCriterion'
example:
- type: ethValue
ethValue: '1000000'
operator: '>='
- type: evmAddress
addresses:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
operator: in
SignEvmTransactionRule:
properties:
action:
type: string
description: Whether matching the rule will cause the request to be rejected or accepted.
example: accept
enum:
- reject
- accept
operation:
type: string
description: The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
example: signEvmTransaction
enum:
- signEvmTransaction
criteria:
$ref: '#/components/schemas/SignEvmTransactionCriteria'
required:
- action
- operation
- criteria
EvmNetworkCriterion:
type: object
x-audience: public
description: A schema for specifying a criterion for the intended `network` of an EVM transaction.
properties:
type:
type: string
description: The type of criterion to use. This should be `evmNetwork`.
example: evmNetwork
enum:
- evmNetwork
networks:
type: array
description: A list of EVM network identifiers that the transaction's intended `network` should be compared to.
items:
type: string
description: The network the transaction is for.
enum:
- base-sepolia
- base
example: base-sepolia
example:
- base
- base-sepolia
operator:
type: string
description: The operator to use for the comparison. The transaction's intended `network` will be on the left-hand side of the operator, and the `networks` field will be on the right-hand side.
enum:
- in
- not in
example: in
required:
- type
- networks
- operator
SendEvmTransactionCriteria:
x-audience: public
type: array
description: A schema for specifying criteria for the SignEvmTransaction operation.
items:
oneOf:
- $ref: '#/components/schemas/EthValueCriterion'
- $ref: '#/components/schemas/EvmAddressCriterion'
- $ref: '#/components/schemas/EvmNetworkCriterion'
- $ref: '#/components/schemas/EvmDataCriterion'
example:
- type: ethValue
ethValue: '1000000'
operator: '>='
- type: evmAddress
addresses:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
operator: in
SendEvmTransactionRule:
x-audience: public
properties:
action:
type: string
description: Whether matching the rule will cause the request to be rejected or accepted.
example: accept
enum:
- reject
- accept
operation:
type: string
description: The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
example: sendEvmTransaction
enum:
- sendEvmTransaction
criteria:
$ref: '#/components/schemas/SendEvmTransactionCriteria'
required:
- action
- operation
- criteria
EvmMessageCriterion:
type: object
x-audience: public
description: A schema for specifying a criterion for the message being signed.
properties:
type:
type: string
description: The type of criterion to use. This should be `evmMessage`.
example: evmMessage
enum:
- evmMessage
match:
type: string
description: A regular expression the message is matched against. Accepts valid regular expression syntax described by [RE2](https://github.com/google/re2/wiki/Syntax).
example: ^hello ([a-z]+)$
required:
- type
- match
SignEvmMessageCriteria:
x-audience: public
type: array
description: A schema for specifying the rejection criteria for the SignEvmMessage operation.
items:
oneOf:
- $ref: '#/components/schemas/EvmMessageCriterion'
example:
- type: evmMessage
match: ^hello ([a-z]+)$
SignEvmMessageRule:
x-audience: public
properties:
action:
type: string
description: Whether matching the rule will cause the request to be rejected or accepted.
example: accept
enum:
- reject
- accept
operation:
type: string
description: The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
example: signEvmMessage
enum:
- signEvmMessage
criteria:
$ref: '#/components/schemas/SignEvmMessageCriteria'
required:
- action
- operation
- criteria
EvmTypedAddressCondition:
type: object
x-audience: public
description: A schema for specifying criterion for an address field of an EVM typed message. The address can be deeply nested within the typed data's message.
properties:
addresses:
type: array
description: A list of 0x-prefixed EVM addresses that the value located at the message's path should be compared to. There is a limit of 100 addresses per criterion.
items:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
description: The 0x-prefixed EVM address that the value located at the message's path should be compared to.
example:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
- '0x1234567890123456789012345678901234567890'
operator:
type: string
description: The operator to use for the comparison. The value located at the message's path will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side.
enum:
- in
- not in
example: in
path:
type: string
description: The path to the field to compare against this criterion. To reference deeply nested fields within the message, separate object keys by `.`, and access array values using `[index]`. If the field does not exist or is not an address, the operation will be rejected.
example: targets[0].address
required:
- addresses
- operator
- path
EvmTypedNumericalCondition:
type: object
x-audience: public
description: A schema for specifying criterion for a numerical field of an EVM typed message. The value can be deeply nested within the typed data's message.
properties:
value:
type: string
pattern: ^[0-9]+$
description: The amount that the value located at the message's path should be compared to.
example: '1000000000000000000'
operator:
type: string
description: The operator to use for the comparison. The value located at the message's path will be on the left-hand side of the operator, and the `value` field will be on the right-hand side.
enum:
- '>'
- '>='
- <
- <=
- '=='
example: <=
path:
type: string
description: The path to the field to compare against this criterion. To reference deeply nested fields within the message, separate object keys by `.`, and access array values using `[index]`. If the field does not exist or is not an address, the operation will be rejected.
example: targets[0].amount
required:
- value
- operator
- path
EvmTypedStringCondition:
type: object
x-audience: public
description: A schema for specifying criterion for a string field of an EVM typed message. The value can be deeply nested within the typed data's message.
properties:
match:
type: string
description: A regular expression the field is matched against.
example: ^hello ([a-z]+)$
path:
type: string
description: The path to the field to compare against this criterion. To reference deeply nested fields within the message, separate object keys by `.`, and access array values using `[index]`. If the field does not exist or is not an address, the operation will be rejected.
example: targets[0].message
required:
- match
- path
SignEvmTypedDataFieldCriterion:
x-audience: public
type: object
properties:
type:
type: string
description: The type of criterion to use. This should be `evmTypedDataField`.
example: evmTypedDataField
enum:
- evmTypedDataField
types:
type: object
description: An object containing EIP-712 type definitions, as well as a primary type for the root message object.
example:
primaryType: Mail
types:
Person:
- name: name
type: string
- name: wallet
type: address
- name: score
type: uint256
Mail:
- name: from
type: Person
- name: to
type: Person
- name: contents
type: string
properties:
types:
type: object
description: EIP-712 compliant map of model names to model definitions.
additionalProperties:
type: array
description: Object containing names and types for fields within structured data.
items:
type: object
properties:
name:
type: string
description: The name of a key within an EIP-712 data structure.
type:
type: string
description: The Solidity type of a value within an EIP-712 data structure.
primaryType:
type: string
description: The name of the root EIP-712 type. This value must be included in the `types` object.
required:
- types
- primaryType
conditions:
type: array
items:
oneOf:
- $ref: '#/components/schemas/EvmTypedAddressCondition'
- $ref: '#/components/schemas/EvmTypedNumericalCondition'
- $ref: '#/components/schemas/EvmTypedStringCondition'
description: A list of conditions to check against the data being signed. Each condition must be met for the rule to take effect.
example:
- addresses:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
operator: in
path: to.wallet
- value: '50'
operator: '>='
path: to.score
- match: ^hello ([a-z]+)$
path: contents
required:
- type
- types
- conditions
SignEvmTypedDataVerifyingContractCriterion:
type: object
x-audience: public
description: A schema for specifying criterion for a domain's verifying contract.
properties:
type:
type: string
description: The type of criterion to use. This should be `evmTypedDataVerifyingContract`.
example: evmTypedDataVerifyingContract
enum:
- evmTypedDataVerifyingContract
addresses:
type: array
description: A list of 0x-prefixed EVM addresses that the domain's verifying contract should be compared to. There is a limit of 100 addresses per criterion.
items:
type: string
pattern: ^0x[0-9a-fA-F]{40}$
description: The 0x-prefixed EVM address that the domain's verifying contract should be compared to.
example:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
- '0x1234567890123456789012345678901234567890'
operator:
type: string
description: The operator to use for the comparison. The domain's verifying contract will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side.
enum:
- in
- not in
example: in
required:
- type
- addresses
- operator
SignEvmTypedDataCriteria:
x-audience: public
type: array
description: A schema for specifying criteria for the SignEvmTypedData operation.
items:
oneOf:
- $ref: '#/components/schemas/SignEvmTypedDataFieldCriterion'
- $ref: '#/components/schemas/SignEvmTypedDataVerifyingContractCriterion'
example:
- type: evmTypedDataField
types:
types:
Person:
- name: name
type: string
- name: wallet
type: address
- name: score
type: uint256
Mail:
- name: from
type: Person
- name: to
type: Person
- name: contents
type: string
primaryType: Mail
conditions:
- addresses:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
operator: in
path: to.wallet
- value: '50'
operator: '>='
path: to.score
- match: ^hello ([a-z]+)$
path: contents
- type: evmTypedDataVerifyingContract
addresses:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
operator: in
SignEvmTypedDataRule:
x-audience: public
properties:
action:
type: string
description: Whether matching the rule will cause the request to be rejected or accepted.
example: accept
enum:
- reject
- accept
operation:
type: string
description: The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
example: signEvmTypedData
enum:
- signEvmTypedData
criteria:
$ref: '#/components/schemas/SignEvmTypedDataCriteria'
required:
- action
- operation
- criteria
SolAddressCriterion:
type: object
description: The criterion for the recipient addresses of a Solana transaction.
properties:
type:
type: string
description: The type of criterion to use. This should be `solAddress`.
example: solAddress
enum:
- solAddress
addresses:
type: array
description: The Solana addresses that are compared to the list of addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array.
items:
type: string
pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
description: The Solana address that is compared to the list of addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array.
example:
- HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
operator:
type: string
description: The operator to use for the comparison. Each of the addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array will be on the left-hand side of the operator, and the addresses field will be on the right-hand side.
enum:
- in
- not in
example: in
required:
- type
- addresses
- operator
SignSolTransactionCriteria:
type: array
x-audience: public
description: A schema for specifying criteria for the SignSolTransaction operation.
items:
oneOf:
- $ref: '#/components/schemas/SolAddressCriterion'
example:
- type: solAddress
addresses:
- HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
operator: in
SignSolTransactionRule:
properties:
action:
type: string
description: Whether matching the rule will cause the request to be rejected or accepted.
example: accept
enum:
- reject
- accept
operation:
type: string
description: The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
example: signSolTransaction
enum:
- signSolTransaction
criteria:
$ref: '#/components/schemas/SignSolTransactionCriteria'
required:
- action
- operation
- criteria
SignEvmHashRule:
x-audience: public
properties:
action:
type: string
description: Whether any attempts to sign a hash will be accepted or rejected. This rule does not accept any criteria.
example: accept
enum:
- reject
- accept
operation:
type: string
description: The operation to which the rule applies.
example: signEvmHash
enum:
- signEvmHash
required:
- action
- operation
Rule:
type: object
description: A rule that limits the behavior of an account.
oneOf:
- $ref: '#/components/schemas/SignEvmTransactionRule'
- $ref: '#/components/schemas/SendEvmTransactionRule'
- $ref: '#/components/schemas/SignEvmMessageRule'
- $ref: '#/components/schemas/SignEvmTypedDataRule'
- $ref: '#/components/schemas/SignSolTransactionRule'
- $ref: '#/components/schemas/SignEvmHashRule'
example:
action: accept
operation: signEvmTransaction
criteria:
- type: ethValue
ethValue: '1000000'
operator: '>='
- type: evmAddress
addresses:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
operator: in
Policy:
type: object
properties:
id:
type: string
description: The unique identifier for the policy.
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 123e4567-e89b-12d3-a456-426614174000
description:
type: string
description: |-
An optional human-readable description of the policy.
Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less.
pattern: ^[A-Za-z0-9 ,.]{1,50}$
example: Default policy
scope:
type: string
description: The scope of the policy. Only one project-level policy can exist at any time.
enum:
- project
- account
example: project
rules:
type: array
description: A list of rules that comprise the policy.
items:
$ref: '#/components/schemas/Rule'
example:
- action: accept
operation: signEvmTransaction
criteria:
- type: ethValue
ethValue: '1000000000000000000'
operator: <=
- type: evmAddress
addresses:
- '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
- '0x1234567890123456789012345678901234567890'
operator: in
- action: accept
operation: signSolTransaction
criteria:
- type: solAddress
addresses:
- HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
operator: in
createdAt:
type: string
description: The ISO 8601 timestamp at which the Policy was created.
example: '2025-03-25T12:00:00Z'
updatedAt:
type: string
description: The ISO 8601 timestamp at which the Policy was last updated.
example: '2025-03-26T12:00:00Z'
required:
- id
- scope
- rules
- createdAt
- updatedAt
SolanaAccount:
type: object
properties:
address:
type: string
pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
description: The base58 encoded Solana address.
example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT
name:
type: string
description: |-
An optional name for the account.
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
Account names are guaranteed to be unique across all Solana accounts in the developer's CDP Project.
example: my-account
pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
policies:
type: array
x-audience: public
description: The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists.
items:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example:
- 123e4567-e89b-12d3-a456-426614174000
createdAt:
type: string
description: The ISO 8601 UTC timestamp at which the account was created.
example: '2025-03-25T12:00:00Z'
format: date-time
updatedAt:
type: string
description: The ISO 8601 UTC timestamp at which the account was last updated.
example: '2025-03-26T12:00:00Z'
format: date-time
required:
- address
PaymentRailAction:
description: The action of the payment method.
type: string
enum:
- source
- target
example: source
PaymentMethod:
type: object
description: The fiat payment method object.
properties:
id:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 8e03978e-40d5-43e8-bc93-6894a57f9324
description: The ID of the payment method which previously was added.
type:
type: string
enum:
- card
- fiat_account
example: card
description: The type of payment method.
currency:
type: string
example: USD
description: The currency of the payment method.
actions:
type: array
items:
$ref: '#/components/schemas/PaymentRailAction'
example:
- source
- target
description: The actions for the payment method.
limits:
type: object
description: The limits of the payment method.
properties:
sourceLimit:
type: object
description: The limit for this payment method being used as a source for transfers.
properties:
amount:
type: string
description: The amount of the limit.
example: '100'
currency:
type: string
description: The currency of the limit.
example: USD
targetLimit:
type: object
description: The limit for this payment method being used as a target for transfers.
properties:
amount:
type: string
description: The amount of the limit.
example: '100'
currency:
type: string
description: The currency of the limit.
example: USD
example:
sourceLimit:
value: '100.00'
currency: USD
targetLimit:
value: '100.00'
currency: USD
required:
- id
- type
- currency
- actions
example:
id: 8e03978e-40d5-43e8-bc93-6894a57f9324
type: card
currency: USD
actions:
- source
- target
limits:
sourceLimit:
value: '100.00'
currency: USD
CryptoRail:
description: The crypto rails available.
type: object
properties:
currency:
type: string
example: USDC
description: The currency symbol of the asset.
name:
type: string
example: USD Coin
description: The name of the asset.
networks:
description: All available networks of the asset.
type: array
items:
type: object
properties:
name:
type: string
example: base
description: The name of the network.
chainId:
type: integer
format: int64
example: 8453
description: The chain ID of the network.
contractAddress:
type: string
example: '0xd9aa0e1babc7397f2c6cb2f9b6edb6f6953b4d62'
description: The contract address of the asset on the network.
description: The networks of the asset.
example:
- name: base
chainId: 8453
contractAddress: '0xd9aa0e1babc7397f2c6cb2f9b6edb6f6953b4d62'
actions:
type: array
items:
$ref: '#/components/schemas/PaymentRailAction'
example:
- source
- target
description: The actions for the crypto rail.
required:
- currency
- name
- networks
- actions
example:
name: USD Coin
currency: USDC
networks:
- name: base
chainId: 8453
contractAddress: '0xd9aa0e1babc7397f2c6cb2f9b6edb6f6953b4d62'
actions:
- source
- target
PaymentMethodRequest:
description: The fiat payment method request object.
type: object
properties:
id:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
description: The ID of the payment method.
example: 8e03978e-40d5-43e8-bc93-6894a57f9324
required:
- id
example:
id: 8e03978e-40d5-43e8-bc93-6894a57f9324
TransferSource:
description: The source of the transfer.
type: object
oneOf:
- $ref: '#/components/schemas/PaymentMethodRequest'
CryptoRailAddress:
type: object
description: The crypto rail input object which specifies the symbol, network, and address which is the source or destination wallet address.
properties:
currency:
type: string
description: The symbol of the currency of the payment rail.
example: USDC
network:
type: string
description: The network of the payment rail.
example: base
address:
type: string
description: The address of the payment rail. This is the source or destination wallet address. It is not a contract address.
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
required:
- currency
- network
- address
TransferTarget:
description: The target of the transfer.
type: object
oneOf:
- $ref: '#/components/schemas/CryptoRailAddress'
Fee:
type: object
description: The fee for the transfer.
properties:
type:
type: string
enum:
- exchange_fee
- network_fee
description: The type of fee.
example: exchange_fee
amount:
type: string
description: The amount of the fee.
example: '10.25'
currency:
type: string
description: The currency of the fee.
example: USD
description:
type: string
example: Operation Fee to cover the cost of bank processing.
description: The description of the fee.
required:
- type
- amount
- currency
example:
type: exchange_fee
amount: '10.25'
currency: USD
description: Exchange Fee to cover the cost of bank processing.
Transfer:
type: object
description: The transfer object.
properties:
id:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
example: 8e03978e-40d5-43e8-bc93-6894a57f9324
description: The ID of the transfer.
sourceType:
type: string
enum:
- payment_method
description: The type of the source of the transfer.
example: payment_method
source:
type: object
oneOf:
- $ref: '#/components/schemas/PaymentMethodRequest'
description: The source of the transfer.
example:
id: 8e03978e-40d5-43e8-bc93-6894a57f9324
targetType:
type: string
enum:
- crypto_rail
description: The type of the target of the transfer.
example: crypto_rail
target:
type: object
oneOf:
- $ref: '#/components/schemas/CryptoRailAddress'
description: The target of the transfer.
example:
currency: USDC
network: base
address: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
sourceAmount:
type: string
description: The amount the source will transfer.
example: '110.50'
sourceCurrency:
type: string
description: The currency the source will transfer.
example: USD
targetAmount:
type: string
description: The amount the target will receive.
example: '100'
targetCurrency:
type: string
description: The currency the target will receive.
example: USD
userAmount:
type: string
description: The amount the customer put in to transfer.
example: '100'
userCurrency:
type: string
description: The currency the customer put in to transfer.
example: USD
fees:
type: array
description: The fees for the transfer.
items:
$ref: '#/components/schemas/Fee'
example:
- type: exchange_fee
amount: '10.25'
currency: USD
- type: network_fee
amount: '0.25'
currency: USD
status:
type: string
enum:
- created
- pending
- started
- completed
- failed
description: The status of the transfer.
example: created
createdAt:
type: string
example: '2021-01-01T00:00:00Z'
description: The UTC date and time in ISO 8601 format the transfer was created.
updatedAt:
type: string
example: '2021-01-01T00:00:00Z'
description: The UTC date and time in ISO 8601 format the transfer was updated.
transactionHash:
type: string
description: The transaction hash or transaction signature of the transfer.
example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
required:
- id
- sourceType
- source
- targetType
- target
- sourceAmount
- sourceCurrency
- targetAmount
- targetCurrency
- userAmount
- userCurrency
- fees
- status
- createdAt
- updatedAt
example:
id: 8e03978e-40d5-43e8-bc93-6894a57f9324
sourceType: payment_method
source:
id: 8e03978e-40d5-43e8-bc93-6894a57f9324
targetType: crypto_rail
target:
currency: USDC
network: base
address: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
sourceAmount: '110.50'
sourceCurrency: USD
targetAmount: '100'
targetCurrency: USD
userAmount: '100'
userCurrency: USD
fees:
- type: exchange_fee
amount: '10.25'
currency: USD
- type: network_fee
amount: '0.25'
currency: USD
status: completed
createdAt: '2021-01-01T00:00:00Z'
updatedAt: '2021-01-01T00:00:00Z'
transactionHash: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
responses:
InternalServerError:
description: Internal server error.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
internal_server_error:
value:
errorType: internal_server_error
errorMessage: An internal server error occurred. Please try again later.
BadGatewayError:
description: Bad gateway.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
bad_gateway:
value:
errorType: bad_gateway
errorMessage: Bad gateway. Please try again later.
ServiceUnavailableError:
description: Service unavailable.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
service_unavailable:
value:
errorType: service_unavailable
errorMessage: Service unavailable. Please try again later.
PaymentMethodRequiredError:
description: A payment method is required to complete this operation.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
payment_method_required:
value:
errorType: payment_method_required
errorMessage: A valid payment method is required to complete this operation. Please add a payment method to your account at https://portal.cdp.coinbase.com.
IdempotencyError:
description: Idempotency key conflict.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
idempotency_error:
value:
errorType: idempotency_error
errorMessage: Idempotency key '8e03978e-40d5-43e8-bc93-6894a57f9324' was already used with a different request payload. Please try again with a new idempotency key.
AlreadyExistsError:
description: The resource already exists.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
idempotency_key_already_exists:
value:
errorType: already_exists
errorMessage: Another request with the same idempotency key is currently processing.
parameters:
XWalletAuth:
name: X-Wallet-Auth
in: header
required: true
description: |
A JWT signed using your Wallet Secret, encoded in base64. Refer to the
[Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
section of our Authentication docs for more details on how to generate your Wallet Token.
schema:
type: string
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEyMywicm9sZSI6ImFkbWluIiwiZXhwIjoxNzAxOTgwMDAwfQ.HWvMTKmCCTxHaxjvZyLaC6UQ6TV3ErTDWBf7zmdH0Lw
IdempotencyKey:
name: X-Idempotency-Key
in: header
required: false
description: |
An optional [UUID v4](https://www.uuidgenerator.net/version4) request header for making requests safely retryable.
When included, duplicate requests with the same key will return identical responses.
Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
schema:
type: string
maxLength: 36
minLength: 36
pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
example: 8e03978e-40d5-43e8-bc93-6894a57f9324