{ "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", "description": "The production server of the CDP APIs." }], "security": [{ "apiKeyAuth": [] }], "tags": [{ "name": "End User Accounts", "x-audience": "public", "description": "The End User Accounts APIs enable developers to manage the accounts belonging to their end users. End User Accounts are typically created by end users themselves when they sign in to the developer's application via the CDP Web SDK. However, developers also have the option of creating End User Accounts on behalf of their end users. Critically, developers do not have the ability to sign transactions or messages on behalf of the end user; only end users can do this.\n\nEnd User Accounts APIs are accessed by the developer's servers and authenticated by the developer's CDP API key." }, { "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).\n\nAn **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.\n\nAn EVM account is identified by its **address**, which is a 0x-prefixed hexadecimal string. The same address can be used across multiple EVM networks.\n\nAccounts 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.\n\n## Authentication\n\nThe EVM Account API uses two layers of authentication to ensure the security of your accounts' private keys:\n\n- **CDP Secret API Key**: This key is used to authenticate all requests to the entire suite of\n   REST APIs offered on Coinbase Developer Platform.\n- **Wallet Secret**: This secret is used specifically to authenticate sensitive wallet operations\n  to `POST` and `DELETE` endpoints in the EVM and Solana Account APIs.\n\n\nTo learn more about creating and using these keys, visit our [Authentication docs](https://docs.cdp.coinbase.com/api-reference/v2/authentication).\n\n<Tip>\n\n\n**Use our SDK**\n\n\nThe [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.\n\n\n</Tip>" }, { "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.\n\nA **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.\nSmart Accounts are identified by their **address**, which is a 0x-prefixed hexadecimal string.\nSmart Accounts can be assigned an optional **name** at creation time for easier identification in subsequent API calls.\n\nA 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:\n\n 1. A user approves token spending via smart contract.\n 2. The smart contract determines the exchange rate and facilitates the swap between the two tokens.\n 3. The transaction is completed atomically and the tokens are transferred to the user's wallet.\n\nThe Swap API supports:\n\n - **Getting a price**: Estimate the amount of tokens you will receive for a given amount of exchanged tokens.\n - **Creating a swap quote**: Return a swap transaction payload that you can use to sign and submit in order to execute the swap.\n\nFor the easiest experience creating, signing, and submitting a swap, we recommend using the [CDP SDK](https://github.com/coinbase/cdp-sdk/).\n- [Python SDK examples](https://github.com/coinbase/cdp-sdk/tree/main/python#evm-swaps)\n- [TypeScript SDK examples](https://github.com/coinbase/cdp-sdk/tree/main/typescript#evm-swaps)\n\nTo 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.\nThis includes tokens (i.e. ERC-20s) and the native gas token of the network.\n## Denomination\n- '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)`.\n- '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.\n\n  - 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.\n  - 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": "Onchain Data", "x-audience": "public", "description": "Query and analyze blockchain data with high performance and reliability. Features include real-time token balances, token discovery, and transaction history with freshness, accuracy, and completeness like never before." }, { "name": "Onramp", "x-audience": "public", "description": "The v2 Onramp APIs are an evolution of our [v1 APIs](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/), designed to make the fiat-to-crypto experience feel native to your applications for higher conversion and less friction. These APIs only cover a subset of Coinbase Onramp functionality as described below, for all other use cases please refer to our [v1 APIs](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/).\n\n## Supported Use Cases\n\n#### Apple Pay Onramp (iOS apps)\n\nThis use case allows you to offer an Apple Pay onramp experience with debit cards in your mobile app without users needing to create or log into a Coinbase account. Our API returns a `paymentLink` URL that renders an Apple Pay button for you to load in a webview in your app, making the onramp experience feel native to your application.\n\nRefer to our [detailed integration guide](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api) for more information on the limitations and requirements of this use case. See our [onramp mobile demo app](https://github.com/coinbase/onramp-demo-mobile) for a reference implementation.\n\n#### Hosted UI Onramp\n\nThis use case enables you to offer a full-featured onramp experience by redirecting users to a Coinbase-hosted page where they can choose to log into their existing Coinbase account or proceed as a guest. The Onramp Session API generates secure, single-use Onramp URLs with customizable parameters, allowing you to control available payment methods, preset transaction amounts, and cryptocurrencies for a tailored user experience.\n\nRefer to our [guide](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/generating-onramp-url) for implementation details and customization options for this use case." }, { "name": "Payments (Alpha)", "x-audience": "public", "description": "The Payments APIs enable you to create and manage payment transfers.\nThe Payments APIs are currently in alpha and are subject to change. The following payment apis are supported.\n### API Reference\n- `GET /v2/payments/rails/payment-methods`: Get fiat payment methods.\n- `GET /v2/payments/rails/crypto`: Get crypto rails.\n- `POST /v2/payments/transfers`: Create a transfer quote.\n- `POST /v2/payments/transfers/{transferId}/execute`: Execute a transfer quote.\n- `GET  /v2/payments/transfers/{transferId}`: Get a transfer by transferId.\n### Payment Rails\nPayment rails are the source or the target of a transfer.\nWe support the following payment rails:\n- Crypto rails: Onchain currency and networks to send and receive crypto (e.g. Currency: USDC, Network: Ethereum, Solana, Bitcoin, Polygon, Avalanche).\n- Payment methods: Payment methods that are previously added in your account (e.g Debit Card).\n### Transfer\nA Transfer is a money movement between two payment rails. we support the following transfer types:\n- Fiat to Crypto transfer\n\n  - Source: a payment method (payment method that is already added in your account. e.g. Card)\n\n  - Target: onchain address to receive crypto\n\n### Create a Transfer\n1. Use `/v2/payments/rails/payment-methods` and `/v2/payments/rails/crypto` to get all available payment rails.\n2. Choose the payment rails to use as source and target, and the amount to transfer.\n    - Use `/v2/payments/transfers` to create a transfer quote.\n    - Optionally, you can set `execute` to true to execute the transfer quote immediately.\n\n3. Once you have a transfer quote, use `/v2/payments/transfers/{transferId}/execute` to execute a transfer quote.\n4. 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.\n- A **policy** is a collection of `rules` with defined criteria.\n- Each **rule** contains a specified `action`, `operation`, and `criteria`:\n  - An `action` can either `accept` or `reject` a transaction if the criteria in the rule are met.\n  - `criteria` is an array of logical expressions. All parameters must evaluate to true for the action to be applied.\n  - An `operation` corresponds to a CDP v2 API:\n      - `signEvmTransaction` or `signSolTransaction` for signing transactions (to set a transaction limit).\n      - `sendEvmTransaction` for signing a transaction, and sending it to a supported network.\n      - `signEvmHash` for signing an arbitrary 32 byte hash.\n      - `signEvmMessage` for signing an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message.\n      - `prepareUserOperation` for preparing user operations on a smart account.\n      - `sendUserOperation` for sending user operations using a smart account.\n- A **rule** indicates how an operation should behave, specifying whether a request with defined criteria should be accepted or rejected.\n## Policy Scope\nPolicies can be applied at the project and/or account level:\n- **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.\n- **Account-level policy**: An `account`-level policy applies to one or more accounts. An account\n  can have at most one account-level policy at any given time.\n\nThus, a single account can be assigned at most two policies at any given time: one project-level policy and one account-level policy.\n\nScope is specified in the `scope` field of a policy:\n```json {\n  \"description\": \"Project-level policy\",\n  \"scope\": \"account\",\n  ...\n```\n## Policy Evaluation\n**Project-level policies** are evaluated first, followed by **account-level policies**.\nThe Policy Engine will process the request against each rule in the order it is defined within the `rules` array:\n\n  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.\n  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).\n  1. If no further policies exist, the request is rejected.\n\nFor example, the following policy is a project-level policy with two rules. The Policy Engine will:\n\n   1. **Evaluate the first rule:** For a `signEvmTransaction` request, accept the request if the transaction is less than or equal to 1000000000000000000 wei OR\n   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`.\n   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).\n   1. Otherwise, the request is rejected.\n\nRules are processed in the order they are defined. Once a rule applies to an operation, subsequent rules are ignored.\n```json\n{\n  \"description\": \"Project-level policy\",\n  \"scope\": \"project\",\n  \"rules\": [\n    {\n      \"action\": \"accept\",\n      \"operation\": \"signEvmTransaction\",\n      \"criteria\": [\n        {\n          \"type\": \"ethValue\",\n          \"ethValue\": \"1000000000000000000\",\n          \"operator\": \"<=\"\n        }\n      ]\n    },\n    {\n      \"action\": \"accept\",\n      \"operation\": \"signEvmTransaction\",\n      \"criteria\": [\n        {\n          \"type\": \"ethValue\",\n          \"ethValue\": \"2000000000000000000\",\n          \"operator\": \"<=\"\n        },\n        {\n          \"type\": \"evmAddress\",\n          \"addresses\": [\n            \"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\"\n          ],\n          \"operator\": \"in\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n## Policy Application\n\nProject-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.\n\nAccount-level policies can be applied in two ways:\n- By specifying the `accountPolicy` field in the request body of the `createEvmAccount` and\n  `createSolAccount` operations.\n\n- By specifying the `accountPolicy` field in the request body of the `updateEvmAccount` and\n  `updateSolanaAccount` operations.\n\n\n## Criteria\n\nThe following criteria are supported:\n\n### SignEvmTransaction Criteria\n#### ethValue\nA 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.\n#### evmAddress\nA 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.\n#### evmData\nA 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`.\n#### netUSDChange\nA criterion based on the USD denominated market value of assets being transferred, or exposing the sender to. The types of assets included in the calculation include native assets, `ERC20`, `ERC721`, and `ERC1155` tokens. The sum total USD amount of assets being transferred and exposed is compared to the criterion's `changeCents` field using the `operator` field. If signing a testnet transaction, then this criterion configuration will be ignored.\n### SendEvmTransaction Criteria\n#### ethValue\nA 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.\n#### evmAddress\nA 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.\n#### evmNetwork\nA 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.\nValid networks for this criterion include:\n  - `base`\n  - `base-sepolia`\n  - `ethereum`\n  - `ethereum-sepolia`\n  - `avalanche`\n  - `polygon`\n  - `optimism`\n  - `arbitrum`\n\n#### evmData\nA 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`.\n#### netUSDChange\nA criterion based on the USD denominated market value of assets being transferred, or exposing the sender to. The types of assets included in the calculation include native assets, `ERC20`, `ERC721`, and `ERC1155` tokens. The sum total USD amount of assets being transferred and exposed is compared to the criterion's `changeCents` field using the `operator` field. If sending a testnet transaction, then this criterion configuration will be ignored.\n### SendUserOperation Criteria\n#### ethValue\nA criterion based on the value of the user operation. The operation's `value` fields are compared to the criterion's `ethValue` field using the `operator` field.\n#### evmAddress\nA criterion based on the recipient address of the operation. The operation's `to` fields are compared to the criterion's `addresses` field using the `operator` field.\n#### evmData\nA 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`.\n### PrepareUserOperation Criteria\n#### ethValue\nA criterion based on the value of the user operation. The operation's `value` fields are compared to the criterion's `ethValue` field using the `operator` field.\n#### evmAddress\nA criterion based on the recipient address of the user operation. The operation's `to` fields are compared to the criterion's `addresses` field using the `operator` field.\n#### evmNetwork\nA criterion based on the intended network of the user operation. The `network` field in the `prepareUserOperation` request body is compared to the criterion's `networks` field using the `operator` field.\nValid networks for this criterion include:\n  - `base-sepolia`\n  - `base`\n  - `arbitrum`\n  - `optimism`\n  - `zora`\n  - `polygon`\n  - `bnb`\n  - `avalanche`\n  - `ethereum`\n  - `ethereum-sepolia`\n\n#### evmData\nA 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`.\n### SignEvmHash Criteria\nThe `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.\n### SignEvmMessage Criteria\n#### evmMessage\nA 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.\n### SignSolMessage Criteria\n#### solMessage\nA 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.\n### SignSolTransaction Criteria\n#### solAddress\nA 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.\n#### solValue\nA criterion based on the value of the transaction. The criterion's `solValue` field is compared to the transaction's `value`, which is the amount of SOL in lamports being transferred, using the `operator` field.\n#### splAddress\nA criterion based on the recipient addresses of SPL token transfer instructions in the transaction. The criterion's `addresses` field is compared to the list of SPL token transfer recipient addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array using the `operator` field.\n#### splValue\nA criterion based on the SPL token value of SPL token transfer instructions in the transaction. The criterion's `splValue` field is compared to the transaction instruction's `value` field, which is the amount of the SPL token being transferred, using the `operator` field.\n#### mintAddress\nA criterion based on the token mint addresses of SPL token transfer instructions in the transaction. The criterion's `addresses` field is compared to the list of token mint addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array using the `operator` field.\n#### solData\nA criterion based on Solana transaction instruction data. The criterion uses Interface Definition Language (IDL) specifications to decode and validate instruction data against specific rules. The `idls` field specifies which Solana programs to validate against (either known program names like \"SystemProgram\" and \"TokenProgram\", or custom IDL objects), and the `conditions` field defines instruction-specific validation rules including instruction names and parameter constraints.\n#### programId\nA criterion based on the program IDs of a transaction's instructions. The criterion's `programIds` field is compared to the list of program IDs in the transaction's instructions using the `operator` field.\n### SendSolTransaction Criteria\n#### solAddress\nA 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.\n#### solValue\nA criterion based on the value of the transaction. The criterion's `solValue` field is compared to the transaction's `value`, which is the amount of SOL in lamports being transferred, using the `operator` field.\n#### splAddress\nA criterion based on the recipient addresses of SPL token transfer instructions in the transaction. The criterion's `addresses` field is compared to the list of SPL token transfer recipient addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array using the `operator` field.\n#### splValue\nA criterion based on the SPL token value of SPL token transfer instructions in the transaction. The criterion's `splValue` field is compared to the transaction instruction's `value` field, which is the amount of the SPL token being transferred, using the `operator` field.\n#### mintAddress\nA criterion based on the token mint addresses of SPL token transfer instructions in the transaction. The criterion's `addresses` field is compared to the list of token mint addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array using the `operator` field.\n#### solData\nA criterion based on Solana transaction instruction data. The criterion uses Interface Definition Language (IDL) specifications to decode and validate instruction data against specific rules. The `idls` field specifies which Solana programs to validate against (either known program names like \"SystemProgram\" and \"TokenProgram\", or custom IDL objects), and the `conditions` field defines instruction-specific validation rules including instruction names and parameter constraints.\n#### programId\nA criterion based on the program IDs of a transaction's instructions. The criterion's `programIds` field is compared to the list of program IDs in the transaction's instructions using the `operator` field.\n#### solNetwork\nA criterion based on the intended network of the transaction. The `network` field in the `sendSolanaTransaction` request body is compared to the criterion's `networks` field using the `operator` field.\nValid networks for this criterion include:\n  - `solana-devnet`\n  - `solana`\n\n## Restricting Contract Interactions on Ethereum\nSmart 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.\nOne of the primary use cases for function restrictions is protecting high-risk operations from unauthorized access such as:\n- Fund transfers - Contract upgrades - Parameter modifications - Emergency pauses\nPolicy Engine supports such restrictions that evaluate against transaction data with the `evmData` criterion for the `signEvmTransaction`, and `sendEvmTransaction` operations.\n## Examples\n### USD Limits\nThe following example demonstrates a policy that only allows transactions to transfer, or expose the sender to, less than $100.00 worth of assets at a time. This USD denominated amount includes native assets, `ERC20`, `ERC721`, and `ERC1155` tokens calculated using current market prices.\n```json {\n  \"scope\": \"account\",\n  \"description\": \"Reject assets out over 100 USD\",\n  \"rules\": [\n    {\n      \"action\": \"reject\",\n      \"operation\": \"sendEvmTransaction\",\n      \"criteria\": [\n        {\n          \"type\": \"netUSDChange\",\n          \"changeCents\": 10000,\n          \"operator\": \">\",\n        },\n      ],\n    },\n    {\n      \"action\": \"reject\",\n      \"operation\": \"signEvmTransaction\",\n      \"criteria\": [\n        {\n          \"type\": \"netUSDChange\",\n          \"changeCents\": 10000,\n          \"operator\": \">\",\n        },\n      ],\n    },\n  ],\n} ```\n### Limiting USDC Spend\nThis 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.\n```json {\n  \"description\": \"Limit USDC Spend\",\n  \"scope\": \"account\",\n  \"rules\": [\n    {\n      \"action\": \"accept\",\n      \"operation\": \"sendEvmTransaction\",\n      \"criteria\": [\n        {\n          \"type\": \"evmNetwork\",\n          \"networks\": [\"base\"],\n          \"operator\": \"in\"\n        },\n        {\n          \"type\": \"evmAddress\",\n          \"addresses\": [\"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\"],\n          \"operator\": \"in\"\n        },\n        {\n          \"type\": \"evmData\",\n          \"abi\": \"erc20\",\n          \"conditions\": [\n            {\n              \"function\": \"transfer\",\n              \"params\": [\n                {\n                  \"name\": \"value\",\n                  \"operator\": \"<=\",\n                  \"value\": \"10000\"\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    },\n    {\n      \"action\": \"accept\",\n      \"operation\": \"signEvmTransaction\",\n      \"criteria\": [\n        {\n          \"type\": \"evmAddress\",\n          \"addresses\": [\"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\"],\n          \"operator\": \"in\"\n        },\n        {\n          \"type\": \"evmData\",\n          \"abi\": \"erc20\",\n          \"conditions\": [\n            {\n              \"function\": \"transfer\",\n              \"params\": [\n                {\n                  \"name\": \"value\",\n                  \"operator\": \"<=\",\n                  \"value\": \"10000\"\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n} ```." }, { "name": "Solana Accounts", "x-audience": "public", "description": "The Solana Account APIs enable you to create and use Solana accounts across SVM-compatible blockchains.\n\nAn **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.\n\nA Solana account is identified by its **address**, which is a base-58 encoded string.\n\nAccounts 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.\n\n## Authentication\n\nThe Solana Account APIs use two layers of authentication to ensure the security of your accounts' private keys:\n\n- **CDP Secret API Key**: This key is used to authenticate all requests to the entire suite of\n   REST APIs offered on Coinbase Developer Platform.\n- **Wallet Secret**: This secret is used specifically to authenticate sensitive wallet operations\n  to `POST` and `DELETE` endpoints in the EVM and Solana Account APIs.\n\n\nTo learn more about creating and using these keys, visit our [Authentication docs](https://docs.cdp.coinbase.com/api-reference/v2/authentication).\n\n<Tip>\n\n\n**Use our SDK**\n\n\nThe [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.\n\n\n</Tip>" }, { "name": "Solana Token Balances", "x-audience": "public", "description": "The Solana Token Balances APIs enable you to retrieve the balances of Solana addresses.\nThis includes SPL tokens and the native SOL token of the network.\n## Denomination\n- 'amount' is denominated in the smallest indivisible unit of the token. For SOL, the smallest indivisible unit is lamports (10^-9 SOL). For SPL tokens, the smallest unit is defined by the token's decimals configuration.\n- '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.\n\n  - For native SOL, `decimals` is 9 (1 SOL = 10^9 lamports).\n  - For SPL tokens, `decimals` is defined in the token's mint configuration." }, { "name": "SQL API (Alpha)", "x-audience": "public", "description": "The SQL APIs enable you to write performant, high-freshness, and endlessly flexible SQL queries against onchain data." }, { "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.\nFor more details on the x402 payment protocol, please see the [x402 specification](https://www.x402.org/).\nThe x402 Facilitator APIs enable you to facilitate payments using the x402 payment protocol by exposing two APIs:\n- `POST /v2/x402/verify`: Verify a payment with a supported scheme and network.\n- `POST /v2/x402/settle`: Settle a payment with a supported scheme and network." }], "paths": { "/platform/v2/solana/token-balances/{network}/{address}": { "get": { "x-audience": "public", "summary": "List Solana token balances", "description": "Lists the token balances of a Solana address on a given network. The balances include SPL tokens and the native SOL token. The response is paginated, and by default, returns 20 balances per page.\n\n**Note:** This endpoint is still under development and does not yet provide strong availability or freshness guarantees. Freshness and availability of new token balances will improve over the coming weeks.", "operationId": "listSolanaTokenBalances", "tags": ["Solana Token Balances"], "security": [{ "apiKeyAuth": [] }], "parameters": [{ "name": "address", "description": "The base58 encoded Solana address to get balances for.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$" }, "example": "HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT" }, { "name": "network", "description": "The human-readable network name to get the balances for.", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/ListSolanaTokenBalancesNetwork" }, "example": "solana" }, { "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/SolanaTokenBalance" }, "description": "The list of Solana token balances.", "example": [{ "amount": { "amount": "1250000000", "decimals": 9 }, "token": { "symbol": "SOL", "name": "Solana", "mintAddress": "So11111111111111111111111111111111111111111" } }, { "amount": { "amount": "123456000", "decimals": 6 }, "token": { "symbol": "USDC", "name": "USD Coin", "mintAddress": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU" } }] } } }, { "$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 \"^[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": "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" } } } }, "/platform/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" } } } }, "/platform/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." } }, "document_verification_failed": { "value": { "errorType": "document_verification_failed", "errorMessage": "The user has not verified their identity for their coinbase.com account." } }, "recipient_allowlist_violation": { "value": { "errorType": "recipient_allowlist_violation", "errorMessage": "The user is not allowed to receive funds at this address, according to their coinbase account allowlist." } }, "recipient_allowlist_pending": { "value": { "errorType": "recipient_allowlist_pending", "errorMessage": "The user is not allowed to receive funds at this address, because changes to their coinbase account allowlist are pending." } }, "travel_rules_recipient_violation": { "value": { "errorType": "travel_rules_recipient_violation", "errorMessage": "The user is not allowed to receive funds at this address, because it violates travel rules." } } } } } }, "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" } } } }, "/platform/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" } } } }, "/platform/v2/x402/supported": { "get": { "x-audience": "public", "summary": "Get supported payment schemes and networks", "description": "Get the supported x402 protocol payment schemes and networks that the facilitator is able to verify and settle payments for.", "operationId": "supportedX402PaymentKinds", "tags": ["x402 Facilitator"], "security": [{ "apiKeyAuth": [] }], "responses": { "200": { "$ref": "#/components/responses/x402SupportedPaymentKindsResponse" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "502": { "$ref": "#/components/responses/BadGatewayError" }, "503": { "$ref": "#/components/responses/ServiceUnavailableError" } } } }, "/platform/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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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" } } } }, "/platform/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" } } } }, "/platform/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.\n\nPer the specification, the message in the request body is prepended with `0x19 <0x45 (E)> <thereum Signed Message:\\n\" + len(message)>` 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" } } } }, "/platform/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" } } } }, "/platform/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" } } } }, "/platform/v2/x402/verify": { "post": { "x-audience": "public", "summary": "Verify a payment", "description": "Verify an x402 protocol payment with a specific scheme and network.", "operationId": "verifyX402Payment", "tags": ["x402 Facilitator"], "security": [{ "apiKeyAuth": [] }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "x402Version": { "$ref": "#/components/schemas/X402Version" }, "paymentPayload": { "$ref": "#/components/schemas/x402PaymentPayload" }, "paymentRequirements": { "$ref": "#/components/schemas/x402PaymentRequirements" } }, "required": ["x402Version", "paymentPayload", "paymentRequirements"] } } } }, "responses": { "200": { "$ref": "#/components/responses/x402VerifyResponse" }, "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" } } } }, "/platform/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" } } } }, "/platform/v2/evm/token-balances/{network}/{address}": { "get": { "x-audience": "public", "summary": "List EVM token balances", "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.\n**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" } } } }, "/platform/v2/policy-engine/policies": { "get": { "x-audience": "public", "summary": "List policies", "description": "Lists the policies belonging to the developer's CDP Project. Use the `scope` parameter to filter the policies by scope.\nThe 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": { "x-audience": "public", "summary": "Create a policy", "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.\nPolicy 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" } } } }, "/platform/v2/evm/accounts/{address}/sign/transaction": { "post": { "x-audience": "public", "summary": "Sign a transaction", "description": "Signs a transaction with the given EVM account.\nThe transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/).\n\nThe 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" } } } }, "/platform/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": { "$ref": "#/components/schemas/EvmUserOperationNetwork" }, "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/<token>" } }, "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" } } } }, "/platform/v2/evm/smart-accounts/{address}/spend-permissions/revoke": { "post": { "x-audience": "public", "summary": "Revoke a spend permission", "description": "Revokes an existing spend permission.", "operationId": "revokeSpendPermission", "tags": ["EVM Smart Accounts"], "security": [{ "apiKeyAuth": [] }], "parameters": [{ "$ref": "#/components/parameters/XWalletAuth" }, { "$ref": "#/components/parameters/IdempotencyKey" }, { "name": "address", "description": "The address of the Smart account this spend permission is valid for.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" }, "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevokeSpendPermissionRequest" } } } }, "responses": { "200": { "description": "Successfully revoked spend permission.", "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": "Smart account not found." } } } } } }, "500": { "$ref": "#/components/responses/InternalServerError" }, "502": { "$ref": "#/components/responses/BadGatewayError" }, "503": { "$ref": "#/components/responses/ServiceUnavailableError" } } } }, "/platform/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" } } } }, "/platform/v2/evm/smart-accounts/{address}/spend-permissions": { "post": { "x-audience": "public", "summary": "Create a spend permission", "description": "Creates a spend permission for the given smart account address.", "operationId": "createSpendPermission", "tags": ["EVM Smart Accounts"], "security": [{ "apiKeyAuth": [] }], "parameters": [{ "$ref": "#/components/parameters/XWalletAuth" }, { "$ref": "#/components/parameters/IdempotencyKey" }, { "name": "address", "description": "The address of the Smart Account to create the spend permission for.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" }, "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSpendPermissionRequest" } } } }, "responses": { "200": { "description": "Successfully created spend permission.", "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": "Smart account not found." } } } } } }, "500": { "$ref": "#/components/responses/InternalServerError" }, "502": { "$ref": "#/components/responses/BadGatewayError" }, "503": { "$ref": "#/components/responses/ServiceUnavailableError" } } } }, "/platform/v2/evm/smart-accounts": { "get": { "summary": "List Smart Accounts", "description": "Lists the Smart Accounts belonging to the developer's CDP Project.\nThe 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", "tags": ["EVM Smart Accounts"], "security": [{ "apiKeyAuth": [] }], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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" } } } }, "/platform/v2/data/evm/token-ownership/{network}/{address}": { "get": { "operationId": "listTokensForAccount", "summary": "List token addresses for account", "x-audience": "public", "description": "Retrieve all ERC-20 token contract addresses that an account has ever received tokens from. \nAnalyzes transaction history to discover token interactions.\n", "tags": ["Onchain Data"], "security": [{ "apiKeyAuth": [] }], "parameters": [{ "name": "network", "in": "path", "required": true, "description": "The blockchain network to query.", "schema": { "type": "string", "enum": ["base", "base-sepolia"] }, "example": "base" }, { "name": "address", "in": "path", "required": true, "description": "The account address to analyze for token interactions.", "schema": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" }, "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }], "responses": { "200": { "description": "Token addresses retrieved successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountTokenAddressesResponse" } } } }, "400": { "description": "Invalid account address format.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "invalid_address": { "value": { "errorType": "invalid_request", "errorMessage": "Invalid account address format. Address must be 40 hex characters prefixed with '0x'" } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "429": { "description": "Rate limit exceeded.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "rate_limit_exceeded": { "value": { "errorType": "rate_limit_exceeded", "errorMessage": "Too many requests. Please try again later." } } } } } }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/platform/v2/solana/faucet": { "post": { "x-audience": "public", "summary": "Request funds on Solana devnet", "description": "Request funds from the CDP Faucet on Solana devnet.\n\nFaucets are available for SOL.\n\nTo prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.\nThese limits are applied at both the CDP Project level and the blockchain address level.\nA single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address.\n\n| Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits|\n|:-----:|:-------------------------:|:--------------------------------:|\n| SOL   | 0.00125 SOL               | 0.0125 SOL                       |\n| USDC  | 1 USDC                    | 10 USDC                          |\n", "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" } } } }, "/platform/v2/onramp/sessions": { "post": { "summary": "Create an onramp session", "description": "Returns a single-use URL for an Onramp session. This API provides flexible  functionality based on the parameters provided, supporting three cases:\n\n**Important**: The returned URL is single-use only. Once a user visits the URL,  no one else can access it.\n## Use Cases\n### 1. Basic Session (Minimum Parameters)\n**Required**: `destinationAddress`, `purchaseCurrency`, `destinationNetwork`\n\n**Returns**: Basic single-use onramp URL. The `quote` object will not be included in the response.\n### 2. One-Click Onramp URL\n**Required**: Basic parameters + `paymentAmount`, `paymentCurrency`\n\n**Returns**: One-click onramp URL for streamlined checkout. The `quote` object will not be included in the response.\n### 3. One-Click Onramp URL with Quote\n**Required**: One-Click Onramp parameters + `paymentMethod`, `country`, `subdivision`\n\n**Returns**: Complete pricing quote and one-click onramp URL. Both `session` and `quote` objects will be included in the response.", "operationId": "createOnrampSession", "tags": ["Onramp"], "security": [{ "apiKeyAuth": [] }], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "purchaseCurrency": { "description": "The ticker (e.g. `BTC`, `USDC`, `SOL`) or the Coinbase UUID (e.g. `d85dce9b-5b73-5c3c-8978-522ce1d1c1b4`)  of the crypto asset to be purchased.\n\nUse the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location.", "type": "string", "example": "USDC" }, "destinationNetwork": { "description": "The name of the crypto network the purchased currency will be sent on.\n\nUse the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location.", "type": "string", "example": "base" }, "destinationAddress": { "description": "The address the purchased crypto will be sent to.", "type": "string", "example": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F" }, "paymentAmount": { "description": "A string representing the amount of fiat the user wishes to pay in exchange for crypto.", "type": "string", "example": "100.00" }, "paymentCurrency": { "description": "The fiat currency to be converted to crypto.", "type": "string", "example": "USD" }, "paymentMethod": { "$ref": "#/components/schemas/OnrampQuotePaymentMethodTypeId" }, "country": { "description": "The ISO 3166-1 two letter country code (e.g. US).", "type": "string", "example": "US" }, "subdivision": { "description": "The ISO 3166-2 two letter state code (e.g. NY). Only required for US.", "type": "string", "example": "NY" }, "redirectUrl": { "description": "URL to redirect the user to when they successfully complete a transaction. This URL will be  embedded in the returned onramp URL as a query parameter.", "type": "string", "example": "https://yourapp.com/success" }, "clientIp": { "description": "The IP address of the end user requesting the onramp transaction.", "type": "string", "example": "127.0.0.1" } }, "required": ["destinationAddress", "purchaseCurrency", "destinationNetwork"] } } } }, "responses": { "201": { "description": "Onramp session created successfully.", "content": { "application/json": { "schema": { "type": "object", "properties": { "session": { "$ref": "#/components/schemas/OnrampSession" }, "quote": { "$ref": "#/components/schemas/OnrampQuote" } }, "required": ["session"] } } } }, "400": { "description": "Invalid request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "invalid_request": { "value": { "errorType": "invalid_request", "errorMessage": "Missing required parameters." } }, "invalid_destination_address": { "value": { "errorType": "invalid_request", "errorMessage": "The destination address is not valid for the specified network." } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "429": { "$ref": "#/components/responses/RateLimitExceeded" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/platform/v2/solana/accounts/{address}/sign/transaction": { "post": { "x-audience": "public", "summary": "Sign a transaction", "description": "Signs a transaction with the given Solana account.\nThe unsigned transaction should be serialized into a byte array and then encoded as base64.\n\n**Transaction types**\n\nThe following transaction types are supported:\n* [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html)\n* [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html)\n\nThe 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" } } } }, "/platform/v2/policy-engine/policies/{policyId}": { "get": { "x-audience": "public", "summary": "Get a policy by ID", "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": { "x-audience": "public", "summary": "Delete a policy", "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": { "x-audience": "public", "summary": "Update a policy", "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.\nPolicy 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" } } } }, "/platform/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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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" } } } }, "/platform/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" } } } }, "/platform/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" } } } }, "/platform/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" } } } }, "/platform/v2/data/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.\n\n**Note:** This endpoint provides <1 second freshness from chain tip, <500ms response latency for wallets with reasonable token history, and 99.9% uptime for production use.", "operationId": "listDataTokenBalances", "tags": ["Onchain Data"], "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" } } } }, "/platform/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" } } } }, "/platform/v2/evm/smart-accounts/{address}": { "get": { "summary": "Get a Smart Account by address", "description": "Gets a Smart Account by its address.", "operationId": "getEvmSmartAccount", "tags": ["EVM Smart Accounts"], "security": [{ "apiKeyAuth": [] }], "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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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" } } } }, "/platform/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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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" } } } }, "/platform/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.\n\nFaucets are available for ETH, USDC, EURC, and cbBTC on Base Sepolia and Ethereum Sepolia, and for ETH only on Ethereum Hoodi.\n\nTo prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.\nThese limits are applied at both the CDP User level and the blockchain address level.\nA single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address.\n\n| Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits|\n|:-----:|:-------------------------:|:--------------------------------:|\n| ETH   | 0.0001 ETH                | 0.1 ETH                          |\n| USDC  | 1 USDC                    | 10 USDC                          |\n| EURC  | 1 EURC                    | 10 EURC                          |\n| cbBTC | 0.0001 cbBTC              | 0.001 cbBTC                      |\n", "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.\n**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" } } } }, "/platform/v2/evm/smart-accounts/{address}/user-operations/{userOpHash}/send": { "post": { "summary": "Send a user operation", "description": "Sends a user operation with a signature.\nThe 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).\nThe 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)\nIf 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" } } } }, "/platform/v2/data/query/run": { "post": { "operationId": "runSQLQuery", "summary": "Run SQL Query", "x-audience": "public", "description": "Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs.\n\nThis endpoint provides direct SQL access to comprehensive blockchain data across supported networks.\nQueries are executed against optimized data structures for high-performance analytics.\n\n### Allowed Queries\n\n  - Standard SQL syntax (ClickHouse dialect)\n  - Read-only queries (SELECT statements)\n  - No DDL or DML operations\n  - No cartesian products\n\n### Supported Tables\n\n  - `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more.\n  - `base.transactions` - Base mainnet transaction data including hash, block number, gas usage.\n  - `base.blocks` - Base mainnet block information.\n  - `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode).\n  - `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included.\n\n### Query Limits\n\n  - Maximum result set: 10,000 rows\n  - Query timeout: 30 seconds\n  - Maximum JOINs: 5\n", "tags": ["SQL API (Alpha)"], "security": [{ "apiKeyAuth": [] }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnchainDataQuery" } } } }, "responses": { "200": { "description": "Query run successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnchainDataResult" } } } }, "400": { "$ref": "#/components/responses/InvalidSQLQueryError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "408": { "description": "Query timeout.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "query_timeout": { "value": { "errorType": "timed_out", "errorMessage": "Query execution was cut off by the server. Please try again with a more efficient query." } } } } } }, "429": { "description": "Rate limit exceeded.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "rate_limit_exceeded": { "value": { "errorType": "rate_limit_exceeded", "errorMessage": "Too many requests. Please try again later." } } } } } }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/TimedOutError" } } } }, "/platform/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.\nAccount 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" } } } }, "/platform/v2/onramp/orders/{orderId}": { "get": { "summary": "Get an onramp order by ID", "description": "Get an onramp order by ID.", "operationId": "getOnrampOrderById", "tags": ["Onramp"], "security": [{ "apiKeyAuth": [] }], "parameters": [{ "name": "orderId", "in": "path", "required": true, "description": "The ID of the onramp order to retrieve.", "schema": { "type": "string" }, "example": "123e4567-e89b-12d3-a456-426614174000" }], "responses": { "200": { "description": "Successfully retrieved an onramp order.", "content": { "application/json": { "schema": { "type": "object", "properties": { "order": { "$ref": "#/components/schemas/OnrampOrder" } }, "required": ["order"] } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "description": "Order not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "not_found": { "value": { "errorType": "not_found", "errorMessage": "Order with the given ID does not exist." } } } } } }, "429": { "$ref": "#/components/responses/RateLimitExceeded" } } } }, "/platform/v2/onramp/orders": { "post": { "summary": "Create an onramp order", "description": "Create a new Onramp order or get a quote for an Onramp order. Either `paymentAmount` or `purchaseAmount` must be provided.\n\nThis API currently only supports the payment method `GUEST_CHECKOUT_APPLE_PAY`, and the `paymentLink` returned will only work in iOS apps. We do not support web integration via iframes at this time.\n\nFor detailed integration instructions and to get access to this API, refer to the  [Apple Pay Onramp API docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api).", "operationId": "createOnrampOrder", "tags": ["Onramp"], "security": [{ "apiKeyAuth": [] }], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "agreementAcceptedAt": { "description": "The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms  (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement),  and Privacy Policy (https://www.coinbase.com/legal/privacy).", "format": "date-time", "type": "string", "example": "2025-04-24T00:00:00Z" }, "destinationAddress": { "description": "The address the purchased crypto will be sent to.", "type": "string", "example": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F" }, "destinationNetwork": { "description": "The name of the crypto network the purchased currency will be sent on.\n\nUse the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location.", "type": "string", "example": "base" }, "email": { "description": "The verified email address of the user requesting the onramp transaction. This email must be verified by your app (via OTP) before being used with the Onramp API.", "type": "string", "example": "test@example.com" }, "isQuote": { "description": "If true, this API will return a quote without creating any transaction.", "type": "boolean", "default": false }, "partnerOrderRef": { "description": "Optional partner order reference ID.", "type": "string", "example": "order-1234" }, "partnerUserRef": { "description": "A unique string that represents the user in your app. This can be used to link individual transactions  together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-”  (e.g. \"sandbox-user-1234\") to perform a sandbox transaction which will allow you to test your integration  without any real transfer of funds.\n\nThis value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user.", "type": "string", "example": "user-1234" }, "paymentAmount": { "description": "A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using  this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount  of the payment currency.", "type": "string", "example": "100.00" }, "paymentCurrency": { "description": "The fiat currency to be converted to crypto.", "type": "string", "example": "USD" }, "paymentMethod": { "$ref": "#/components/schemas/OnrampOrderPaymentMethodTypeId" }, "phoneNumber": { "description": "The phone number of the user requesting the onramp transaction in E.164 format. This phone number must  be verified by your app (via OTP) before being used with the Onramp API.\n\nPlease refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api) for more details on phone number verification requirements and best practices.", "type": "string", "example": "+12055555555" }, "phoneNumberVerifiedAt": { "description": "Timestamp of when the user's phone number was verified via OTP. User phone number must be verified  every 60 days. If this timestamp is older than 60 days, an error will be returned.", "format": "date-time", "type": "string", "example": "2025-04-24T00:00:00Z" }, "purchaseAmount": { "description": "A string representing the amount of crypto the user wishes to purchase. When using this parameter the  returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase  currency.", "type": "string", "example": "10.000000" }, "purchaseCurrency": { "description": "The ticker (e.g. `BTC`, `USDC`, `SOL`) or the Coinbase UUID (e.g. `d85dce9b-5b73-5c3c-8978-522ce1d1c1b4`)  of the crypto asset to be purchased.\n\nUse the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location.", "type": "string", "example": "USDC" }, "clientIp": { "description": "The IP address of the end user requesting the onramp transaction.", "type": "string", "example": "127.0.0.1" }, "domain": { "description": "The domain that the Apple Pay button will be rendered on. Required when using the `GUEST_CHECKOUT_APPLE_PAY`  payment method and embedding the payment link in an iframe.", "type": "string", "example": "pay.coinbase.com" } }, "required": ["paymentCurrency", "purchaseCurrency", "paymentMethod", "destinationAddress", "destinationNetwork", "phoneNumber", "email", "agreementAcceptedAt", "phoneNumberVerifiedAt", "partnerUserRef"] } } } }, "responses": { "201": { "description": "Successfully created an onramp order.", "content": { "application/json": { "schema": { "type": "object", "properties": { "order": { "$ref": "#/components/schemas/OnrampOrder" }, "paymentLink": { "$ref": "#/components/schemas/OnrampPaymentLink" } }, "required": ["order"] } } } }, "400": { "description": "Invalid request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "invalid_request": { "value": { "errorType": "invalid_request", "errorMessage": "Missing required params." } }, "network_not_tradable": { "value": { "errorType": "network_not_tradable", "errorMessage": "The selected asset cannot be purchased on the selected network in the user's location." } }, "guest_permission_denied": { "value": { "errorType": "guest_permission_denied", "errorMessage": "The user is not allowed to complete onramp transactions as a guest." } }, "guest_region_forbidden": { "value": { "errorType": "guest_region_forbidden", "errorMessage": "Guest onramp transactions are not allowed in the user's region." } }, "guest_transaction_limit": { "value": { "errorType": "guest_transaction_limit", "errorMessage": "This transaction would exceed the user's weekly guest onramp transaction limit." } }, "guest_transaction_count": { "value": { "errorType": "guest_transaction_count", "errorMessage": "The user has reached the lifetime guest onramp transaction count limit (15)." } }, "phone_number_verification_expired": { "value": { "errorType": "phone_number_verification_expired", "errorMessage": "The user's phone number verification has expired. Please re-verify the user's phone number" } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "429": { "$ref": "#/components/responses/RateLimitExceeded" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/platform/v2/solana/accounts/send/transaction": { "post": { "x-audience": "public", "summary": "Send a Solana transaction", "description": "Signs and sends a single Solana transaction using multiple Solana accounts. The transaction may contain contain several instructions, each of which may require signatures from different account keys.\n\nThe transaction should be serialized into a byte array and base64 encoded. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction.\n\n**Transaction types**\n\nThe following transaction types are supported:\n* [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions)\n* [Versioned transactions](https://solana.com/developers/guides/advanced/versions)\n\n**Instruction Batching**\n\nTo batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back.\n\n**Network Support**\n\nThe following Solana networks are supported:\n* `solana` - Solana Mainnet\n* `solana-devnet` - Solana Devnet\n\nThe developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction.", "operationId": "sendSolanaTransaction", "tags": ["Solana Accounts"], "security": [{ "apiKeyAuth": [] }], "parameters": [{ "$ref": "#/components/parameters/XWalletAuth" }, { "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "network": { "type": "string", "description": "The Solana network to send the transaction to.", "enum": ["solana", "solana-devnet"], "example": "solana-devnet" }, "transaction": { "type": "string", "description": "The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching.", "example": "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=" } }, "required": ["network", "transaction"] } } } }, "responses": { "200": { "description": "Successfully signed and sent transaction.", "content": { "application/json": { "schema": { "type": "object", "properties": { "transactionSignature": { "type": "string", "description": "The base58 encoded transaction signature.", "example": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW" } }, "required": ["transactionSignature"] } } } }, "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": "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" } } } }, "/platform/v2/evm/smart-accounts/{address}/spend-permissions/list": { "get": { "x-audience": "public", "summary": "List spend permissions", "description": "Lists spend permission for the given smart account address.", "operationId": "listSpendPermissions", "tags": ["EVM Smart Accounts"], "security": [{ "apiKeyAuth": [] }], "parameters": [{ "name": "address", "description": "The address of the Smart account to list spend permissions for.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" }, "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, { "name": "pageSize", "description": "The number of spend permissions 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 spend permissions. Will be empty if there are no more spend permissions to fetch.", "in": "query", "required": false, "schema": { "type": "string" }, "example": "eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ==" }], "responses": { "200": { "description": "Successfully listed spend permissions.", "content": { "application/json": { "schema": { "allOf": [{ "type": "object", "required": ["spendPermissions"], "properties": { "spendPermissions": { "type": "array", "description": "The spend permissions for the smart account.", "items": { "$ref": "#/components/schemas/SpendPermissionResponseObject" } } } }, { "$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." } } } } } }, "404": { "description": "Not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "not_found": { "value": { "errorType": "not_found", "errorMessage": "Smart account not found." } } } } } }, "500": { "$ref": "#/components/responses/InternalServerError" }, "502": { "$ref": "#/components/responses/BadGatewayError" }, "503": { "$ref": "#/components/responses/ServiceUnavailableError" } } } }, "/platform/v2/x402/settle": { "post": { "x-audience": "public", "summary": "Settle a payment", "description": "Settle an x402 protocol payment with a specific scheme and network.", "operationId": "settleX402Payment", "tags": ["x402 Facilitator"], "security": [{ "apiKeyAuth": [] }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "x402Version": { "$ref": "#/components/schemas/X402Version" }, "paymentPayload": { "$ref": "#/components/schemas/x402PaymentPayload" }, "paymentRequirements": { "$ref": "#/components/schemas/x402PaymentRequirements" } }, "required": ["x402Version", "paymentPayload", "paymentRequirements"] } } } }, "responses": { "200": { "$ref": "#/components/responses/x402SettleResponse" }, "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" } } } }, "/platform/v2/end-users/auth/validate-token": { "post": { "x-audience": "public", "summary": "Validate end user access token", "description": "Validates the end user's access token and returns the end user's information. Returns an error if the access token is invalid or expired.\n\nThis API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.", "operationId": "validateEndUserAccessToken", "tags": ["End User Accounts"], "security": [{ "apiKeyAuth": [] }], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "description": "The request body for a developer to verify an end user's access token.", "properties": { "accessToken": { "type": "string", "description": "The access token in JWT format to verify.", "example": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjA1ZGNmYTU1LWY1NzktNDg5YS1iNThhLTFlMDI5Nzk0N2VlNiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjZHAtYXBpIiwiYXV0aF90eXBlIjoiZW1haWwiLCJleHAiOjE3NTM5ODAyOTksImlhdCI6MTc1Mzk3ODQ5OSwiaXNzIjoiY2RwLWFwaSIsImp0aSI6IjA3ZWY5M2JlLTYzMDQtNGQ1YS05NmE3LWJlMGI5MWI0ZTE3NCIsInByb2plY3RfaWQiOiJjNzRkOGI4OC0wOTNiLTQyZDItOGE4Yy1kZGM1YzVlMGViNDMiLCJzdWIiOiJjYTM4YTM4ZC0xNmE5LTRkMjYtYTcxZC0zOWY2NmY5YzZiN2UifQ.1SU0pOy-WR002qUw4hd_UmZWRSLz-ZL6v7PvQvZMKVE6a51x_tqeUeRGaTGuYl1whg0eccMObmK7FqXKRH6E4g" } }, "required": ["accessToken"] } } } }, "responses": { "200": { "description": "Confirms that the access token is valid and returns the end user's information.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EndUser" } } } }, "400": { "description": "Request body is invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "invalid_request": { "value": { "errorType": "invalid_request", "errorMessage": "Missing access token" } } } } } }, "401": { "description": "Request is not properly authenticated, or the access token is invalid or expired.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "unauthorized": { "value": { "errorType": "unauthorized", "errorMessage": "Invalid JWT issuer: not-cdp-api, expected: cdp-api" } } } } } }, "404": { "description": "End user not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "not_found": { "value": { "errorType": "not_found", "errorMessage": "End user not found" } } } } } }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/platform/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" } } } }, "/platform/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" } } } }, "/platform/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/).\n\nThe transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md).\n\n\n**Transaction fields and API behavior**\n\n- `to` *(Required)*: The address of the contract or account to send the transaction to.\n- `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored.\n  The transaction will be sent to the network indicated by the `network` field in the request body.\n\n- `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign\n   a nonce to the transaction based on the current state of the account.\n\n- `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction.\n   If not provided, the API will estimate a value based on current network conditions.\n\n- `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction.\n   If not provided, the API will estimate a value based on current network conditions.\n\n- `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value\n  based on the `to` and `data` fields of the transaction.\n\n- `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction.\n- `data` *(Optional)*: The data to send with the transaction; only used for contract calls.\n- `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", "avalanche", "polygon", "optimism", "arbitrum"], "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" } } } }, "/platform/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.\nThe response is paginated, and by default, returns 20 accounts per page.\n\nIf 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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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" } } } }, "/platform/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" } } } }, "/platform/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" } } } }, "/platform/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" } } } }, "/platform/v2/solana/accounts/{address}/sign/message": { "post": { "x-audience": "public", "summary": "Sign a message", "description": "Signs an arbitrary message with the given Solana account.\n\n**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" } } } }, "/platform/v2/evm/accounts": { "get": { "x-audience": "public", "summary": "List EVM accounts", "description": "Lists the EVM accounts belonging to the developer's CDP Project.\nThe 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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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" } } } } }, "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": { "EmailAuthentication": { "type": "object", "title": "EmailAuthentication", "description": "Information about an end user who authenticates using a one-time password sent to their email address.", "properties": { "type": { "type": "string", "description": "The type of authentication information.", "example": "email", "enum": ["email"] }, "email": { "type": "string", "description": "The email address of the end user.", "example": "user@example.com", "format": "email" } }, "required": ["type", "email"] }, "SmsAuthentication": { "type": "object", "title": "SmsAuthentication", "description": "Information about an end user who authenticates using a one-time password sent to their phone number via SMS.", "properties": { "type": { "type": "string", "description": "The type of authentication information.", "example": "sms", "enum": ["sms"] }, "phoneNumber": { "type": "string", "description": "The phone number of the end user in E.164 format.", "example": "+12055555555", "pattern": "^\\+[1-9]\\d{1,14}$" } }, "required": ["type", "phoneNumber"] }, "DeveloperJWTAuthentication": { "type": "object", "title": "DeveloperJWTAuthentication", "description": "Information about an end user who authenticates using a JWT issued by the developer.", "properties": { "type": { "type": "string", "description": "The type of authentication information.", "enum": ["jwt"], "example": "jwt" }, "kid": { "type": "string", "description": "The key ID of the JWK used to sign the JWT.", "example": "NjVBRjY5MDlCMUIwNzU4RTA2QzZFMDQ4QzQ2MDAyQjVDNjk1RTM2Qg" }, "sub": { "type": "string", "description": "The unique identifier for the end user that is captured in the `sub` claim of the JWT.", "example": "e051beeb-7163-4527-a5b6-35e301529ff2" } }, "required": ["type", "sub", "kid"] }, "AuthenticationMethod": { "description": "Information about how the end user is authenticated.", "oneOf": [{ "$ref": "#/components/schemas/EmailAuthentication" }, { "$ref": "#/components/schemas/SmsAuthentication" }, { "$ref": "#/components/schemas/DeveloperJWTAuthentication" }] }, "AuthenticationMethods": { "type": "array", "description": "The list of valid authentication methods linked to the end user.", "items": { "$ref": "#/components/schemas/AuthenticationMethod" }, "example": [{ "type": "email", "email": "user@example.com" }, { "type": "sms", "phoneNumber": "+12055555555" }, { "type": "jwt", "sub": "e051beeb-7163-4527-a5b6-35e301529ff2", "kid": "NjVBRjY5MDlCMUIwNzU4RTA2QzZFMDQ4QzQ2MDAyQjVDNjk1RTM2Qg" }] }, "EndUser": { "type": "object", "description": "Information about the end user.", "properties": { "userId": { "description": "A stable, unique identifier for the end user. The `userId` must be unique across all end users in the developer's CDP Project. It must be between 1 and 100 characters long and can only contain alphanumeric characters and hyphens.", "type": "string", "pattern": "^[a-zA-Z0-9-]{1,100}$", "example": "e051beeb-7163-4527-a5b6-35e301529ff2" }, "authenticationMethods": { "$ref": "#/components/schemas/AuthenticationMethods" }, "evmAccounts": { "type": "array", "description": "The list of EVM accounts associated with the end user. Currently, only one EVM account is supported per end user.", "items": { "type": "string", "description": "The address of the EVM account associated with the end user.", "pattern": "^0x[0-9a-fA-F]{40}$", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "example": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"] }, "evmSmartAccounts": { "type": "array", "description": "The list of EVM smart accounts associated with the end user. Currently, only one EVM smart account is supported per end user.", "items": { "type": "string", "description": "The address of the EVM smart account associated with the end user.", "pattern": "^0x[0-9a-fA-F]{40}$", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "example": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"] }, "solanaAccounts": { "type": "array", "description": "The list of Solana accounts associated with the end user. Currently, only one Solana account is supported per end user.", "items": { "type": "string", "description": "The base58 encoded address of the Solana account associated with the end user.", "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$", "example": "HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT" }, "example": ["HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT"] } }, "required": ["userId", "authenticationMethods", "evmAccounts", "evmSmartAccounts", "solanaAccounts", "createdAt"] }, "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_sql_query", "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", "network_not_tradable", "guest_permission_denied", "guest_region_forbidden", "guest_transaction_limit", "guest_transaction_count", "phone_number_verification_expired", "document_verification_failed", "recipient_allowlist_violation", "recipient_allowlist_pending", "travel_rules_recipient_violation"], "x-error-instructions": { "already_exists": "This error occurs when trying to create a resource that already exists.\n\n**Steps to resolve:**\n1. Check if the resource exists before creation\n2. Use GET endpoints to verify resource state\n3. Use unique identifiers/names for resources", "bad_gateway": "This error occurs when the CDP API is unable to connect to the backend service.\n\n**Steps to resolve:**\n1. Retry your request after a short delay\n2. If persistent, contact CDP support with:\n   - The timestamp of the error\n   - Request details\n3. Consider implementing retry logic with an exponential backoff\n\n**Note:** These errors are automatically logged and monitored by CDP.", "faucet_limit_exceeded": "This error occurs when you've exceeded the faucet request limits.\n\n**Steps to resolve:**\n1. Wait for the time window to reset\n2. Use funds more efficiently in your testing\n\nFor more information on faucet limits, please visit the [EVM Faucet endpoint](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/faucets/request-funds-on-evm-test-networks) or the [Solana Faucet endpoint](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/faucets/request-funds-on-solana-devnet).", "forbidden": "This error occurs when you don't have permission to access the resource.\n\n**Steps to resolve:**\n1. Verify your permissions to access the resource\n2. Ensure that you are the owner of the requested resource", "idempotency_error": "This error occurs when an idempotency key is reused with different parameters.\n\n**Steps to resolve:**\n1. Generate a new UUID v4 for each unique request\n2. Only reuse idempotency keys for exact request duplicates\n3. Track used keys within your application\n\n**Example idempotency key implementation:**\n```typescript lines wrap\nimport { v4 as uuidv4 } from 'uuid';\n\nfunction createIdempotencyKey() {\n  return uuidv4();\n}\n```", "internal_server_error": "This indicates an unexpected error that occurred on the CDP servers.\n\n**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.\n\n**Steps to resolve:**\n1. Retry your request after a short delay\n2. If persistent, contact CDP support with:\n   - Your correlation ID\n   - Timestamp of the error\n   - Request details\n3. Consider implementing retry logic with an exponential backoff\n\n**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.\n\n**Steps to resolve:**\n1. Check all required fields and parameters are present\n2. Ensure request body (if applicable) follows the correct schema\n3. Verify all parameter formats match the API specification:\n   - Query parameters\n   - Path parameters\n   - Request headers\n4. Validate any addresses, IDs, or other formatted strings meet requirements\n\n**Common validation issues:**\n- Missing required parameters\n- Invalid parameter types or formats\n- Malformed JSON in request body\n- Invalid enum values", "invalid_sql_query": "This error occurs when the SQL query is invalid or not allowed.\n\n**Common causes:**\n- Using non-SELECT SQL statements (INSERT, UPDATE, DELETE, etc.)\n- Invalid table or column names\n- Syntax errors in SQL query\n- Query exceeds character limit\n- Too many JOIN operations", "invalid_signature": "This error occurs when the signature provided for the given user operation is invalid.\n\n**Steps to resolve:**\n1. Verify the signature was generated by the correct owner account\n2. Ensure the signature corresponds to the exact user operation hash\n3. Check that the signature format matches the expected format\n4. Confirm you're using the correct network for the Smart Account\n\n**Common causes:**\n- Using wrong owner account to sign\n- Signing modified/incorrect user operation data\n- Malformed signature encoding\n- Network mismatch between signature and broadcast", "malformed_transaction": "This error occurs when the transaction data provided is not properly formatted or is invalid.\n\n**Steps to resolve:**\n1. Verify transaction encoding:\n   - **EVM networks**: Check RLP encoding is correct\n   - **Solana**: Validate base64 encoding\n2. Ensure all required transaction fields are present\n3. Validate transaction parameters are within acceptable ranges\n4. Check that the transaction type is supported on the target network (see our [Supported Networks](https://docs.cdp.coinbase.com/get-started/supported-networks) page for more details)\n\n**Common causes:**\n- Invalid hex encoding for EVM transactions\n- Missing required transaction fields\n- Incorrect parameter formats\n- Unsupported transaction types\n- 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.\n\n**Steps to resolve:**\n1. Verify the resource ID/address/account exists\n2. Check your permissions to access the resource\n3. Ensure you're using the correct network/environment\n4. Confirm the resource hasn't been deleted\n\n**Common causes:**\n- Mistyped addresses\n- Accessing resources from the wrong CDP project\n- 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.\n\n**Steps to resolve:**\n1. Add a valid payment method to your account using the [CDP Portal](https://portal.cdp.coinbase.com)\n2. Ensure your payment method is valid and not expired\n\n**Common causes:**\n- No payment method configured on the account\n- Payment method is expired", "rate_limit_exceeded": "This error occurs when you've exceeded the API rate limits.\n\n**Steps to resolve:**\n1. Implement exponential backoff\n2. Cache responses where possible\n3. Wait for rate limit window to reset\n\n**Best practices:**\n```typescript lines wrap\nasync function withRetry(fn: () => Promise<any>) {\n  let delay = 1000;\n  while (true) {\n    try {\n      return await fn();\n    } catch (e) {\n      if (e.errorType === \"rate_limit_exceeded\") {\n        await sleep(delay);\n        delay *= 2;\n        continue;\n      }\n      throw e;\n    }\n  }\n}\n```", "request_canceled": "This error occurs when the client cancels an in-progress request before it completes.\n\n**Steps to resolve:**\n1. Check client-side timeout configurations\n2. Review request cancellation logic in your code\n3. Consider increasing timeout thresholds for long-running operations\n4. Implement request tracking to identify premature cancellations\n\n**Best practices:**\n```typescript lines wrap\nasync function withTimeout<T>(promise: Promise<T>, timeoutMs: number): Promise<T> {\n  const timeout = new Promise((_, reject) => {\n    setTimeout(() => {\n      reject(new Error(\"Operation timed out\"));\n    }, timeoutMs);\n  });\n\n  try {\n    return await Promise.race([promise, timeout]);\n  } catch (error) {\n    // Handle timeout or cancellation\n    throw error;\n  }\n}\n```", "service_unavailable": "This error occurs when the CDP API is temporarily unable to handle requests due to maintenance or high load.\n\n**Steps to resolve:**\n1. Retry your request after a short delay\n2. If persistent, contact CDP support with:\n   - The timestamp of the error\n   - Request details\n3. Consider implementing retry logic with an exponential backoff\n\n**Note:** These errors are automatically logged and monitored by CDP.", "timed_out": "This error occurs when a request exceeds the maximum allowed processing time.\n\n**Steps to resolve:**\n1. Break down large requests into smaller chunks (if applicable)\n2. Implement retry logic with exponential backoff\n3. Use streaming endpoints for large data sets\n\n**Example retry implementation:**\n```typescript lines wrap\nasync function withRetryAndTimeout<T>(\n  operation: () => Promise<T>,\n  maxRetries = 3,\n  timeout = 30000,\n): Promise<T> {\n  let attempts = 0;\n  while (attempts < maxRetries) {\n    try {\n      return await Promise.race([\n        operation(),\n        new Promise((_, reject) =>\n          setTimeout(() => reject(new Error(\"Timeout\")), timeout)\n        ),\n      ]);\n    } catch (error) {\n      attempts++;\n      if (attempts === maxRetries) throw error;\n      // Exponential backoff\n      await new Promise(resolve =>\n        setTimeout(resolve, Math.pow(2, attempts) * 1000)\n      );\n    }\n  }\n  throw new Error(\"Max retries exceeded\");\n}\n```", "unauthorized": "This error occurs when authentication fails.\n\n**Steps to resolve:**\n1. Verify your CDP API credentials:\n   - Check that your API key is valid\n   - Check that your Wallet Secret is properly configured\n2. Validate JWT token:\n   - Not expired\n   - Properly signed\n   - Contains required claims\n3. Check request headers:\n   - Authorization header present\n   - X-Wallet-Auth header included when required\n\n**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.\n\n**Steps to resolve:**\n1. Update project or accounts to remove references to the Policy in question.\n2. Retry your delete request.", "network_not_tradable": "This error occurs when the selected asset cannot be purchased on the selected network in the user's location.\n\n**Steps to resolve:**\n1. Verify the asset is tradable on the selected network\n2. Check the user's location to ensure it is allowed to purchase the asset on the selected network\n\n**Common causes:**\n- Users in NY are not allowed to purchase USDC on any network other than Ethereum", "guest_permission_denied": "This error occurs when the user is not allowed to complete onramp transactions as a guest.\n\n**Steps to resolve:**\n1. Redirect the user to create a Coinbase account to buy and send crypto.", "guest_region_forbidden": "This error occurs when guest onramp transactions are not allowed in the user's region.\n\n**Steps to resolve:**\n1. Redirect the user to create a Coinbase account to buy and send crypto.", "guest_transaction_limit": "This error occurs when the user has reached the weekly guest onramp transaction limit.\n\n**Steps to resolve:**\n1. Inform the user they have reached their weekly limit and will have to wait until next week.", "guest_transaction_count": "This error occurs when the user has reached the lifetime guest onramp transaction count limit.\n\n**Steps to resolve:**\n1. Redirect the user to create a Coinbase account to buy and send crypto.", "phone_number_verification_expired": "This error occurs when the user's phone number verification has expired. Use of guest Onramp requires the user's\nphone number to be verified every 60 days.\n\n**Steps to resolve:**\n1. Re-verify the user's phone number via OTP.\n2. Retry the request with the phoneNumberVerifiedAt field set to new verification timestamp.", "document_verification_failed": "This error occurs when the user has not verified their identity for their coinbase.com account.\n**Steps to resolve:**\n1. Verify your coinbase account identity with valid documents at https://www.coinbase.com/settings/account-levels.", "recipient_allowlist_violation": "This error occurs when the user is not allowed to receive funds at this address, according to their coinbase account allowlist.\n**Steps to resolve:**\n1. Either disable the allowlist or add the wallet address at https://www.coinbase.com/settings/allowlist\n2. Wait approximately 2 days for updates to take effect.", "recipient_allowlist_pending": "This error occurs when the user is not allowed to receive funds at this address, because changes to their coinbase account allowlist are pending.\n**Steps to resolve:**\n1. Wait approximately 2 days for updates to take effect.", "travel_rules_recipient_violation": "This error occurs when the user is not allowed to receive funds at this address, because it violates travel rules.\n**Steps to resolve:**\n1. Ensure your desired transfer is not blocked by local travel regulations." } }, "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" } }, "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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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==" } } }, "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).\nEach key corresponds to a type name (e.g., \"`EIP712Domain`\", \"`PermitTransferFrom`\").\n", "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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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]$" }, "policies": { "type": "array", "x-audience": "public", "description": "The list of policy IDs that apply to the smart account. This will include both the project-level policy and the account-level policy, if one exists.", "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", "owners"] }, "EvmUserOperationNetwork": { "type": "string", "description": "The network the user operation is for.", "enum": ["base-sepolia", "base", "arbitrum", "optimism", "zora", "polygon", "bnb", "avalanche", "ethereum", "ethereum-sepolia"], "example": "base" }, "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"] }, "UserOperationReceiptRevert": { "type": "object", "description": "The revert data if the user operation has reverted.", "properties": { "data": { "type": "string", "pattern": "^0x[0-9a-fA-F]*$", "description": "The 0x-prefixed raw hex string.", "example": "0x123" }, "message": { "type": "string", "description": "Human-readable revert reason if able to decode.", "example": "reason for failure" } }, "required": ["data", "message"], "example": { "data": "0x123", "message": "reason for failure" } }, "UserOperationReceipt": { "type": "object", "description": "The receipt that contains information about the execution of user operation.", "properties": { "revert": { "$ref": "#/components/schemas/UserOperationReceiptRevert" }, "transactionHash": { "type": "string", "pattern": "^0x[a-fA-F0-9]{64}$", "description": "The hash of this transaction as 0x-prefixed string.", "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" }, "blockHash": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$|^$", "description": "The block hash of the block including the transaction as 0x-prefixed string.", "example": "0x386544b58930c0ec9e8f3ed09fb4cdb76b9ae0a1a37ddcacebe3925b57978e65" }, "blockNumber": { "type": "integer", "description": "The block height (number) of the block including the transaction.", "example": 29338819 }, "gasUsed": { "type": "string", "description": "The gas used for landing this user operation.", "example": "100000" } }, "example": { "revert": { "data": "0x123", "message": "reason for failure" }, "blockHash": "0x386544b58930c0ec9e8f3ed09fb4cdb76b9ae0a1a37ddcacebe3925b57978e65", "blockNumber": 29338819, "gasUsed": "100000" } }, "EvmUserOperation": { "type": "object", "properties": { "network": { "$ref": "#/components/schemas/EvmUserOperationNetwork" }, "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" }, "receipts": { "type": "array", "description": "The list of receipts associated with the user operation.", "items": { "$ref": "#/components/schemas/UserOperationReceipt" }, "example": [{ "revert": { "data": "0x123", "message": "reason for failure" }, "blockHash": "0x386544b58930c0ec9e8f3ed09fb4cdb76b9ae0a1a37ddcacebe3925b57978e65", "blockNumber": 29338819, "gasUsed": "100000" }] } }, "required": ["network", "userOpHash", "calls", "status"] }, "SpendPermissionNetwork": { "type": "string", "description": "The network the spend permission is on.", "enum": ["base", "base-sepolia", "ethereum", "ethereum-sepolia", "optimism", "arbitrum", "avalanche", "polygon"], "example": "base" }, "CreateSpendPermissionRequest": { "type": "object", "description": "Request parameters for creating a Spend Permission.", "properties": { "network": { "$ref": "#/components/schemas/SpendPermissionNetwork" }, "spender": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "description": "Entity that can spend account's tokens. Can be either a Smart Account or an EOA.", "example": "0x9Fb909eA400c2b8D99Be292DADf07e63B814527c" }, "token": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "description": "ERC-7528 native token address (e.g. \"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\" for native ETH), or an  ERC-20 contract address.", "example": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" }, "allowance": { "type": "string", "description": "Maximum allowed value to spend, in atomic units for the specified token, within each period.", "example": "1000000000000000000" }, "period": { "type": "string", "description": "Time duration for resetting used allowance on a recurring basis (seconds).", "example": "86400" }, "start": { "type": "string", "description": "The start time for this spend permission, in Unix seconds.", "example": "0" }, "end": { "type": "string", "description": "The expiration time for this spend permission, in Unix seconds.", "example": "281474976710655" }, "salt": { "type": "string", "description": "An arbitrary salt to differentiate unique spend permissions with otherwise identical data.", "example": "95959551014433038874972658238091428449162862973207257628575040053304171156143" }, "extraData": { "type": "string", "description": "Arbitrary data to include in the permission.", "example": "0x" }, "paymasterUrl": { "type": "string", "description": "The paymaster URL of the spend permission.", "example": "https://paymaster.cdp.coinbase.com" } }, "required": ["network", "spender", "token", "allowance", "period", "start", "end"] }, "SpendPermission": { "type": "object", "description": "The core spend permission.", "example": { "account": "0xd53Ee96438383Bb1eff07958D110B81363E9Ab47", "spender": "0x9Fb909eA400c2b8D99Be292DADf07e63B814527c", "token": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "allowance": "1000000000000000000", "period": "86400", "start": "0", "end": "281474976710655", "salt": "0", "extraData": "0x" }, "properties": { "account": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "description": "Smart account this spend permission is valid for.", "example": "0xd53Ee96438383Bb1eff07958D110B81363E9Ab47" }, "spender": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "description": "Entity that can spend account's tokens.", "example": "0x9Fb909eA400c2b8D99Be292DADf07e63B814527c" }, "token": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "description": "Token address (ERC-7528 native token address or ERC-20 contract).", "example": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" }, "allowance": { "type": "string", "description": "Maximum allowed value to spend, in atomic units for the specified token, within each period.", "example": "1000000000000000000" }, "period": { "type": "string", "description": "Time duration for resetting used allowance on a recurring basis (seconds).", "example": "86400" }, "start": { "type": "string", "description": "The start time for this spend permission, in Unix seconds.", "example": "0" }, "end": { "type": "string", "description": "The expiration time for this spend permission, in Unix seconds.", "example": "281474976710655" }, "salt": { "type": "string", "description": "An arbitrary salt to differentiate unique spend permissions with otherwise identical data.", "example": "0" }, "extraData": { "type": "string", "description": "Arbitrary data to include in the permission.", "example": "0x" } }, "required": ["account", "spender", "token", "allowance", "period", "start", "end", "salt", "extraData"] }, "SpendPermissionResponseObject": { "type": "object", "properties": { "permission": { "$ref": "#/components/schemas/SpendPermission" }, "permissionHash": { "type": "string", "description": "Unique hash identifier for this permission.", "example": "0x62bc94756bb6221a7913beab6024171fc60d3380fdc06759bfac76e8ccb3f63d" }, "revoked": { "type": "boolean", "description": "Whether this permission has been revoked.", "example": false }, "revokedAt": { "type": "string", "description": "The UTC ISO 8601 timestamp when the permission was revoked (if applicable).", "example": "2025-03-25T12:00:00Z", "format": "date-time" }, "createdAt": { "type": "string", "description": "The UTC ISO 8601 timestamp when the permission was created.", "example": "2025-03-25T12:00:00Z", "format": "date-time" }, "network": { "$ref": "#/components/schemas/SpendPermissionNetwork" } }, "required": ["permission", "permissionHash", "revoked", "createdAt", "network"] }, "RevokeSpendPermissionRequest": { "type": "object", "description": "Request parameters for revoking a Spend Permission.", "properties": { "network": { "$ref": "#/components/schemas/SpendPermissionNetwork" }, "permissionHash": { "type": "string", "description": "The hash of the spend permission to revoke.", "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" }, "paymasterUrl": { "type": "string", "description": "The paymaster URL of the spend permission.", "example": "https://paymaster.cdp.coinbase.com" } }, "required": ["network", "permissionHash"] }, "EvmSwapsNetwork": { "type": "string", "enum": ["base", "ethereum", "arbitrum", "optimism"], "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": { "title": "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", "title": "SwapUnavailableResponse", "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": { "title": "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.\n- 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.\nNot 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`.\nFurther, 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).\nThe token symbol is not unique. It is possible for two different tokens to have the same symbol.\nFor 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.\nNot 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.\nFurther, 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\").\nThe token name is not unique. It is possible for two different tokens to have the same name.\nFor 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.\nNot 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.\nFurther, 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.\nFor 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", "title": "EthValueCriterion", "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", "title": "EvmAddressCriterion", "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 300 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", "title": "KnownAbiType", "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.\n  - [erc20 - Token Standard](https://eips.ethereum.org/EIPS/eip-20).\n  - [erc721 - Non-Fungible Token Standard](https://eips.ethereum.org/EIPS/eip-721).\n  - [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", "title": "AbiFunction", "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", "title": "AbiInput", "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", "title": "EvmDataParameterCondition", "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", "title": "EvmDataParameterConditionList", "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", "title": "EvmDataCriterion", "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"] }, "NetUSDChangeCriterion": { "type": "object", "title": "NetUSDChangeCriterion", "description": "A schema for specifying a criterion for the USD denominated asset transfer or exposure for a transaction. This includes native transfers, as well as token transfers.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `netUSDChange`.", "example": "netUSDChange", "enum": ["netUSDChange"] }, "changeCents": { "type": "integer", "description": "The amount of USD, in cents, that the total value of a transaction's asset transfer should be compared to.", "example": 10000 }, "operator": { "type": "string", "description": "The operator to use for the comparison. The total value of a transaction's asset transfer will be on the left-hand side of the operator, and the `changeCents` field will be on the right-hand side.", "enum": [">", ">=", "<", "<=", "=="], "example": "<=" } }, "required": ["type", "changeCents", "operator"] }, "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" }, { "$ref": "#/components/schemas/NetUSDChangeCriterion" }] }, "example": [{ "type": "ethValue", "ethValue": "1000000", "operator": ">=" }, { "type": "evmAddress", "addresses": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"], "operator": "in" }] }, "SignEvmTransactionRule": { "title": "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", "title": "EvmNetworkCriterion", "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", "ethereum", "ethereum-sepolia", "avalanche", "polygon", "optimism", "arbitrum", "zora", "bnb"], "example": "base-sepolia" }, "example": ["base", "ethereum"] }, "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" }, { "$ref": "#/components/schemas/NetUSDChangeCriterion" }] }, "example": [{ "type": "ethValue", "ethValue": "1000000", "operator": ">=" }, { "type": "evmAddress", "addresses": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"], "operator": "in" }] }, "SendEvmTransactionRule": { "x-audience": "public", "title": "SendEvmTransactionRule", "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", "title": "EvmMessageCriterion", "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", "title": "SignEvmMessageRule", "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", "title": "EvmTypedAddressCondition", "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 300 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", "title": "EvmTypedNumericalCondition", "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", "title": "EvmTypedStringCondition", "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", "title": "SignEvmTypedDataFieldCriterion", "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", "title": "SignEvmTypedDataVerifyingContractCriterion", "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 300 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", "title": "SignEvmTypedDataRule", "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", "title": "SolAddressCriterion", "description": "The criterion for the recipient addresses of a Solana transaction's native transfer instruction.", "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 native transfer recipient 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 native transfer recipient 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 native transfer recipient 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"] }, "SolValueCriterion": { "x-audience": "public", "type": "object", "title": "SolValueCriterion", "description": "The criterion for the SOL value in lamports of a native transfer instruction in a Solana transaction.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `solValue`.", "example": "solValue", "enum": ["solValue"] }, "solValue": { "type": "string", "description": "The amount of SOL in lamports that the transaction instruction's `value` field should be compared to.", "example": "1000000000000000000" }, "operator": { "type": "string", "description": "The operator to use for the comparison. The transaction instruction's `value` field will be on the left-hand side of the operator, and the `solValue` field will be on the right-hand side.", "enum": [">", ">=", "<", "<=", "=="], "example": "<=" } }, "required": ["type", "solValue", "operator"] }, "SplAddressCriterion": { "x-audience": "public", "type": "object", "title": "SplAddressCriterion", "description": "The criterion for the recipient addresses of a Solana transaction's SPL token transfer instructions.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `splAddress`.", "example": "splAddress", "enum": ["splAddress"] }, "addresses": { "type": "array", "description": "The Solana addresses that are compared to the list of SPL token transfer recipient 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 SPL token transfer recipient 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 SPL token transfer recipient 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"] }, "SplValueCriterion": { "x-audience": "public", "type": "object", "title": "SplValueCriterion", "description": "The criterion for the SPL token value of a SPL token transfer instruction in a Solana transaction.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `splValue`.", "example": "splValue", "enum": ["splValue"] }, "splValue": { "type": "string", "description": "The amount of the SPL token that the transaction instruction's `value` field should be compared to.", "example": "1000000000000000000" }, "operator": { "type": "string", "description": "The operator to use for the comparison. The transaction instruction's `value` field will be on the left-hand side of the operator, and the `splValue` field will be on the right-hand side.", "enum": [">", ">=", "<", "<=", "=="], "example": "<=" } }, "required": ["type", "splValue", "operator"] }, "MintAddressCriterion": { "x-audience": "public", "type": "object", "title": "MintAddressCriterion", "description": "The criterion for the token mint addresses of a Solana transaction's SPL token transfer instructions.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `mintAddress`.", "example": "mintAddress", "enum": ["mintAddress"] }, "addresses": { "type": "array", "description": "The Solana addresses that are compared to the list of token mint 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 token mint 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 token mint 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"] }, "KnownIdlType": { "type": "string", "x-audience": "public", "title": "KnownIdlType", "description": "A reference to an established Solana program. When referencing a `KnownIdlType` within a policy rule configuring an `SolDataCriterion`, criteria will decode instruction data as documented in the programs. For more information on supported programs, see the links below.\n  - [SystemProgram](https://docs.rs/solana-program/latest/solana_program/system_instruction/enum.SystemInstruction.html).\n  - [TokenProgram](https://docs.rs/spl-token/latest/spl_token/instruction/enum.TokenInstruction.html).\n  - [AssociatedTokenProgram](https://docs.rs/spl-associated-token-account/latest/spl_associated_token_account/instruction/index.html).", "enum": ["SystemProgram", "TokenProgram", "AssociatedTokenProgram"] }, "Idl": { "x-audience": "public", "type": "object", "description": "IDL Specification following Anchor's IDL format v0.30+.", "required": ["address", "instructions"], "properties": { "address": { "type": "string", "description": "The program address.", "example": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }, "instructions": { "type": "array", "description": "List of program instructions.", "example": [{ "name": "transfer_checked", "discriminator": [119, 250, 202, 24, 253, 135, 244, 121], "accounts": [{ "name": "mint", "writable": true }, { "name": "rent" }], "args": [{ "name": "amount", "type": "u64" }, { "name": "decimals", "type": "u8" }] }], "items": { "type": "object", "required": ["name", "discriminator", "args"], "properties": { "name": { "type": "string", "description": "The instruction name.", "example": "transfer_checked" }, "discriminator": { "type": "array", "description": "Array of 8 numbers representing the instruction discriminator.", "items": { "type": "integer", "minimum": 0, "maximum": 255 }, "minItems": 8, "maxItems": 8, "example": [119, 250, 202, 24, 253, 135, 244, 121] }, "args": { "type": "array", "description": "List of instruction arguments.", "items": { "type": "object", "required": ["name", "type"], "properties": { "name": { "type": "string", "description": "The argument name.", "example": "amount" }, "type": { "type": "string", "description": "The argument type.", "example": "u64" } } } }, "accounts": { "type": "array", "description": "Optional list of accounts required by the instruction.", "items": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "description": "The account name.", "example": "mint" }, "writable": { "type": "boolean", "description": "Whether the account is writable.", "example": true }, "signer": { "type": "boolean", "description": "Whether the account must be a signer.", "example": false } } } } } } }, "metadata": { "type": "object", "description": "Optional metadata about the IDL.", "example": { "name": "system_program", "version": "0.1.0", "spec": "0.1.0" }, "properties": { "name": { "type": "string", "description": "The program name.", "example": "system_program" }, "version": { "type": "string", "description": "The program version.", "example": "0.1.0" }, "spec": { "type": "string", "description": "The IDL specification version.", "example": "0.1.0" } } }, "types": { "type": "array", "description": "Optional type definitions for custom data structures used in the program.", "items": { "type": "object" }, "example": [{ "name": "MyStruct", "type": "struct", "fields": [{ "name": "id", "type": "u64" }, { "name": "owner", "type": "pubkey" }] }] } } }, "SolDataParameterCondition": { "type": "object", "x-audience": "public", "title": "SolDataParameterCondition", "description": "A single parameter condition to apply against a specific instruction's parameters.", "properties": { "name": { "type": "string", "description": "The parameter name.", "example": "amount" }, "operator": { "type": "string", "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.", "enum": [">", ">=", "<", "<=", "=="], "example": "==" }, "value": { "type": "string", "description": "The value to compare against.", "example": "1000000" } }, "required": ["name", "operator", "value"] }, "SolDataParameterConditionList": { "type": "object", "x-audience": "public", "title": "SolDataParameterConditionList", "description": "A single parameter condition to apply against a specific instruction's parameters.", "properties": { "name": { "type": "string", "description": "The parameter name.", "example": "amount" }, "operator": { "type": "string", "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.", "enum": ["in", "not in"], "example": "in" }, "values": { "type": "array", "description": "The values to compare against.", "items": { "type": "string", "description": "A single potential value to compare against the resolved `name` value.", "example": "1000000" }, "example": ["1000000", "HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT", "6"] } }, "required": ["name", "operator", "values"] }, "SolDataCondition": { "type": "object", "x-audience": "public", "description": "A single condition to apply against a specific instruction type and its parameters.", "properties": { "instruction": { "type": "string", "description": "The instruction name.", "example": "transfer_checked" }, "params": { "type": "array", "description": "Parameter conditions for the instruction.", "items": { "description": "A list of parameter conditions to apply against a specific instruction's data.", "oneOf": [{ "$ref": "#/components/schemas/SolDataParameterCondition" }, { "$ref": "#/components/schemas/SolDataParameterConditionList" }] }, "example": [{ "name": "amount", "operator": "<=", "value": "1000000" }, { "name": "decimals", "operator": "==", "value": "6" }, { "name": "owner", "operator": "in", "values": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "So11111111111111111111111111111111111111112"] }] } }, "required": ["instruction"] }, "SolDataCriterion": { "x-audience": "public", "type": "object", "description": "A schema for specifying criterion for instruction data in a Solana transaction.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `solData`.", "example": "solData", "enum": ["solData"] }, "idls": { "type": "array", "description": "List of IDL specifications. Can contain known program names (strings) or custom IDL objects.", "items": { "oneOf": [{ "$ref": "#/components/schemas/KnownIdlType" }, { "$ref": "#/components/schemas/Idl" }] }, "example": ["SystemProgram", "TokenProgram", { "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "instructions": [{ "name": "transfer_checked", "discriminator": [119, 250, 202, 24, 253, 135, 244, 121], "args": [{ "name": "amount", "type": "u64" }, { "name": "decimals", "type": "u8" }] }] }] }, "conditions": { "type": "array", "description": "A list of conditions to apply against the transaction instruction. Only one condition must evaluate to true for this criterion to be met.", "items": { "$ref": "#/components/schemas/SolDataCondition" }, "example": [{ "instruction": "transfer_checked", "params": [{ "name": "lamports", "operator": "<=", "value": "1000000" }, { "name": "space", "operator": "==", "value": "64" }] }] } }, "required": ["type", "idls", "conditions"] }, "ProgramIdCriterion": { "x-audience": "public", "type": "object", "title": "ProgramIdCriterion", "description": "The criterion for the program IDs of a Solana transaction's instructions.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `programId`.", "example": "programId", "enum": ["programId"] }, "programIds": { "type": "array", "description": "The Solana program IDs that are compared to the list of program IDs in the transaction's instructions.", "items": { "type": "string", "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$", "description": "The Solana program ID that is compared to the list of program IDs in the transaction's instructions." }, "example": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "11111111111111111111111111111112"] }, "operator": { "type": "string", "description": "The operator to use for the comparison. Each of the program IDs in the transaction's instructions will be on the left-hand side of the operator, and the `programIds` field will be on the right-hand side.", "enum": ["in", "not in"], "example": "in" } }, "required": ["type", "programIds", "operator"] }, "SignSolTransactionCriteria": { "type": "array", "x-audience": "public", "description": "A schema for specifying criteria for the SignSolTransaction operation.", "items": { "oneOf": [{ "$ref": "#/components/schemas/SolAddressCriterion" }, { "$ref": "#/components/schemas/SolValueCriterion" }, { "$ref": "#/components/schemas/SplAddressCriterion" }, { "$ref": "#/components/schemas/SplValueCriterion" }, { "$ref": "#/components/schemas/MintAddressCriterion" }, { "$ref": "#/components/schemas/SolDataCriterion" }, { "$ref": "#/components/schemas/ProgramIdCriterion" }] }, "example": [{ "type": "solAddress", "addresses": ["HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT"], "operator": "in" }] }, "SignSolTransactionRule": { "title": "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"] }, "SolNetworkCriterion": { "x-audience": "public", "type": "object", "title": "SolNetworkCriterion", "description": "The criterion for the Solana network of a transaction.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `solNetwork`.", "example": "solNetwork", "enum": ["solNetwork"] }, "networks": { "type": "array", "description": "The Solana networks that the transaction's intended network should be compared to.", "items": { "type": "string", "description": "The Solana network the transaction is for.", "enum": ["solana-devnet", "solana"], "example": "solana-devnet" }, "example": ["solana-devnet", "solana"] }, "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"] }, "SendSolTransactionCriteria": { "x-audience": "public", "type": "array", "description": "A schema for specifying criteria for the SendSolTransaction operation.", "items": { "oneOf": [{ "$ref": "#/components/schemas/SolAddressCriterion" }, { "$ref": "#/components/schemas/SolValueCriterion" }, { "$ref": "#/components/schemas/SplAddressCriterion" }, { "$ref": "#/components/schemas/SplValueCriterion" }, { "$ref": "#/components/schemas/MintAddressCriterion" }, { "$ref": "#/components/schemas/SolDataCriterion" }, { "$ref": "#/components/schemas/ProgramIdCriterion" }, { "$ref": "#/components/schemas/SolNetworkCriterion" }] }, "example": [{ "type": "solAddress", "addresses": ["HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT"], "operator": "in" }, { "type": "solValue", "solValue": "1000000000000000000", "operator": "<=" }] }, "SendSolTransactionRule": { "x-audience": "public", "title": "SendSolTransactionRule", "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": "sendSolTransaction", "enum": ["sendSolTransaction"] }, "criteria": { "$ref": "#/components/schemas/SendSolTransactionCriteria" } }, "required": ["action", "operation", "criteria"] }, "SolMessageCriterion": { "x-audience": "public", "type": "object", "title": "SolMessageCriterion", "description": "The criterion for the message of a Solana transaction.", "properties": { "type": { "type": "string", "description": "The type of criterion to use. This should be `solMessage`.", "example": "solMessage", "enum": ["solMessage"] }, "match": { "type": "string", "description": "A regular expression the field is matched against.", "example": "^hello ([a-z]+)$" } }, "required": ["type", "match"] }, "SignSolMessageCriteria": { "x-audience": "public", "type": "array", "description": "A schema for specifying criteria for the SignSolMessage operation.", "items": { "oneOf": [{ "$ref": "#/components/schemas/SolMessageCriterion" }] }, "example": [{ "type": "solMessage", "match": "^hello ([a-z]+)$" }] }, "SignSolMessageRule": { "x-audience": "public", "title": "SignSolMessageRule", "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": "signSolMessage", "enum": ["signSolMessage"] }, "criteria": { "$ref": "#/components/schemas/SignSolMessageCriteria" } }, "required": ["action", "operation", "criteria"] }, "SignEvmHashRule": { "x-audience": "public", "title": "SignEvmHashRule", "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"] }, "PrepareUserOperationCriteria": { "x-audience": "public", "type": "array", "description": "A schema for specifying criteria for the PrepareUserOperation operation.", "items": { "oneOf": [{ "$ref": "#/components/schemas/EthValueCriterion" }, { "$ref": "#/components/schemas/EvmAddressCriterion" }, { "$ref": "#/components/schemas/EvmNetworkCriterion" }, { "$ref": "#/components/schemas/EvmDataCriterion" }, { "$ref": "#/components/schemas/NetUSDChangeCriterion" }] }, "example": [{ "type": "ethValue", "ethValue": "1000000", "operator": ">=" }, { "type": "evmAddress", "addresses": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"], "operator": "in" }] }, "PrepareUserOperationRule": { "x-audience": "public", "title": "PrepareUserOperationRule", "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": "prepareUserOperation", "enum": ["prepareUserOperation"] }, "criteria": { "$ref": "#/components/schemas/PrepareUserOperationCriteria" } }, "required": ["action", "operation", "criteria"] }, "SendUserOperationCriteria": { "x-audience": "public", "type": "array", "description": "A schema for specifying criteria for the SendUserOperation operation.", "items": { "oneOf": [{ "$ref": "#/components/schemas/EthValueCriterion" }, { "$ref": "#/components/schemas/EvmAddressCriterion" }, { "$ref": "#/components/schemas/EvmDataCriterion" }, { "$ref": "#/components/schemas/NetUSDChangeCriterion" }] }, "example": [{ "type": "ethValue", "ethValue": "1000000", "operator": ">=" }, { "type": "evmAddress", "addresses": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"], "operator": "in" }] }, "SendUserOperationRule": { "x-audience": "public", "title": "SendUserOperationRule", "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": "sendUserOperation", "enum": ["sendUserOperation"] }, "criteria": { "$ref": "#/components/schemas/SendUserOperationCriteria" } }, "required": ["action", "operation", "criteria"] }, "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/SendSolTransactionRule" }, { "$ref": "#/components/schemas/SignSolMessageRule" }, { "$ref": "#/components/schemas/SignEvmHashRule" }, { "$ref": "#/components/schemas/PrepareUserOperationRule" }, { "$ref": "#/components/schemas/SendUserOperationRule" }], "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.\nPolicy 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.\nAccount names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.\nAccount 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"] }, "ListSolanaTokenBalancesNetwork": { "type": "string", "enum": ["solana", "solana-devnet"], "description": "The name of the supported Solana networks in human-readable format.", "example": "solana" }, "SolanaTokenAmount": { "type": "object", "description": "Amount of a given Solana token.", "example": { "amount": "1250000000", "decimals": 9 }, "properties": { "amount": { "type": "string", "pattern": "^[0-9]+$", "description": "The amount is denominated in the smallest indivisible unit of the token. For SOL, the smallest indivisible unit is lamports (10^-9 SOL). For SPL tokens, the smallest unit is defined by the token's decimals configuration.", "example": "1250000000" }, "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.\n- For native SOL, `decimals` is 9 (1 SOL = 10^9 lamports). - For SPL tokens, `decimals` is defined in the token's mint configuration.", "example": 9 } }, "required": ["amount", "decimals"] }, "SolanaToken": { "type": "object", "description": "General information about a Solana token. Includes the mint address, and other identifying information.", "example": { "symbol": "SOL", "name": "Solana", "mintAddress": "So11111111111111111111111111111111111111111" }, "properties": { "symbol": { "type": "string", "description": "The symbol of this token (ex: SOL, USDC, RAY).\nThe token symbol is not unique. It is possible for two different tokens to have the same symbol.\nFor the native SOL token, this symbol is \"SOL\". For SPL tokens, this symbol is defined in the token's metadata.\nNot all tokens have a symbol. This field will only be populated when the token has metadata available.", "example": "SOL" }, "name": { "type": "string", "description": "The name of this token (ex: \"Solana\", \"USD Coin\", \"Raydium\").\nThe token name is not unique. It is possible for two different tokens to have the same name.\nFor the native SOL token, this name is \"Solana\". For SPL tokens, this name is defined in the token's metadata.\nNot all tokens have a name. This field will only be populated when the token has metadata available.", "example": "Solana" }, "mintAddress": { "type": "string", "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$", "description": "The mint address of the token.\nFor native SOL, the mint address is `So11111111111111111111111111111111111111111`. For SPL tokens, this is the mint address where the token is defined.", "example": "So11111111111111111111111111111111111111111" } }, "required": ["mintAddress"] }, "SolanaTokenBalance": { "type": "object", "properties": { "amount": { "$ref": "#/components/schemas/SolanaTokenAmount" }, "token": { "$ref": "#/components/schemas/SolanaToken" } }, "required": ["amount", "token"] }, "OnchainDataQuery": { "type": "object", "description": "Request to execute a SQL query against indexed blockchain data.", "required": ["sql"], "properties": { "sql": { "type": "string", "description": "SQL query to execute against the indexed blockchain data.", "example": "SELECT block_number, transaction_hash FROM base.transactions WHERE block_number > 1000000 LIMIT 10", "minLength": 1, "maxLength": 10000 } } }, "OnchainDataResult": { "type": "object", "description": "Result of executing a SQL query.", "properties": { "result": { "type": "array", "description": "Query result as an array of objects representing rows.", "items": { "type": "object", "additionalProperties": true, "description": "Row data with column names as keys.", "example": { "event_signature": "Transfer(address,address,uint256)", "from": "0x1234567890abcdef", "to": "0x1234567890abcdef", "amount": 1000000000000000000 } }, "example": [{ "event_signature": "Transfer(address,address,uint256)", "from": "0x1234567890abcdef", "to": "0x1234567890abcdef", "amount": 1000000000000000000 }, { "event_signature": "Transfer(address,address,uint256)", "from": "0x1234567890abcdef", "to": "0x1234567890abcdef", "amount": 2000000000000000000 }] }, "schema": { "type": "object", "description": "Schema information for the query result. This is a derived schema from the query result, so types may not match the underlying table.\n", "example": { "columns": [{ "name": "block_number", "type": "UInt64" }, { "name": "transaction_hash", "type": "String" }] }, "properties": { "columns": { "type": "array", "description": "Column definitions.", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Column name." }, "type": { "type": "string", "description": "Column data type (ClickHouse types).", "enum": ["String", "UInt8", "UInt16", "UInt32", "UInt64", "UInt128", "UInt256", "Int8", "Int16", "Int32", "Int64", "Int128", "Int256", "Float32", "Float64", "Bool", "Date", "DateTime", "DateTime64", "UUID"] } }, "example": { "name": "event_signature", "type": "String", "description": "The signature of the event." } } } } }, "metadata": { "type": "object", "description": "Metadata about query execution.", "properties": { "cached": { "type": "boolean", "description": "Whether the result was served from cache.", "example": false }, "executionTimeMs": { "type": "integer", "description": "Query execution time in milliseconds.", "example": 145 }, "rowCount": { "type": "integer", "description": "Number of rows returned.", "example": 2 } }, "example": { "cached": false, "executionTimeMs": 145, "rowCount": 2 } } } }, "AccountTokenAddressesResponse": { "type": "object", "description": "Response containing token addresses that an account has received.", "properties": { "accountAddress": { "type": "string", "description": "The account address that was queried.", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "tokenAddresses": { "type": "array", "description": "List of token contract addresses that the account has received.", "items": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "description": "Token contract address." }, "example": ["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "0x4200000000000000000000000000000000000006", "0x0000000000000000000000000000000000000000"] }, "totalCount": { "type": "integer", "description": "Total number of unique token addresses discovered.", "example": 15, "minimum": 0 } } }, "X402Version": { "type": "integer", "description": "The version of the x402 protocol.", "enum": [1], "example": 1 }, "x402ExactEvmPayload": { "type": "object", "title": "x402ExactEvmPayload", "description": "The x402 protocol exact scheme payload for EVM networks. The scheme is implemented using ERC-3009. For more details, please see [EVM Exact Scheme Details](https://github.com/coinbase/x402/blob/main/specs/schemes/exact/scheme_exact_evm.md).", "properties": { "signature": { "type": "string", "description": "The EIP-712 hex-encoded signature of the ERC-3009 authorization message.", "example": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480" }, "authorization": { "type": "object", "description": "The authorization data for the ERC-3009 authorization message.", "properties": { "from": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "description": "The 0x-prefixed, checksum EVM address of the sender of the payment.", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "to": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "description": "The 0x-prefixed, checksum EVM address of the recipient of the payment.", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "value": { "type": "string", "description": "The value of the payment, in atomic units of the payment asset.", "example": "1000000000000000000" }, "validAfter": { "type": "string", "description": "The unix timestamp after which the payment is valid.", "example": "1716150000" }, "validBefore": { "type": "string", "description": "The unix timestamp before which the payment is valid.", "example": "1716150000" }, "nonce": { "type": "string", "description": "The hex-encoded nonce of the payment.", "example": "0x1234567890abcdef1234567890abcdef12345678" } }, "example": { "from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "value": "1000000000000000000", "validAfter": "1716150000", "validBefore": "1716150000", "nonce": "0x1234567890abcdef1234567890abcdef12345678" }, "required": ["from", "to", "value", "validAfter", "validBefore", "nonce"] } }, "example": { "signature": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480", "authorization": { "from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "value": "1000000000000000000", "validAfter": "1716150000", "validBefore": "1716150000", "nonce": "0x1234567890abcdef1234567890abcdef12345678" } }, "required": ["signature", "authorization"] }, "x402ExactSolanaPayload": { "type": "object", "title": "x402ExactSolanaPayload", "description": "The x402 protocol exact scheme payload for Solana networks. For more details, please see [Solana Exact Scheme Details](https://github.com/coinbase/x402/blob/main/specs/schemes/exact/scheme_exact_svm.md).", "properties": { "transaction": { "type": "string", "description": "The base64-encoded Solana transaction.", "example": "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=" } }, "example": { "transaction": "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=" }, "required": ["transaction"] }, "x402PaymentPayload": { "type": "object", "description": "The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.", "properties": { "x402Version": { "$ref": "#/components/schemas/X402Version" }, "scheme": { "type": "string", "description": "The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.", "enum": ["exact"], "example": "exact" }, "network": { "type": "string", "description": "The network of the blockchain to send payment on.", "enum": ["base-sepolia", "base", "solana-devnet", "solana"], "example": "base" }, "payload": { "type": "object", "description": "The payload of the payment depending on the x402Version, scheme, and network.", "oneOf": [{ "$ref": "#/components/schemas/x402ExactEvmPayload" }, { "$ref": "#/components/schemas/x402ExactSolanaPayload" }], "example": { "signature": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480", "authorization": { "from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "value": "1000000000000000000", "validAfter": "1716150000", "validBefore": "1716150000", "nonce": "0x1234567890abcdef1234567890abcdef12345678" } } } }, "example": { "x402Version": 1, "scheme": "exact", "network": "base", "payload": { "signature": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480", "authorization": { "from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "value": "1000000000000000000", "validAfter": "1716150000", "validBefore": "1716150000", "nonce": "0x1234567890abcdef1234567890abcdef12345678" } } }, "required": ["x402Version", "scheme", "network", "payload"] }, "x402PaymentRequirements": { "type": "object", "description": "The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.", "properties": { "scheme": { "type": "string", "description": "The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.", "enum": ["exact"], "example": "exact" }, "network": { "type": "string", "description": "The network of the blockchain to send payment on.", "enum": ["base-sepolia", "base", "solana-devnet", "solana"], "example": "base" }, "maxAmountRequired": { "type": "string", "description": "The maximum amount required to pay for the resource in atomic units of the payment asset.", "example": "1000000" }, "resource": { "type": "string", "description": "The URL of the resource to pay for.", "example": "https://api.example.com/premium/resource/123" }, "description": { "type": "string", "description": "The description of the resource.", "example": "Premium API access for data analysis" }, "mimeType": { "type": "string", "description": "The MIME type of the resource response.", "example": "application/json" }, "outputSchema": { "type": "object", "description": "The optional JSON schema describing the resource output.", "additionalProperties": true, "example": { "data": "string" } }, "payTo": { "type": "string", "description": "The destination to pay value to.\n\nFor EVM networks, payTo will be a 0x-prefixed, checksum EVM address.\n\nFor Solana-based networks, payTo will be a base58-encoded Solana address.", "pattern": "^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "maxTimeoutSeconds": { "type": "integer", "description": "The maximum time in seconds for the resource server to respond.", "example": 10 }, "asset": { "type": "string", "description": "The asset to pay with.\n\nFor EVM networks, the asset will be a 0x-prefixed, checksum EVM address.\n\nFor Solana-based networks, the asset will be a base58-encoded Solana address.", "pattern": "^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "extra": { "type": "object", "description": "The optional additional scheme-specific payment info.", "additionalProperties": true, "example": { "gasLimit": "1000000" } } }, "required": ["scheme", "network", "maxAmountRequired", "resource", "description", "mimeType", "payTo", "asset", "maxTimeoutSeconds"] }, "x402VerifyInvalidReason": { "type": "string", "description": "The reason the payment is invalid on the x402 protocol.", "enum": ["insufficient_funds", "invalid_scheme", "invalid_network", "invalid_x402_version", "invalid_payment_requirements", "invalid_payload", "invalid_exact_evm_payload_authorization_value", "invalid_exact_evm_payload_authorization_valid_after", "invalid_exact_evm_payload_authorization_valid_before", "invalid_exact_evm_payload_authorization_typed_data_message", "invalid_exact_evm_payload_authorization_from_address_kyt", "invalid_exact_evm_payload_authorization_to_address_kyt", "invalid_exact_evm_payload_signature", "invalid_exact_evm_payload_signature_address", "invalid_exact_svm_payload_transaction", "invalid_exact_svm_payload_transaction_amount_mismatch", "invalid_exact_svm_payload_transaction_create_ata_instruction", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset", "invalid_exact_svm_payload_transaction_instructions", "invalid_exact_svm_payload_transaction_instructions_length", "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high", "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked", "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked", "invalid_exact_svm_payload_transaction_not_a_transfer_instruction", "invalid_exact_svm_payload_transaction_cannot_derive_receiver_ata", "invalid_exact_svm_payload_transaction_receiver_ata_not_found", "invalid_exact_svm_payload_transaction_sender_ata_not_found", "invalid_exact_svm_payload_transaction_simulation_failed", "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata"], "example": "insufficient_funds" }, "x402SettleErrorReason": { "type": "string", "description": "The reason the payment settlement errored on the x402 protocol.", "enum": ["insufficient_funds", "invalid_scheme", "invalid_network", "invalid_x402_version", "invalid_payment_requirements", "invalid_payload", "invalid_exact_evm_payload_authorization_value", "invalid_exact_evm_payload_authorization_valid_after", "invalid_exact_evm_payload_authorization_valid_before", "invalid_exact_evm_payload_authorization_typed_data_message", "invalid_exact_evm_payload_authorization_from_address_kyt", "invalid_exact_evm_payload_authorization_to_address_kyt", "invalid_exact_evm_payload_signature_address", "settle_exact_svm_block_height_exceeded", "settle_exact_svm_transaction_confirmation_timed_out"], "example": "insufficient_funds" }, "x402SupportedPaymentKind": { "type": "object", "description": "The supported payment kind for the x402 protocol. A kind is comprised of a scheme and a network, which together uniquely identify a way to move money on the x402 protocol. For more details, please see [x402 Schemes](https://github.com/coinbase/x402?tab=readme-ov-file#schemes).", "properties": { "x402Version": { "$ref": "#/components/schemas/X402Version" }, "scheme": { "type": "string", "description": "The scheme of the payment protocol.", "enum": ["exact"], "example": "exact" }, "network": { "type": "string", "description": "The network of the blockchain.", "enum": ["base-sepolia", "base", "solana-devnet", "solana"], "example": "base" }, "extra": { "type": "object", "description": "The optional additional scheme-specific payment info.", "additionalProperties": true, "example": { "feePayer": "HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT" } } }, "required": ["x402Version", "scheme", "network"] }, "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", "title": "PaymentMethodRequest", "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", "title": "CryptoRailAddress", "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" } }, "OnrampOrderPaymentMethodTypeId": { "type": "string", "description": "The type of payment method to be used to complete an onramp order.", "enum": ["GUEST_CHECKOUT_APPLE_PAY"], "example": "GUEST_CHECKOUT_APPLE_PAY" }, "OnrampOrderFee": { "type": "object", "description": "A fee associated with an order.", "properties": { "type": { "type": "string", "enum": ["FEE_TYPE_NETWORK", "FEE_TYPE_EXCHANGE"], "description": "The type of fee.", "example": "FEE_TYPE_NETWORK" }, "amount": { "type": "string", "description": "The amount of the fee.", "example": "0.95" }, "currency": { "type": "string", "description": "The currency of the fee.", "example": "USDC" } }, "required": ["type", "amount", "currency"] }, "OnrampOrderStatus": { "type": "string", "description": "The status of an onramp order.", "enum": ["ONRAMP_ORDER_STATUS_PENDING_AUTH", "ONRAMP_ORDER_STATUS_PENDING_PAYMENT", "ONRAMP_ORDER_STATUS_PROCESSING", "ONRAMP_ORDER_STATUS_COMPLETED", "ONRAMP_ORDER_STATUS_FAILED"], "example": "ONRAMP_ORDER_STATUS_COMPLETED" }, "OnrampOrder": { "type": "object", "description": "An Onramp order.", "properties": { "orderId": { "type": "string", "description": "The ID of the onramp order.", "example": "123e4567-e89b-12d3-a456-426614174000" }, "paymentTotal": { "type": "string", "description": "The total amount of fiat to be paid, inclusive of any fees.", "example": "100.75" }, "paymentSubtotal": { "type": "string", "description": "The amount of fiat to be converted to crypto.", "example": "100" }, "paymentCurrency": { "type": "string", "description": "The fiat currency to be converted to crypto.", "example": "USD" }, "paymentMethod": { "$ref": "#/components/schemas/OnrampOrderPaymentMethodTypeId" }, "purchaseAmount": { "type": "string", "description": "The amount of crypto to be purchased.", "example": "100.000000" }, "purchaseCurrency": { "type": "string", "description": "The crypto currency to be purchased.", "example": "USDC" }, "fees": { "type": "array", "description": "The fees associated with the order.", "items": { "$ref": "#/components/schemas/OnrampOrderFee" }, "example": [{ "type": "FEE_TYPE_EXCHANGE", "amount": "0.5", "currency": "USD" }, { "type": "FEE_TYPE_NETWORK", "amount": "0.25", "currency": "USD" }] }, "exchangeRate": { "type": "string", "description": "The exchange rate used to convert fiat to crypto i.e. the crypto value of one fiat.", "example": "1" }, "destinationAddress": { "type": "string", "description": "The destination address to send the crypto to.", "example": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F" }, "destinationNetwork": { "type": "string", "description": "The network to send the crypto on.", "example": "base" }, "status": { "$ref": "#/components/schemas/OnrampOrderStatus" }, "txHash": { "type": "string", "description": "The transaction hash of the order (only available once crypto has been sent).", "example": "0x363cd3b3d4f49497cf5076150cd709307b90e9fc897fdd623546ea7b9313cecb" }, "createdAt": { "type": "string", "description": "The date and time the order was created.", "example": "2025-04-24T00:00:00Z" }, "updatedAt": { "type": "string", "description": "The date and time the order was last updated.", "example": "2025-04-24T00:00:00Z" } }, "required": ["orderId", "paymentTotal", "paymentSubtotal", "paymentCurrency", "paymentMethod", "purchaseAmount", "purchaseCurrency", "fees", "exchangeRate", "destinationAddress", "destinationNetwork", "status", "createdAt", "updatedAt"] }, "OnrampPaymentLinkType": { "type": "string", "description": "The type of payment link.", "enum": ["PAYMENT_LINK_TYPE_APPLE_PAY_BUTTON"], "example": "PAYMENT_LINK_TYPE_APPLE_PAY_BUTTON" }, "OnrampPaymentLink": { "type": "object", "description": "A payment link to pay for an order.\n\nPlease refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/onramp-overview) for details on how to integrate with the different payment link types.", "properties": { "url": { "type": "string", "description": "The URL to the hosted widget the user should be redirected to. For certain payment link types you can append your  own redirect_url query parameter to this URL to ensure the user is redirected back to your app after the widget completes.", "example": "https://pay.coinbase.com/v2/api-onramp/apple-pay?sessionToken=MWYwNWQwODktZTZlYy02OTdlLTgzZTYtMTI3NzcyOWJhNjM3" }, "paymentLinkType": { "$ref": "#/components/schemas/OnrampPaymentLinkType" } }, "required": ["url", "paymentLinkType"] }, "OnrampQuotePaymentMethodTypeId": { "type": "string", "description": "The type of payment method used to generate the onramp quote.", "enum": ["CARD", "ACH", "APPLE_PAY", "PAYPAL", "FIAT_WALLET", "CRYPTO_WALLET"], "example": "CARD" }, "OnrampSession": { "type": "object", "description": "An onramp session containing a ready-to-use onramp URL.", "properties": { "onrampUrl": { "type": "string", "description": "Ready-to-use onramp URL.", "example": "https://pay.coinbase.com/buy?sessionToken=abc123F" } }, "required": ["onrampUrl"], "example": { "onrampUrl": "https://pay.coinbase.com/buy?sessionToken=abc123F" } }, "OnrampQuote": { "type": "object", "description": "Quote information with pricing details for the crypto purchase.", "properties": { "paymentTotal": { "type": "string", "description": "The total amount of fiat to be paid, inclusive of any fees.", "example": "100.75" }, "paymentSubtotal": { "type": "string", "description": "The amount of fiat to be converted to crypto.", "example": "100.00" }, "paymentCurrency": { "type": "string", "description": "The fiat currency to be converted to crypto.", "example": "USD" }, "purchaseAmount": { "type": "string", "description": "The amount of crypto to be purchased.", "example": "100.000000" }, "purchaseCurrency": { "type": "string", "description": "The crypto currency to be purchased.", "example": "USDC" }, "destinationNetwork": { "type": "string", "description": "The network to send the crypto on.", "example": "base" }, "fees": { "type": "array", "description": "The fees associated with the quote.", "items": { "$ref": "#/components/schemas/OnrampOrderFee" }, "example": [{ "type": "FEE_TYPE_EXCHANGE", "amount": "0.5", "currency": "USD" }, { "type": "FEE_TYPE_NETWORK", "amount": "0.25", "currency": "USD" }] }, "exchangeRate": { "type": "string", "description": "The exchange rate used to convert fiat to crypto i.e. the crypto value of one fiat.", "example": "1" } }, "required": ["paymentTotal", "paymentSubtotal", "paymentCurrency", "purchaseAmount", "purchaseCurrency", "destinationNetwork", "fees", "exchangeRate"], "example": { "paymentTotal": "100.75", "paymentSubtotal": "100.00", "paymentCurrency": "USD", "purchaseAmount": "100.000000", "purchaseCurrency": "USDC", "destinationNetwork": "base", "fees": [{ "type": "FEE_TYPE_EXCHANGE", "amount": "0.5", "currency": "USD" }, { "type": "FEE_TYPE_NETWORK", "amount": "0.25", "currency": "USD" }], "exchangeRate": "1" } } }, "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." } } } } } }, "InvalidSQLQueryError": { "description": "The underlying SQL string is invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "unsupported_query": { "value": { "errorType": "invalid_sql_query", "errorMessage": "INSERTs are not supported" } }, "invalid_sql": { "value": { "errorType": "invalid_sql_query", "errorMessage": "SQL syntax error: Invalid table name 'invalid_table'" } }, "query_too_long": { "value": { "errorType": "invalid_sql_query", "errorMessage": "Query exceeds maximum length of 10,000 characters" } } } } } }, "UnauthorizedError": { "description": "Unauthorized.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "unauthorized": { "value": { "errorType": "unauthorized", "errorMessage": "The request is not properly authenticated." } } } } } }, "TimedOutError": { "description": "The request timed out.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "timed_out": { "value": { "errorType": "timed_out", "errorMessage": "The request timed out because the server did not respond in time." } } } } } }, "x402VerifyResponse": { "description": "Successfully verified payment on the x402 protocol.", "content": { "application/json": { "schema": { "type": "object", "properties": { "isValid": { "type": "boolean", "description": "Indicates whether the payment is valid.", "example": false }, "invalidReason": { "$ref": "#/components/schemas/x402VerifyInvalidReason" }, "payer": { "type": "string", "description": "The onchain address of the client that is paying for the resource.\n\nFor EVM networks, the payer will be a 0x-prefixed, checksum EVM address.\n\nFor Solana-based networks, the payer will be a base58-encoded Solana address.", "pattern": "^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" } }, "required": ["isValid", "payer"] } } } }, "x402SettleResponse": { "description": "Successfully settled payment on the x402 protocol.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates whether the payment settlement is successful.", "example": false }, "errorReason": { "$ref": "#/components/schemas/x402SettleErrorReason" }, "payer": { "type": "string", "description": "The onchain address of the client that is paying for the resource.\n\nFor EVM networks, the payer will be a 0x-prefixed, checksum EVM address.\n\nFor Solana-based networks, the payer will be a base58-encoded Solana address.", "pattern": "^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "transaction": { "type": "string", "description": "The transaction of the settlement.\nFor EVM networks, the transaction will be a 0x-prefixed, EVM transaction hash.\nFor Solana-based networks, the transaction will be a base58-encoded Solana signature.", "pattern": "^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$", "example": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, "network": { "type": "string", "description": "The network where the settlement occurred.", "example": "base" } }, "required": ["success", "payer", "transaction", "network"] } } } }, "x402SupportedPaymentKindsResponse": { "description": "Successfully retrieved supported payment kinds for the x402 protocol.", "content": { "application/json": { "schema": { "type": "object", "properties": { "kinds": { "type": "array", "description": "The list of supported payment kinds.", "items": { "$ref": "#/components/schemas/x402SupportedPaymentKind" }, "example": [{ "x402Version": 1, "scheme": "exact", "network": "base" }, { "x402Version": 1, "scheme": "exact", "network": "base-sepolia" }, { "x402Version": 1, "scheme": "exact", "network": "solana" }, { "x402Version": 1, "scheme": "exact", "network": "solana-devnet" }] } }, "required": ["kinds"] } } } }, "RateLimitExceeded": { "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." } } } } } } }, "parameters": { "XWalletAuth": { "name": "X-Wallet-Auth", "in": "header", "required": true, "description": "A JWT signed using your Wallet Secret, encoded in base64. Refer to the\n[Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)\nsection of our Authentication docs for more details on how to generate your Wallet Token.\n", "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.\nWhen included, duplicate requests with the same key will return identical responses. \nRefer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.\n", "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" } } } }
