# Table of Contents
- [Swap | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#swap-api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [What is OKX OS | Introduction | WaaS Web3 API Docs | OKX](#what-is-okx-os-introduction-waas-web3-api-docs-okx)
- [What is Connecting Wallet | Introduction | Wallet Integration Web3 API Docs | OKX](#what-is-connecting-wallet-introduction-wallet-integration-web3-api-docs-okx)
- [Preparations | Introduction | WaaS Web3 API Docs | OKX](#preparations-introduction-waas-web3-api-docs-okx)
- [Introduction | Wallet API | WaaS Web3 API Docs | OKX](#introduction-wallet-api-waas-web3-api-docs-okx)
- [Transaction Broadcasting | Wallet API | WaaS Web3 API Docs | OKX](#transaction-broadcasting-wallet-api-waas-web3-api-docs-okx)
- [On-chain Information Query | Wallet API | WaaS Web3 API Docs | OKX](#on-chain-information-query-wallet-api-waas-web3-api-docs-okx)
- [Swap API | DEX API | WaaS Web3 API Docs | OKX](#swap-api-dex-api-waas-web3-api-docs-okx)
- [Signature SDK | Wallet API | WaaS Web3 API Docs | OKX](#signature-sdk-wallet-api-waas-web3-api-docs-okx)
- [Error codes | Swap API | DEX API | WaaS Web3 API Docs | OKX](#error-codes-swap-api-dex-api-waas-web3-api-docs-okx)
- [Introduction | DEX API | WaaS Web3 API Docs | OKX](#introduction-dex-api-waas-web3-api-docs-okx)
- [Limit order API | DEX API | WaaS Web3 API Docs | OKX](#limit-order-api-dex-api-waas-web3-api-docs-okx)
- [DEX Widget | DEX API | WaaS Web3 API Docs | OKX](#dex-widget-dex-api-waas-web3-api-docs-okx)
- [Resources | Wallet API | WaaS Web3 API Docs | OKX](#resources-wallet-api-waas-web3-api-docs-okx)
- [Build swap applications | DEX API | WaaS Web3 API Docs | OKX](#build-swap-applications-dex-api-waas-web3-api-docs-okx)
- [Quick Start | Wallet API | WaaS Web3 API Docs | OKX](#quick-start-wallet-api-waas-web3-api-docs-okx)
- [Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX](#wallet-account-management-wallet-api-waas-web3-api-docs-okx)
- [Get Supported Chains | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#get-supported-chains-api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [Query Transaction Status | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#query-transaction-status-api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [Supported Networks | Introduction | WaaS Web3 API Docs | OKX](#supported-networks-introduction-waas-web3-api-docs-okx)
- [API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [Get tokens | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#get-tokens-api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [Approve transactions | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#approve-transactions-api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [Adding Fees | Swap API | DEX API | WaaS Web3 API Docs | OKX](#adding-fees-swap-api-dex-api-waas-web3-api-docs-okx)
- [Smart contract | Swap API | DEX API | WaaS Web3 API Docs | OKX](#smart-contract-swap-api-dex-api-waas-web3-api-docs-okx)
- [Get quotes | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#get-quotes-api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [Get liquidity sources | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#get-liquidity-sources-api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX](#dex-cross-chain-dex-api-waas-web3-api-docs-okx)
- [Get Solana swap instructions | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX](#get-solana-swap-instructions-api-reference-swap-api-dex-api-waas-web3-api-docs-okx)
- [Webhook | Wallet API | WaaS Web3 API Docs | OKX](#webhook-wallet-api-waas-web3-api-docs-okx)
- [Dex-integration | Swap API | DEX API | WaaS Web3 API Docs | OKX](#dex-integration-swap-api-dex-api-waas-web3-api-docs-okx)
- [Introduction | Marketplace API | WaaS Web3 API Docs | OKX](#introduction-marketplace-api-waas-web3-api-docs-okx)
- [FAQ | Swap API | DEX API | WaaS Web3 API Docs | OKX](#faq-swap-api-dex-api-waas-web3-api-docs-okx)
- [Runes API | Marketplace API | WaaS Web3 API Docs | OKX](#runes-api-marketplace-api-waas-web3-api-docs-okx)
- [API reference | Marketplace API | WaaS Web3 API Docs | OKX](#api-reference-marketplace-api-waas-web3-api-docs-okx)
- [Fractal Ordinals API | Marketplace API | WaaS Web3 API Docs | OKX](#fractal-ordinals-api-marketplace-api-waas-web3-api-docs-okx)
- [Ordinals API | Marketplace API | WaaS Web3 API Docs | OKX](#ordinals-api-marketplace-api-waas-web3-api-docs-okx)
- [Error codes | Marketplace API | WaaS Web3 API Docs | OKX](#error-codes-marketplace-api-waas-web3-api-docs-okx)
- [Quickstart | DeFi API | WaaS Web3 API Docs | OKX](#quickstart-defi-api-waas-web3-api-docs-okx)
- [API reference | DeFi API | WaaS Web3 API Docs | OKX](#api-reference-defi-api-waas-web3-api-docs-okx)
- [Introduction | DeFi API | WaaS Web3 API Docs | OKX](#introduction-defi-api-waas-web3-api-docs-okx)
- [Error code | DeFi API | WaaS Web3 API Docs | OKX](#error-code-defi-api-waas-web3-api-docs-okx)
- [FAQ | DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX](#faq-dex-cross-chain-dex-api-waas-web3-api-docs-okx)
- [Apply to display DApps | More resources | WaaS Web3 API Docs | OKX](#apply-to-display-dapps-more-resources-waas-web3-api-docs-okx)
- [App Universal Link | More resources | WaaS Web3 API Docs | OKX](#app-universal-link-more-resources-waas-web3-api-docs-okx)
- [View chainIndex | Resources | Wallet API | WaaS Web3 API Docs | OKX](#view-chainindex-resources-wallet-api-waas-web3-api-docs-okx)
- [Bitcoin-compatible chain | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX](#bitcoin-compatible-chain-connect-to-app-or-mini-wallet-wallet-integration-web3-api-docs-okx)
- [OKX Web3 Build User Agreement | More resources | WaaS Web3 API Docs | OKX](#okx-web3-build-user-agreement-more-resources-waas-web3-api-docs-okx)
- [General specification | More resources | WaaS Web3 API Docs | OKX](#general-specification-more-resources-waas-web3-api-docs-okx)
- [Update Account | Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX](#update-account-wallet-account-management-wallet-api-waas-web3-api-docs-okx)
- [Definitions | Resources | Wallet API | WaaS Web3 API Docs | OKX](#definitions-resources-wallet-api-waas-web3-api-docs-okx)
- [Building a Web3 Wallet | Quick Start | Wallet API | WaaS Web3 API Docs | OKX](#building-a-web3-wallet-quick-start-wallet-api-waas-web3-api-docs-okx)
- [Preparation | Quick Start | Wallet API | WaaS Web3 API Docs | OKX](#preparation-quick-start-wallet-api-waas-web3-api-docs-okx)
- [Build Inscription Wallet | Quick Start | Wallet API | WaaS Web3 API Docs | OKX](#build-inscription-wallet-quick-start-wallet-api-waas-web3-api-docs-okx)
- [Use swap API | Build swap applications | DEX API | WaaS Web3 API Docs | OKX](#use-swap-api-build-swap-applications-dex-api-waas-web3-api-docs-okx)
- [Subscribe Data | Webhook | Wallet API | WaaS Web3 API Docs | OKX](#subscribe-data-webhook-wallet-api-waas-web3-api-docs-okx)
- [Solana-compatible chain | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX](#solana-compatible-chain-connect-to-app-or-mini-wallet-wallet-integration-web3-api-docs-okx)
- [Ton | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX](#ton-connect-to-app-or-mini-wallet-wallet-integration-web3-api-docs-okx)
- [Create Account | Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX](#create-account-wallet-account-management-wallet-api-waas-web3-api-docs-okx)
- [Building an On-Chain Data Dashboard | Quick Start | Wallet API | WaaS Web3 API Docs | OKX](#building-an-on-chain-data-dashboard-quick-start-wallet-api-waas-web3-api-docs-okx)
- [Sui | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX](#sui-connect-to-app-or-mini-wallet-wallet-integration-web3-api-docs-okx)
- [Delete Account | Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX](#delete-account-wallet-account-management-wallet-api-waas-web3-api-docs-okx)
- [Supported bridges | DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX](#supported-bridges-dex-cross-chain-dex-api-waas-web3-api-docs-okx)
- [Changelog | More resources | WaaS Web3 API Docs | OKX](#changelog-more-resources-waas-web3-api-docs-okx)
- [Smart contract | DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX](#smart-contract-dex-cross-chain-dex-api-waas-web3-api-docs-okx)
- [Use crosschain API | Build swap applications | DEX API | WaaS Web3 API Docs | OKX](#use-crosschain-api-build-swap-applications-dex-api-waas-web3-api-docs-okx)
- [Tron | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX](#tron-connect-to-app-or-mini-wallet-wallet-integration-web3-api-docs-okx)
- [Aptos | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX](#aptos-connect-to-app-or-mini-wallet-wallet-integration-web3-api-docs-okx)
- [Cosmos | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX](#cosmos-connect-to-app-or-mini-wallet-wallet-integration-web3-api-docs-okx)
- [Get Accounts | Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX](#get-accounts-wallet-account-management-wallet-api-waas-web3-api-docs-okx)
- [Unsubscribe Data | Webhook | Wallet API | WaaS Web3 API Docs | OKX](#unsubscribe-data-webhook-wallet-api-waas-web3-api-docs-okx)
- [API reference | DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX](#api-reference-dex-cross-chain-dex-api-waas-web3-api-docs-okx)
- [Get Popular collections | Runes API | Marketplace API | WaaS Web3 API Docs | OKX](#get-popular-collections-runes-api-marketplace-api-waas-web3-api-docs-okx)
---
# Swap | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
Swap
Swap[#](#swap)
===============
Generate the data to call the OKX DEX router to execute a swap.
Note
In Uni v3 pools, the following scenario may occur:
If the liquidity for the desired token pair in the pool is depleted, the pool will only consume part of the payment token, leaving a remainder.
As a fully decentralized smart contract, the OKX DEX Router will automatically refund the remainder.
During your integration, please ensure compatibility with this scenario by configuring your contract to support token refunds, thereby ensuring a smooth user experience.
### Request address[#](#request-address)
GET `https://www.okx.com/api/v5/dex/aggregator/swap`
### Request param[#](#request-param)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| chainId | String | Yes | Chain ID (e.g., `1` for Ethereum. See [Chain IDs](/web3/build/docs/waas/walletapi-resources-supported-networks)
) |
| amount | String | Yes | The input amount of a token to be sold
(set in minimal divisible units, e.g., 1.00 USDT set as 1000000, 1.00 DAI set as 1000000000000000000), you could get the minimal divisible units from [Tokenlist](/web3/build/docs/waas/dex-get-tokens)
. |
| fromTokenAddress | String | Yes | The contract address of a token you want to send (e.g.,`0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`) |
| toTokenAddress | String | Yes | The contract address of a token you want to receive (e.g.,`0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48`) |
| slippage | String | Yes | Slippage limit.
Note:
1\. For EVM networks, the slippage setting has a minimum value of `0` and a maximum value of `1`.
2\. For Solana, the slippage setting has a minimum value of `0` and a maximum value of less than `1`.
(For example: `0.005` means that the maximum slippage for this transaction is `0.5%`, while `1` means that the maximum slippage of this transaction is `100%`.) |
| userWalletAddress | String | Yes | User's wallet address (e.g.,`0x3f6a3f57569358a512ccc0e513f171516b0fd42a`) |
| swapReceiverAddress | String | No | Recipient address of a purchased token if not set, `userWalletAddress` will receive a purchased token (e.g.,`0x3f6a3f57569358a512ccc0e513f171516b0fd42a`) |
| feePercent | String | No | The percentage of fromTokenAmount or toTokenAmount will be sent to the referrer’s address, the rest will be set as the input amount to be sold. `Min percentage: 0`. `Max percentage: 3`.
Maximum 2 decimal points. Longer sections will be automatically omitted. (E.g. 1.326% is the actual input, but the final calculation will only adopt 1.32%.) |
| fromTokenReferrerWalletAddress | String | No | The wallet address to receive the commission fee from the `fromToken`.
When using the API, you need to configure the commission ratio using `feePercent`.
Each transaction can only choose commission from either the `fromToken` or the `toToken`.
Note:
1\. For **EVM chains**: Transactions involving wrapped pairs, such as ETH and WETH, are not supported here.
2\. For **Solana chain**: The commission address must have some SOL deposited in advance for activation. |
| toTokenReferrerWalletAddress | String | No | The wallet address to receive the commission fee from the `toToken`.
When using the API, you need to configure the commission ratio using `feePercent`.
Each transaction can only choose commission from either the `fromToken` or the `toToken`.
Note:
1\. For **EVM chains**: Transactions involving wrapped pairs, such as ETH and WETH, are not supported here.
2\. For **Solana chain**: The commission address must have some SOL deposited in advance for activation. |
| enablePositiveSlippage | Boolean | No | The default setting is false. The positive slippage revenue will be sent to userWalletAddress in default. When enabled, the positive slippage revenue will be sent to the referrer’s address |
| gaslimit | String | No | (Optional, The gas (in wei) for the swap transaction. If the value is too low to achieve the quote, an error will be returned |
| gasLevel | String | No | (Optional, defaults to `average`) The target gas price level for the swap transaction,set to `average` or `fast` or `slow` |
| dexIds | String | No | DexId of the liquidity pool for limited quotes, multiple combinations separated by `,` (e.g., `1,50,180`, see liquidity list for more) |
| directRoute | Boolean | No | The default setting is false. When enabled, Direct Routes restrict our routing to a single liquidity pool only. Currently, this feature is only active for Solana swaps. |
| priceImpactProtectionPercentage | String | No | (Optional. The default is 90%.) The percentage (between 0 - 1.0) of the price impact allowed.
When the priceImpactProtectionPercentage is set, if the estimated price impact is above the percentage indicated, an error will be returned. For example, if PriceImpactProtectionPercentage = .25 (25%), any quote with a price impact higher than 25% will return an error.
This is an **optional** feature, and the default value is 0.9. When it’s set to 1.0 (100%), the feature will be disabled, which means that every transaction will be allowed to pass.
**Note:** If we’re unable to calculate the price impact, we’ll return null, and the price impact protection will be disabled. |
| callDataMemo | String | No | You can customize the parameters to be sent on the blockchain in callData by encoding the data into a 128-character 64-bytes hexadecimal string. For example, the string “0x...111” needs to keep the “0x” at its start. |
| computeUnitPrice | String | No | Used for transactions on the Solana network and similar to gasPrice on Ethereum. This price determines the priority level of the transaction. The higher the price, the more likely that the transaction can be processed faster. |
| computeUnitLimit | String | No | Used for transactions on the Solana network and analogous to gasLimit on Ethereum, which ensures that the transaction won’t take too much computing resource. |
| autoSlippage | Boolean | No | Default is false. When set to true, the original slippage (if set) will be covered by the autoSlippage and the API will calculate and return auto slippage recommendations based on current market data. |
| maxAutoSlippage | String | No | When autoSlippage is set to true, this value is the maximum auto slippage returned by the API. We recommend that users adopt this value to ensure risk control. |
### Response param[#](#response-param)
| Parameter | Type | Description |
| --- | --- | --- |
| _**routerResult**_ | _**Object**_ | _**Quote path data**_ |
| chainId | String | Chain ID (e.g., `1` for Ethereum. See [Chain IDs](/web3/build/docs/waas/walletapi-resources-supported-networks)
) |
| fromTokenAmount | String | The input amount of a token to be sold ( e.g.,`500000000000000000000000`) |
| toTokenAmount | String | The resulting amount of a token to be bought ( e.g.,`168611907733361`) |
| tradeFee | String | Estimated network fee (USD) of the quote route |
| estimateGasFee | String | Estimated gas consumption is returned in the smallest units of each chain, such as wei. |
| _**dexRouterList**_ | _**Array**_ | _**Quote path data set**_ |
| router | String | One of the main paths for the token swap |
| routerPercent | String | The percentage of assets handled by the main path (e.g.,`5`) |
| _**subRouterList**_ | _**Array**_ | _**Quote path sub data set**_ |
| _**dexProtocol**_ | _**Array**_ | _**Liquidity protocols used on the main path**_ |
| dexName | String | The name of the liquidity protocol (e.g.,`Verse`) |
| percent | String | The percentage of assets handled by the protocol (e.g.,`100`) |
| _**fromToken**_ | _**Object**_ | _**The information of a token to be sold**_ |
| tokenContractAddress | String | Token contract address (e.g.,`0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48`) |
| tokenSymbol | String | Token symbol (e.g.,`USDC`) |
| tokenUnitPrice | String | The token unit price returned by this interface is a general USDis a general USD real time price based on data from on-chain sources. Note: This price is only a recommended price. For some special cases, the token unit price may be 'null' |
| decimal | String | The decimal number defines the smallest unit into which a single currency token can be divided. For example, if the decimal number of a token is 8, it means that a single such token can be divided into 100,000,000 of its smallest units. _**Note: This parameter is for reference only. It may change due to reasons such as settings adjustments by the contract owner.**_ |
| isHoneyPot | Boolean | If the token is a honeypot token. `yes:true` `no:false` |
| taxRate | String | Token tax rate for selling: Applicable to tokens with configurable tax mechanisms (e.g., SafeMoon, SPL2022 tokens). Returns 0 for regular tokens without tax. The value ranges from 0 to 1, where 0.01 represents 1%. |
| _**toToken**_ | _**Object**_ | _**The information of a token to be bought**_ |
| tokenContractAddress | String | Token contract address (e.g.,`0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48`) |
| tokenSymbol | String | Token symbol (e.g.,`USDC`) |
| tokenUnitPrice | String | The token unit price returned by this interface is a general USD price based on data from on-chain, exchange, and other third-party sources. Note: This price is only a recommended price. For some special cases, the token unit price may be 'null' |
| decimal | String | The decimal number defines the smallest unit into which a single currency token can be divided. For example, if the decimal number of a token is 8, it means that a single such token can be divided into 100,000,000 of its smallest units. _**Note: This parameter is for reference only. It may change due to reasons such as settings adjustments by the contract owner.**_ |
| isHoneyPot | Boolean | If the token is a honeypot token. `yes:true` `no:false` |
| taxRate | String | Token tax rate for buying: Applicable to tokens with configurable tax mechanisms (e.g., SafeMoon, SPL2022 tokens). Returns 0 for regular tokens without tax. The value ranges from 0 to 1, where 0.01 represents 1%. |
| _**quoteCompareList**_ | _**Array**_ | _**Comparison of quote routes**_ |
| dexName | String | DEX name of the quote route |
| dexLogo | String | DEX logo of the quote route |
| tradeFee | String | Estimated network fee (USD) of the quote route |
| amountOut | String | Received amount of the quote route |
| priceImpactPercentage | String | Percentage = (Received value – Paid value) / Paid value. The swap amount will affect the depth of the liquidity pool, causing a value difference. This percentage can be positive if the received value exceeds the paid value. |
| _**tx**_ | _**Object**_ | _**contract data model**_ |
| signatureData | _**Array**_ | If this parameter is returned, it indicates that the transaction requires additional signing data. Developers should use this parameter as one of the inputs for the transaction signature and ensure it is correctly applied during the signing process. |
| from | String | User's wallet address (e.g.,`0x3f6a3f57569358a512ccc0e513f171516b0fd42a`) |
| gas | String | estimated amount of the gas limit, increase this value by 50% (e.g.,`1173250`) |
| gasPrice | String | Gas price in wei (e.g.,`58270000000`) |
| maxPriorityFeePerGas | String | EIP-1559: Recommended priority cost of gas per unit (e.g.,`500000000`) |
| to | String | The contract address of OKX DEX router (e.g.,`0x3b3ae790Df4F312e745D270119c6052904FB6790`) |
| value | String | The amount of native tokens (in wei) that will be sent to the contract address (e.g.,`0`) |
| minReceiveAmount | String | The minimum amount of a token to buy when the price reaches the upper limit of slippage (e.g.,`900645839798`) |
| data | String | Call data |
| slippage | String | The value of current transaction slippage |
[DEX API\
\
Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[DEX API\
\
Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
### Request example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/swap?chainId=1&amount=10000000000000&toTokenAddress=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&fromTokenAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&slippage=0.05&userWalletAddress=0x6f9ffea7370310cd0f890dfde5e0e061059dcfb8' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
### Response example[#](#response-example)
200
{
"code": "0",
"data": [\
{\
"routerResult": {\
"chainId": "1",\
"dexRouterList": [\
{\
"router": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee--0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",\
"routerPercent": "100",\
"subRouterList": [\
{\
"dexProtocol": [\
{\
"dexName": "Uniswap V3",\
"percent": "100"\
}\
],\
"fromToken": {\
"decimal": "18",\
"isHoneyPot": false,\
"taxRate": "0",\
"tokenContractAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",\
"tokenSymbol": "WETH",\
"tokenUnitPrice": "3342.87"\
},\
"toToken": {\
"decimal": "6",\
"isHoneyPot": false,\
"taxRate": "0",\
"tokenContractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",\
"tokenSymbol": "USDC",\
"tokenUnitPrice": "0.9995"\
}\
}\
]\
}\
],\
"estimateGasFee": "135000",\
"fromToken": {\
"decimal": "18",\
"isHoneyPot": false,\
"taxRate": "0",\
"tokenContractAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",\
"tokenSymbol": "ETH",\
"tokenUnitPrice": "3342.87"\
},\
"fromTokenAmount": "10000000000000",\
"priceImpactPercentage": "0.001",\
"quoteCompareList": [\
{\
"amountOut": "32990",\
"dexLogo": "https://static.okx.com/cdn/wallet/logo/balancer.png",\
"dexName": "Balancer V1",\
"tradeFee": "44.32919149271585462"\
},\
{\
"amountOut": "334",\
"dexLogo": "https://static.okx.com/cdn/wallet/logo/DODO.png",\
"dexName": "DODO",\
"tradeFee": "36.96825563599181972"\
},\
{\
"amountOut": "33023",\
"dexLogo": "https://static.okx.com/cdn/wallet/logo/balancer.png",\
"dexName": "Balancer V2",\
"tradeFee": "19.79273863696907162"\
},\
{\
"amountOut": "32980",\
"dexLogo": "https://static.okx.com/cdn/explorer/dex/logo/Dex_Sushiswap_V3.png",\
"dexName": "Sushiswap V3",\
"tradeFee": "15.70332982767794112"\
},\
{\
"amountOut": "32964",\
"dexLogo": "https://static.okx.com/cdn/wallet/logo/SHIB.png",\
"dexName": "ShibaSwap",\
"tradeFee": "15.70332982767794112"\
}\
],\
"toToken": {\
"decimal": "6",\
"isHoneyPot": false,\
"taxRate": "0",\
"tokenContractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",\
"tokenSymbol": "USDC",\
"tokenUnitPrice": "0.9995"\
},\
"toTokenAmount": "33474",\
"tradeFee": "4.3491690602723664"\
},\
"tx": {\
"data": "0x0d5f0e3b00000000000000000001881f6f9ffea7370310cd0f890dfde5e0e061059dcfb8000000000000000000000000000000000000000000000000000009184e72a0000000000000000000000000000000000000000000000000000000000000007c3800000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001800000000000000000000000e0554a476a092703abdb3ef35c80e0d76d32939f",\
"from": "0x6f9ffea7370310cd0f890dfde5e0e061059dcfb8",\
"gas": "202500",\
"gasPrice": "32657616776",\
"maxPriorityFeePerGas": "2086453233",\
"minReceiveAmount": "31800",\
"signatureData": [\
""\
],\
"to": "0x7D0CcAa3Fac1e5A943c5168b6CEd828691b46B36",\
"value": "10000000000000"\
}\
}\
],
"msg": ""
}
[DEX API\
\
Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[DEX API\
\
Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
---
# What is OKX OS | Introduction | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Introduction
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Introduction
What is OKX OS
What is OKX OS[#](#what-is-okx-os)
===================================
OKX OS is a comprehensive Web3 development solution that standardizes the integration of public chains and protocols, significantly reducing development time and costs. It covers four major scenarios: Wallet, DEX, Marketplace, and DeFi.
**OKX OS offers the most powerful data querying capabilities, deeply analyzing asset data, transaction history, project information, and more.** It supports over 60 networks, including EVM, UTXO, Solana, TON, TRON, and cutting-edge ecosystems like inscriptions.
If you are looking to build your own Web3 service, adopting OKX OS will be a more efficient and cost-effective choice.
[Wallet API\
\
On-chain data query, wallet account management, transaction broadcasting](../waas/walletapi-introduction)
[DEX API\
\
Swap, cross-chain, aggregate multi-platform liquidity](../waas/dex-introduction)
[Marketplace API\
\
NFT creation and trading, NFT data query, aggregate multi-platform liquidity](../waas/marketplace-introduction)
[DeFi API\
\
DeFi information query, staking, and redemption](../waas/defi-quickstart-overview)
For more Web3 workflows and basic principles, you can view the technical architecture:
[Introduction\
\
Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
---
# What is Connecting Wallet | Introduction | Wallet Integration Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
[Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
Connect to App or Mini Wallet
[Connection Prerequisites](/web3/build/docs/sdks/app-connect-preparation)
[EVM-Compatible Chains](/web3/build/docs/sdks/app-connect-evm)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/app-connect-bitcoin)
[Solana-Compatible Chains](/web3/build/docs/sdks/app-connect-solana)
[TON](/web3/build/docs/sdks/app-connect-ton)
[SUI](/web3/build/docs/sdks/app-connect-sui)
[Aptos/Movement](/web3/build/docs/sdks/app-connect-aptos)
[Cosmos/Sei](/web3/build/docs/sdks/app-connect-cosmos)
[Tron](/web3/build/docs/sdks/app-connect-tron)
[Starknet](/web3/build/docs/sdks/app-connect-starknet)
[Troubleshooting](/web3/build/docs/sdks/app-connect-faq)
Connect to Extension Wallet
[Preparation](/web3/build/docs/sdks/web-detect-okx-wallet)
[EVM Compatible Chains](/web3/build/docs/sdks/chains/evm/introduce)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/chains/bitcoin/introduce)
[Tron](/web3/build/docs/sdks/chains/tron/introduce)
[Solana-Compatible Chains](/web3/build/docs/sdks/chains/solana/introduce)
[TON](/web3/build/docs/sdks/chains/ton/introduce)
[Aptos/Movement](/web3/build/docs/sdks/chains/aptos/introduce)
[Cosmos/Sei](/web3/build/docs/sdks/chains/cosmos/introduce)
[SUI](/web3/build/docs/sdks/chains/sui/introduce)
[Stacks](/web3/build/docs/sdks/chains/stacks/introduce)
[Starknet](/web3/build/docs/sdks/chains/starknet/introduce)
[Cardano](/web3/build/docs/sdks/chains/cardano/introduce)
[Nostr](/web3/build/docs/sdks/chains/nostr/introduce)
[NEAR](/web3/build/docs/sdks/chains/near/introduce)
[WAX](/web3/build/docs/sdks/chains/wax/introduce)
[Display DApp icon](/web3/build/docs/sdks/web-display-dapp-icon)
Introduction
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
What is Connecting Wallet
What is Connecting Wallet[#](#what-is-connecting-wallet)
=========================================================
In a DApp, adding a "Connect OKX Wallet" button allows interaction with the OKX Wallet.
OKX Wallet comes in various forms and currently supports:
1. App Wallet
2. Browser Extension Wallet
3. Mini Wallet: Telegram built-in mini program
DApps can choose the appropriate connection method:
[Connect App or Mini Wallet\
\
Suitable for DApp operations in Telegram or mobile browser. You can choose to launch the OKX App or Telegram Mini Wallet.](./app-connect-preparation)
[Connect Browser Extension Wallet\
\
Suitable for DApp operations in PC browser. Also compatible with the DApp browser built into the OKX App.](./web-detect-okx-wallet)
**Please note that you can choose between UI SDK and ProviderAPI when accessing. It is recommended to choose UI SDK for one-time access and multi-end compatibility.**
[More resources\
\
OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
[Introduction\
\
Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
---
# Preparations | Introduction | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Use the developer portal](/web3/build/docs/waas/introduction-to-developer-portal-interface)
[REST API authentication](/web3/build/docs/waas/rest-authentication)
[Node.js environment Settings](/web3/build/docs/waas/nodejs-environment)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Introduction
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Introduction
Preparations
Preparation[#](#preparation)
=============================
This section introduces the prerequisite steps for integrating with OKX OS, as well as authentication and environment configuration.
[Use the developer portal\
\
Create your project and API Key](/web3/build/docs/waas/introduction-to-developer-portal-interface)
[Configuration\
\
Call the API interface configuration premise](/web3/build/docs/waas/rest-authentication)
[General specification\
\
Introduce interface design and usage specifications](/web3/build/docs/waas/okx-waas-standard)
[Introduction\
\
What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Introduction\
\
Use the developer portal](/web3/build/docs/waas/introduction-to-developer-portal-interface)
---
# Introduction | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
Introduction
Introduction[#](#introduction)
===============================
Wallet API offers a non-custodial wallet-centric underlying technology solution that you can flexibly use to build the on-chain services and applications.
Service Scope[#](#service-scope)
---------------------------------
The Wallet API mainly includes the following modules:
**1\. Address and Account Creation**
**2\. On-chain Asset and Coin Price Query, supporting:**
* Native public chain tokens: e.g., ETH on Ethereum
* Contract tokens: e.g., ERC-20, BEP-20
**3\. Transaction-related functionalities, such as composing, signing, broadcasting, tracking, and history queries, supporting:**
* Transactions on account model networks like EVM
* Transactions on UTXO model networks like BTC
**4\. Other commonly used data, such as token information, gas prices, contract approval information, etc.**
Application Scenarios[#](#application-scenarios)
-------------------------------------------------
Based on the above capabilities, you can build the following applications:
**1\. Web3 Multi-chain Wallet**, [supporting 60+ public chains](/web3/build/docs/waas/wallet-supported-networks)
**2\. DApp Embedded Wallet**
**3\. Multi-chain Web3 Applications**
**4\. Exchange Wallet**
Or other possible products and applications. If you want to use our services to build new product categories, feel free to join us on [Discord](https://discord.gg/JBYgQxuyeu)
to talk with us.
[Introduction\
\
Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
[Wallet API\
\
Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
Table of contents
[Service Scope](#service-scope)
[Application Scenarios](#application-scenarios)
---
# Transaction Broadcasting | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Pre-Transaction Information](/web3/build/docs/waas/walletapi-api-intro-pre-transaction)
[Transaction Broadcast](/web3/build/docs/waas/walletapi-api-send-transaction)
[Transaction Order](/web3/build/docs/waas/walletapi-api-order-id-transaction-list)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
Transaction Broadcasting
Transaction Broadcasting[#](#transaction-broadcasting)
=======================================================
The Transaction Broadcasting API interface provides services for obtaining signature data, broadcasting transactions, and tracking transactions after they are sent.
[Get Transaction Information\
\
Obtain signature data, gas network fees, nonce, and other related information](/web3/build/docs/waas/walletapi-api-intro-pre-transaction)
[Transaction Broadcasting\
\
Broadcast transactions and set related broadcasting strategies](/web3/build/docs/waas/walletapi-api-send-transaction)
[Query Broadcasted Transactions\
\
Check the status of transactions after broadcasting](/web3/build/docs/waas/walletapi-api-intro-post-transaction-data-api)
[Wallet API\
\
Get Addresses Under Account](/web3/build/docs/waas/walletapi-api-account-detail)
[Wallet API\
\
Pre-Transaction Information](/web3/build/docs/waas/walletapi-api-intro-pre-transaction)
---
# On-chain Information Query | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Supported Blockchains](/web3/build/docs/waas/walletapi-api-get-supported-blockchain)
[Coin Prices and Project Information](/web3/build/docs/waas/walletapi-api-intro-tokendata)
[Get Asset by Address](/web3/build/docs/waas/walletapi-api-intro-asset-address)
[Get Asset by Account](/web3/build/docs/waas/walletapi-api-intro-asset-account)
[Transaction History](/web3/build/docs/waas/walletapi-api-intro-post-transaction-data-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
On-chain Information Query
On-Chain Information Query[#](#on-chain-information-query)
===========================================================
The on-chain information query provides core data API interfaces related to Web3 development, including chain data, asset data, coin prices and project information, transaction history, and authorization data.
[Supported Blockchains\
\
Provides information on blockchain networks supported by the wallet API](/web3/build/docs/waas/api-get-supported-blockchain)
[Coin Prices and Project Information\
\
Query historical and real-time coin prices, as well as project information for cryptocurrencies](/web3/build/docs/waas/walletapi-api-intro-tokendata)
[Asset Query by Address\
\
Query asset details at the address level](/web3/build/docs/waas/walletapi-api-intro-asset-address)
[Asset Query by Account\
\
Query asset details at the account level](/web3/build/docs/waas/walletapi-api-intro-asset-account)
[Transaction History\
\
Query transaction summaries and detailed transaction data for any address, including inscription transaction details](/web3/build/docs/waas/walletapi-api-intro-post-transaction-data-api)
[Wallet API\
\
Building a Web3 Wallet](/web3/build/docs/waas/walletapi-quickstart-multi-chain)
[Wallet API\
\
Supported Blockchains](/web3/build/docs/waas/walletapi-api-get-supported-blockchain)
---
# Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
Swap API
Swap API[#](#swap-api)
=======================
[API reference\
\
DEX aggregation API reference](/web3/build/docs/waas/dex-api-reference)
[Smart contract\
\
Swap API smart contracts](/web3/build/docs/waas/dex-smart-contract)
[Error codes\
\
Swap API error codes](/web3/build/docs/waas/dex-error-code)
[FAQ\
\
Swap API FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[DEX API\
\
Build limit order applications](/web3/build/docs/waas/dex-limit-order-quick-start)
[DEX API\
\
API reference](/web3/build/docs/waas/dex-api-reference)
---
# Signature SDK | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Javascript Signing SDK](/web3/build/docs/waas/private-key-wallet-javascript-sdk)
[Go Signing SDK](/web3/build/docs/waas/private-key-wallet-go-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
Signature SDK
Signing SDK[#](#signing-sdk)
=============================
[Javascript Signing SDK](/web3/build/docs/waas/private-key-wallet-javascript-sdk)
[Go Signing SDK](/web3/build/docs/waas/private-key-wallet-go-sdk)
[Wallet API\
\
Subscription List](/web3/build/docs/waas/walletapi-api-webhook-get-subscriptions)
[Wallet API\
\
Javascript Signing SDK](/web3/build/docs/waas/private-key-wallet-javascript-sdk)
---
# Error codes | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
Error codes
Error codes[#](#error-codes)
=============================
| Code | HTTP status | Message |
| --- | --- | --- |
| 0 | 200 | Succeeded |
| 50011 | 429 | Rate limit reached. Please refer to API documentation and throttle requests accordingly |
| 50014 | 400 | Parameter {param0} cannot be empty |
| 50026 | 500 | System error. Try again later |
| 50103 | 401 | Request header "OK-ACCESS-KEY" cannot be empty |
| 50104 | 401 | Request header "OK-ACCESS-PASSPHRASE" cannot be empty |
| 50105 | 401 | Request header "OK-ACCESS-PASSPHRASE" incorrect |
| 50106 | 401 | Request header "OK-ACCESS-SIGN" cannot be empty |
| 50107 | 401 | Request header "OK-ACCESS-TIMESTAMP" cannot be empty |
| 50111 | 401 | Invalid OK-ACCESS-KEY |
| 50112 | 401 | Invalid OK-ACCESS-TIMESTAMP |
| 50113 | 401 | Invalid signature |
| 51000 | 400 | Parameter {param0} error |
| 80000 | 200 | Repeated request |
| 80001 | 200 | CallData exceeds the maximum limit. Try again in 5 minutes. |
| 80002 | 200 | Requested token Object count has reached the limit. |
| 80003 | 200 | Requested native token Object count has reached the limit. |
| 80004 | 200 | Timeout when querying SUI Object. |
| 80005 | 200 | Not enough Sui objects under the address for swapping |
| 82000 | 200 | Insufficient liquidity |
| 82001 | 500 | The commission service is not available during the upgrade |
| 82102 | 200 | Less than the minimum quantity limit,the minimum amount is {0} |
| 82103 | 200 | Exceeds than the maximum quantity limit,the maximum amount is {0} |
| 82104 | 200 | This token is not supported |
| 82105 | 200 | This chain is not supported |
| 82112 | 200 | The value difference from this transaction’s quote route is higher than {num}, which may cause asset loss,The default value is 90%. It can be adjusted using the string priceImpactProtectionPercentage. |
| 82116 | 200 | callData exceeds the maximum limit. Try again in 5 minutes. |
| 82120 | 200 | Detected honeypot tokens or high-risk tokens with a 100% buy/sell tax. Transactions have been intercepted. |
| 82130 | 200 | The chain does not require authorized transactions and can be exchanged directly. |
[DEX API\
\
Smart contract](/web3/build/docs/waas/dex-smart-contract)
[DEX API\
\
FAQ](/web3/build/docs/waas/dex-aggregation-faq)
---
# Introduction | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Swap API](/web3/build/docs/waas/dex-aggregation-process)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-swap-process)
[Limit order API](/web3/build/docs/waas/dex-limit-order-process)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
Introduction
Introduction[#](#introduction)
===============================
Welcome to OKX DEX’s developer documentation. OKX DEX is an all-in-one trading aggregator for multi-chain and cross-chain transactions. You can use it to build the Web3 trading services and applications you need, suitable for various scenarios such as Web3 wallets, DApp projects, and DeFi projects.
### Multi-chain support[#](#multi-chain-support)
We support 20 networks, including EVM networks, Solana, TRON, and other networks.
### Aggregating multiple cross-chain bridges and DEXs[#](#aggregating-multiple-cross-chain-bridges-and-dexs)
We aggregate 18 cross-chain bridges, including third-party bridges and official bridges, to guarantee optimal received token amounts. We aggregate over 400 decentralized exchanges, providing the best quotes.
### Stability and high availability[#](#stability-and-high-availability)
Our API response time is within 100 milliseconds, while fetching optimal quote routes completely free of charge.
[Swap API\
\
Swap](/web3/build/docs/waas/dex-aggregation-process)
[Cross-chain API\
\
Cross-chain](/web3/build/docs/waas/dex-crosschain-swap-process)
[Limit order API\
\
Limit order](/web3/build/docs/waas/dex-limit-order-process)
[Wallet API\
\
Error Codes](/web3/build/docs/waas/walletapi-resources-errorcode)
[DEX API\
\
Swap API](/web3/build/docs/waas/dex-aggregation-process)
---
# Limit order API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[API reference](/web3/build/docs/waas/dex-limit-order-reference)
[Smart contract](/web3/build/docs/waas/dex-limit-order-smart-contract)
[Error codes](/web3/build/docs/waas/dex-limit-order-error-code)
[FAQ](/web3/build/docs/waas/dex-limit-order-faq)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
Limit order API
Limit order API[#](#limit-order-api)
=====================================
[API reference\
\
Limit order API reference](/web3/build/docs/waas/dex-limit-order-reference)
[Smart contract\
\
Limit order API smart contracts](/web3/build/docs/waas/dex-limit-order-smart-contract)
[Error codes\
\
Limit order API error codes](/web3/build/docs/waas/dex-limit-order-error-code)
[FAQ\
\
Limit order API FAQ](/web3/build/docs/waas/dex-limit-order-faq)
[DEX API\
\
FAQ](/web3/build/docs/waas/dex-crosschain-faq)
[DEX API\
\
API reference](/web3/build/docs/waas/dex-limit-order-reference)
---
# DEX Widget | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
[Use Widget](/web3/build/docs/waas/dex-widget)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
DEX Widget
DEX Widget[#](#dex-widget)
===========================
[Use Widget\
\
Quick guide for DEX Widget](/web3/build/docs/waas/dex-widget)
[DEX API\
\
FAQ](/web3/build/docs/waas/dex-limit-order-faq)
[DEX API\
\
Use Widget](/web3/build/docs/waas/dex-widget)
---
# Resources | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
[Definitions](/web3/build/docs/waas/walletapi-resources-definitions)
[View chainIndex](/web3/build/docs/waas/walletapi-resources-supported-networks)
[Webhook Guidance](/web3/build/docs/waas/walletapi-bp-data-subscription)
[Error Codes](/web3/build/docs/waas/walletapi-resources-errorcode)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
Resources
Resources[#](#resources)
=========================
[Common Parameter Definitions\
\
Definitions involved in Wallet API services](/web3/build/docs/waas/walletapi-resources-definitions)
[Check ChainIndex\
\
Supported blockchain networks](/web3/build/docs/waas/walletapi-resources-supported-networks)
[Webhook Guidance\
\
Some notes for using the webhook service to subscribe to on-chain data](/web3/build/docs/waas/walletapi-bp-data-subscription)
[Wallet API\
\
Go Signing SDK](/web3/build/docs/waas/private-key-wallet-go-sdk)
[Wallet API\
\
Definitions](/web3/build/docs/waas/walletapi-resources-definitions)
---
# Build swap applications | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Build swap applications](/web3/build/docs/waas/dex-api-quick-start-reference)
[Build bridge applications](/web3/build/docs/waas/dex-crosschain-api-quick-start-reference)
[Build limit order applications](/web3/build/docs/waas/dex-limit-order-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
Build swap applications
Quick start[#](#quick-start)
=============================
Before using the DEX API, you need to [create a project](/web3/build/docs/waas/introduction-to-developer-portal-interface#create-project)
and [generate an API key](/web3/build/docs/waas/introduction-to-developer-portal-interface#generate-api-keys)
in the developer portal. The detailed steps and related resources are as follows:
[Build swap applications on the EVM network\
\
Quick guide for swap API](/web3/build/docs/waas/dex-use-swap-quick-start)
[Build swap applications on Solana\
\
Build swap applications on Solana](/web3/build/docs/waas/dex-use-swap-solana-quick-start)
[Build bridge applications\
\
Quick guide for cross-chain API](/web3/build/docs/waas/dex-use-crosschain-quick-start)
[Build limit order applications\
\
Quick guide for limit order API](/web3/build/docs/waas/dex-limit-order-quick-start)
[DEX API\
\
Limit order API](/web3/build/docs/waas/dex-limit-order-process)
[DEX API\
\
Build swap applications](/web3/build/docs/waas/dex-api-quick-start-reference)
---
# Quick Start | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[Preparation](/web3/build/docs/waas/walletapi-quickstart-preparation)
[Building an On-Chain Data Dashboard](/web3/build/docs/waas/walletapi-quickstart-dashboard)
[Build Inscription Wallet](/web3/build/docs/waas/walletapi-quickstart-inscription)
[Building a Web3 Wallet](/web3/build/docs/waas/walletapi-quickstart-multi-chain)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
Quick Start
Quick Start[#](#quick-start)
=============================
Based on your development goals, check out the sample cases to quickly get started with our services.
[Build On-Chain Data Dashboard\
\
This case allows you to become familiar with various methods of querying on-chain data](/web3/build/docs/waas/walletapi-quickstart-dashboard)
[Build Bitcoin Inscription Wallet\
\
This case allows you to become familiar with wallet management, inscription data querying, and building and broadcasting inscription transactions](/web3/build/docs/waas/walletapi-quickstart-inscription)
[Build Web3 Wallet\
\
This case allows you to become familiar with wallet management, querying data across different public chains, and constructing and broadcasting transactions](/web3/build/docs/waas/walletapi-quickstart-multi-chain)
[Wallet API\
\
Introduction](/web3/build/docs/waas/walletapi-introduction)
[Wallet API\
\
Preparation](/web3/build/docs/waas/walletapi-quickstart-preparation)
---
# Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Create Account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
[Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
[Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
[Get Accounts](/web3/build/docs/waas/walletapi-api-accounts)
[Get Addresses Under Account](/web3/build/docs/waas/walletapi-api-account-detail)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
Wallet Account Management
Wallet Account Management[#](#wallet-account-management)
=========================================================
Provides API interfaces for managing wallet accounts, supporting operations to add, delete, update, and query wallet account addresses.
[Create Account\
\
Create a wallet account aggregating multiple chain addresses](/web3/build/docs/waas/walletapi-api-create-watch-only-account)
[Update Account\
\
Update multiple chain addresses under this wallet account](/web3/build/docs/waas/walletapi-api-update-watch-only-account)
[Delete Account\
\
Delete a wallet account](/web3/build/docs/waas/walletapi-api-delete-account)
[Query Created Accounts\
\
Query the created wallet accounts](/web3/build/docs/waas/walletapi-api-accounts)
[Query Addresses Under Account\
\
Query addresses under a specific wallet account](/web3/build/docs/waas/walletapi-api-account-detail)
[Wallet API\
\
Get Inscription Transactions](/web3/build/docs/waas/walletapi-api-inscription-transaction-detail-by-txhash)
[Wallet API\
\
Create Account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
---
# Get Supported Chains | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
Get Supported Chains
Get Supported Chains[#](#get-supported-chains)
===============================================
Retrieve information on chains supported for single-chain exchanges. The request returns supported target chains for cross-chain transactions.
### Request URL[#](#request-url)
GET `https://www.okx.com/api/v5/dex/aggregator/supported/chain`
### Request Parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| chainId | String | No | Unique identifier for the chain.
If left empty \`\`\`\`, the response will return all supported chain information.
If a specific chain ID is provided, information for that chain will be returned, e.g., `1`: Ethereum. See more [here](/web3/build/docs/waas/walletapi-resources-supported-networks)
. |
### Response Parameters[#](#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| chainId | String | Unique identifier for the chain (e.g., `1`: Ethereum; see more [here](/web3/build/docs/waas/walletapi-resources-supported-networks)
). |
| chainName | String | Chain name (e.g., `Optimism`). |
| dexTokenApproveAddress | String | DEX authorization contract address; if no authorization has been made, this field will be empty. |
[DEX API\
\
API reference](/web3/build/docs/waas/dex-api-reference)
[DEX API\
\
Get tokens](/web3/build/docs/waas/dex-get-tokens)
### Request example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/supported/chain?chainId=1' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
### Response example[#](#response-example)
200
{
"code":"0",
"data":[\
{\
"chainId":"1",\
"chainName":"Ethereum",\
"dexTokenApproveAddress": "0x40aA958dd87FC8305b97f2BA922CDdCa374bcD7f"\
},\
],
"msg":""
}
[DEX API\
\
API reference](/web3/build/docs/waas/dex-api-reference)
[DEX API\
\
Get tokens](/web3/build/docs/waas/dex-get-tokens)
---
# Query Transaction Status | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
Query Transaction Status
Query Transaction Status[#](#query-transaction-status)
=======================================================
Query the final transaction status of a single-chain swap using `txhash`.
### Request URL[#](#request-url)
GET `https://www.okx.com/api/v5/dex/aggregator/history`
### Request Parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| chainId | String | Yes | Chain ID (e.g., `1`: Ethereum, see [Chain ID List](/web3/build/docs/waas/walletapi-resources-supported-networks)
) |
| txHash | String | Yes | Transaction hash for a swap initiated via OKX DEX API |
| isFromMyProject | Boolean | No | Set `true` to check if the transaction is under the current API Key. Set `false` or omit to query any OKX DEX API transaction. |
### Response Parameters[#](#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| chainId | String | Unique identifier of the chain (e.g., 1: Ethereum, see Chain ID List). |
| txHash | String | Transaction hash. |
| height | String | Block height where the transaction occurred. |
| txTime | String | Transaction time in Unix timestamp (milliseconds). |
| status | String | Transaction status: `pending` (In Progress), `success` (Success), `failure` (Failure). |
| txType | String | Transaction action: `Approve`, `Wrap`, `Unwrap`, `Swap`. |
| fromAddress | String | Sender's address. |
| dexRouter | String | Interaction address. |
| toAddress | String | Receiver's address. |
| fromTokenDetails | Array | Details of the token being swapped. |
| \>symbol | String | Symbol of the token being swapped. |
| \>amount | String | Swap amount in the smallest unit (e.g., wei for Ethereum). |
| \>tokenAddress | String | Contract address of the token being swapped (e.g., `0xEeeeeEeeeEeEee...`). |
| toTokenDetails | Array | Details of the token received in the swap. |
| \>symbol | String | Symbol of the token received. |
| \>amount | String | Amount received in the smallest unit. |
| \>tokenAddress | String | Contract address of the received token (e.g., `0xa0b86991c6218b36...`). |
| referalAmount | String | Referral fee amount. |
| errorMsg | String | Error message. |
| gasLimit | String | Gas limit for the transaction. |
| gasUsed | String | Gas used in the transaction, in the smallest unit (e.g., wei). |
| gasPrice | String | Gas price in the smallest unit (e.g., wei). |
| txFee | String | Transaction fee, in the main chain currency. |
[DEX API\
\
Swap](/web3/build/docs/waas/dex-swap)
[DEX API\
\
Adding Fees](/web3/build/docs/waas/dex-api-addfee)
### Request Example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/history?chainId=784&txHash=5GePcvqEakoUtArW8PHULDSQds95vcgeiTznvbnb8hCV' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
### Response example[#](#response-example)
200
{
"code": "0",
"data": {
"chainId": "784",
"dexRouter": "0x51159f25f262ae01e87532b673de3b38df8f0ecc2dc0581f1033df6b84b84955",
"errorMsg": "",
"fromAddress": "0x4b9df646075d8621e2578f14818427e4c708709744ea3b827136056f85f88da7",
"fromTokenDetails": {
"amount": "892919000000.000",
"symbol": "HIPPO",
"tokenAddress": "0x8993129d72e733985f7f1a00396cbd055bad6f817fee36576ce483c8bbb8b87b::sudeng::SUDENG"
},
"gasLimit": "",
"gasPrice": "",
"gasUsed": "",
"height": "99502953",
"referralAmount": "892919000",
"status": "success",
"toAddress": "0x4b9df646075d8621e2578f14818427e4c708709744ea3b827136056f85f88da7",
"toTokenDetails": {
"amount": "1532443840.00000000",
"symbol": "SUI",
"tokenAddress": "0x2::sui::SUI"
},
"txFee": "7976416",
"txHash": "5GePcvqEakoUtArW8PHULDSQds95vcgeiTznvbnb8hCV",
"txTime": "1736390263909",
"txType": "swap"
},
"msg": ""
}
[DEX API\
\
Swap](/web3/build/docs/waas/dex-swap)
[DEX API\
\
Adding Fees](/web3/build/docs/waas/dex-api-addfee)
---
# Supported Networks | Introduction | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Introduction
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Introduction
Supported Networks
Supported Networks[#](#supported-networks)
===========================================
EVM Networks[#](#evm-networks)
-------------------------------
| Chain | Wallet API | DEX API | Marketplace API | DeFi API |
| --- | --- | --- | --- | --- |
| Ethereum Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| OP Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| BNB Smart Chain Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| OKT Chain | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| X layer | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| Polygon Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| Arbitrum One | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| Avalanche C-Chain | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| zkSync Era Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| Polygon zkEVM | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| Base | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | |
| Linea | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | |
| Fantom Opera | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | [Supported](/web3/build/docs/waas/defi-introduction) |
| Mantle | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | [Supported](/web3/build/docs/waas/defi-introduction) |
| Conflux eSpace | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | |
| Metis Andromeda Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | |
| Merlin Chain | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | |
| Blast | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | |
| Manta Pacific Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| opBNB Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | [Supported](/web3/build/docs/waas/marketplace-introduction) | [Supported](/web3/build/docs/waas/defi-introduction) |
| Kaia Network (Klaytn Mainnet) | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | [Supported](/web3/build/docs/waas/marketplace-introduction) | |
| Arbitrum Nova | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | [Supported](/web3/build/docs/waas/marketplace-introduction) | |
| Scroll | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | [Supported](/web3/build/docs/waas/marketplace-introduction) | |
| Gnosis | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | [Supported](/web3/build/docs/waas/defi-introduction) |
| Core Blockchain Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | [Supported](/web3/build/docs/waas/defi-introduction) |
| B^2 network | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Kroma | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Flare Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Cronos Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | |
| Ethereum Classic | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Immutable zkEVM | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| KCC Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| PulseChain | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Omega Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Endurance Smart Chain Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Moonbeam | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Moonriver | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Ronin Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Rangers | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Mode network | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Taiko network | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Bitlayer network | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Bob network | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Kava EVM | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| EthereumPoW | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Celo Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Ethereum Fair (DIS Chain) | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Gravity | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Wemix | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Lumi | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Sepolia | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| ZetaChain Mainnet | | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | |
| Sonic | | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) | | |
UTXO Networks[#](#utxo-networks)
---------------------------------
| Chain | Wallet API | DEX API | Marketplace API | DeFi API |
| --- | --- | --- | --- | --- |
| Bitcoin Mainnet | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | [Supported: Ordinals Market](/web3/build/docs/waas/marketplace-ordinals-api) | |
| Fractal Bitcoin Mainnet | [Not fully supported for transaction broadcasting](/web3/build/docs/waas/walletapi-api-intro-query-api) | | [Supported: Ordinals Market](/web3/build/docs/waas/marketplace-ordinals-api) | |
| Litecoin | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Doge | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| Dash | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
| BCH | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | | | |
Other Networks[#](#other-networks)
-----------------------------------
| Chain | Wallet API | DEX API |
| --- | --- | --- |
| Tron | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) |
| Solana | [Supported](/web3/build/docs/waas/walletapi-api-intro-query-api) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) |
| SUI | [Supported](/web3/build/docs/waas/walletapi-quickstart-multi-chain) | [Supported: Swap & Cross-chain](/web3/build/docs/waas/dex-aggregation-root-quick-start) |
| Ton | Coming Soon | [Supported: Swap](/web3/build/docs/waas/dex-aggregation-root-quick-start) |
[Introduction\
\
Node.js environment Settings](/web3/build/docs/waas/nodejs-environment)
[Wallet API\
\
Introduction](/web3/build/docs/waas/walletapi-introduction)
Table of contents
[EVM Networks](#evm-networks)
[UTXO Networks](#utxo-networks)
[Other Networks](#other-networks)
---
# API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
API reference
API reference[#](#api-reference)
=================================
[Get Supported Chains\
\
Get chains available that support single-chain transactions](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens\
\
Get tokens available for swap in the OKX aggregation protocol](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources\
\
Get liquidity sources available for swap in the OKX aggregation protocol](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions\
\
Generate the relevant data for calling the contract](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes\
\
Get the best quote for a swap through OKX DEX](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions\
\
Get Solana swap instructions through the OKX DEX](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap\
\
Generate the data for calling the OKX DEX router to swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status\
\
Get swap transaction history through the OKX DEX](/web3/build/docs/waas/dex-swap-history)
[DEX API\
\
Swap API](/web3/build/docs/waas/dex-aggregation)
[DEX API\
\
Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
---
# Get tokens | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
Get tokens
Get tokens[#](#get-tokens)
===========================
It fetches a list of tokens. This interface returns a list of tokens that belong to major platforms or are deemed significant enough by OKX. However, you can still quote and swap other tokens outside of this list on OKX DEX.
### Request address[#](#request-address)
GET `https://www.okx.com/api/v5/dex/aggregator/all-tokens`
### Request param[#](#request-param)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| chainId | String | Yes | Chain ID (e.g., `1` for Ethereum. See [Chain IDs](/web3/build/docs/waas/walletapi-resources-supported-networks)
) |
### Response param[#](#response-param)
| Parameter | Type | The precision of tokens |
| --- | --- | --- |
| decimals | String | The precision of tokens (e.g., `18`) |
| tokenContractAddress | String | Token contract address (e.g., `0x382bb369d343125bfb2117af9c149795c6c65c50`) |
| tokenLogoUrl | String | Token logo (e.g., `https://static.okx.com/cdn/wallet/logo/USDT-991ffed9-e495-4d1b-80c2-a4c5f96ce22d.png`) |
| tokenName | String | Token full name (e.g., `Tether`) |
| tokenSymbol | String | Token symbol (e.g., `USDT`) |
[DEX API\
\
Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[DEX API\
\
Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
### Request example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/all-tokens?chainId=1' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
### Response example[#](#response-example)
200
{
"code": "0",
"data": [\
{\
"decimals": "18",\
"tokenContractAddress": "0x382bb369d343125bfb2117af9c149795c6c65c50",\
"tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/USDT-991ffed9-e495-4d1b-80c2-a4c5f96ce22d.png",\
"tokenName": "Tether",\
"tokenSymbol": "USDT"\
},\
{\
"decimals": "18",\
"tokenContractAddress": "0xc946daf81b08146b1c7a8da2a851ddf2b3eaaf85",\
"tokenLogoUrl": "https://static.okx.com/cdn/explorer/okexchain/exchain_usdc.png",\
"tokenName": "USD Coin",\
"tokenSymbol": "USDC"\
},\
{\
"decimals": "18",\
"tokenContractAddress": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2",\
"tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/okb.png",\
"tokenName": "OKB",\
"tokenSymbol": "OKB"\
},\
{\
"decimals": "18",\
"tokenContractAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",\
"tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/okt.png",\
"tokenName": "OKTC",\
"tokenSymbol": "OKT"\
},\
{\
"decimals": "18",\
"tokenContractAddress": "0x218c3c3d49d0e7b37aff0d8bb079de36ae61a4c0",\
"tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/BNB-20220308.png",\
"tokenName": "Binance Coin",\
"tokenSymbol": "BNB"\
},\
{\
"decimals": "18",\
"tokenContractAddress": "0x332730a4f6e03d9c55829435f10360e13cfa41ff",\
"tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/BUSD-20220308.png",\
"tokenName": "Binance USD",\
"tokenSymbol": "BUSD"\
},\
{\
"decimals": "18",\
"tokenContractAddress": "0xdcac52e001f5bd413aa6ea83956438f29098166b",\
"tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/eth_usdk.png",\
"tokenName": "USDK",\
"tokenSymbol": "USDK"\
}\
],
"msg": ""
}
[DEX API\
\
Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[DEX API\
\
Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
---
# Approve transactions | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
Approve transactions
Approve transactions[#](#approve-transactions)
===============================================
According to the [ERC-20 standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/)
, we need to make sure that the OKX router has permission to spend funds with the user's wallet before making a transaction. This API will generate the relevant data for calling the contract.
### Request address[#](#request-address)
GET `https://www.okx.com/api/v5/dex/aggregator/approve-transaction`
### Request param[#](#request-param)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| chainId | String | Yes | Chain ID (e.g., `1` for Ethereum. See [Chain IDs](/web3/build/docs/waas/walletapi-resources-supported-networks)
) |
| tokenContractAddress | String | Yes | Token contract address (e.g., `0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48`) |
| approveAmount | String | Yes | The amount of token that needs to be permitted (set in minimal divisible units, e.g., `1.00` USDT set as `1000000`, `1.00` DAI set as `1000000000000000000`) |
### Response param[#](#response-param)
| Parameter | Type | Description |
| --- | --- | --- |
| data | String | Call data |
| dexContractAddress | String | The contract address of OKX DEX approve (e.g., `0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9`) |
| gasLimit | String | Gas limit (e.g., `50000`) |
| gasPrice | String | Gas price in wei (e.g., `110000000`) |
[DEX API\
\
Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[DEX API\
\
Get quotes](/web3/build/docs/waas/dex-get-quote)
### Request example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/approve-transaction?chainId=1&tokenContractAddress=0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9&approveAmount=1000000' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
### Response example[#](#response-example)
200
{
"code": "0",
"data": [\
{\
"data": "0x095ea7b3000000000000000000000000c67879f4065d3b9fe1c09ee990b891aa8e3a4c2f00000000000000000000000000000000000000000000000000000000000f4240",\
"dexContractAddress": "0xc67879F4065d3B9fe1C09EE990B891Aa8E3a4c2f",\
"gasLimit": "50000",\
"gasPrice": "110000000"\
}\
],
"msg": ""
}
[DEX API\
\
Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[DEX API\
\
Get quotes](/web3/build/docs/waas/dex-get-quote)
---
# Adding Fees | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
Adding Fees
Adding Fees[#](#adding-fees)
=============================
The OKX DEX API supports configuring referral fees and fee-receiving addresses for token swaps
You can extend the implementation to include fee parameters in your swap quotes and charge up to 3% per swap from your users.
The OKX DEX API plans to take a certain percentage of the referral fee charged by you to your users. Currently the OKX DEX API charges no fees.
Note
Ton chain currently does not support commission splitting.
// Extended quoteParams with fee support
const quoteParams = {
chainId: SOLANA_CHAIN_ID,
amount: rawAmount,
fromTokenAddress,
toTokenAddress,
slippage: "0.5",
userWalletAddress: userAddress,
// Fee-related parameters
fromTokenReferrerWalletAddress: "Your_REFERRER_WALLET_ADDRESS", // Optional: Referrer address for commissions based on fromToken
toTokenReferrerWalletAddress: "REFERRER_WALLET", // Optional: Referrer address for commissions based on toToken
feePercent: "1.5", // Optional: Commission percentage (0-3%, max 2 decimal points)
} as Record;
Important Fee Configuration Notes:
* The feePercent parameter must be between 0 and 3%
* Maximum 2 decimal points are supported for feePercent E.g. 1.326% is the actual input, but the final calculation will only adopt 1.32%
* For Solana , the commission address must have some SOL deposited for activation
* Each transaction can only choose commission from either the fromToken or the toToken
Example Usage with Fees:
// .. Previous code implementation
// Get swap quote
const quoteParams = {
chainId: SOLANA_CHAIN_ID,
amount: rawAmount,
fromTokenAddress,
toTokenAddress,
slippage: "0.5",
userWalletAddress: userAddress,
// Additional Fee params
fromTokenReferrerWalletAddress: "fee-recipient-wallet-address",
feePercent: "1",
// The wallet addresses to receive the commission fee (Each transaction can only choose commission from either the fromToken or the toToken)
// toTokenReferrerWalletAddress: "fee-recipient-wallet-address",
// fromTokenReferrerWalletAddress: "fee-recipient-wallet-address",
} as Record;
const timestamp = new Date().toISOString();
const requestPath = "/api/v5/dex/aggregator/swap";
const queryString = "?" + new URLSearchParams(quoteParams).toString();
const headers = getHeaders(timestamp, "GET", requestPath, queryString);
const response = await fetch(
`https://www.okx.com${requestPath}${queryString}`,
{ method: "GET", headers }
);
const data = await response.json();
// .. Continue code implementation
Command Line Usage with Fees:
# Example: Swap .01 SOL to USDC with 1.5% fee to referrer
npx ts-node swap.ts .01 11111111111111111111111111111111 EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --referrer YOUR_REFERRER_ADDRESS --fee 1.5
Fee Calculation Example: For a trade of 100 USDC with a 1.5% fee:
* Fee amount: 1.5 USDC (1.5% of 100 USDC)
* Actual swap amount: 98.5 USDC
* The fee (1.5 USDC) will be sent to the referrer address
[DEX API\
\
Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[DEX API\
\
Dex-integration](/web3/build/docs/waas/dex-integration)
---
# Smart contract | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
Smart contract
Smart contract[#](#smart-contract)
===================================
The contract addresses of OKX DEX router and ABI
Contract address[#](#contract-address)
---------------------------------------
The contract addresses of the DEX router and token approval may be subject to replacement due to contract upgrades. To ensure uninterrupted use of the API, we recommend using the contract addresses returned by the response parameters: `/approve-transaction` API and `/swap` API for approvals and transactions.
### DEX router[#](#dex-router)
The contract addresses of OKX DEX router.Ton and Solana chains do not require authorization.
| Chain | DEX router address |
| --- | --- |
| Ethereum | 0x1ef032a3c471a99cc31578c8007f256d95e89896 |
| Solana | 6m2CDdhRgxpH4WjvdzxAYbGxwdGUz5MziiL5jek2kBma |
| SUI | 0xe28762b4a2ad4aa04deab905fd5851278ef0adf27d7483b2e727b08284b5f337 |
| Tron | TCkwEw4NdkaTJ1atJg5jZ18NgtHfpzZTC5 |
| Sonic | 0x4Efa4b8545a3a77D80Da3ECC8F81EdB1a4bda783 |
| Ton | EQBjfOGw4Iq6FYZplhwZ5rRNb7Htac7WJh8g\_eQcGTswxVqP |
| zkSync Era | 0xb9061E38FeE7d30134F56aEf7117E2F6d1580666 |
| Optimism | 0xf332761c673b59B21fF6dfa8adA44d78c12dEF09 |
| Polygon | 0xA748D6573acA135aF68F2635BE60CB80278bd855 |
| BNB Chain | 0x9333C74BDd1E118634fE5664ACA7a9710b108Bab |
| OKC | 0xf6Aab105CB9e66e03CAD2c2F3f8558242593385c |
| Avalanche C | 0x1daC23e41Fc8ce857E86fD8C1AE5b6121C67D96d |
| Fantom | 0xf332761c673b59B21fF6dfa8adA44d78c12dEF09 |
| Arbitrum | 0xf332761c673b59B21fF6dfa8adA44d78c12dEF09 |
| Linea | 0x6b2C0c7be2048Daa9b5527982C29f48062B34D58 |
| Conflux eSpace | 0x0112bc6fDB78345e612B862a6B388FfeB00E2320 |
| Base | 0x6b2C0c7be2048Daa9b5527982C29f48062B34D58 |
| Mantle | 0x6b2C0c7be2048Daa9b5527982C29f48062B34D58 |
| Scroll | 0x6b2C0c7be2048Daa9b5527982C29f48062B34D58 |
| Manta | 0x6b2C0c7be2048Daa9b5527982C29f48062B34D58 |
| Metis | 0x6b2C0c7be2048Daa9b5527982C29f48062B34D58 |
| Blast | 0x2E86f54943faFD2cB62958c3deed36C879e3E944 |
| Zeta | 0x0DaB5A5294AfAae76Ce990993fC10b896A01DBd1 |
| Polygon zkEvm | 0x6b2C0c7be2048Daa9b5527982C29f48062B34D58 |
| Merlin | 0x127a986cE31AA2ea8E1a6a0F0D5b7E5dbaD7b0bE |
| X Layer | 0x127a986cE31AA2ea8E1a6a0F0D5b7E5dbaD7b0bE |
### Token approval[#](#token-approval)
A list of smart contracts for ERC-20 token approval
| Chain | Approval contract address |
| --- | --- |
| Ethereum | 0x40aA958dd87FC8305b97f2BA922CDdCa374bcD7f |
| Sonic | 0xd321ab5589d3e8fa5df985ccfef625022e2dd910 |
| Tron | THRAE2VhGNAcvPKtT96AqyXtSQwhiU1XL8 |
| zkSync Era | 0xc67879F4065d3B9fe1C09EE990B891Aa8E3a4c2f |
| Optimism | 0x68D6B739D2020067D1e2F713b999dA97E4d54812 |
| Polygon | 0x3B86917369B83a6892f553609F3c2F439C184e31 |
| BNB Chain | 0x2c34A2Fb1d0b4f55de51E1d0bDEfaDDce6b7cDD6 |
| OKC | 0x70cBb871E8f30Fc8Ce23609E9E0Ea87B6b222F58 |
| Avalanche C | 0x40aA958dd87FC8305b97f2BA922CDdCa374bcD7f |
| Fantom | 0x70cBb871E8f30Fc8Ce23609E9E0Ea87B6b222F58 |
| Arbitrum | 0x70cBb871E8f30Fc8Ce23609E9E0Ea87B6b222F58 |
| Linea | 0x57df6092665eb6058DE53939612413ff4B09114E |
| Conflux eSpace | 0x68D6B739D2020067D1e2F713b999dA97E4d54812 |
| Base | 0x57df6092665eb6058DE53939612413ff4B09114E |
| Mantle | 0x57df6092665eb6058DE53939612413ff4B09114E |
| Scroll | 0x57df6092665eb6058DE53939612413ff4B09114E |
| Manta | 0x57df6092665eb6058DE53939612413ff4B09114E |
| Metis | 0x57df6092665eb6058DE53939612413ff4B09114E |
| Blast | 0x5fD2Dc91FF1dE7FF4AEB1CACeF8E9911bAAECa68 |
| Zeta | 0x03B5ACdA01207824cc7Bc21783Ee5aa2B8d1D2fE |
| Polygon zkEvm | 0x57df6092665eb6058DE53939612413ff4B09114E |
| Merlin | 0x8b773D83bc66Be128c60e07E17C8901f7a64F000 |
| X Layer | 0x8b773D83bc66Be128c60e07E17C8901f7a64F000 |
The Application Binary Interface of Contract (ABI)[#](#the-application-binary-interface-of-contract-(abi))
-----------------------------------------------------------------------------------------------------------
Please refer to: [https://github.com/okx/OKX-DEX-Aggregator-ABI](https://github.com/okx/OKX-DEX-Aggregator-ABI)
[DEX API\
\
Dex-integration](/web3/build/docs/waas/dex-integration)
[DEX API\
\
Error codes](/web3/build/docs/waas/dex-error-code)
Table of contents
[Contract address](#contract-address)
[The Application Binary Interface of Contract (ABI)](#the-application-binary-interface-of-contract-(abi))
---
# Get quotes | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
Get quotes
Get quotes[#](#get-quotes)
===========================
Get the best quote for a swap through OKX DEX.
### Request address[#](#request-address)
GET `https://www.okx.com/api/v5/dex/aggregator/quote`
### Request param[#](#request-param)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| chainId | String | Yes | Chain ID (e.g., `1` for Ethereum. See [Chain IDs](/web3/build/docs/waas/wallet-supported-networks)
) |
| amount | String | Yes | The input amount of a token to be sold (set in minimal divisible units, e.g., 1.00 USDT set as 1000000, 1.00 DAI set as 1000000000000000000), you could get the minimal divisible units from [Tokenlist](/web3/build/docs/waas/dex-get-tokens)
. |
| fromTokenAddress | String | Yes | The contract address of a token to be sold (e.g., `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`) |
| toTokenAddress | String | Yes | The contract address of a token to be bought (e.g., `0xa892e1fef8b31acc44ce78e7db0a2dc610f92d00`) |
| dexIds | String | No | DexId of the liquidity pool for limited quotes, multiple combinations separated by `,` (e.g.,`1,50,180`, see liquidity list for more) |
| directRoute | Boolean | No | The default setting is false. When enabled, Direct Routes restrict our routing to a single liquidity pool only. Currently, this feature is only active for Solana swaps. |
| priceImpactProtectionPercentage | String | No | (Optional. The default is 90%.) The percentage (between 0 - 1.0) of the price impact allowed.
When the priceImpactProtectionPercentage is set, if the estimated price impact is above the percentage indicated, an error will be returned. For example, if PriceImpactProtectionPercentage = .25 (25%), any quote with a price impact higher than 25% will return an error.
This is an **optional** feature, and the default value is 0.9. When it’s set to 1.0 (100%), the feature will be disabled, which means that every transaction will be allowed to pass.
**Note:** If we’re unable to calculate the price impact, we’ll return null, and the price impact protection will be disabled. |
| feePercent | String | No | The percentage of fromTokenAmount will be sent to the referrer's address, the rest will be set as the input amount to be sold. min percentage:0
max percentage:3
By configuring this parameter, you can obtain the final amount of `totoken` provided to the user after deducting the commission from `fromtoken`.
A maximum of two decimal places is allowed. If more decimals are entered, the system will automatically round up. |
### Response param[#](#response-param)
| Parameter | Type | Description |
| --- | --- | --- |
| chainId | String | Chain ID (e.g., 1 for Ethereum. See [Chain IDs](/web3/build/docs/waas/walletapi-resources-supported-networks)
) |
| _**dexRouterList**_ | _**Array**_ | _**Quote path data set**_ |
| fromTokenAmount | String | The input amount of a token to be sold (e.g., `500000000000000000000000`) |
| toTokenAmount | String | The resulting amount of a token to be bought (e.g., `168611907733361`) |
| tradeFee | String | Estimated network fee (USD) of the quote route |
| estimateGasFee | String | Estimated gas consumption is returned in the smallest units of each chain, such as wei. |
| router | String | One of the main paths for the token swap |
| routerPercent | String | The percentage of assets handled by the main path (e.g., `5`) |
| _**subRouterList**_ | _**Array**_ | _**DEX Router information**_ |
| _**dexProtocol**_ | _**Array**_ | _**Liquidity protocols used on the main path**_ (e.g., `Verse`) |
| percent | String | The percentage of assets handled by the protocol (e.g., `100`) |
| dexName | String | The name of the liquidity protocol |
| _**fromToken**_ | _**Object**_ | _**The information of a token to be sold**_ |
| tokenContractAddress | String | Token contract address (e.g., `0xa892e1fef8b31acc44ce78e7db0a2dc610f92d00`) |
| tokenSymbol | String | Token symbol (e.g., `0xa892e1fef8b31acc44ce78e7db0a2dc610f92d00`) |
| tokenUnitPrice | String | The token unit price returned by this interface is a general USD real time price based on data from on-chain sources. Note: This price is only a recommended price. For some special cases, the token unit price may be 'null' |
| decimal | String | The decimal number defines the smallest unit into which a single currency token can be divided. For example, if the decimal number of a token is 8, it means that a single such token can be divided into 100,000,000 of its smallest units. _**Note: This parameter is for reference only. It may change due to reasons such as settings adjustments by the contract owner.**_ |
| isHoneyPot | Boolean | If the token is a honeypot token. `yes:true` `no:false` |
| taxRate | String | Token tax rate for selling: Applicable to tokens with configurable tax mechanisms (e.g., SafeMoon, SPL2022 tokens). Returns 0 for regular tokens without tax. The value ranges from 0 to 1, where 0.01 represents 1%. |
| _**toToken**_ | _**Object**_ | _**The information of a token to be bought**_ |
| tokenContractAddress | String | Token contract address (e.g., `0xa892e1fef8b31acc44ce78e7db0a2dc610f92d00`) |
| tokenSymbol | String | Token symbol (e.g., `0xa892e1fef8b31acc44ce78e7db0a2dc610f92d00`) |
| tokenUnitPrice | String | The token unit price returned by this interface is a general USD price based on data from on-chain, exchange, and other third-party sources. Note: This price is only a recommended price. For some special cases, the token unit price may be 'null' |
| decimal | String | The decimal number defines the smallest unit into which a single currency token can be divided. For example, if the decimal number of a token is 8, it means that a single such token can be divided into 100,000,000 of its smallest units. _**Note: This parameter is for reference only. It may change due to reasons such as settings adjustments by the contract owner.**_ |
| isHoneyPot | Boolean | If the token is a honeypot token. `yes:true` `no:false` |
| taxRate | String | Token tax rate for buying: Applicable to tokens with configurable tax mechanisms (e.g., SafeMoon, SPL2022 tokens). Returns 0 for regular tokens without tax. The value ranges from 0 to 1, where 0.01 represents 1%. |
| _**quoteCompareList**_ | _**Array**_ | _**Comparison of quote routes**_ |
| dexName | String | DEX name of the quote route |
| dexLogo | String | DEX logo of the quote route |
| tradeFee | String | Estimated network fee (USD) of the quote route |
| amountOut | String | Received amount of the quote route |
| priceImpactPercentage | String | Percentage = (Received value – Paid value) / Paid value. The swap amount will affect the depth of the liquidity pool, causing a value difference. This percentage can be positive if the received value exceeds the paid value. |
[DEX API\
\
Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[DEX API\
\
Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
### Request example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/quote?amount=10000000000000000000&chainId=1&toTokenAddress=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&fromTokenAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
### Response example[#](#response-example)
200
{
"code": "0",
"data": [\
{\
"chainId": "1",\
"dexRouterList": [\
{\
"router": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee--0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",\
"routerPercent": "100",\
"subRouterList": [\
{\
"dexProtocol": [\
{\
"dexName": "Uniswap V3",\
"percent": "100"\
}\
],\
"fromToken": {\
"decimal": "18",\
"isHoneyPot": false,\
"taxRate": "0",\
"tokenContractAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",\
"tokenSymbol": "WETH",\
"tokenUnitPrice": "3606.94"\
},\
"toToken": {\
"decimal": "6",\
"isHoneyPot": false,\
"taxRate": "0",\
"tokenContractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",\
"tokenSymbol": "USDC",\
"tokenUnitPrice": "0.9999"\
}\
}\
]\
}\
],\
"estimateGasFee": "135000",\
"fromToken": {\
"decimal": "18",\
"isHoneyPot": false,\
"taxRate": "0",\
"tokenContractAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",\
"tokenSymbol": "ETH",\
"tokenUnitPrice": "3606.94"\
},\
"fromTokenAmount": "1000000000000000",\
"originToTokenAmount": "3608628",\
"priceImpactPercentage": "0.04",\
"quoteCompareList": [\
{\
"amountOut": "35984",\
"dexLogo": "https://static.okx.com/cdn/wallet/logo/DODO.png",\
"dexName": "DODO",\
"tradeFee": "13.609993622490384"\
},\
{\
"amountOut": "3586381",\
"dexLogo": "https://static.okx.com/cdn/wallet/logo/balancer.png",\
"dexName": "Balancer V1",\
"tradeFee": "16.319948104844664"\
},\
{\
"amountOut": "3580447",\
"dexLogo": "https://static.okx.com/cdn/wallet/logo/UNI.png",\
"dexName": "Uniswap V1",\
"tradeFee": "8.018574649654157568"\
},\
{\
"amountOut": "3585311",\
"dexLogo": "https://static.okx.com/cdn/web3/dex/logo/Fluid.png",\
"dexName": "Fluid",\
"tradeFee": "7.957841558644062204"\
},\
{\
"amountOut": "3591031",\
"dexLogo": "https://static.okx.com/cdn/wallet/logo/balancer.png",\
"dexName": "Balancer V2",\
"tradeFee": "7.286766496997064"\
}\
],\
"toToken": {\
"decimal": "6",\
"isHoneyPot": false,\
"taxRate": "0",\
"tokenContractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",\
"tokenSymbol": "USDC",\
"tokenUnitPrice": "0.9999"\
},\
"toTokenAmount": "3608628",\
"tradeFee": "4.1057406791269083"\
}\
],
"msg": ""
}
[DEX API\
\
Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[DEX API\
\
Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
---
# Get liquidity sources | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
Get liquidity sources
Get liquidity sources[#](#get-liquidity-sources)
=================================================
Get a list of liquidity that are available for swap in the OKX aggregation protocol.
### Request address[#](#request-address)
GET `https://www.okx.com/api/v5/dex/aggregator/get-liquidity`
### Request param[#](#request-param)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| chainId | String | Yes | Chain ID (e.g., `1` for Ethereum. See [Chain IDs](/web3/build/docs/waas/walletapi-resources-supported-networks)
) |
### Response param[#](#response-param)
| Parameter | Type | The precision of tokens |
| --- | --- | --- |
| id | String | The id of liquidity (e.g., `34`) |
| name | String | The name of liquidity (e.g., `Uniswap V2`) |
| logo | String | Liquidity Logo URL (e.g., `https://static.okx.com/cdn/wallet/logo/UNI.png`) |
[DEX API\
\
Get tokens](/web3/build/docs/waas/dex-get-tokens)
[DEX API\
\
Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
### Request example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/get-liquidity?chainId=1' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
### Response example[#](#response-example)
200
{
"code": "0",
"data": [\
{\
"id": "34",\
"logo": "https://static.okx.com/cdn/wallet/logo/UNI.png",\
"name": "Uniswap V2"\
},\
{\
"id": "29",\
"logo": "https://static.okx.com/cdn/wallet/logo/SUSHI.png",\
"name": "SushiSwap"\
},\
{\
"id": "47",\
"logo": "https://static.okx.com/cdn/explorer/dex/logo/Dex_DefiSwap.png",\
"name": "DeFi Swap"\
},\
{\
"id": "49",\
"logo": "https://static.okx.com/cdn/wallet/logo/convxswap.png",\
"name": "Convergence"\
},\
{\
"id": "48",\
"logo": "https://static.okx.com/cdn/wallet/logo/luaswap.png",\
"name": "LuaSwap"\
},\
{\
"id": "40",\
"logo": "https://static.okx.com/cdn/wallet/logo/SHIB.png",\
"name": "ShibaSwap"\
},\
{\
"id": "30",\
"logo": "https://static.okx.com/cdn/wallet/logo/pancake.png",\
"name": "PancakeSwap"\
},\
{\
"id": "53",\
"logo": "https://static.okx.com/cdn/wallet/logo/UNI.png",\
"name": "Uniswap V3"\
},\
{\
"id": "54",\
"logo": "https://static.okx.com/cdn/wallet/logo/balancer.png",\
"name": "Balancer V1"\
},\
{\
"id": "51",\
"logo": "https://static.okx.com/cdn/wallet/logo/balancer.png",\
"name": "Balancer V2"\
},\
{\
"id": "55",\
"logo": "https://static.okx.com/cdn/wallet/logo/Curve.png",\
"name": "Curve V1"\
},\
{\
"id": "259",\
"logo": "https://static.okx.com/cdn/wallet/logo/Curve.png",\
"name": "Curve"\
},\
{\
"id": "58",\
"logo": "https://static.okx.com/cdn/wallet/logo/Curve.png",\
"name": "Curve V2"\
},\
{\
"id": "52",\
"logo": "https://static.okx.com/cdn/wallet/logo/bancor.png",\
"name": "Bancor"\
},\
{\
"id": "59",\
"logo": "https://static.okx.com/cdn/wallet/logo/Kyber.png",\
"name": "Kyber"\
},\
{\
"id": "81",\
"logo": "https://static.okx.com/cdn/wallet/logo/Synapse.png",\
"name": "Synapse"\
},\
{\
"id": "83",\
"logo": "https://static.okx.com/cdn/wallet/logo/Wombat.png",\
"name": "Wombat"\
},\
{\
"id": "80",\
"logo": "https://static.okx.com/cdn/wallet/logo/DODO.png",\
"name": "DODO"\
},\
{\
"id": "82",\
"logo": "https://static.okx.com/cdn/wallet/logo/Shell.png",\
"name": "Shell"\
},\
{\
"id": "88",\
"logo": "https://static.okx.com/cdn/wallet/logo/DODO.png",\
"name": "DODO V2"\
},\
{\
"id": "264",\
"logo": "https://static.okx.com/cdn/wallet/logo/DODO.png",\
"name": "DODO V3"\
},\
{\
"id": "91",\
"logo": "https://static.okx.com/cdn/wallet/logo/Smoothy.png",\
"name": "Smoothy"\
},\
{\
"id": "92",\
"logo": "https://static.okx.com/cdn/wallet/logo/RadioShack.png",\
"name": "RadioShack"\
},\
{\
"id": "90",\
"logo": "https://static.okx.com/cdn/wallet/logo/ORION.png",\
"name": "Orion"\
},\
{\
"id": "89",\
"logo": "https://static.okx.com/cdn/wallet/logo/FraxFinance.png",\
"name": "FraxSwap"\
},\
{\
"id": "99",\
"logo": "https://static.okx.com/cdn/wallet/logo/okb.png",\
"name": "OKX DEX"\
},\
{\
"id": "28",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Hashflow.png",\
"name": "HashFlow"\
},\
{\
"id": "101",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Swapr.png",\
"name": "Swapr"\
},\
{\
"id": "351",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_DFX.png",\
"name": "DFX Finance V3"\
},\
{\
"id": "104",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_bancor.png",\
"name": "Bancor V3"\
},\
{\
"id": "105",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_PSM.png",\
"name": "PSM"\
},\
{\
"id": "106",\
"logo": "https://static.okx.com/cdn/wallet/logo/balancer.png",\
"name": "Balancer"\
},\
{\
"id": "108",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Verse.png",\
"name": "Verse"\
},\
{\
"id": "110",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_1inch_limit_order.png",\
"name": "1inch Limit Order"\
},\
{\
"id": "248",\
"logo": "https://static.okx.com/cdn/wallet/logo/okb.png",\
"name": "OKX Limit Order"\
},\
{\
"id": "132",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_defiplaza.png",\
"name": "DefiPlaza"\
},\
{\
"id": "114",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Swerve.png",\
"name": "Swerve"\
},\
{\
"id": "113",\
"logo": "https://static.okx.com/cdn/wallet/logo/Kyber.png",\
"name": "Kyber Elastic"\
},\
{\
"id": "131",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_defiplaza.png",\
"name": "StablePlaza"\
},\
{\
"id": "130",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_0x_limit_order.png",\
"name": "0x Limit Order"\
},\
{\
"id": "133",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Clipper.png",\
"name": "Clipper"\
},\
{\
"id": "134",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Lido.png",\
"name": "Lido"\
},\
{\
"id": "135",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_NOMISWAP.png",\
"name": "Nomiswap Stable"\
},\
{\
"id": "136",\
"logo": "https://static.okx.com/cdn/explorer/dex/logo/solidly.png",\
"name": "Solidly"\
},\
{\
"id": "215",\
"logo": "https://static.okx.com/cdn/wallet/logo/traderjoexyz.png",\
"name": "Trader Joe V2.1"\
},\
{\
"id": "153",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_Cafe_Swap.png",\
"name": "Cafe Swap"\
},\
{\
"id": "141",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_ELK.png",\
"name": "ELK"\
},\
{\
"id": "102",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Unifi.png",\
"name": "Unifi"\
},\
{\
"id": "159",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_LINKSWAP.png",\
"name": "LINKSWAP"\
},\
{\
"id": "160",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_Sake_Swap.png",\
"name": "Sake Swap"\
},\
{\
"id": "27",\
"logo": "https://static.okx.com/cdn/wallet/logo/Curve.png",\
"name": "Curve 3CRV"\
},\
{\
"id": "202",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_Aave.png",\
"name": "Aave V2"\
},\
{\
"id": "230",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_Aave.png",\
"name": "Aave V3"\
},\
{\
"id": "199",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_Compound.png",\
"name": "Compound"\
},\
{\
"id": "266",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_Compound.png",\
"name": "Compound V3"\
},\
{\
"id": "184",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_logo_Frax.png",\
"name": "sfrxETH"\
},\
{\
"id": "356",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_logo_Frax.png",\
"name": "sFRAX"\
},\
{\
"id": "186",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Lido.png",\
"name": "stMatic"\
},\
{\
"id": "200",\
"logo": "https://static.okx.com/cdn/wallet/logo/pancake.png",\
"name": "PancakeSwap V3"\
},\
{\
"id": "203",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_Rocketpool.png",\
"name": "RocketPool"\
},\
{\
"id": "207",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_kronos.png",\
"name": "Kronos"\
},\
{\
"id": "204",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_1inch_limit_order.png",\
"name": "1inch LP v1.1"\
},\
{\
"id": "210",\
"logo": "https://static.okx.com/cdn/wallet/logo/Curve.png",\
"name": "Curve TNG"\
},\
{\
"id": "330",\
"logo": "https://static.okx.com/cdn/wallet/logo/Curve.png",\
"name": "CurveNG"\
},\
{\
"id": "214",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Mooniswap.png",\
"name": "Mooniswap"\
},\
{\
"id": "213",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Integral.png",\
"name": "Integral"\
},\
{\
"id": "218",\
"logo": "https://static.okx.com/cdn/wallet/logo/dex_Maverick.png",\
"name": "Maverick V1"\
},\
{\
"id": "226",\
"logo": "https://static.okx.com/cdn/wallet/logo/Curve.png",\
"name": "Curve LLAMMA"\
},\
{\
"id": "234",\
"logo": "https://static.okx.com/cdn/explorer/dex/logo/Dex_xSigma.png",\
"name": "xSigma"\
},\
{\
"id": "239",\
"logo": "https://static.okx.com/cdn/explorer/dex/logo/Dex_Sushiswap_V3.png",\
"name": "Sushiswap V3"\
},\
{\
"id": "257",\
"logo": "https://static.okx.com/cdn/explorer/dex/logo/Synthetix.png",\
"name": "Wrapped Synthetix"\
},\
{\
"id": "262",\
"logo": "https://static.okx.com/cdn/explorer/dex/logo/solidly.png",\
"name": "Solidly V3"\
},\
{\
"id": "265",\
"logo": "https://static.okx.com/cdn/explorer/dex/logo/SmarDex.png",\
"name": "SmarDex"\
},\
{\
"id": "328",\
"logo": "https://static.okx.com/cdn/web3/dex/logo/sDai.png",\
"name": "sDai"\
},\
{\
"id": "365",\
"logo": "https://static.okx.com/cdn/web3/dex/logo/Angle.png",\
"name": "Angle"\
},\
{\
"id": "352",\
"logo": "https://static.okx.com/cdn/web3/dex/logo/Angle.png",\
"name": "Angle Stake"\
},\
{\
"id": "258",\
"logo": "https://static.okx.com/cdn/wallet/logo/okb.png",\
"name": "OKX Pre Limit Order"\
},\
{\
"id": "354",\
"logo": "https://static.okx.com/cdn/web3/dex/logo/Origin.png",\
"name": "Origin Wrapper"\
},\
{\
"id": "355",\
"logo": "https://static.okx.com/cdn/web3/dex/logo/Origin.png",\
"name": "Origin"\
},\
{\
"id": "368",\
"logo": "https://static.okx.com/cdn/wallet/logo/Dex_Aave.png",\
"name": "Bgd Aave Static"\
},\
{\
"id": "379",\
"logo": "https://static.okx.com/cdn/web3/dex/logo/Unicly.png",\
"name": "Unicly"\
},\
{\
"id": "394",\
"logo": "https://static.okx.com/cdn/web3/dex/logo/novabits.png",\
"name": "Novabits V3"\
}\
],
"msg": ""
}
[DEX API\
\
Get tokens](/web3/build/docs/waas/dex-get-tokens)
[DEX API\
\
Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
---
# DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[API reference](/web3/build/docs/waas/dex-crosschain-api)
[Supported bridges](/web3/build/docs/waas/dex-crosschain-supported-bridges)
[Smart contract](/web3/build/docs/waas/dex-crosschain-smart-contract)
[Error codes](/web3/build/docs/waas/dex-crosschain-error-code)
[FAQ](/web3/build/docs/waas/dex-crosschain-faq)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
DEX cross-chain
Cross-chain API[#](#cross-chain-api)
=====================================
[API reference\
\
DEX cross-chain API reference](/web3/build/docs/waas/dex-crosschain-api)
[Smart contract\
\
Cross-chain API smart contracts](/web3/build/docs/waas/dex-crosschain-smart-contract)
[Error codes\
\
Cross-chain API error codes](/web3/build/docs/waas/dex-crosschain-error-code)
[FAQ\
\
Cross-chain API FAQ](/web3/build/docs/waas/dex-crosschain-faq)
[DEX API\
\
FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[DEX API\
\
API reference](/web3/build/docs/waas/dex-crosschain-api)
---
# Get Solana swap instructions | API reference | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Get Supported Chains](/web3/build/docs/waas/dex-get-aggregator-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-get-tokens)
[Get liquidity sources](/web3/build/docs/waas/dex-get-liquidity)
[Approve transactions](/web3/build/docs/waas/dex-approve-transaction)
[Get quotes](/web3/build/docs/waas/dex-get-quote)
[Get Solana swap instructions](/web3/build/docs/waas/dex-solana-swap-instruction)
[Swap](/web3/build/docs/waas/dex-swap)
[Query Transaction Status](/web3/build/docs/waas/dex-swap-history)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
Get Solana swap instructions
Get Solana swap instructions[#](#get-solana-swap-instructions)
===============================================================
Obtain transaction instruction data for redemption or custom assembly in Solana.
### Request address[#](#request-address)
GET `https://www.okx.com/api/v5/dex/aggregator/swap-instruction`
### Request parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| chainId | String | Yes | Chain ID (e.g., `1` for Ethereum. See [Chain ID List](/web3/build/docs/waas/walletapi-resources-supported-networks)
for more details.) |
| amount | String | Yes | Token amount for the quote.
(The amount must include its precision. For example, exchanging 1.00 USDT requires inputting `1000000`, while exchanging 1.00 DAI requires `1000000000000000000`. Token precision can be obtained from the token list.) |
| fromTokenAddress | String | Yes | Address of the token contract being swapped from (e.g., `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`). |
| toTokenAddress | String | Yes | Address of the token contract being swapped to (e.g., `0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48`). |
| slippage | String | Yes | Slippage limit.
**Note:**
On Solana, the minimum is `0`, and the maximum must be less than `1`.
(e.g., `0.005` means a max slippage of `0.5%`, `1` means `100%`). |
| userWalletAddress | String | Yes | User’s wallet address (e.g., `0x3f6a3f57569358a512ccc0e513f171516b0fd42a`). |
| swapReceiverAddress | String | No | Recipient address for the purchased asset. If not set, the asset will be sent to the `userWalletAddress`. (e.g., `0x3f6a3f57569358a512ccc0e513f171516b0fd42a`). |
| feePercent | String | No | Percentage of the `fromToken` or `toToken` amount sent to the referral address. Minimum: `0%`, Maximum: `3%`, supports up to two decimal places (e.g., input `1.326%`, but only `1.32%` will be used). |
| fromTokenReferrerWalletAddress | String | No | Wallet address receiving the referral fee in `fromToken`.
**Must be used with `feePercent`**, and a single transaction can only apply **either `fromToken` or `toToken` referral fees**.
**Note:**
**Solana:** The referral address must hold some SOL for activation. |
| toTokenReferrerWalletAddress | String | No | Wallet address receiving the referral fee in `toToken`.
**Must be used with `feePercent`**, and a single transaction can only apply **either `fromToken` or `toToken` referral fees**.
**Note:**
**Solana:** The referral address must hold some SOL for activation. |
| dexIds | String | No | Restrict the quote to specific liquidity pools by `dexId`. Multiple IDs should be comma-separated (e.g., `1,50,180`. See liquidity list for more details). |
| priceImpactProtectionPercentage | String | No | (Optional, default: `90%`) Allowed price impact percentage (between `0` and `1.0`).
If the estimated price impact exceeds the specified percentage, an error will be returned.
Example: If `priceImpactProtectionPercentage = 0.25 (25%)`, any quote exceeding `25%` price impact will return an error.
**This is an optional feature**, defaulting to `0.9`. Setting it to `1.0 (100%)` disables this protection, allowing all trades to proceed.
**Note:** If price impact cannot be calculated, it will return `null`, and this feature will be disabled. |
| computeUnitPrice | String | No | Used for transactions on the Solana network and similar to gasPrice on Ethereum. This price determines the priority level of the transaction. The higher the price, the more likely that the transaction can be processed faster. |
| computeUnitLimit | String | No | Used for transactions on the Solana network and analogous to gasLimit on Ethereum, which ensures that the transaction won’t take too much computing resource. |
### Response parameter[#](#response-parameter)
| Parameter | Type | Description |
| --- | --- | --- |
| addressLookupTableAccount | Array | Address Lookup Table Account. A data structure in the Solana blockchain used to optimize the management and referencing of addresses in transactions. It allows developers to store a group of related addresses in a table and reference them in transactions via index values (instead of the full 32-byte address), significantly improving transaction efficiency and scalability. |
| instructionLists | Array | Detailed transaction instruction information |
| data | String | Instruction data |
| accounts | Array | Instruction account information |
| isSigner | Boolean | Whether the account is a signer |
| isWritable | Boolean | Whether the account is writable |
| pubkey | Boolean | Public key address of the account |
| programId | String | Program ID for instruction execution |
[DEX API\
\
Get quotes](/web3/build/docs/waas/dex-get-quote)
[DEX API\
\
Swap](/web3/build/docs/waas/dex-swap)
### Request example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/swap-instruction?chainId=501&amount=350000000&fromTokenAddress=11111111111111111111111111111111&toTokenAddress=Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB&slippage=0.4&userWalletAddress=FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
### Response example[#](#response-example)
200
{
"code": "0",
"data": {
"addressLookupTableAddresses": [\
"EDDSpjZHrsFKYTMJDcBqXAjkLcu9EKdvrQR4XnqsXErH",\
"9YcB7FUV4cLxTtDWEf399ooy3idpfepeEhMqGihKDDwX",\
"4tbRdGdVvuSzWjFeJJYVMv2vvTpEhCdWbFmNZAnuxmtk"\
],
"instructionLists": [\
{\
"data": "ApC+BgA=",\
"accounts": [],\
"programId": "ComputeBudget111111111111111111111111111111"\
},\
{\
"data": "A08vKAAAAAAA",\
"accounts": [],\
"programId": "ComputeBudget111111111111111111111111111111"\
},\
{\
"data": "AwAAAN22LW+lIkpOjB6e81eI68Mgzu7zEfkmh9QEBkCPOLG3DQAAAAAAAAAxNzM5MjU1OTc3NzU58B0fAAAAAAClAAAAAAAAAAbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp",\
"accounts": [\
{\
"isSigner": true,\
"isWritable": false,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "9haFKThJYWEVA66mtxv7nTBWMHieQdnZpmLjvXAiS2zm"\
}\
],\
"programId": "11111111111111111111111111111111"\
},\
{\
"data": "AQ==",\
"accounts": [\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "9haFKThJYWEVA66mtxv7nTBWMHieQdnZpmLjvXAiS2zm"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "So11111111111111111111111111111111111111112"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "SysvarRent111111111111111111111111111111111"\
}\
],\
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"\
},\
{\
"data": "AgAAAICT3BQAAAAA",\
"accounts": [\
{\
"isSigner": true,\
"isWritable": true,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "9haFKThJYWEVA66mtxv7nTBWMHieQdnZpmLjvXAiS2zm"\
}\
],\
"programId": "11111111111111111111111111111111"\
},\
{\
"data": "EQ==",\
"accounts": [\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "9haFKThJYWEVA66mtxv7nTBWMHieQdnZpmLjvXAiS2zm"\
}\
],\
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"\
},\
{\
"data": "AQ==",\
"accounts": [\
{\
"isSigner": true,\
"isWritable": true,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "HwEh3U3E7aPRwXUhzes6wxX1kbSmKm85ugK6DXP5vgzf"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "11111111111111111111111111111111"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"\
}\
],\
"programId": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"\
},\
{\
"data": "QUs/TOtbW4iAk9wUAAAAAIXrRQQAAAAAHVqQAgAAAAABAAAAgJPcFAAAAAABAAAAAgAAAAEAAAANAQAAAGQBAAAABQEAAABkTpgBAAAAAAA=",\
"accounts": [\
{\
"isSigner": true,\
"isWritable": true,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "9haFKThJYWEVA66mtxv7nTBWMHieQdnZpmLjvXAiS2zm"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "HwEh3U3E7aPRwXUhzes6wxX1kbSmKm85ugK6DXP5vgzf"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "So11111111111111111111111111111111111111112"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo"\
},\
{\
"isSigner": true,\
"isWritable": true,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "9haFKThJYWEVA66mtxv7nTBWMHieQdnZpmLjvXAiS2zm"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "HjkGLCPnsMr4yP2Tmi1Uj7gV7Y2xDj2Npn9kYfVBYr2s"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "8gJ7UWboMeQ6z6AQwFP3cAZwSYG8udVS2UesyCbH79r7"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "chM5ZB1uPZxvJJAK4D1Z4KHAYjWKvwuQTy6fFAeWQ1T"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "FGFaiYjXTVuLsKvzn6ueckraNTeqUGHeYqrQPQCpd7kH"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "So11111111111111111111111111111111111111112"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "DoBNfRox1ZjEsZq6QPY4jpN8hN4Fu9JVkAxJQro164VR"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "D1ZN9Wj1fRSUQfCjhvnu1hqDMT7hzjzBBpi12nVniYD6"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "6TWKYuLYtuJVtvfqnPEs1ZxFMRDGTKkQJgTa4Dv7CzQS"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "EMfT8Jw2M5fs691J6ycgTuggXRJ4uLfbCrqZYJXMXpdL"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "7VVeicGxT7XmwG4Sg25QVFRcAZDaBtGxT9d1CpByzGYN"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "HV1KXxWFaSeriyFvXyx48FqG9BoFbfinB8njCJonqP7K"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "HjkGLCPnsMr4yP2Tmi1Uj7gV7Y2xDj2Npn9kYfVBYr2s"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "HwEh3U3E7aPRwXUhzes6wxX1kbSmKm85ugK6DXP5vgzf"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "2EXiumdi14E9b8Fy62QcA5Uh6WdHS2b38wtSxp72Mibj"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "3uaZBfHPfmpAHW7dsimC1SnyR61X4bJqQZKWmRSCXJxv"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "4zbGjjRx8bmZjynJg2KnkJ54VAk1crcrYsGMy79EXK1P"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "5XkWQL9FJL4qEvL8c3zCzzWnMGzerM3jbGuuyRprsEgG"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "jfrmNrBtxnX1FH36ATeiaXnpA4ppQcKtv7EfrgMsgLJ"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "77quYg4MGneUdjgXCunt9GgM1usmrxKY31twEy3WHwcS"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "37m9QdvxmKRdjm3KKV2AjTiGcXMfWHQpVFnmhtb289yo"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "AQKXXC29ybqL8DLeAVNt3ebpwMv8Sb4csberrP6Hz6o5"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "9MgPMkdEHFX7DZaitSh6Crya3kCCr1As6JC75bm3mjuC"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "H61Y7xVnbWVXrQQx3EojTEqf3ogKVY5GfGjEn5ewyX7B"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "9FLih4qwFMjdqRAGmHeCxa64CgjP1GtcgKJgHHgz44ar"\
},\
{\
"isSigner": false,\
"isWritable": false,\
"pubkey": "FGBvMAu88q9d1Csz7ZECB5a2gbWwp6qicNxN2Mo7QhWG"\
}\
],\
"programId": "6m2CDdhRgxpH4WjvdzxAYbGxwdGUz5MziiL5jek2kBma"\
},\
{\
"data": "CQ==",\
"accounts": [\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "9haFKThJYWEVA66mtxv7nTBWMHieQdnZpmLjvXAiS2zm"\
},\
{\
"isSigner": false,\
"isWritable": true,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
},\
{\
"isSigner": true,\
"isWritable": true,\
"pubkey": "FvUDkjR1STZ3c6g3DjXwLsiQ477t2HGH4LQ81xMKWJZk"\
}\
],\
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"\
}\
]
},
"msg": ""
}
[DEX API\
\
Get quotes](/web3/build/docs/waas/dex-get-quote)
[DEX API\
\
Swap](/web3/build/docs/waas/dex-swap)
---
# Webhook | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Subscribe Data](/web3/build/docs/waas/walletapi-api-webhook-subscribe)
[Unsubscribe Data](/web3/build/docs/waas/walletapi-api-webhook-unsubscribe)
[Subscription List](/web3/build/docs/waas/walletapi-api-webhook-get-subscriptions)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
Webhook
Webhook[#](#webhook)
=====================
Webhooks provide a way for notifications to be delivered to an external server whenever certain events occur on the on-chain.
Note
In case of special situations such as block reorganization, the Webhook may resend data. When receiving this, you need to implement idempotency handling.
[Subscribe\
\
Enable subscription to receive data pushes related to specific addresses](/web3/build/docs/waas/walletapi-api-webhook-subscribe)
[Unsubscribe\
\
Stop receiving data pushes related to specific addresses by canceling subscription](/web3/build/docs/waas/walletapi-api-webhook-unsubscribe)
[View Subscription List\
\
View the list of successfully subscribed addresses](/web3/build/docs/waas/walletapi-api-webhook-get-subscriptions)
[Wallet API\
\
Transaction Order](/web3/build/docs/waas/walletapi-api-order-id-transaction-list)
[Wallet API\
\
Subscribe Data](/web3/build/docs/waas/walletapi-api-webhook-subscribe)
---
# Dex-integration | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
Dex-integration
Dex-integration[#](#dex-integration)
=====================================
To successfully integrate your DEX into the OKX Routing Engine, please follow the steps below:
1. Provide a DEX SDK compatible with the OKX DEX AMM Interface: We require a DEX SDK that is fully compatible with our AMM (Automated Market Maker) interface. This SDK will allow us to communicate with your DEX and integrate its functionalities, enabling liquidity provision and trade execution seamlessly on our platform. The SDK should be able to handle key functions like pricing, order matching, liquidity pool interaction, and trade execution.
2. Allow us to fork your SDK: In order to ensure long-term maintenance and support for our users, it’s important that we can fork your SDK. This means we need the ability to create our own version of the SDK for integration purposes. By doing so, we can:
* Guarantee the stability of the SDK for our users.
* Maintain and update the SDK independently, fixing potential bugs and addressing issues related to your DEX’s integration within our ecosystem.
* Customize the SDK to meet our specific requirements and adapt it for performance optimization.
3. Follow the guide and example we provide: We will provide a detailed integration guide and example code to ensure smooth integration. This will help you understand the technical requirements and structure, making the process easier and faster. By adhering to this documentation, you ensure that your DEX SDK aligns with our platform’s needs and integration standards.
By meeting these guidelines, we will be able to provide your DEX with reliable support and ensure that your liquidity is accessible through the OKX DEX Routing Engine.
Note
Currently, the interface only works for Solana-based DEXs.
AMM Interface[#](#amm-interface)
---------------------------------
use async_trait::async_trait;
use solana_client::rpc_client::RpcClient;
use solana_sdk::pubkey::Pubkey;
use std::collections::HashMap;
use std::error::Error;
use tokio::sync::mpsc::Sender;
pub mod raydium_clmm;
// Other dex template
// pub mod raydium_amm;
// pub mod orca_amm;
// ...
#[async_trait]
pub trait Dex: Send + Sync {
// Return DEX Name
fn dex_name(&self) -> String;
// Return DEX Program ID
fn dex_program_id(&self) -> Pubkey;
// Quote function
fn quote(&self, amount_in: f64, metadata: &PoolMetadata) -> f64;
// fetch all the pool address
fn fetch_pool_addresses(&self, client: &RpcClient) -> Vec;
// monitor new pools and event changes
async fn listen_new_pool_addresses(
&self,
client: &RpcClient,
address_tx: Sender,
) -> Result<(), Box>;
// To export quote parameters from the pool address
fn fetch_pool_metadata(&self, client: &RpcClient, pool_address: &str) -> Option;
}
// abstract design for pool metadata
#[derive(Clone)]
pub struct PoolMetadata {
pub pool_address: String,
pub base_mint: String,
pub quote_mint: String,
pub base_reserve: Option,
pub quote_reserve: Option,
pub trade_fee: Option,
pub extra: HashMap,
}
// Extended value types for pool
#[derive(Clone)]
pub enum PoolMetadataValue {
String(String),
Number(f64),
Bool(bool),
Array(Vec),
Map(HashMap),
}
// Generic simplify HashMap access
macro_rules! get_extra {
($metadata:expr, $key:expr, $variant:path) => {
$metadata.extra.get($key).and_then(|v| match v {
$variant(val) => Some(val.clone()),
_ => None,
})
};
}
pub(crate) use get_extra;
An example of implementation based on Raydium CLMM[#](#an-example-of-implementation-based-on-raydium-clmm)
-----------------------------------------------------------------------------------------------------------
use async_trait::async_trait;
use solana_client::rpc_client::RpcClient;
use solana_sdk::{
pubkey::Pubkey,
signature::Signature,
commitment_config::CommitmentConfig,
};
use std::collections::HashMap;
use std::error::Error;
use std::sync::{Arc, Mutex};
use tokio::sync::mpsc::Sender;
use base58::{FromBase58, ToBase58};
use log::{info, error};
use tokio_tungstenite::{connect_async, tungstenite::protocol::Message};
use super::{Dex, PoolMetadata, get_extra};
// Raydium CLMM Program ID
const PROGRAM_ID: &str = "CLMM9tUush29+wnRVN2QqohW5Ns5mYAPbXTRmbn6kYH";
// Global Mapping Table
lazy_static::lazy_static! {
static ref POOL_ADDRESS_MAP: Arc>> = Arc::new(Mutex::new(HashMap::new()));
}
// Raydium CLMM Pool Derived Account
#[derive(Clone)]
struct PoolDerivedAccounts {
pool_address: String,
base_mint: String,
quote_mint: String,
base_vault: String,
quote_vault: String,
fee_state: String,
tick_array_current: String,
tick_array_prev: String,
tick_array_next: String,
observation_state: String,
}
pub struct RaydiumCLMM;
#[async_trait]
impl Dex for RaydiumCLMM {
fn dex_name(&self) -> String {
"RaydiumCLMM".to_string()
}
fn dex_program_id(&self) -> Pubkey {
Pubkey::from_str(PROGRAM_ID).unwrap()
}
fn quote(&self, amount_in: f64, metadata: &PoolMetadata) -> f64 {
if amount_in <= 0.0 {
return 0.0;
}
let fee_rate = metadata.trade_fee.unwrap_or(0.0);
let amount_in_with_fee = amount_in * (1.0 - fee_rate);
let mut remaining_in = amount_in_with_fee;
let mut total_out = 0.0;
let sqrt_price_x64 = get_extra!(metadata, "sqrt_price_x64", PoolMetadataValue::Number).unwrap_or(0.0);
let tick_current_index = get_extra!(metadata, "tick_current_index", PoolMetadataValue::Number).unwrap_or(0.0) as i32;
let tick_array = get_extra!(metadata, "tick_array", PoolMetadataValue::Array).unwrap_or(vec![]);
if tick_array.is_empty() {
return 0.0;
}
let current_price = sqrt_price_x64 / 2_f64.powi(64);
let mut current_tick = tick_current_index;
let mut ticks: Vec<(i32, f64)> = tick_array.iter()
.filter_map(|v| match v {
PoolMetadataValue::Map(m) => {
let tick_index = get_extra!(m, "tick_index", PoolMetadataValue::Number)? as i32;
let liquidity = get_extra!(m, "liquidity", PoolMetadataValue::Number)?;
Some((tick_index, liquidity))
},
_ => None,
})
.collect();
ticks.sort_by(|a, b| a.0.cmp(&b.0));
for (tick_index, liquidity) in ticks {
if tick_index <= current_tick {
continue;
}
let sqrt_price_lower = (1.0001_f64.powf(current_tick as f64)).sqrt();
let sqrt_price_upper = (1.0001_f64.powf(tick_index as f64)).sqrt();
let delta_sqrt_price = sqrt_price_upper - sqrt_price_lower;
let max_amount_out = liquidity * delta_sqrt_price;
let cost = max_amount_out * (sqrt_price_upper + sqrt_price_lower) / 2.0;
if remaining_in >= cost {
total_out += max_amount_out;
remaining_in -= cost;
current_tick = tick_index;
} else {
let fraction = remaining_in / cost;
total_out += max_amount_out * fraction;
remaining_in = 0.0;
break;
}
if remaining_in <= 0.0 {
break;
}
}
total_out
}
fn fetch_pool_addresses(&self, client: &RpcClient) -> Vec {
let program_id = self.dex_program_id();
let accounts = match client.get_program_accounts(&program_id) {
Ok(accs) => accs,
Err(e) => {
error!("Failed to fetch {} pool addresses: {}", self.dex_name(), e);
return Vec::new();
}
};
let mut pool_addresses = Vec::new();
for (pubkey, account) in accounts {
if account.owner != program_id {
continue;
}
let data = account.data;
if data.len() < 200 {
continue;
}
let base_mint = data[0..32].to_base58();
let quote_mint = data[32..64].to_base58();
if base_mint.is_empty() || quote_mint.is_empty() {
continue;
}
let discriminator = u64::from_le_bytes(data[0..8].try_into().unwrap());
if discriminator == 0 {
continue;
}
let pool_address = pubkey.to_string();
pool_addresses.push(pool_address.clone());
if let Some(accounts) = self.derive_accounts_from_pool_address(client, &pool_address) {
POOL_ADDRESS_MAP.lock().unwrap().insert(pool_address, accounts);
}
}
pool_addresses
}
async fn listen_new_pool_addresses(
&self,
client: &RpcClient,
address_tx: Sender,
) -> Result<(), Box> {
let program_id = self.dex_program_id();
let ws_url = "wss://api.mainnet-beta.solana.com";
let (mut ws_stream, _) = connect_async(ws_url).await?;
let subscribe_msg = format!(
r#"{"jsonrpc":"2.0","id":1,"method":"logsSubscribe","params":["mentions","{}"]}"#,
program_id
);
ws_stream.send(Message::Text(subscribe_msg)).await?;
while let Some(msg) = ws_stream.next().await {
let msg = msg?;
if let Message::Text(text) = msg {
let log: serde_json::Value = serde_json::from_str(&text)?;
if log.get("result").is_some() {
continue;
}
let params = log.get("params").and_then(|p| p.get("result")).ok_or("No params")?;
let tx_sig = params.get("signature").and_then(|s| s.as_str()).ok_or("No signature")?;
let logs = params.get("logs").and_then(|l| l.as_array()).ok_or("No logs")?;
let tx = client.get_transaction(
&Signature::from_str(tx_sig)?,
CommitmentConfig::confirmed(),
)?;
if tx.meta.is_some() && tx.meta.unwrap().err.is_some() {
continue;
}
let log_str = logs.iter().filter_map(|l| l.as_str()).collect::>().join(" ");
let account_keys = tx.transaction.message.account_keys;
for (i, key) in account_keys.iter().enumerate() {
if tx.transaction.message.is_writable(i) {
let pool_address = self.find_pool_address_from_account(&key.to_string());
if pool_address.is_empty() && self.is_valid_pool_address(client, &key.to_string()) {
if let Some(accounts) = self.derive_accounts_from_pool_address(client, &key.to_string()) {
POOL_ADDRESS_MAP.lock().unwrap().insert(key.to_string(), accounts);
info!("Detected new {} pool address: {}", self.dex_name(), key);
address_tx.send(key.to_string()).await?;
}
} else if !pool_address.is_empty() {
info!("Detected writable account affecting pool: {}, Pool: {}", tx_sig, pool_address);
address_tx.send(pool_address).await?;
}
}
}
if log_str.contains("initialize") {
if let Some(pool_address) = self.extract_new_pool_address(client, tx_sig) {
if self.is_valid_pool_address(client, &pool_address) {
if let Some(accounts) = self.derive_accounts_from_pool_address(client, &pool_address) {
POOL_ADDRESS_MAP.lock().unwrap().insert(pool_address.clone(), accounts);
info!("Detected new {} pool address: {}", self.dex_name(), pool_address);
address_tx.send(pool_address).await?;
}
}
}
}
}
}
Ok(())
}
fn fetch_pool_metadata(&self, client: &RpcClient, pool_address: &str) -> Option {
let derived_accounts = self.derive_accounts_from_pool_address(client, pool_address)?;
let out = client.get_account_data(&Pubkey::from_str(pool_address).ok()?).ok()?;
if out.len() < 200 {
error!("Pool data too short for {}", pool_address);
return None;
}
let base_reserve = self.get_vault_balance(client, &derived_accounts.base_vault);
let quote_reserve = self.get_vault_balance(client, &derived_accounts.quote_vault);
let fee_data = client.get_account_data(&Pubkey::from_str(&derived_accounts.fee_state).ok()?).ok()?;
let fee_numerator = u64::from_le_bytes(fee_data[0..8].try_into().unwrap());
let fee_denominator = u64::from_le_bytes(fee_data[8..16].try_into().unwrap());
let trade_fee = if fee_denominator > 0 { Some(fee_numerator as f64 / fee_denominator as f64) } else { None };
let sqrt_price_x64 = u64::from_le_bytes(out[64..72].try_into().unwrap());
let tick_current_index = i32::from_le_bytes(out[72..76].try_into().unwrap());
let tick_array_data = client.get_account_data(&Pubkey::from_str(&derived_accounts.tick_array_current).ok()?).unwrap_or_default();
let mut tick_array = Vec::new();
if !tick_array_data.is_empty() {
for i in (8..tick_array_data.len() - 12).step_by(12) {
let tick_index = i32::from_le_bytes(tick_array_data[i..i+4].try_into().unwrap());
let liquidity = f64::from_le_bytes(tick_array_data[i+4..i+12].try_into().unwrap()) / 1_000_000.0;
let mut tick_map = HashMap::new();
tick_map.insert("tick_index".to_string(), PoolMetadataValue::Number(tick_index as f64));
tick_map.insert("liquidity".to_string(), PoolMetadataValue::Number(liquidity));
tick_array.push(PoolMetadataValue::Map(tick_map));
}
}
let mut extra = HashMap::new();
extra.insert("sqrt_price_x64".to_string(), PoolMetadataValue::Number(sqrt_price_x64 as f64));
extra.insert("tick_current_index".to_string(), PoolMetadataValue::Number(tick_current_index as f64));
extra.insert("tick_array".to_string(), PoolMetadataValue::Array(tick_array));
Some(PoolMetadata {
pool_address: pool_address.to_string(),
base_mint: derived_accounts.base_mint,
quote_mint: derived_accounts.quote_mint,
base_reserve: Some(base_reserve),
quote_reserve: Some(quote_reserve),
trade_fee,
extra,
})
}
}
impl RaydiumCLMM {
fn derive_accounts_from_pool_address(&self, client: &RpcClient, pool_address: &str) -> Option {
let out = client.get_account_data(&Pubkey::from_str(pool_address).ok()?).ok()?;
if out.len() < 200 {
error!("Pool data too short for {}", pool_address);
return None;
}
let base_mint = out[0..32].to_base58();
let quote_mint = out[32..64].to_base58();
let base_vault = out[96..128].to_base58();
let quote_vault = out[128..160].to_base58();
let fee_state = out[160..192].to_base58();
let tick_array_current_seed = format!("tick_array{}", pool_address);
let tick_array_current = Pubkey::create_program_address(
&[&tick_array_current_seed.as_bytes()],
&Pubkey::from_str(PROGRAM_ID).unwrap(),
).ok()?.to_string();
let tick_array_prev_seed = format!("tick_array_prev{}", pool_address);
let tick_array_prev = Pubkey::create_program_address(
&[&tick_array_prev_seed.as_bytes()],
&Pubkey::from_str(PROGRAM_ID).unwrap(),
).ok()?.to_string();
let tick_array_next_seed = format!("tick_array_next{}", pool_address);
let tick_array_next = Pubkey::create_program_address(
&[&tick_array_next_seed.as_bytes()],
&Pubkey::from_str(PROGRAM_ID).unwrap(),
).ok()?.to_string();
let observation_state_seed = format!("observation_state{}", pool_address);
let observation_state = Pubkey::create_program_address(
&[&observation_state_seed.as_bytes()],
&Pubkey::from_str(PROGRAM_ID).unwrap(),
).ok()?.to_string();
Some(PoolDerivedAccounts {
pool_address: pool_address.to_string(),
base_mint,
quote_mint,
base_vault,
quote_vault,
fee_state,
tick_array_current,
tick_array_prev,
tick_array_next,
observation_state,
})
}
fn find_pool_address_from_account(&self, account_address: &str) -> String {
let map = POOL_ADDRESS_MAP.lock().unwrap();
for (pool_address, accounts) in map.iter() {
if account_address == pool_address ||
account_address == &accounts.base_vault ||
account_address == &accounts.quote_vault ||
account_address == &accounts.tick_array_current ||
account_address == &accounts.tick_array_prev ||
account_address == &accounts.tick_array_next {
return pool_address.clone();
}
}
String::new()
}
fn is_valid_pool_address(&self, client: &RpcClient, pool_address: &str) -> bool {
let out = match client.get_account_data(&Pubkey::from_str(pool_address).unwrap()) {
Ok(data) => data,
Err(_) => return false,
};
if out.len() < 200 {
return false;
}
if Pubkey::from_str(&out.owner.to_string()).unwrap() != Pubkey::from_str(PROGRAM_ID).unwrap() {
return false;
}
let base_mint = out[0..32].to_base58();
let quote_mint = out[32..64].to_base58();
if base_mint.is_empty() || quote_mint.is_empty() {
return false;
}
let discriminator = u64::from_le_bytes(out[0..8].try_into().unwrap());
if discriminator == 0 {
return false;
}
true
}
fn get_vault_balance(&self, client: &RpcClient, vault: &str) -> f64 {
match client.get_token_account_balance(&Pubkey::from_str(vault).unwrap(), CommitmentConfig::confirmed()) {
Ok(resp) => resp.ui_amount.unwrap_or(0.0),
Err(_) => 0.0,
}
}
fn extract_new_pool_address(&self, client: &RpcClient, tx_sig: &str) -> Option {
let tx = client.get_transaction(
&Signature::from_str(tx_sig).ok()?,
CommitmentConfig::confirmed(),
).ok()?;
for key in tx.transaction.message.account_keys {
if key.is_writable() && !key.is_signer() {
return Some(key.to_string());
}
}
None
}
}
[DEX API\
\
Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[DEX API\
\
Smart contract](/web3/build/docs/waas/dex-smart-contract)
Table of contents
[AMM Interface](#amm-interface)
[An example of implementation based on Raydium CLMM](#an-example-of-implementation-based-on-raydium-clmm)
---
# Introduction | Marketplace API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Marketplace API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Marketplace API
Introduction
Introduction[#](#introduction)
===============================
Welcome to the developers' documentation for the OKX NFT Marketplace, a one-stop decentralized NFT aggregated exchange platform that supports multi-chain NFT creations and cross-platform transactions. OKX NFT Marketplace provides real-time on-chain data for users and developers, and is dedicated to building a decentralized multi-chain NFT ecosystem.
NFT aggregator[#](#nft-aggregator)
-----------------------------------
OKX NFT Marketplace combines the order book depth from multiple mainstream marketplaces and platforms to provide up-to-date order data for developers and users. OKX Marketplace also includes abundant NFT collection data, and supports real-time and accurate on-chain data. Marketplaces that support aggregation are OKX NFT, Opensea, Magic Eden, Looksrare, IMX, and X2Y2.
OKX NFT Marketplace allows NFT holders to list their NFTs on multiple platforms simultaneously with the least of efforts and the best liquidity. Marketplaces that support listings are OKX NFT, Opensea, Looksrare, and Magic Eden.
OKX NFT Marketplace supports ETH, OKTC, BSC, Polygon, IMX, AVAX-C, Solana, Arbitrum One, zkSync Era, Aptos, Optimism, Klaytn, Arbitrum Nova, Base and Linea. We also plan to support NFT aggregated transactions on more chains.
Issuance Marketplace & Secondary Marketplace[#](#issuance-marketplace-&-secondary-marketplace)
-----------------------------------------------------------------------------------------------
Issuance Marketplace: OKX NFT's exclusive primary issuance platform selects high-quality NFT projects for completely decentralized offerings, allowing users to obtain their preferred NFT at lower prices in the issuance market as soon as possible.
Secondary Marketplace: OKX NFT Marketplace lets users conduct peer-to-peer transactions and helps both buyers and sellers seek the best price. OKX is dedicated to providing users with an efficient and low-cost NFT trading experience with high liquidity.
Contract architecture[#](#contract-architecture)
-------------------------------------------------
### Overview[#](#overview)
#### Features that EVM contract supports[#](#features-that-evm-contract-supports)
* Batch purchasing
* Collection offers
* Listing
* Offer functions
* Instant royalties for the creator
* ERC-2981 royalties support
#### Features that Solana contract supports[#](#features-that-solana-contract-supports)
* Batch purchasing
* Listing
* Instant royalties for the creator
### OKX NFT Marketplace contract[#](#okx-nft-marketplace-contract)
Users authorize the OKX secondary market to authorize `union approve` contract to use tokens (this step is not required for native tokens)
Users then call the OKX `Aggregator` contract interface to interact with the OKX secondary market, such as making bids or listing orders
### OKX NFT aggregator contract[#](#okx-nft-aggregator-contract)
Develop `Adapter` contracts for different markets
Register `Adapter` contracts to `Market Registry` contracts
OKX `Aggregator` contracts are linked to different markets via `Adapter` contracts; for instance, OKX `Aggregator` contracts interact with `OpenSea` markets via `OpenSea Adapter` contracts
How to start[#](#how-to-start)
-------------------------------
Go to [NFT Market](/web3/marketplace/nft)
to begin your NFT journey.
Go to the marketplace and choose NFTs to bid or purchase directly. Visit your profile to view your NFT assets and begin trading.
If you are a digital artist, you are welcome to make your own NFT on our Create NFT page.
Deployed contract[#](#deployed-contract)
-----------------------------------------
### OKX NFT aggregator contract[#](#okx-nft-aggregator-contract)
| **Number** | **Network** | **Contract address** |
| --- | --- | --- |
| 1 | Ethereum | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 2 | OKTC | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 3 | BNB Chain | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 4 | Polygon | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 5 | Avalanche-C | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 6 | Arbitrum One | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 7 | Arbitrum Nova | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 8 | zkSync Era | 0x444b2Fd4395Ec890fbC492753DCe1bE2fC8Ff63D |
| 9 | Optimism | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 10 | Klaytn | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 11 | Base | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 12 | Linea | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 13 | opBNB | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
| 14 | Polygon zkEVM | 0xa7FD99748cE527eAdC0bDAc60cba8a4eF4090f7c |
### OKX self-operated marketplace contract[#](#okx-self-operated-marketplace-contract)
| **Number** | **Network** | **Contract address** |
| --- | --- | --- |
| 1 | Ethereum | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 2 | OKTC | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 3 | BNB Chain | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 4 | Polygon | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 5 | Avalanche-C | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 6 | Arbitrum One | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 7 | Arbitrum Nova | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 8 | zkSync Era | 0xd756E8070b33a35E42f00140Ac92c4b4e0bBfb82 |
| 9 | Optimism | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 10 | Klaytn | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 11 | Base | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 12 | Linea | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 13 | opBNB | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
| 14 | Polygon zkEVM | 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC |
[DEX API\
\
Use Widget](/web3/build/docs/waas/dex-widget)
[Marketplace API\
\
Runes API](/web3/build/docs/waas/marketplace-runes-api)
Table of contents
[NFT aggregator](#nft-aggregator)
[Issuance Marketplace & Secondary Marketplace](#issuance-marketplace-&-secondary-marketplace)
[Contract architecture](#contract-architecture)
[How to start](#how-to-start)
[Deployed contract](#deployed-contract)
---
# FAQ | Swap API | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[API reference](/web3/build/docs/waas/dex-api-reference)
[Adding Fees](/web3/build/docs/waas/dex-api-addfee)
[Dex-integration](/web3/build/docs/waas/dex-integration)
[Smart contract](/web3/build/docs/waas/dex-smart-contract)
[Error codes](/web3/build/docs/waas/dex-error-code)
[FAQ](/web3/build/docs/waas/dex-aggregation-faq)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Swap API](/web3/build/docs/waas/dex-aggregation)
FAQ
FAQ[#](#faq)
=============
What is the Native Token Address for Each Chain?[#](#what-is-the-native-token-address-for-each-chain?)
-------------------------------------------------------------------------------------------------------
We have defined the native tokens for each chain. Please refer to the table below for details:
| Chain Name | Native Token Address | |
| --- | --- | --- |
| EVM | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | |
| Solana | 11111111111111111111111111111111 | |
| Sui | 0x2::sui::SUI | |
| Tron | T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb | |
| Ton | EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c | |
[DEX API\
\
Error codes](/web3/build/docs/waas/dex-error-code)
[DEX API\
\
Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
Table of contents
[What is the Native Token Address for Each Chain?](#what-is-the-native-token-address-for-each-chain?)
---
# Runes API | Marketplace API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Get Runes collection](/web3/build/docs/waas/marketplace-get-runes-collection)
[Get Popular collections](/web3/build/docs/waas/marketplace-runes-popular-collections)
[Get sale activity](/web3/build/docs/waas/marketplace-runes-trade-history)
[Get asset for an address](/web3/build/docs/waas/marketplace-runes-asset)
[Get Runes listing](/web3/build/docs/waas/marketplace-runes-listings)
[Create listing](/web3/build/docs/waas/marketplace-runes-create-listing)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Marketplace API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Marketplace API
Runes API
Runes API[#](#runes-api)
=========================
[Get Runes collection\
\
Get Runes collection](/web3/build/docs/waas/marketplace-get-runes-collection)
[Get Popular collections\
\
Get Popular collections](/web3/build/docs/waas/marketplace-runes-popular-collections)
[Get sale activity\
\
Get sale activity](/web3/build/docs/waas/marketplace-runes-trade-history)
[Get asset for an address\
\
Get asset for an address](/web3/build/docs/waas/marketplace-runes-asset)
[Get Runes listing\
\
Get Runes listing](/web3/build/docs/waas/marketplace-runes-listings)
[Create listing\
\
Create listing](/web3/build/docs/waas/marketplace-runes-create-listing)
[Marketplace API\
\
Introduction](/web3/build/docs/waas/marketplace-introduction)
[Marketplace API\
\
Get Runes collection](/web3/build/docs/waas/marketplace-get-runes-collection)
---
# API reference | Marketplace API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[NFT API](/web3/build/docs/waas/marketplace-nft-api)
[Asset API](/web3/build/docs/waas/marketplace-asset-api)
[Collection API](/web3/build/docs/waas/marketplace-collection-api)
[Order API](/web3/build/docs/waas/marketplace-order-api)
[Supported blockchains](/web3/build/docs/waas/marketplace-supported-blockchains)
[Integrated markets](/web3/build/docs/waas/marketplace-integrated-markets)
[Models](/web3/build/docs/waas/marketplace-models)
[Interact with different order types](/web3/build/docs/waas/marketplace-order-types)
[Deployed contract](/web3/build/docs/waas/marketplace-deployed-contract)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Marketplace API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Marketplace API
API reference
Market API[#](#market-api)
===========================
[Runes API\
\
Obtain API descriptions related to NFT](/web3/build/docs/waas/marketplace-runes-api)
[NFT API\
\
Obtain API descriptions related to Rune](/web3/build/docs/waas/marketplace-nft-api)
[Asset API\
\
Obtain API descriptions related to Asset](/web3/build/docs/waas/marketplace-asset-api)
[Collection API\
\
Obtain API descriptions related to Collection](/web3/build/docs/waas/marketplace-collection-api)
[Order API\
\
Obtain API descriptions related to Order](/web3/build/docs/waas/marketplace-order-api)
[Models\
\
Specific description of various models](/web3/build/docs/waas/marketplace-models)
[Interact with different order types\
\
Understanding different order types to help build business](/web3/build/docs/waas/marketplace-order-types)
[Deployed contract\
\
Obtain deployed contract addresses](/web3/build/docs/waas/marketplace-deployed-contract)
[Marketplace API\
\
Create listing](/web3/build/docs/waas/marketplace-runes-create-listing)
[Marketplace API\
\
NFT API](/web3/build/docs/waas/marketplace-nft-api)
---
# Fractal Ordinals API | Marketplace API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Retrieve Fractal Ordinals collection](/web3/build/docs/waas/marketplace-fractal-retrieve-ordinal-collection-list)
[Retrieve Fractal Ordinals activities](/web3/build/docs/waas/marketplace-fractal-retrieve-ordinal-activities)
[Retrieve valid inscriptions](/web3/build/docs/waas/marketplace-fractal-ordinals-get-inscriptions)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Marketplace API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Marketplace API
Fractal Ordinals API
Fractal Ordinals API[#](#fractal-ordinals-api)
===============================================
[Retrieve Fractal Ordinals collection\
\
Get the list of all Fractal NFT and Brc20 collections](/web3/build/docs/waas/marketplace-fractal-retrieve-ordinal-collection-list)
[Retrieve Fractal Ordinals activities\
\
Get all transaction records under a specific collection](/web3/build/docs/waas/marketplace-fractal-retrieve-ordinal-activities)
[Retrieve valid inscriptions\
\
Get asset for an address](/web3/build/docs/waas/marketplace-fractal-ordinals-get-inscriptions)
[Marketplace API\
\
Ordinals related models](/web3/build/docs/waas/marketplace-ordinal-model)
[Marketplace API\
\
Retrieve Fractal Ordinals collection](/web3/build/docs/waas/marketplace-fractal-retrieve-ordinal-collection-list)
---
# Ordinals API | Marketplace API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Quick start](/web3/build/docs/waas/ordinals-quick-start)
[Create listing to OKX](/web3/build/docs/waas/create-ordinals-api)
[Retrieve Ordinals collection](/web3/build/docs/waas/marketplace-retrieve-ordinal-collection-list)
[Retrieve Ordinals listings](/web3/build/docs/waas/marketplace-retrieve-ordinal-listings)
[Retrieve Ordinals activities](/web3/build/docs/waas/marketplace-retrieve-ordinal-activities)
[Ordinals related models](/web3/build/docs/waas/marketplace-ordinal-model)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Marketplace API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Marketplace API
Ordinals API
BTC Ordinals API[#](#btc-ordinals-api)
=======================================
[Quick start\
\
Quick start](/web3/build/docs/waas/ordinals-quick-start)
[Create listing to OKX\
\
Create listing to OKX](/web3/build/docs/waas/create-ordinals-api)
[Retrieve Ordinals collection\
\
Get the list of all BTC NFT and Brc20 collections](/web3/build/docs/waas/marketplace-retrieve-ordinal-collection-list)
[Retrieve Ordinals listings\
\
Get all active listings for a given collection](/web3/build/docs/waas/marketplace-retrieve-ordinal-listings)
[Retrieve Ordinals activities\
\
Get all transaction records under a specific collection](/web3/build/docs/waas/marketplace-retrieve-ordinal-activities)
[Ordinals related models\
\
Specific description of Ordinals models](/web3/build/docs/waas/marketplace-ordinal-model)
[Marketplace API\
\
Deployed contract](/web3/build/docs/waas/marketplace-deployed-contract)
[Marketplace API\
\
Quick start](/web3/build/docs/waas/ordinals-quick-start)
---
# Error codes | Marketplace API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Marketplace API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Marketplace API
Error codes
Error codes[#](#error-codes)
=============================
| Code | HTTP status | Message |
| --- | --- | --- |
| 0 | 200 | Succeeded |
| 50011 | 429 | Rate limit reached; please refer to API documentation and throttle requests accordingly |
| 50014 | 400 | Parameter {param0} cannot be empty |
| 50026 | 500 | System error; try again later |
| 50103 | 401 | Request header "OK-ACCESS-KEY" cannot be empty |
| 50104 | 401 | Request header "OK-ACCESS-PASSPHRASE" cannot be empty. |
| 50105 | 401 | Request header "OK-ACCESS-PASSPHRASE" incorrect |
| 50106 | 401 | Request header "OK-ACCESS-SIGN" cannot be empty |
| 50107 | 401 | Request header "OK-ACCESS-TIMESTAMP" cannot be empty |
| 50111 | 401 | Invalid OK-ACCESS-KEY |
| 50112 | 401 | Invalid OK-ACCESS-TIMESTAMP |
| 50113 | 401 | Invalid signature |
| 83000 | 200 | Data not found |
| 83001 | 200 | Wrong parameters |
| 83002 | 200 | Chain not supported |
| 83003 | 200 | Time range contains a conflict between optional exclusive peers \[createTime, updateTime\] |
[Marketplace API\
\
Retrieve valid inscriptions](/web3/build/docs/waas/marketplace-fractal-ordinals-get-inscriptions)
[DeFi API\
\
Introduction](/web3/build/docs/waas/defi-introduction)
---
# Quickstart | DeFi API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[Overview](/web3/build/docs/waas/defi-quickstart-overview)
[Subscription process](/web3/build/docs/waas/defi-quickstart-subscription-flow)
[Redemption process](/web3/build/docs/waas/defi-quickstart-redemption-flow)
[Reward claiming process](/web3/build/docs/waas/defi-quickstart-bonus-flow)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DeFi API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DeFi API
Quickstart
Quickstart[#](#quickstart)
===========================
[Overview\
\
This page explains the data interaction process of the OKX Web DeFi investment](/web3/build/docs/waas/defi-quickstart-overview)
[Subscription process\
\
This page explains the subscription process](/web3/build/docs/waas/defi-quickstart-subscription-flow)
[Redemption process\
\
This page explains the redemption process](/web3/build/docs/waas/defi-quickstart-redemption-flow)
[Reward claiming process\
\
This page explains the reward claiming process](/web3/build/docs/waas/defi-quickstart-bonus-flow)
[DeFi API\
\
Introduction](/web3/build/docs/waas/defi-introduction)
[DeFi API\
\
Overview](/web3/build/docs/waas/defi-quickstart-overview)
---
# API reference | DeFi API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Introduction](/web3/build/docs/waas/defi-api-reference-introduction)
[Query information](/web3/build/docs/waas/defi-api-reference-explore)
[Calculation](/web3/build/docs/waas/defi-api-reference-calculation)
[Transaction](/web3/build/docs/waas/defi-api-reference-transaction)
[User](/web3/build/docs/waas/defi-api-reference-personal)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DeFi API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DeFi API
API reference
API reference[#](#api-reference)
=================================
[Introduction\
\
Information about DeFi API business scenarios](/web3/build/docs/waas/defi-api-reference-introduction)
[Query information\
\
Information about protocols, platforms, and investment products](/web3/build/docs/waas/defi-api-reference-explore)
[Calculation\
\
Tools for calculating investment returns](/web3/build/docs/waas/defi-api-reference-calculation)
[Transaction\
\
Information about on-chain transaction invocation data](/web3/build/docs/waas/defi-api-reference-transaction)
[User\
\
Information about querying user assets and positions](/web3/build/docs/waas/defi-api-reference-personal)
[DeFi API\
\
Reward claiming process](/web3/build/docs/waas/defi-quickstart-bonus-flow)
[DeFi API\
\
Introduction](/web3/build/docs/waas/defi-api-reference-introduction)
---
# Introduction | DeFi API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DeFi API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DeFi API
Introduction
Introduction[#](#introduction)
===============================
OKX Web3 DeFi is the only all-in-one DeFi investment solution on the market. Our multichain DeFi aggregator provides users with a comprehensive platform for aggregating investment opportunities in DeFi, enabling them to quickly and easily locate investment products that meet their needs.
OKX Web3 DeFi has accessed over 80 protocols like Aave, Compound, Curve, Yearn, and Uniswap. We also provide support for over 15 networks, such as Arbitrum, Ethereum, and Polygon. Integrating OKX Web3 DeFi Open API into your application will enable users to easily and quickly access all DeFi protocols and enjoy the benefits when investing in DeFi.
[Marketplace API\
\
Error codes](/web3/build/docs/waas/marketplace-error-code)
[DeFi API\
\
Quickstart](/web3/build/docs/waas/defi-quickstart)
---
# Error code | DeFi API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DeFi API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DeFi API
Error code
Error code[#](#error-code)
===========================
| Code | HTTP status | Message (EN) | Message (CN) |
| --- | --- | --- | --- |
| 0 | 200 | Succeeded | 操作成功 |
| 50011 | 429 | Rate limit reached. Please refer to API documentation and throttle requests accordingly. | 用户请求频率过快,超过该接口允许的限额。请参考 API 文档并限制请求 |
| 50014 | 400 | Parameter {0} cannot be empty. | 必填参数 {0} 不能为空 |
| 50026 | 500 | System error. Try again later. | 系统错误,请稍后重试 |
| 50103 | 401 | Request header “OK-ACCESS-KEY” cannot be empty. | 请求头“OK\_ACCESS\_KEY”不能为空 |
| 50104 | 401 | Request header “OK-ACCESS-PASSPHRASE” cannot be empty. | 请求头“OK\_ACCESS\_PASSPHRASE”不能为空 |
| 50105 | 401 | Request header “OK-ACCESS-PASSPHRASE” is incorrect. | 请求头“OK\_ACCESS\_PASSPHRASE”错误 |
| 50106 | 401 | Request header “OK-ACCESS-SIGN” cannot be empty. | 请求头“OK\_ACCESS\_SIGN”不能为空 |
| 50107 | 401 | Request header “OK-ACCESS-TIMESTAMP” cannot be empty. | 请求头“OK\_ACCESS\_TIMESTAMP”不能为空 |
| 50111 | 401 | Invalid OK-ACCESS-KEY | OK\_ACCESS\_KEY 无效 |
| 50112 | 401 | Invalid OK-ACCESS-TIMESTAMP | OK\_ACCESS\_TIMESTAMP 无效 |
| 50113 | 401 | Invalid signature | 签名无效 |
| 84000 | 400 | Parameter error | 参数错误 |
| 84001 | 200 | Platform not supported | 不支持的平台 |
| 84003 | 200 | Protocol not supported | 不支持的协议 |
| 84007 | 200 | Investment product not supported | 不支持的投资品 |
| 84010 | 200 | Token not supported | 不支持的币种 |
| 84011 | 200 | Platform logo is empty | 平台 logo 为空 |
| 84013 | 200 | Swap not supported | 不支持兑换 |
| 84014 | 200 | Balance validation unsuccessful | 余额校验失败 |
| 84016 | 200 | Smart contract execution unsuccessful | 合约方法执行失败 |
| 84017 | 200 | Staking rate validation unsuccessful | 质押率校验失败 |
| 84018 | 200 | Balancing unsuccessful | 配平失败 |
| 84019 | 200 | Address format unmatched | 地址格式不匹配 |
| 84021 | 200 | Syncing assets | 资产同步中 |
| 84022 | 200 | Authorization type not supported | 不支持的交易授权 |
| 84998 | 200 | Investment error | 投资异常 |
| 84999 | 500 | Default error | 默认异常 |
[DeFi API\
\
Query user’s redemption application list](/web3/build/docs/waas/defi-api-reference-personal-invest-unstake-list)
[More resources\
\
General specification](/web3/build/docs/waas/okx-waas-standard)
---
# FAQ | DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[API reference](/web3/build/docs/waas/dex-crosschain-api)
[Supported bridges](/web3/build/docs/waas/dex-crosschain-supported-bridges)
[Smart contract](/web3/build/docs/waas/dex-crosschain-smart-contract)
[Error codes](/web3/build/docs/waas/dex-crosschain-error-code)
[FAQ](/web3/build/docs/waas/dex-crosschain-faq)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[DEX cross-chain](/web3/build/docs/waas/dex-crosschain-aggregator)
FAQ
FAQ[#](#faq)
=============
Common reasons for cross-chain failures[#](#common-reasons-for-cross-chain-failures)
-------------------------------------------------------------------------------------
There are three categories of unsuccessful cross-chain swaps: unsuccessful source-chain swaps, unsuccessful destination-chain swaps, and unsuccessful cross-bridge transactions.
1. The source-chain swaps and the destination-chain swaps may fail for the following reasons:
* Broadcast failure
* Insufficient gas
* Exceeded slippage setting
* Insufficient approved crypto amount
* Third-party DEX contract execution error
* The transaction was sped up or canceled
* Tokens traded were safeMoon or honeypot tokens
2. Cross-bridge transactions may fail for the following reasons:
* Exceeded the third-party bridge’s slippage
* Triggered the third-party bridge’s blocklist
* The minimum/maximum cross-chain amount required by the bridge wasn’t met
* Insufficient liquidity on the bridge
* The cross-bridge transaction timed out
Transaction time is too long[#](#transaction-time-is-too-long)
---------------------------------------------------------------
NO, The transaction of source-chain swaps usually takes less than one minute. The official bridges have long transaction times because of their own cross-chain mechanisms. If the other third-party bridge doesn’t return the final status for a long time, you can check the transaction status on the chain or contact third-party customer service for confirmation.
Are speed-ups and transaction cancellation supported?[#](#are-speed-ups-and-transaction-cancellation-supported?)
-----------------------------------------------------------------------------------------------------------------
No, speed-ups and transaction cancellation aren’t supported.
Cross-chain refund[#](#cross-chain-refund)
-------------------------------------------
There are two types of cross-chain refunds at the moment. The first is a refund initiated by a third-party bridge. The second is a refund initiated by OKX DEX.
1. Refund initiated by a third-party bridge
* The main reason for this type of refund is that the bridge refund rules have been triggered when the funds have entered the bridge, but the bridge transaction is unable to proceed normally.
* Refunds are initiated generally because there is insufficient liquidity due to changes in the bridge’s pool, or the user’s cross-chain amount is below the minimum required by the bridge, or some other rules have been triggered, such as the third-party bridge’s blocklists.
* The third-party bridge will initiate the refund. The refund token is generally USDT, USDC, DAI, WETH, and ETH. The refund is returned from the third-party bridge, and the final amount received by the user will have the gas fee deducted.
* Common third-party bridges for cross-chain refunds include SWFT etc.
2. Refunds initiated by OKX DEX
* There are two main reasons for refunds. The first is that when OKX pre-executes a swap on the destination chain, if the pre-executed transaction returns an error, a refund will be automatically triggered. The second is an actual unsuccessful swap on the destination chain.
* If pre-execution transactions return errors, it’s usually because the set slippage has been exceeded, or errors have occurred during third-party DEX contract executions, or the traded tokens are safeMoon tokens or honeypot tokens, etc.
* Failed transactions on the destination chain will also trigger automatic refunds. Common reasons for such failures can be found in the above-mentioned cross-chain scenarios.
* OKX DEX will initiate the refund. The refund token is USDT, USDC, DAI, WETH, or ETH. The refund is returned from OKX DEX, and the final amount received by the user will have the gas fee deducted.
[DEX API\
\
Error codes](/web3/build/docs/waas/dex-crosschain-error-code)
[DEX API\
\
Limit order API](/web3/build/docs/waas/dex-limit-order)
Table of contents
[Common reasons for cross-chain failures](#common-reasons-for-cross-chain-failures)
[Transaction time is too long](#transaction-time-is-too-long)
[Are speed-ups and transaction cancellation supported?](#are-speed-ups-and-transaction-cancellation-supported?)
[Cross-chain refund](#cross-chain-refund)
---
# Apply to display DApps | More resources | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
More resources
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
More resources
Apply to display DApps
Apply to display DApps[#](#apply-to-display-dapps)
===================================================
Many Web3 users find it a headache to search for their favorite DApps using tools like Google search engine, but fear not, OKX is here to offer a solution. We've integrated the most used DApps into our Web3 service. Users can enjoy a seamless experience with our latest built-in search tool. Jump into your favorite DApps and hit the ground running with Discover on OKX Web3, a service built to be your gateway to Web3.
If you want to list your DApp on Discover, you need to fill in our form to [build with us](https://forms.gle/kLwVFevWXBjRa6WC6)
. For info on product promotions, please get in touch with [wallet@okx.com](mailto:wallet@okx.com)
[More resources\
\
General specification](/web3/build/docs/waas/okx-waas-standard)
[More resources\
\
App Universal Link](/web3/build/docs/waas/app-universal-link)
---
# App Universal Link | More resources | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
More resources
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
More resources
App Universal Link
App Universal Link[#](#app-universal-link)
===========================================
To enable users to easily interact with your DApp within a mobile app, you need to create a deep link in the mobile browser that directs them to the Discover page in the OKX App, where your DApp will be opened.
This tutorial will guide you through the process using JavaScript.
### Step 1: Define the deep link parameters[#](#step-1:-define-the-deep-link-parameters)
Open your JavaScript file or script, and define the URL you want to pass as a parameter in your deep link:
const dappUrl = "https://app.uniswap.org/";
Replace `https://app.uniswap.org/` with the actual URL of your DApp.
### Step 2: Encode the deep link parameters[#](#step-2:-encode-the-deep-link-parameters)
Use `encodeURIComponent` to encode the `dappUrl`:
const encodedDappUrl = encodeURIComponent(dappUrl);
This ensures that special characters in the URL are properly handled for inclusion in a web link.
### Step 3: Construct the deep link[#](#step-3:-construct-the-deep-link)
Combine the encoded parameters to form the deep link:
const deepLink = "okx://wallet/dapp/url?dappUrl=" + encodedDappUrl;
This creates a deep link specific to your DApp on the OKX platform.
### Step 4: Encode entire URL[#](#step-4:-encode-entire-url)
Encode the entire URL, including the deep link, to ensure proper formatting for web applications:
const encodedUrl = "https://www.okx.com/download?deeplink=" + encodeURIComponent(deepLink);
This results in the final encoded URL that users will interact with.
### Step 5: Output or use[#](#step-5:-output-or-use)
You can print the `encodedUrl` to the console or use it as needed in your application:
console.log(encodedUrl);
This line is for demonstration purposes; in your actual application, you would use the `encodedUrl` as required.
### Testing:[#](#testing:)
This JavaScript code is a client-side script that checks the user's device and environment to determine whether the user is accessing a web page from a mobile device, specifically an iOS or Android device, or whether they are using the OKX app.
const ua = navigator.userAgent;
const isIOS = /iphone|ipad|ipod|ios/i.test(ua);
const isAndroid = /android|XiaoMi|MiuiBrowser/i.test(ua);
const isMobile = isIOS || isAndroid;
const isOKApp = /OKApp/i.test(ua);
if (isMobile && !isOKApp){
const encodedUrl = "https://www.okx.com/download?deeplink=" + encodeURIComponent("okx://wallet/dapp/url?dappUrl=" + encodeURIComponent(location.href));
window.location.href = encodedUrl;
} else if (window.okxwallet) {
const accounts = await window.okxwallet.request({
method: "eth_requestAccounts",
});
}
### Summary[#](#summary)
By following these steps, you have successfully created a deep link for your DApp within the Discover page of the OKX app. This link, when used, will seamlessly guide users to your DApp, opening up OKX Web3's millions of traffic to your DApp.
[More resources\
\
Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[More resources\
\
Changelog](/web3/build/docs/waas/changelog)
---
# View chainIndex | Resources | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
[Definitions](/web3/build/docs/waas/walletapi-resources-definitions)
[View chainIndex](/web3/build/docs/waas/walletapi-resources-supported-networks)
[Webhook Guidance](/web3/build/docs/waas/walletapi-bp-data-subscription)
[Error Codes](/web3/build/docs/waas/walletapi-resources-errorcode)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Resources](/web3/build/docs/waas/walletapi-resources)
View chainIndex
View chainIndex[#](#view-chainindex)
=====================================
Note
chainIndex: A custom identifier defined by the Wallet API service, which may differ slightly from the chainId of EIP-155.
EIP-155 chainId: The chainId specified in [EIP-155](https://eips.ethereum.org/EIPS/eip-155)
. You can check detailed chainId information through [this link](https://chainid.network/)
.
| No. | Network Name | chainIndex | Supported |
| --- | --- | --- | --- |
| 1 | BTC | 0 | Supported |
| 2 | Ethereum | 1 | Supported |
| 3 | Litecoin | 2 | Supported |
| 4 | Dogecoin | 3 | Supported |
| 5 | Dash | 5 | Supported |
| 6 | Optimism | 10 | Supported |
| 7 | Flare | 14 | Supported |
| 8 | Cronos | 25 | Supported |
| 9 | BNB Smart Chain | 56 | Supported |
| 10 | Ethereum Classic | 61 | Supported |
| 11 | OKTC | 66 | Supported |
| 12 | Gnosis | 100 | Supported |
| 13 | Polygon | 137 | Supported |
| 14 | Bitcoin Cash | 145 | Supported |
| 15 | Manta Pacific | 169 | Supported |
| 16 | Tron | 195 | Supported |
| 17 | X layer | 196 | Supported |
| 18 | opBNB | 204 | Supported |
| 19 | B^2 network | 223 | Supported |
| 20 | Fantom | 250 | Supported |
| 21 | Kroma | 255 | Supported |
| 22 | KCC | 321 | Supported |
| 23 | zkSync Era | 324 | Supported |
| 24 | PulseChain | 369 | Supported |
| 25 | Omega Network | 408 | Supported |
| 26 | Endurance | 648 | Supported |
| 27 | Conflux | 1030 | Supported |
| 28 | Metis | 1088 | Supported |
| 29 | Polygon zkEVM | 1101 | Supported |
| 30 | Core | 1116 | Supported |
| 31 | Moonbeam | 1284 | Supported |
| 32 | Moonriver | 1285 | Supported |
| 33 | Ronin | 2020 | Supported |
| 34 | Rangers | 2025 | Supported |
| 35 | Kava EVM | 2222 | Supported |
| 36 | Merlin Chain | 4200 | Supported |
| 37 | Mantle | 5000 | Supported |
| 38 | Base | 8453 | Supported |
| 39 | Immutable zkEVM | 13371 | Supported |
| 40 | MODE\_ETH | 34443 | Supported |
| 41 | Arbitrum One | 42161 | Supported |
| 42 | Arbitrum Nova | 42170 | Supported |
| 43 | Celo | 42220 | Supported |
| 44 | Avalanche C | 43114 | Supported |
| 45 | Linea | 59144 | Supported |
| 46 | Kaia network (Klaytn) | 8217 | Supported |
| 47 | Blast | 81457 | Supported |
| 48 | Chilizi | 88888 | Not Supported |
| 49 | EthereumPoW | 10001 | Supported |
| 50 | TAIKO\_ETH | 167000 | Supported |
| 51 | BITLAYER\_BTC | 200901 | Supported |
| 52 | Ethereum Fair(DIS chain) | 513100 | Supported |
| 53 | BOB\_ETH | 60808 | Supported |
| 54 | Scroll | 534352 | Supported |
| 55 | Sepolia | 11155111 | Supported |
| 56 | Fractal Bitcoin Mainnet | 70000061 | Supported |
| 57 | Solana | 501 | Supported |
| 58 | SUI | 784 | Supported |
| 59 | Gravity | 1625 | Supported |
| 60 | Wemix | 1111 | Supported |
| 61 | Lumi | 94168 | Supported |
| 62 | Sonic | 146 | Supported |
[Wallet API\
\
Definitions](/web3/build/docs/waas/walletapi-resources-definitions)
[Wallet API\
\
Webhook Guidance](/web3/build/docs/waas/walletapi-bp-data-subscription)
---
# Bitcoin-compatible chain | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
[Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
Connect to App or Mini Wallet
[Connection Prerequisites](/web3/build/docs/sdks/app-connect-preparation)
[EVM-Compatible Chains](/web3/build/docs/sdks/app-connect-evm)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/app-connect-bitcoin)
[SDK](/web3/build/docs/sdks/app-connect-bitcoin-sdk)
[UI](/web3/build/docs/sdks/app-connect-bitcoin-ui)
[Solana-Compatible Chains](/web3/build/docs/sdks/app-connect-solana)
[TON](/web3/build/docs/sdks/app-connect-ton)
[SUI](/web3/build/docs/sdks/app-connect-sui)
[Aptos/Movement](/web3/build/docs/sdks/app-connect-aptos)
[Cosmos/Sei](/web3/build/docs/sdks/app-connect-cosmos)
[Tron](/web3/build/docs/sdks/app-connect-tron)
[Starknet](/web3/build/docs/sdks/app-connect-starknet)
[Troubleshooting](/web3/build/docs/sdks/app-connect-faq)
Connect to Extension Wallet
[Preparation](/web3/build/docs/sdks/web-detect-okx-wallet)
[EVM Compatible Chains](/web3/build/docs/sdks/chains/evm/introduce)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/chains/bitcoin/introduce)
[Tron](/web3/build/docs/sdks/chains/tron/introduce)
[Solana-Compatible Chains](/web3/build/docs/sdks/chains/solana/introduce)
[TON](/web3/build/docs/sdks/chains/ton/introduce)
[Aptos/Movement](/web3/build/docs/sdks/chains/aptos/introduce)
[Cosmos/Sei](/web3/build/docs/sdks/chains/cosmos/introduce)
[SUI](/web3/build/docs/sdks/chains/sui/introduce)
[Stacks](/web3/build/docs/sdks/chains/stacks/introduce)
[Starknet](/web3/build/docs/sdks/chains/starknet/introduce)
[Cardano](/web3/build/docs/sdks/chains/cardano/introduce)
[Nostr](/web3/build/docs/sdks/chains/nostr/introduce)
[NEAR](/web3/build/docs/sdks/chains/near/introduce)
[WAX](/web3/build/docs/sdks/chains/wax/introduce)
[Display DApp icon](/web3/build/docs/sdks/web-display-dapp-icon)
Connect to App or Mini Wallet
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Connect to App or Mini Wallet
Bitcoin-compatible chain
Bitcoin-Compatible Chains[#](#bitcoin-compatible-chains)
=========================================================
The Bitcoin network is a peer-to-peer electronic cash system that uses blockchain technology to record all transactions without relying on a central authority or intermediary. It is maintained by thousands of nodes around the world, working together to uphold a public distributed ledger.
Key features of Bitcoin and similar blockchains (such as Fractal Bitcoin) include a fixed supply, transparent transaction records, anonymity (or pseudonymity), and a tamper-resistant design.
These chains typically employ Proof of Work (PoW) or other consensus mechanisms (like Proof of Stake) to ensure the security and consistency of the network.
As the first successful cryptocurrency, Bitcoin pioneered a new category of digital assets and laid the foundation for subsequent blockchain projects and decentralized systems.
Emerging chains like Fractal Bitcoin build on Bitcoin's foundation, aiming to improve transaction efficiency, scalability, and community governance, advancing the development of the digital currency ecosystem.
* If connecting via SDK, add a "Connect OKX Wallet" button within the DApp. Clicking this button will launch the mobile App Wallet and enable interaction with the OKX Wallet, such as retrieving addresses, initiating wallet signatures, and other functions.
* In addition to SDK, we also provide a UI interface. If using the UI connection, and the DApp is operating in Telegram, users can choose to open the mobile App Wallet or stay in Telegram and launch the OKX Mini Wallet.
[SDK](/web3/build/docs/sdks/app-connect-bitcoin-sdk)
[UI](/web3/build/docs/sdks/app-connect-bitcoin-ui)
[Connect to App or Mini Wallet\
\
UI](/web3/build/docs/sdks/app-connect-evm-ui)
[Connect to App or Mini Wallet\
\
SDK](/web3/build/docs/sdks/app-connect-bitcoin-sdk)
---
# OKX Web3 Build User Agreement | More resources | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
More resources
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
More resources
OKX Web3 Build User Agreement
OKX Web3 Build User Agreement[#](#okx-web3-build-user-agreement)
=================================================================
Last updated: November 28, 2023
This [OKX Web3 Build User Agreement](/web3/build/docs/waas/(https://www.okx.com/help/okx-web3-build-user-agreement))
(this “Agreement”) constitutes an agreement between you, as a developer (“Developer”,“User” or “you”) and the service provider, OKX Technology Services Pte. Ltd., a Singapore registered company (“we”, “us” or “our” or “OKX”), and any of our affiliates, regarding your access and/or use of the OKX Web3 Build Services (collectively, the “Services”).
By using our Services, you confirm that you have read, understood and accepted this Agreement, our [OKX Web3 Ecosystem Terms of Service](/help/okx-web3-ecosystem-terms-of-service)
(the “Terms of Service”), our [OKX Web3 Ecosystem Privacy Notice Statement](/help/okx-web3-ecosystem-privacy-policy)
, and any and all other rules or policies, and you shall be legally bound by any and all of these terms and conditions regardless of your location, nationality, and/or Service(s) used. If you do not agree to be bound by this Agreement, please do not access or use the Services.
This Agreement shall supplement our Terms of Service. In the event of any conflict or inconsistency of any term or provision set forth in this Agreement, our Terms of Service, such conflict or inconsistency shall be resolved by giving precedence first to this Agreement. All other provisions of our OKX Terms of Service not modified by this Agreement shall remain in full force and effect.
Separate user terms and licenses may be made available by OKX from time to time which may supplement this Agreement but as an integral part of this Agreement for the provision of the Services.
1. OUR SERVICES 1.1 Our Services. The Services provides various tools, products and services for Developers to build and create personalised Web3 Ecosystem, products and/or services. Users would be able to build their own decentralized applications and programs that exist and run on a blockchain technology or peer-to-peer network (“Dapps”) by connecting their digital wallets through Third Party Blockchains. The Services provides various features in relation to Web3 infrastructure for wallets, liquidity and on-chain data via application programming interfaces ("API"). Some of the Services may be provided in the form of a Software Development Kit ("SDK"). However, OKX merely provides an interface for Users to connect to the tools, and is not a party to any transactions made through the Services.
Our Services provide Developers with a full-stack of Web3 infrastructure for wallets, liquidity and on-chain data, helping Developers to develop and build their Dapps and other products and services. The Services are solely provided to Developers for development use and they are not intended for re-distribution, re-sale or any other purposes outside the scope of this Agreement.
1.2 Service Details. The Services aggregates the following tools and solutions for Developers to access and build their Web3 ecosystem, products and services:
Web3 Infrastructure Suite;
Wallet as a Service (WaaS) Solution;
Liquidity Solution;
ZK-powered ETH L2; and/or
other tools and solutions made available by OKX from time to time
OKX provides an all-in-one developer portal serving as a streamlined API management and monitoring hub for seamless control and optimization.
1.3 API, SDK and Solutions. Each API, SDK and solutions provided under the Services shall be subject to separate API documentation, user terms and conditions, end user licenses, among other things, for access and use by Users which shall be made available by OKX from time to time. For accessing and using the API, the passphrase that you have created to generate and access your API key is confidential to you and not accessible by OKX. If you lose your passphrase, you will lose access to your API key. You shall agree and undertake to keep your passphrase, and API key strictly confidential and not share it with any third party. You agree that you will be solely liable and responsible for the use of your API key and the security of your passphrase.
1.4 Use of Digital Wallet Is Required. In order to use the Services, you may have to connect a digital wallet such as an OKX Web3 Wallet. You are solely responsible for any Losses that may arise from your use of your digital wallet through the course of the Services. Your digital wallet is not accessible to OKX, and we will not keep or maintain your files, passwords, Mnemonic Phrases, and/or Private Keys for your digital wallet.
OKX is not responsible, and you are solely responsible, for any transactions executed by or involving your digital wallet, regardless of whether you have approved or authorised such transactions.
1.5 Purpose and Legality of Use. You agree that you shall use your Services for legitimate purposes only, and you shall not have the intention of using the Services as a medium of non-compliance to Applicable Laws. You agree that the Digital Assets deposited into your digital wallet did not arise from a violation of Applicable Laws. You also agree to abide by all rules, terms, and any other notices or relevant agreements published and updated by OKX from time to time, including announcements, procedural instructions, risk disclosures, and other rules and terms.
1.6 Password and Private Key. Our Services have various decentralized characteristics of blockchain technology. These decentralized services are different from banking financial institutions. You understand and accept that OKX is not responsible for the following: storage of your security Password (which is the Password you set when you created or imported your digital wallet); Private Key and Mnemonic Phrase; retrieval of your security Password, Private Key, or Mnemonic Phrase; freezing of your wallet; reports of lost wallet; restoration of your wallet or any other actions required to maintain or access your wallet.
1.7 Prototype. You agree and accept that the Service is an early version of the products and/or services, and not yet fully audited. OKX is not responsible for any Losses you may experience, nor is OKX under any obligation to compensate or indemnify any loss Digital Assets to you, in connection with use of any such prototype products or services.
2. SERVICE FEES 2.1 Gas Fees. During the course of your access and use of the Services, you may incur various gas fees. Gas fees generated on any Third Party Blockchains under these Services will be paid by you.
2.2 Third Party Protocol Fees. There may also be other Third Party Platform fees ("Third Party Fees") that arise during your access and use of the Services, including but not limited to transaction fees for transactions of Digital Assets, NFTs and/or other digital collectibles on Dapps and registration fees for Events. You are solely responsible for paying any and all of these Third Party Fees that may arise.
2.3 Service Fees. Please note that OKX does not currently charge any fees (“Service Fees”), but we reserve the right to charge you Service Fees in the future. OKX may charge you certain Service Fees for providing the Services to you. Any Service Fees schedule shall be published on OKX platform from time to time, and OKX reserves the rights to update such fee schedule, if any, in its sole discretion.
3. OWNERSHIP RIGHTS 3.1 General. The Services contain Information and links from Third Party Platforms that redirect Users to the webpages, web applications, mobile application, application program interface, or any associated site linking to web and mobile applications of Third Party Platform.
3.2 Limited Right to Use. OKX does not claim any ownership rights in any content that you provide to be made available through the Services (“User Content”). You agree that you own and have all rights, title and interest, including all intellectual property rights, in any User Content you provide to us. You hereby grant OKX a worldwide, royalty-free license to use, copy and display any User Content that you upload, submit, store and/or send on or through your access and use of the Services (which may include any rights regarding creation or use that you have agreed to).
3.3 Intellectual Property Rights. During the term of the provision of Services to you by OKX, you may have access to OKX's proprietary information and intellectual property rights through accessing the Services, and any materials that may contain copyrightable work, know-how, patentable information, confidential information, among other things, that may be specified by OKX for your use as a developer solely to create and use for your projects, products and services, in accordance with this Agreement and any other API documentation, user terms and conditions, end user licenses, and instructions as OKX may make available to you from time to time. You may not use such materials or information for re-distribution, re-sale or any other purposes without OKX’s prior written approval.
3.4 OKX Trade Marks and IPs. OKX’s trade marks (including, but not limited to the “OKX”, “OKX logo”, “X logo” trade marks), service marks, trade dress, logos and any other indicia of the source of OKX’s goods or services (“OKX Trade Marks”) and intellectual property rights are all the property of OKX and its affiliates. Your limited right to use the OKX Trade Marks in connection with the Services does not give you any right, title or ownership interest with respect to the OKX’s Trade Marks. All goodwill arising from your use of the OKX Trade Marks in connection with this Agreement will insure to the sole and exclusive benefit of OKX. OKX reserves the right to terminate your permission to use the OKX Trade Marks or any intellectual property rights at any time in its sole discretion.
4. ADDITIONAL RISK DISCLOSURES 4.1 No Guarantee of Specific Timing. You understand and agree that when a user redeem or access your Digital Assets, the time it actually takes to receive the Digital Assets into a digital wallet may vary, and the Digital Assets received and displayed on the digital wallet shall be final. OKX is not liable for any Losses as a result of the forementioned.
4.2 Limit of Aggregated Liability. You understand and agree that OKX’s aggregated liability shall not exceed the Service Fees OKX received from you.
4.3 Amendment of the Agreement. You understand and agree that OKX reserves the right to amend the content of this Agreement at any time in its sole discretion. OKX shall not be liable for any Losses arising from your misunderstanding of the Agreement or your delay of reading any amendments or updates to this Agreement.
4.4 Wrong Address. OKX is not responsible for any Losses resulting from sending Digital Assets to the wrong address(es). You shall ensure your deposit of your Digital Assets are to the right address designated by OKX to receive your Digital Assets to be transferred to the Third Party Blockchain through your use of the Services. You shall provide a correct address of your digital wallet that you use to receive your Digital Assets to be transferred from the Third Party Blockchain through use of the Service. OKX shall not be liable for any and all Losses resulting from your own fault or error, including but not limited to: you providing an incorrect address of your digital wallet or other address for receiving Digital Assets, or you transferring your assets to a wrong address instead of the address designated by OKX.
4.5 User Fault or Error. You agree that you shall bear any and all Losses resulting from your own fault or error, including but not limited to: not being in accordance with the transaction prompts operation, not conducting timely transactions via our Services, transferring your Digital Assets to a wrong Third Party Blockchain or wrong address, forgetting or leakage of Passwords and/or Private Keys, cracked Passwords, your computer being invaded or hacked by others, and/or entering into the wrong address to transfer or receive Digital Assets.
4.6 Third Party Content and Services. You understand and agree that when you use the Services, you may access and use Third Party Blockchains. OKX shall not be liable for any and all Losses caused by your use of or access to Third Party Blockchains. You understand and agree to OKX’s grant of access to any and all Third Party Blockchains. OKX merely provides project display, revenue distribution, and other related services. OKX shall not be liable for any Losses incurred as a result of contract vulnerabilities; hacking incidents; suspension, discontinuation, or termination of business; bankruptcy; abnormal suspension; or cessation of Third Party Blockchain operations or other potential risks. Furthermore, you agree to bear any and all Losses you may suffer as a result of the aforementioned risks. If you suffer any Losses as a result of the aforementioned risks, you understand and agree that any Digital Assets that may be stored on your digital wallet may be permanently lost.
The Service may also contain links or functionality to access or use third-party websites (“Third-Party Websites”) and applications (“Third-Party Applications”), or otherwise display, include, or make available content, data, information, services, applications, or materials from third parties (“Third-Party Materials”). Any links of Third-Party Websites in the Services do not mean that OKX endorses any products, services, information and disclaimers provided therein, and OKX does not guarantee the accuracy of the information contained therein. When you click on a link to, or access and use, a Third-Party Website or Third-Party Application, though we may not warn you that you have left our Services, you are subject to the terms and conditions (including privacy policies) of another website or destination. Such Third-Party Websites, Third-Party Applications, and Third-Party Materials are not under the control of OKX, and may be “open” applications for which no recourse is possible. OKX is not responsible or liable for any Third-Party Websites, Third-Party Applications, and Third-Party Materials. OKX provides links to these Third-Party Websites and Third-Party Applications only as a convenience and does not review, approve, monitor, endorse, warrant, or make any representations with respect to Third-Party Websites or Third-Party Applications, or their products or services or associated Third-Party Materials. You use all links in Third-Party Websites, Third-Party Applications, and Third-Party Materials at your own risk. OKX shall not be liable for any Losses caused by your use of such third party products and services on Third-Party Websites and Third-Party Applications. OKX and each Third-Party Website and Third-Party Application are independent legal entities, and this Agreement shall not constitute any form of agency, partnership or cooperative relationship between the parties. OKX and each Third-Party Website and Third-Party Application shall be responsible for their respective claims, debts and disputes arising from the performance of their respective contracts and agreements.
4.7 Third Party Blockchain Malfunctions. You understand and agree that if OKX or any Third Party Blockchain(s) cannot function properly or the Services are interrupted because of the following conditions, and you are unable to use the Services or cannot make commands or perform related operations or transactions, including without limitation, failure, delay, interruption, system lack of response, delayed system response, or any other abnormal and/or unexpected circumstances, OKX shall not be liable for any Losses. These circumstances include but are not limited to:
Third Party Blockchain(s) suspends, discontinues, and/or terminates its business, closes down, and/or abnormally suspends or terminates the Services;
service suspension due to maintenance as announced by OKX or Third Party Blockchain;
system fails to transmit data;
Force Majeure event(s) that lead to the suspension of the third Party Blockchain;
Third Party Blockchain’s service interruption or delay arising from hacking, computer viruses, technical adjustments or failure, website upgrades, banking issues, temporary closures arising from legal or government regulations; etc.;
Third Party Blockchain’s service interruption or delay caused by its computer system being damaged, defective or unable to normally perform;
Losses arising from technical problems that cannot be predicted or solved by existing technology in the industry;
Losses you or other third parties suffer that arise from the fault or delay of the third party;
Losses you or other third parties suffer that arise from changes in laws, regulations and/or government orders;
Losses you or other third parties suffer that arise from Force Majeure events caused by unforeseeable, unavoidable, and/or unsolvable objective circumstances.
You understand and agree that the forementioned reasons may lead to abnormal transactions, price fluctuation, market fluctuation, market interruptions, and other possible abnormal circumstances. You also appreciate that the risk disclosure statement herein is not and cannot be comprehensive or exhaustive. OKX may refuse to execute your commands based on the actual circumstances. Furthermore, you understand and agree that OKX shall not be liable for any Losses arising from or related to any of the forementioned circumstances.
4.8 Losses Based on Your Lack of Eligibility. You understand and accept that OKX shall not be liable for any Losses caused by any risks relating to your eligibility to access or use our Services.
5. PROHIBITED PRACTICES 5.1 No Unfair Trading Practices. You understand and agree that OKX strictly prohibits unfair trading practices. OKX reserves the right to refuse, suspend or terminate the provision of our Services to you, if you perform or are reasonably suspected to be performing the following actions when accessing or using our Services:
market manipulation, price manipulation, insider dealing, market distortion or any other malicious wrongdoings or market behaviours;
harming OKX or other Users through loopholes, unreasonable means, other types of flaws or vulnerabilities on our Services;
violation or attempt to violate other User’s legal rights (including but not limited to their privacy and intellectual property rights);
participation in any activities that OKX regards as harmful to the market, OKX and/or our Services;
violation of any Applicable Laws.
5.2 OKX’s Rights. In order to minimize and/or eliminate any adverse effects on the overall market, OKX reserves the right to take the following measures at its sole discretion, including without limitation, suspending or closing down of your account, restricting or cancelling your commands, contacting and cooperating with relevant legal and/or regulatory authorities. You understand and agree that OKX shall not be liable for any Losses (including without limitation to any direct or indirect Losses, actual Losses or Losses of possible profits) that you may incur in connection with the above measures.
6. WARRANTIES 6.1 GENERAL. THE SERVICES ARE PROVIDED “AS IS.” TO THE EXTENT PROHIBITED BY APPLICABLE LAW, OR TO THE EXTENT ANY STATUTORY RIGHTS APPLY THAT CANNOT BE EXCLUDED, LIMITED OR WAIVED, OKX AND ITS AFFILIATES AND LICENSORS (A) MAKE NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, WHETHER EXPRESS, IMPLIED, STATUTORY OR OTHERWISE REGARDING ANY SERVICE, OUR CONTENT, THE THIRD PARTY CONTENT, OR THE THIRD PARTY SERVICES, AND (B) DISCLAIM ALL WARRANTIES, INCLUDING ANY IMPLIED OR EXPRESS WARRANTIES (I) OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR QUIET ENJOYMENT, (II) ARISING OUT OF ANY COURSE OF DEALING OR USAGE OF TRADE, (III) THAT THE SERVICES, OUR CONTENT, THIRD PARTY CONTENT, OR THIRD PARTY SERVICE WILL BE UNINTERRUPTED, TIMELY, ERROR-FREE OR FREE OF HARMFUL COMPONENTS, AND (IV) THAT ANY CONTENT OR DIGITAL ASSET WILL BE SECURE OR NOT OTHERWISE LOST OR ALTERED. YOU ACKNOWLEDGE AND AGREE THAT YOU HAVE NOT RELIED AND ARE NOT RELYING UPON ANY REPRESENTATION OR WARRANTY FROM OKX THAT IS NOT IN THESE TERMS OR IN A SEPARATE WRITTEN AGREEMENT BETWEEN OKX AND YOU, AND YOU AGREE YOU WILL NOT TAKE A POSITION IN ANY PROCEEDING THAT IS INCONSISTENT WITH THIS CLAUSE.
7. LIMITATION OF LIABILITY AND INDEMNIFICATION You will indemnify, defend, and hold harmless OKX, our affiliates, and our and their respective officers, directors, employees, and agents from and against any Losses relating to or in connection with any third party claim relating to your use of the Services, your breach of this Agreement, or your User Content.
OKX’s aggregated liability in connection with this Agreement shall not exceed the greater of (a) $100 US dollars or (b) the Service Fees OKX received from you in the past twelve months. NOTWITHSTANDING ANYTHING TO THE CONTRARY IN THESE AGREEMENT, OKX WILL NOT BE LIABLE FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, HOWEVER IT ARISES (INCLUDING ATTORNEYS’ FEES AND ALL RELATED COSTS AND EXPENSES OF LITIGATION AND ARBITRATION, OR AT TRIAL OR ON APPEAL, IF ANY, WHETHER OR NOT LITIGATION OR ARBITRATION IS INSTITUTED), WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, INCLUDING WITHOUT LIMITATION ANY CLAIM FOR PERSONAL INJURY OR PROPERTY DAMAGE, ARISING FROM THIS AGREEMENT OR ANY FEDERAL, STATE, OR LOCAL LAWS, STATUTES, RULES, OR REGULATIONS, EVEN IF OKX HAS BEEN PREVIOUSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF SUCH DAMAGES, SO THE PRIOR LIMITATION OR EXCLUSION MAY NOT APPLY TO YOU.
8. GOVERNING LAW 8.1 General. This Agreement, your use of the Services, any claim, counterclaim or dispute of any kind or nature whatsoever arising out of this Agreement (“Dispute”), directly or indirectly, shall be governed by, and construed in accordance with the laws of England and Wales without regard to the principles of conflicts of laws thereof.
9. JURISDICTION AND DISPUTE RESOLUTION 9.1 Dispute Resolution Method. You acknowledge and agree that in the event of any Dispute, the parties shall first refer the Dispute to proceedings at the Hong Kong International Arbitration Centre (“HKIAC”) in accordance with HKIAC’s Mediation Rules in force at that time.
9.2 Arbitration Rules and Jurisdiction. If the Dispute has not been settled upon the signing of a settlement agreement within ninety (90) days following the filing of a request for mediation set forth in Clause 9.1, such Dispute shall be referred to and finally resolved by arbitration administered by the HKIAC under the HKIAC Administered Arbitration Rules in force when the Notice of Arbitration is submitted. The law of this arbitration clause shall be the laws of the Hong Kong Special Administrative Region of the People’s Republic of China (“Hong Kong”). The location of any in-person arbitration hearing shall be Hong Kong, unless otherwise agreed to by the parties.
9.3 Arbitration Seats and Language. You agree that the seat of arbitration shall be Hong Kong. The number of arbitrators shall be three (3). OKX shall appoint one (1) arbitrator and you shall appoint one (1) arbitrator. The third arbitrator shall be appointed by the Chairman of the HKIAC. Such arbitrators shall be freely selected, and the parties shall not be limited in their selection to any prescribed list. Any arbitration proceedings shall be conducted in the English language.
9.4 Limited Discovery. You agree that OKX shall not be required to give general discovery of documents, but may be required only to produce specific, identified documents which are relevant and material to the outcome of the Dispute.
9.5 Final and Binding Nature. Any arbitral award shall be final and binding upon the parties hereto and shall be enforceable in any competent court which has jurisdiction.
9.6 No Class Action or Litigation. You agree to resolve any and all Disputes with OKX on an individual basis through arbitration instead of as part of any class action or representative litigation.
9.7 Confidentiality. The parties agree that the arbitration shall be kept confidential. The existence of the arbitration, any non public information provided in the arbitration, and any submissions, orders or awards made in the arbitration (together, the “Confidential Information”) shall not be disclosed to any non-party except the tribunal, the HKIAC, the parties, their counsel, experts, witnesses, accountants and auditors, insurers and reinsurers, and any other person necessary to the conduct of the arbitration. Notwithstanding the foregoing, a party may disclose Confidential Information to the extent that disclosure may be required to fulfil a legal duty, protect or pursue a legal right, or enforce or challenge an award in bona fide legal proceedings. This confidentiality provision shall survive termination of these Terms and of any arbitration brought pursuant to these Terms.
10. GENERAL PROVISIONS 10.1 Acceptance of All Terms and Conditions. By using the Services, you agree that you have read, understood and accepted this Agreement and all relevant transactions and operational rules in connection with the Services, and you agree to be legally bound by the terms and conditions hereof. OKX reserves the right to change or modify this Agreement at any time at its sole discretion and will provide notice of such changes by posting the revised Agreement on the Site and changing the “Last Updated” date herein. If you do not accept the revised Agreement, you will stop accessing or using the Services. Please also carefully read all terms of service, privacy policies, and relevant transactional and operational rules (as amended from time to time) published on the Third Party Platforms. Access and use of the Services is only allowed after you have read, understood, and agreed to all relevant rules and policies.
10.2 Language. If there is a conflict between the English version of this Agreement and the translated version in other languages, the English version shall prevail. OKX shall have the sole and final discretion to interpret this Agreement.
[More resources\
\
Changelog](/web3/build/docs/waas/changelog)
[Introduction\
\
What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
---
# General specification | More resources | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
More resources
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
More resources
General specification
General specification[#](#general-specification)
=================================================
Response structure[#](#response-structure)
-------------------------------------------
**Success**
{
"code": 0, // success code
"msg": "success", // success message
"data": []
}
**Failure**
{
"code": 1, // error code
"msg": "error", // error message
}
[DeFi API\
\
Error code](/web3/build/docs/waas/defi-error-code)
[More resources\
\
Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
Table of contents
[Response structure](#response-structure)
---
# Update Account | Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Create Account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
[Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
[Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
[Get Accounts](/web3/build/docs/waas/walletapi-api-accounts)
[Get Addresses Under Account](/web3/build/docs/waas/walletapi-api-account-detail)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
Update Account
Update Account[#](#update-account)
===================================
Change the addresses bound under a specific wallet account.
### Request Path[#](#request-path)
POST `https://www.okx.com/api/v5/wallet/account/update-wallet-account`
### Request Parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| accountId | String | Yes | Unique identifier of the account |
| updateType | String | Yes | `add`: Add addresses
`delete`: Delete addresses |
| addresses | Array | Yes | List of addresses. (Maximum 50 addresses per call) |
| \>chainIndex | String | Yes | Unique identifier of the chain |
| \>address | String | Yes | Address |
### Response Parameters[#](#response-parameters)
None
[Wallet API\
\
Create Account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
[Wallet API\
\
Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
### Request Example[#](#request-example)
shell
curl --location --request POST 'https://www.okx.com/api/v5/wallet/account/update-wallet-account' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data-raw '{
"accountId": "13886e05-1265-4b79-8ac3-b7ab46217655",
"updateType": "add",
"addresses": [\
{\
"chainIndex":"1",\
"address":"0x561815e02bac6128bbbbc551005ddfd92a5c24db"\
},{\
"chainIndex":"0",\
"address":"bc1p939endmmt6pvz7ukeywpfsazz57cc4vdu3d0qerz6crhgrtmerfssls5wy"\
}\
]
}'
### Response Example[#](#response-example)
200
{
"code": "0",
"data": [],
"msg": "success"
}
[Wallet API\
\
Create Account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
[Wallet API\
\
Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
---
# Definitions | Resources | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
[Definitions](/web3/build/docs/waas/walletapi-resources-definitions)
[View chainIndex](/web3/build/docs/waas/walletapi-resources-supported-networks)
[Webhook Guidance](/web3/build/docs/waas/walletapi-bp-data-subscription)
[Error Codes](/web3/build/docs/waas/walletapi-resources-errorcode)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Resources](/web3/build/docs/waas/walletapi-resources)
Definitions
Definitions[#](#definitions)
=============================
Here we summarize some common parameters you will encounter when using Wallet API services. You can learn their definitions and usage scenarios.
accountId[#](#accountid)
-------------------------
**accountId** is a unique identifier assigned by Wallet API to an account. Its function is to associate multiple chains and addresses for aggregated queries of assets and transaction history.
chainIndex[#](#chainindex)
---------------------------
**chainIndex** is the unique identifier for a blockchain within the Wallet API service. For chains following the EVM architecture and EIP-155 protocol, the standard chainIndex is used. For other chains like BTC and Solana that do not have a unified ID standard, we use the cointype parameter from the BIP44 specification as the chain identifier. In other special cases, we will ensure the uniqueness of the ID before assigning it. Example chainIndexes are as follows:
| Blockchain Network | chainIndex | eip155chainId |
| --- | --- | --- |
| Bitcoin Mainnet | 0 | |
| Ethereum Mainnet | 1 | 1 |
| OP Mainnet | 10 | 10 |
| ZKSpace | 13 | |
| Flare Mainnet | 14 | 14 |
| Cronos Mainnet | 25 | 25 |
You can check [here](/web3/build/docs/waas/walletapi-resources-supported-networks)
for a full list of supported blockchain networks and their chainIndexes.
orderId[#](#orderid)
---------------------
**orderId** is a unique identifier assigned to each transaction within the Wallet API system. Using orderId for queries ensures that even if a transaction is not on the blockchain, it is recorded within the system, ensuring full visibility of the transaction process.
[Wallet API\
\
Resources](/web3/build/docs/waas/walletapi-resources)
[Wallet API\
\
View chainIndex](/web3/build/docs/waas/walletapi-resources-supported-networks)
Table of contents
[accountId](#accountid)
[chainIndex](#chainindex)
[orderId](#orderid)
---
# Building a Web3 Wallet | Quick Start | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[Preparation](/web3/build/docs/waas/walletapi-quickstart-preparation)
[Building an On-Chain Data Dashboard](/web3/build/docs/waas/walletapi-quickstart-dashboard)
[Build Inscription Wallet](/web3/build/docs/waas/walletapi-quickstart-inscription)
[Building a Web3 Wallet](/web3/build/docs/waas/walletapi-quickstart-multi-chain)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
Building a Web3 Wallet
Building a Web3 Wallet[#](#building-a-web3-wallet)
===================================================
Please ensure that you have completed the [preparation work](/web3/build/docs/waas/walletapi-quickstart-preparation)
. You can use this case to familiarize yourself with wallet management, querying data from various blockchains, and transaction construction and broadcasting.
Step 1: Generate Wallet Mnemonic and Address[#](#step-1:-generate-wallet-mnemonic-and-address)
-----------------------------------------------------------------------------------------------
You can use the [Signature SDK](/web3/build/docs/waas/wallet-client-sdk)
we provide to create a wallet mnemonic and address.
### npm install[#](#npm-install)
First, you need to install the latest version of the Signature SDK. For EVM networks, for example:
npm install @okxweb3/crypto-lib
npm install @okxweb3/coin-base
npm install @okxweb3/coin-ethereum
### Local Build[#](#local-build)
1. Download the project source code
git clone https://github.com/okx/js-wallet-sdk.git
2. Run the build script
sh build.sh
Taking the ETH network as an example, you can use the Signing SDK to create an ETH wallet object and derive the corresponding address.
import { bip39, BigNumber } from "@okxweb3/crypto-lib";
import { EthWallet,MessageTypes } from "@okxweb3/coin-ethereum";
// eth wallet
let wallet = new EthWallet();
// get mnemonic
let mnemonic = await bip39.generateMnemonic();
console.log("generate mnemonic:", mnemonic);
// get derived key
const hdPath = await wallet.getDerivedPath({ index: 0 });
let derivePrivateKey = await wallet.getDerivedPrivateKey({ mnemonic: mnemonic, hdPath: hdPath });
console.log("generate derived private key:", derivePrivateKey, ",derived path: ", hdPath);
// get new address
let newAddress = await wallet.getNewAddress({ privateKey: derivePrivateKey });
console.log("generate new address:", newAddress.address);
// get the public key
let publicKey = newAddress.publicKey;
console.log("the corresponding public key:", publicKey);
### Demo Program[#](#demo-program)
We have prepared an [open-source demo program](https://okx.github.io/js-wallet-sdk-demo/)
to demonstrate the features of the Signing SDK mentioned above. Get the demo program source code [here](https://github.com/okx/js-wallet-sdk-demo)
.
* * *
Step 2: Create an Account[#](#step-2:-create-an-account)
---------------------------------------------------------
You have already generated the mnemonic and address in the previous step. Now you can create an account ([AccountId](/web3/build/docs/waas/walletapi-resources-definitions#accountid)
)to aggregate multiple addresses for batch querying of token balances and transaction history.
Note
Typically, a Web3 wallet involves three concepts:
\- Wallet, Whoever owns the mnemonic owns the wallet.
\- Account, Based on the BIP-44 standard, multiple accounts can be derived from a single set of mnemonics.
\- Address, Each account has one address per chain.
Call the interface to [create a wallet account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
.
For example, subscribing to the same address on different chains is implemented as follows:
// Define your parameters
const addresses = [\
{\
"chainIndex":"1",\
"address":"0x561815e02bac6128bbbbc551005ddfd92a5c24db",\
"publicKey":"02012db63bf0380294a6ecf87615fe869384b0510cb910a094254b6844af023ee2",\
"signature":"62acda5e471d9bf0099add50f4845256868d980821c161095651a918d3ef8a6b2286f512028172eabbe46ec2c9c2c20e5c40ff1fb23e1cdfdbed033ad924ce521b"\
},\
{\
"chainIndex":"10",\
"address":"0x561815e02bac6128bbbbc551005ddfd92a5c24db",\
"publicKey":"02012db63bf0380294a6ecf87615fe869384b0510cb910a094254b6844af023ee2",\
"signature":"62acda5e471d9bf0099add50f4845256868d980821c161095651a918d3ef8a6b2286f512028172eabbe46ec2c9c2c20e5c40ff1fb23e1cdfdbed033ad924ce521b"\
}\
];
const getCreateAccountBody = {
addresses: addresses,
signMessage: '1717062864123', // UNIX Timestamp in millisecond
};
// Define auxiliary function
const getCreateAccountData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/account/create-account'
);
return fetch(apiRequestUrl, {
method: 'post',
headers: headersParams,
body: JSON.stringify(getCreateAccountBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: createAccountData } = await getCreateAccountData();
Beside, if you want to create a watch-only account, call the `POST /api/v5/wallet/account/create-watch-only-account`. Click [here](/web3/build/docs/waas/walletapi-api-create-watch-only-account)
for details.
* * *
Step 3: Construct and Send Transactions[#](#step-3:-construct-and-send-transactions)
-------------------------------------------------------------------------------------
### Get Signing Information[#](#get-signing-information)
First, call the `POST /api/v5/wallet/pre-transaction/sign-info` interface to query the data required for the transaction, such as gas price, gas limit, nonce. Take ETH for an example:
// Define your parameters
// EVM
const postSignInfoBody = {
chainIndex: '1',
fromAddr: '0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2',
toAddr: '0x1e80c39051f078ee34763282cbb36ffd88b40c65',
txAmount: '123000000000000',
extJson: {
inputData: '041bbc6fa102394773c6d8f6d634320773af4'
}
};
// TRON
const postSignInfoBody = {
"chainIndex": "195",
"fromAddr": "TDnSmJ15nmwg5jmYmXWFVgBX53XxfbNHsC",
"toAddr": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"txAmount": "0",
"extJson": {
"permissionType": 1,
"feeLimit": 300000,
"inputData": "0x095ea7b3000000000000000000000000d73c5e36d47eed32f0327f9d3f04b49384e90fab0000000000000000000000000000000000000000000000000000000000000000"
}
};
// Define auxiliary function
const signInfoData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/pre-transaction/sign-info'
);
return fetch(apiRequestUrl, {
method: 'post',
headers: headersParams,
body: JSON.stringify(postSignInfoBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: signInfoData } = await signInfoData();
### Verify Address and Build Transaction[#](#verify-address-and-build-transaction)
Use the Signing SDK to verify the address and build the transaction.
// Verify address
let valid = await wallet.validAddress({
address: newAddress.address
});
console.log("verify address isValid:", valid.isValid);
// Sign the transaction
let signParams = {
privateKey: derivePrivateKey,
data: {
to: newAddress.address,
value: new BigNumber(0),
nonce: 5,
gasPrice: new BigNumber(100 * 1000000000),
gasLimit: new BigNumber(21000),
chainId: 42
}
};
let signedTx = await wallet.signTransaction(signParams);
console.log("signed tx:", signedTx);
### Broadcast Transaction[#](#broadcast-transaction)
Call the [interface](/web3/build/docs/waas/walletapi-api-send-transaction)
to broadcast the transaction to the chain.
// Define your parameters
const postSendTransactionBody = {
"signedTx": "0x02f8720182029f8411e1a3008504bbe2e94682520894d73c5e36d47eed32f0327f9d3f04b49384e90fab85e8d4a5100080c080a0ba380a9be31efabc4c8cfccbb555f8af3c21073d6eca01f180ebebb8942c6f30a0779e6e16a504c413cb9902ceb33ab7e89a533bc13b74477dfa6b6c76dc41fac2
"accountId": "5f45a951-4a8b-4cd9-b20a-3b337b71efcc",
"chainIndex": "1",
"address": "0x238193be9e80e68eace3588b45d8cf4a7eae0fa3",
};
// Define auxiliary function
const sendTransactionData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'api/v5/wallet/pre-transaction/broadcast-transaction'
);
return fetch(apiRequestUrl, {
method: 'post',
headers: headersParams,
body: JSON.stringify(postSendTransactionBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: sendTransactionData } = await sendTransactionData();
After broadcasting, you will receive a response like this:
{
"code": 0,
"msg": "success",
"data": [{\
"orderId": "469356614923743232"\
}]
}
Note
Click to view the definition of [orderId](/web3/build/docs/waas/walletapi-resources-definitions#orderid)
.
* * *
Step 4: Query Transaction Details[#](#step-4:-query-transaction-details)
-------------------------------------------------------------------------
After sending the transaction, use the [interface](/web3/build/docs/waas/walletapi-api-order-id-transaction-list)
get the transaction details.You can also query by transaction hash, see [here](/web3/build/docs/waas/walletapi-api-transaction-detail-by-txhash)
.
// Define your parameters
const params = {
accountId: '13886e05-1265-4b79-8ac3-b7ab46211001',
orderId: '469356614923743232',
chainIndex: '1'
};
// Define auxiliary function
const getTransactionDetailData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/post-transaction/orders',
params
);
return fetch(apiRequestUrl, {
method: 'get',
headers: headersParams,
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: transactionDetailData } = await getTransactionDetailData();
When the details are successfully queried, you will receive a response like this:
{
"code": 0,
"msg": "success",
"data": [\
{\
"chainIndex": "1",\
"orderId": "469356614923743232",\
"txhash": "0xcbf411766d65f3cf92839ababa73c4afec69a83442e8b67a68b5104b50a04ejb",\
"blockHash" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",\
"blockHeight" : "19235519",\
"blockTime" : "1708026551000",\
"feeUsdValue" : "138.846919",\
"fees" : "49102595635945621",\
"gasLimit" : "2000000",\
"gasPrice" : "87504603347",\
"gasUsed" : "561143",\
"txType": "0", \
"txTime": "0", \
"txStatus": "0",\
"txDetail": [\
{\
"iType" : "0", \
"txAmount": "0",\
"tokenAddress":""\
"contractCall" : true,\
"fromAddr" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",\
"toAddr" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",\
"logIndex" : "-1",\
"status" : "SUCCESS"\
}\
]\
}\
]
}
Additionally, you can subscribe to Webhooks to get real-time and accurate information about the status of transactions. [Click here for details](/web3/build/docs/waas/walletapi-api-webhook-intro)
.
* * *
At this point, you have basically implemented the basic functions needed to develop a Web3 wallet.
Additionally, Wallet API provides a rich range of interfaces to fully meet the needs of Web3 wallet developers. For details, please refer to the following content.
[Wallet API\
\
Build Inscription Wallet](/web3/build/docs/waas/walletapi-quickstart-inscription)
[Wallet API\
\
On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
Table of contents
[Step 1: Generate Wallet Mnemonic and Address](#step-1:-generate-wallet-mnemonic-and-address)
[Step 2: Create an Account](#step-2:-create-an-account)
[Step 3: Construct and Send Transactions](#step-3:-construct-and-send-transactions)
[Step 4: Query Transaction Details](#step-4:-query-transaction-details)
---
# Preparation | Quick Start | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[Preparation](/web3/build/docs/waas/walletapi-quickstart-preparation)
[Building an On-Chain Data Dashboard](/web3/build/docs/waas/walletapi-quickstart-dashboard)
[Build Inscription Wallet](/web3/build/docs/waas/walletapi-quickstart-inscription)
[Building a Web3 Wallet](/web3/build/docs/waas/walletapi-quickstart-multi-chain)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
Preparation
Preparation[#](#preparation)
=============================
Create Project and API Key[#](#create-project-and-api-key)
-----------------------------------------------------------
Before using the Wallet API, you need to first create a project on the Developer Management Platform and generate an API key. Here are the detailed steps and related resources:
1. Log in to the Developer Management Platform.
2. Create a new project.
3. Generate the API key in the project settings.
We have prepared a detailed guide to help you complete these steps. You can read the [Developer Portal Guide](/web3/build/docs/waas/introduction-to-developer-portal-interface)
to get started more quickly.
Additionally, you need to set up some basic configuration for API calls.
REST Request Authentication Configuration[#](#rest-request-authentication-configuration)
-----------------------------------------------------------------------------------------
When sending REST requests, you will need to authenticate them. We have provided a detailed [REST Authentication Guide](/web3/build/docs/waas/rest-authentication)
to help you understand and implement this process.
Node.js Environment Setup[#](#node.js-environment-setup)
---------------------------------------------------------
Import the necessary Node.js libraries, set up your environment variables, and define helper functions and assemble parameters in the [Node.js Environment Setup](/web3/build/docs/waas/nodejs-environment)
.
[Wallet API\
\
Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[Wallet API\
\
Building an On-Chain Data Dashboard](/web3/build/docs/waas/walletapi-quickstart-dashboard)
Table of contents
[Create Project and API Key](#create-project-and-api-key)
[REST Request Authentication Configuration](#rest-request-authentication-configuration)
[Node.js Environment Setup](#node.js-environment-setup)
---
# Build Inscription Wallet | Quick Start | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[Preparation](/web3/build/docs/waas/walletapi-quickstart-preparation)
[Building an On-Chain Data Dashboard](/web3/build/docs/waas/walletapi-quickstart-dashboard)
[Build Inscription Wallet](/web3/build/docs/waas/walletapi-quickstart-inscription)
[Building a Web3 Wallet](/web3/build/docs/waas/walletapi-quickstart-multi-chain)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
Build Inscription Wallet
Build Inscription Wallet[#](#build-inscription-wallet)
=======================================================
The Wallet API supports five popular inscription assets: BRC-20, Runes, ARC-20, SRC-20, and Ordinals\_NFT.
Please make sure you have completed the [preparation work](/web3/build/docs/waas/walletapi-quickstart-preparation)
, then you can directly use this case to familiarize yourself with querying inscription data, constructing, and broadcasting inscription transactions.
Step 1: Generate Wallet Mnemonic and Address[#](#step-1:-generate-wallet-mnemonic-and-address)
-----------------------------------------------------------------------------------------------
You can use our provided [Signature SDK](/web3/build/docs/waas/wallet-client-sdk)
to create wallet mnemonics and addresses.
### npm install[#](#npm-install)
First, install the latest version of the Signature SDK. For the BTC network, use the following commands:
npm install @okxweb3/crypto-lib
npm install @okxweb3/coin-base
npm install @okxweb3/coin-bitcoin
### Build Locally[#](#build-locally)
1. Download the project source code
git clone https://github.com/okx/js-wallet-sdk.git
2. Run the build script
sh build.sh
For the BTC network, you can use the following code to create a BTC wallet object with the Signature SDK and derive the corresponding address.
import { BtcWallet,MessageTypes} from "@okxweb3/coin-bitcoin";
// btc wallet
let wallet = new BtcWallet()
// get mnemonic
let mnemonic = await getMnemonic(128);
let param = {
mnemonic: mnemonic,
hdPath: "m/44'/0'/0'/0/0"
};
// get derived key
let privateKey = await wallet.getDerivedPrivateKey(param);
// get new address
import { BtcWallet } from "@okxweb3/coin-bitcoin";
let wallet = new BtcWallet()
// legacy address
let params: NewAddressParams = {
privateKey: "L22jGDH5pKE4WHb2m9r2MdiWTtGarDhTYRqMrntsjD5uCq5z9ahY"
};
let address = await wallet.getNewAddress(params);
// native segwit address
let params2: NewAddressParams = {
privateKey: "L22jGDH5pKE4WHb2m9r2MdiWTtGarDhTYRqMrntsjD5uCq5z9ahY",
addressType: "segwit_native",
};
let address2 = await wallet.getNewAddress(params2);
// nested segwit address
let params3: NewAddressParams = {
privateKey: "L22jGDH5pKE4WHb2m9r2MdiWTtGarDhTYRqMrntsjD5uCq5z9ahY",
addressType: "segwit_nested",
};
let address3 = await wallet.getNewAddress(params3);
// taproot segwit address
let params4: NewAddressParams = {
privateKey: "L22jGDH5pKE4WHb2m9r2MdiWTtGarDhTYRqMrntsjD5uCq5z9ahY",
addressType: "segwit_taproot",
};
let address4 = await wallet.getNewAddress(params4);
// get the public key
let publicKey = newAddress.publicKey;
console.log("the corresponding public key:", publicKey);
### Demo Program[#](#demo-program)
We have prepared an [open-source demo program](https://okx.github.io/js-wallet-sdk-demo/)
,to showcase the functionalities of the Signature SDK mentioned above. Get the demo program source code [here](https://github.com/okx/js-wallet-sdk-demo)
.
* * *
Step 2: Create an Account[#](#step-2:-create-an-account)
---------------------------------------------------------
In the previous step, you generated mnemonics and addresses. Now you can create an account \[(AccountId)\] (./walletapi-resources-definitions)to aggregate multiple addresses for batch querying of token balances and transaction history.
Explanation
Typically, a Web3 wallet has three concepts:
\- Wallet: The owner of the mnemonic owns the wallet.
\- Account: Based on the BIP-44 standard, multiple accounts can be derived from a set of mnemonics.
\- Address: Each chain under each account corresponds to an address.
Call the API to [create a wallet account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
.
For example, to create a BTC wallet account supporting different address types:
// Define your parameters
const addresses = [\
{\
"chainIndex":"0",\
"address":"bc1peqgjr3cwl09mmsh6kvjsvv3ffu4waha00x7xrqrt85wt3zgdwphs72ctnu",\
},\
{\
"chainIndex":"0",\
"address":"18u8nvU5rx1drgwiT4M9sGTD9JX8r53KM9",\
}\
];
const getCreateAccountBody = {
addresses: addresses,
signMessage: '1717062864123', // UNIX Timestamp in millisecond
};
// Define auxiliary function
const getCreateAccountData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/account/create-wallet-account'
);
return fetch(apiRequestUrl, {
method: 'post',
headers: headersParams,
body: JSON.stringify(getCreateAccountBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: createAccountData } = await getCreateAccountData();
* * *
Step 3: Construct and Send Inscription Transactions[#](#step-3:-construct-and-send-inscription-transactions)
-------------------------------------------------------------------------------------------------------------
### Get Signature Required Information[#](#get-signature-required-information)
First, call the `POST /api/v5/wallet/pre-transaction/sign-info` interface to query some data required for signing, such as BTC chain fees, inscription output sizes, etc.
// Define your parameters
// BTC
const postSignInfoBody = {
chainIndex: '0',
fromAddr: 'bc1psnr548clz3f4fz6jmpnw5eqzj2v2musk082wp8fvq5ac3p5ete6qg05u8u',
toAddr: 'bc1psnr548clz3f4fz6jmpnw5eqzj2v2musk082wp8fvq5ac3p5ete6qg05u8u',
txAmount: '0',
extJson: {
}
};
// Define auxiliary function
const signInfoData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/pre-transaction/sign-info'
);
return fetch(apiRequestUrl, {
method: 'post',
headers: headersParams,
body: JSON.stringify(postSignInfoBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: signInfoData } = await signInfoData();
After querying the relevant information, you will receive a response like this:
{
"code": "0",
"msg": "success",
"data": [\
{\
"normalFeeRate": "5",\
"maxFeeRate": "5",\
"minFeeRate": "5",\
"inscriptionOutput": "546",\
"minOutput": "546",\
"normalCost": "1800",\
"maxCost": "3600",\
"minCost": "600"\
}\
]
}
### Get Full UTXO[#](#get-full-utxo)
Call the `GET /api/v5/wallet/utxo/utxo` interface to query all available UTXOs for the current address.
// Define your parameters
// BTC
const postSignInfoBody = {
chainIndex: '0',
fromAddr: 'bc1psnr548clz3f4fz6jmpnw5eqzj2v2musk082wp8fvq5ac3p5ete6qg05u8u',
toAddr: 'bc1psnr548clz3f4fz6jmpnw5eqzj2v2musk082wp8fvq5ac3p5ete6qg05u8u',
txAmount: '0',
extJson: {
}
};
// Define auxiliary function
const signInfoData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/pre-transaction/sign-info'
);
return fetch(apiRequestUrl, {
method: 'get',
headers: headersParams,
body: JSON.stringify(postSignInfoBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: signInfoData } = await signInfoData();
### Get Inscription Asset Details on UTXO[#](#get-inscription-asset-details-on-utxo)
Call the `POST /api/v5/wallet/utxo/utxo-detail` interface to query the inscription details on the UTXO.
// Define your parameters
// BTC
const postSignInfoBody = {
chainIndex: '0',
fromAddr: 'bc1psnr548clz3f4fz6jmpnw5eqzj2v2musk082wp8fvq5ac3p5ete6qg05u8u',
toAddr: 'bc1psnr548clz3f4fz6jmpnw5eqzj2v2musk082wp8fvq5ac3p5ete6qg05u8u',
txAmount: '0',
extJson: {
}
};
// Define auxiliary function
const signInfoData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/pre-transaction/sign-info'
);
return fetch(apiRequestUrl, {
method: 'post',
headers: headersParams,
body: JSON.stringify(postSignInfoBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: signInfoData } = await signInfoData();
### Verify Address and Build Transaction[#](#verify-address-and-build-transaction)
Use the signing SDK to first verify address validity and then build the transaction.
// Verify address
let valid = await wallet.validAddress({
address: newAddress.address
});
console.log("verify address isValid:", valid.isValid);
// Sign a transaction
let signParams = {
privateKey: derivePrivateKey,
data: {
to: newAddress.address,
value: new BigNumber(0),
nonce: 5,
gasPrice: new BigNumber(100 * 1000000000),
gasLimit: new BigNumber(21000),
chainId: 42
}
};
let signedTx = await wallet.signTransaction(signParams);
console.log("signed tx:", signedTx);
### Broadcast Transaction[#](#broadcast-transaction)
Call the [interface](/web3/build/docs/waas/walletapi-api-send-transaction)
to broadcast the transaction to the blockchain.
// Define your parameters
const postSendTransactionBody = {
signedTx: "02000000000101a92808fb32063058e3c752ad2c4a0a6f8957e858dd01483ccff504d4f5ca791d0500000000fdffffff02c405000000000000225120728b5d2f0cf833264adac833e997931155b4aec3020bc87c32fa91509bb2abe61f71080000000000225120f0513064fe1e5b5c31bedff43b943f2f1211d14ab2891687241b138d214888e30140393a287212d5c7341a5d44ba2409dda5db95a854e500475ec8bf2ea0f7f63d35c849102c0f906f48d1833f3b5b7a7ca726e14fc2d715b4cbbecb8488e028baab00000000"
accountId:"c79e7775-9e78-4a2d-b27f-9021f3bf5fca",
address: "bc1p7pgnqe87red4cvd7ml6rh9pl9ufpr522k2y3dpeyrvfc6g2g3r3s3ae9dr",
};
// Define auxiliary function
const sendTransactionData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'api/v5/wallet/pre-transaction/broadcast-transaction'
);
return fetch(apiRequestUrl, {
method: 'post',
headers: headersParams,
body: JSON.stringify(postSendTransactionBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: sendTransactionData } = await sendTransactionData();
After broadcasting, you will receive the following response:
{
"code": 0,
"msg": "success",
"data": [{\
"orderId": "469356614923743232"\
}]
}
Note
Click to see the [orderId](/web3/build/docs/waas/walletapi-resources-definitions#orderid)
definition
* * *
Step 5: Query Inscription Transaction Details[#](#step-5:-query-inscription-transaction-details)
-------------------------------------------------------------------------------------------------
After sending the transaction, use the `GET /api/v5/wallet/post-transaction/inscription-transaction-detail-by-txhash` interface to obtain the inscription transaction details via txhash.
// Define your parameters
const params = {
accountId: '13886e05-1265-4b79-8ac3-b7ab46211001',
orderId: '469356614923743232',
chainIndex: '1'
};
// Define auxiliary function
const getTransactionDetailData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/post-transaction/transaction-detail-by-ordid',
params
);
return fetch(apiRequestUrl, {
method: 'get',
headers: headersParams,
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: transactionDetailData } = await getTransactionDetailData();
After successfully querying the details, you will receive a response like the following:
{
"code": 0,
"msg": "success",
"data": [\
{\
"chainIndex": "1",\
"orderId": "469356614923743232",\
"txhash": "0xcbf411766d65f3cf92839ababa73c4afec69a83442e8b67a68b5104b50a04ejb",\
"blockHash" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",\
"blockHeight" : "19235519",\
"blockTime" : "1708026551000",\
"feeUsdValue" : "138.846919",\
"fees" : "49102595635945621",\
"gasLimit" : "2000000",\
"gasPrice" : "87504603347",\
"gasUsed" : "561143",\
"txType": "0", \
"txTime": "0", \
"txStatus": "0",\
"txDetail": [\
{\
"iType" : "0", \
"txAmount": "0",\
"tokenAddress":""\
"contractCall" : true,\
"fromAddr" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",\
"toAddr" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",\
"logIndex" : "-1",\
"status" : "SUCCESS"\
}\
]\
}\
]
}
Additionally, you can subscribe to Webhooks to get real-time and accurate information on the status of your transaction after it has been sent,[See details](/web3/build/docs/waas/walletapi-api-webhook-intro)
.
At this point, you have basically implemented the essential functions required for developing an inscription wallet.
Moreover, the wallet API provides a rich set of interfaces to meet the needs of Web3 wallet developers. For more details, please refer to the following content.
[Wallet API\
\
Building an On-Chain Data Dashboard](/web3/build/docs/waas/walletapi-quickstart-dashboard)
[Wallet API\
\
Building a Web3 Wallet](/web3/build/docs/waas/walletapi-quickstart-multi-chain)
Table of contents
[Step 1: Generate Wallet Mnemonic and Address](#step-1:-generate-wallet-mnemonic-and-address)
[Step 2: Create an Account](#step-2:-create-an-account)
[Step 3: Construct and Send Inscription Transactions](#step-3:-construct-and-send-inscription-transactions)
[Step 5: Query Inscription Transaction Details](#step-5:-query-inscription-transaction-details)
---
# Use swap API | Build swap applications | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Build swap applications](/web3/build/docs/waas/dex-api-quick-start-reference)
[Build swap applications on the EVM network](/web3/build/docs/waas/dex-use-swap-quick-start)
[Build swap applications on Solana](/web3/build/docs/waas/dex-use-swap-solana-quick-start)
[Build swap applications on Sui](/web3/build/docs/waas/dex-use-swap-sui-quick-start)
[Build swap applications on the Ton network](/web3/build/docs/waas/dex-use-swap-ton-quick-start)
[Build bridge applications](/web3/build/docs/waas/dex-crosschain-api-quick-start-reference)
[Build limit order applications](/web3/build/docs/waas/dex-limit-order-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Build swap applications](/web3/build/docs/waas/dex-aggregation-root-quick-start)
Use swap API
Build swap applications[#](#build-swap-applications)
=====================================================
[Build swap applications on the EVM network\
\
Build swap applications on EVM](/web3/build/docs/waas/dex-use-swap-quick-start)
[Build swap applications on Solana\
\
Build swap applications on Solana](/web3/build/docs/waas/dex-use-swap-solana-quick-start)
[Build swap applications on the Ton network\
\
Build swap applications on Ton](/web3/build/docs/waas/dex-use-swap-ton-quick-start)
[DEX API\
\
Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[DEX API\
\
Build swap applications on the EVM network](/web3/build/docs/waas/dex-use-swap-quick-start)
---
# Subscribe Data | Webhook | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Subscribe Data](/web3/build/docs/waas/walletapi-api-webhook-subscribe)
[Unsubscribe Data](/web3/build/docs/waas/walletapi-api-webhook-unsubscribe)
[Subscription List](/web3/build/docs/waas/walletapi-api-webhook-get-subscriptions)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
Subscribe Data
Subscribe Data[#](#subscribe-data)
===================================
Subscribe data related to block events and transaction events. You can create up to 20 subscriptions at a time, as shown in the array format of the request example. After a successful subscription, messages will be pushed through webhook.
Note
In case of special situations such as block reorganization, the Webhook may resend data. When receiving this, you need to implement idempotency handling.
### Request Path[#](#request-path)
POST `https://www.okx.com/api/v5/wallet/webhook/subscribe`
### Request Parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| url | String | Yes | Webhook callback address
For detailed usage, refer to [here](/web3/build/docs/waas/walletapi-bp-data-subscription#receive-callback-messages)
The callback address needs to be reviewed, and you can receive push messages only after the review is passed. Contact us |
| type | String | Yes | Type of data to subscribe to. Valid values are:
`block`: triggers when any block is generated
`token_issuance`: Token issuance
`fee_fluctuation`: Fee fluctuation |
| chainIndex | String | Yes | Unique identifier of the chain |
| name | String | No | Name of the subscription |
| feeChangeFilter | Object | No | Fee fluctuation filter, applicable only when the type is `fee_fluctuation` |
| \> minChange | String | Yes | Minimum fluctuation |
| \> maxChange | String | No | Maximum fluctuation |
### Response Parameters[#](#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| id | String | Unique identifier of the subscription |
[Wallet API\
\
Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Wallet API\
\
Unsubscribe Data](/web3/build/docs/waas/walletapi-api-webhook-unsubscribe)
### Request Example[#](#request-example)
shell
curl --location --request POST 'https://www.okx.com/api/v5/wallet/webhook/subscribe' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data-raw '[\
{\
"chainIndex":"3",\
"url":"http://your.server.com/webhook",\
"type":"transaction"\
}\
]'
### Response Example[#](#response-example)
200
{
"code":"0",
"data":[\
{ \
"id":"1"\
}\
],
"msg":""
}
[Wallet API\
\
Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Wallet API\
\
Unsubscribe Data](/web3/build/docs/waas/walletapi-api-webhook-unsubscribe)
---
# Solana-compatible chain | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
[Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
Connect to App or Mini Wallet
[Connection Prerequisites](/web3/build/docs/sdks/app-connect-preparation)
[EVM-Compatible Chains](/web3/build/docs/sdks/app-connect-evm)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/app-connect-bitcoin)
[Solana-Compatible Chains](/web3/build/docs/sdks/app-connect-solana)
[SDK](/web3/build/docs/sdks/app-connect-solana-sdk)
[UI](/web3/build/docs/sdks/app-connect-solana-ui)
[TON](/web3/build/docs/sdks/app-connect-ton)
[SUI](/web3/build/docs/sdks/app-connect-sui)
[Aptos/Movement](/web3/build/docs/sdks/app-connect-aptos)
[Cosmos/Sei](/web3/build/docs/sdks/app-connect-cosmos)
[Tron](/web3/build/docs/sdks/app-connect-tron)
[Starknet](/web3/build/docs/sdks/app-connect-starknet)
[Troubleshooting](/web3/build/docs/sdks/app-connect-faq)
Connect to Extension Wallet
[Preparation](/web3/build/docs/sdks/web-detect-okx-wallet)
[EVM Compatible Chains](/web3/build/docs/sdks/chains/evm/introduce)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/chains/bitcoin/introduce)
[Tron](/web3/build/docs/sdks/chains/tron/introduce)
[Solana-Compatible Chains](/web3/build/docs/sdks/chains/solana/introduce)
[TON](/web3/build/docs/sdks/chains/ton/introduce)
[Aptos/Movement](/web3/build/docs/sdks/chains/aptos/introduce)
[Cosmos/Sei](/web3/build/docs/sdks/chains/cosmos/introduce)
[SUI](/web3/build/docs/sdks/chains/sui/introduce)
[Stacks](/web3/build/docs/sdks/chains/stacks/introduce)
[Starknet](/web3/build/docs/sdks/chains/starknet/introduce)
[Cardano](/web3/build/docs/sdks/chains/cardano/introduce)
[Nostr](/web3/build/docs/sdks/chains/nostr/introduce)
[NEAR](/web3/build/docs/sdks/chains/near/introduce)
[WAX](/web3/build/docs/sdks/chains/wax/introduce)
[Display DApp icon](/web3/build/docs/sdks/web-display-dapp-icon)
Connect to App or Mini Wallet
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Connect to App or Mini Wallet
Solana-compatible chain
Solana-Compatible Chains[#](#solana-compatible-chains)
=======================================================
Solana is a high-performance blockchain platform committed to providing fast, secure, and scalable solutions for decentralized applications and cryptocurrencies. The platform utilizes an innovative consensus algorithm called Proof of History (PoH) that can handle tens of thousands of transactions per second (TPS) while maintaining decentralization and security. Overall, Solana aims to achieve mass adoption of blockchain through its unique technological advantages, catering to various complex decentralized applications and global financial systems.
Common Solana-compatible networks include SOON, Sonic, etc.
* If connecting via SDK, add a "Connect OKX Wallet" button within the DApp. Clicking this button will launch the mobile App Wallet and enable interaction with the OKX Wallet, such as retrieving addresses, initiating wallet signatures, and other functions.
* In addition to SDK, we also provide a UI interface. If using the UI connection, and the DApp is operating in Telegram, users can choose to open the mobile App Wallet or stay in Telegram and launch the OKX Mini Wallet.
[SDK](/web3/build/docs/sdks/app-connect-solana-sdk)
[UI](/web3/build/docs/sdks/app-connect-solana-ui)
[Connect to App or Mini Wallet\
\
UI](/web3/build/docs/sdks/app-connect-bitcoin-ui)
[Connect to App or Mini Wallet\
\
SDK](/web3/build/docs/sdks/app-connect-solana-sdk)
---
# Ton | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
[Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
Connect to App or Mini Wallet
[Connection Prerequisites](/web3/build/docs/sdks/app-connect-preparation)
[EVM-Compatible Chains](/web3/build/docs/sdks/app-connect-evm)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/app-connect-bitcoin)
[Solana-Compatible Chains](/web3/build/docs/sdks/app-connect-solana)
[TON](/web3/build/docs/sdks/app-connect-ton)
[SDK](/web3/build/docs/sdks/app-connect-ton-sdk)
[UI](/web3/build/docs/sdks/app-connect-ton-ui)
[SUI](/web3/build/docs/sdks/app-connect-sui)
[Aptos/Movement](/web3/build/docs/sdks/app-connect-aptos)
[Cosmos/Sei](/web3/build/docs/sdks/app-connect-cosmos)
[Tron](/web3/build/docs/sdks/app-connect-tron)
[Starknet](/web3/build/docs/sdks/app-connect-starknet)
[Troubleshooting](/web3/build/docs/sdks/app-connect-faq)
Connect to Extension Wallet
[Preparation](/web3/build/docs/sdks/web-detect-okx-wallet)
[EVM Compatible Chains](/web3/build/docs/sdks/chains/evm/introduce)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/chains/bitcoin/introduce)
[Tron](/web3/build/docs/sdks/chains/tron/introduce)
[Solana-Compatible Chains](/web3/build/docs/sdks/chains/solana/introduce)
[TON](/web3/build/docs/sdks/chains/ton/introduce)
[Aptos/Movement](/web3/build/docs/sdks/chains/aptos/introduce)
[Cosmos/Sei](/web3/build/docs/sdks/chains/cosmos/introduce)
[SUI](/web3/build/docs/sdks/chains/sui/introduce)
[Stacks](/web3/build/docs/sdks/chains/stacks/introduce)
[Starknet](/web3/build/docs/sdks/chains/starknet/introduce)
[Cardano](/web3/build/docs/sdks/chains/cardano/introduce)
[Nostr](/web3/build/docs/sdks/chains/nostr/introduce)
[NEAR](/web3/build/docs/sdks/chains/near/introduce)
[WAX](/web3/build/docs/sdks/chains/wax/introduce)
[Display DApp icon](/web3/build/docs/sdks/web-display-dapp-icon)
Connect to App or Mini Wallet
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Connect to App or Mini Wallet
Ton
TON[#](#ton)
=============
TON chain, fully known as The Open Network, aims to provide fast and efficient transaction processing capabilities, while supporting smart contracts and decentralized applications. TON uses an innovative design called "multi-chain architecture," enabling high scalability and allowing multiple blockchains to run in parallel, thus improving the throughput and performance of the entire network.
* If connecting via SDK, add a "Connect OKX Wallet" button within the DApp. Clicking this button will launch the mobile App Wallet and enable interaction with the OKX Wallet, such as retrieving addresses, initiating wallet signatures, and other functions.
* In addition to SDK, we also provide a UI interface. If using the UI connection, and the DApp is operating in Telegram, users can choose to open the mobile App Wallet or stay in Telegram and launch the OKX Mini Wallet.
If you've used Ton Connect before, this document is a seamless way to reduce your development costs.
[SDK](/web3/build/docs/sdks/app-connect-ton-sdk)
[UI](/web3/build/docs/sdks/app-connect-ton-ui)
If you have used OKX Connect before, you can reduce your development costs by connecting to it with this documentation
[SDK](/web3/build/docs/sdks/app-connect-ton-provider-sdk)
[UI](/web3/build/docs/sdks/app-connect-ton-provider-ui)
[Connect to App or Mini Wallet\
\
UI](/web3/build/docs/sdks/app-connect-solana-ui)
[Connect to App or Mini Wallet\
\
SDK](/web3/build/docs/sdks/app-connect-ton-sdk)
---
# Create Account | Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Create Account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
[Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
[Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
[Get Accounts](/web3/build/docs/waas/walletapi-api-accounts)
[Get Addresses Under Account](/web3/build/docs/waas/walletapi-api-account-detail)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
Create Account
Create Account[#](#create-account)
===================================
Bind multiple addresses to create a wallet account. The supported chains return all tokens by default, and it allows aggregated queries for asset and transaction history.
Note
The number of addresses that can be aggregated in a wallet account has an upper limit, which is based on the number of chains [we support](/web3/build/docs/waas/walletapi-resources-supported-networks)
.
### Request Path[#](#request-path)
POST `https://www.okx.com/api/v5/wallet/account/create-wallet-account`
### Request Parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| addresses | Array | Yes | List of addresses. (Maximum 50 addresses per call, for subsequent additions, use [Update Account](/web3/build/docs/waas/walletapi-api-update-watch-only-account)
) |
| \>chainIndex | String | Yes | Unique identifier of the chain |
| \>address | String | Yes | Address |
### Response Parameters[#](#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| accountId | String | Unique identifier of the wallet account |
[Wallet API\
\
Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Wallet API\
\
Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
### Request Example[#](#request-example)
shell
curl --location --request POST 'https://www.okx.com/api/v5/wallet/account/create-wallet-account' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data-raw '{
"addresses": [\
{\
"chainIndex":"1",\
"address":"0x561815e02bac6128bbbbc551005ddfd92a5c24db"\
},{\
"chainIndex":"0",\
"address":"bc1p939endmmt6pvz7ukeywpfsazz57cc4vdu3d0qerz6crhgrtmerfssls5wy"\
}\
]
}'
### Response Example[#](#response-example)
200
{
"code": "0",
"data": [\
{\
"accountId": "13886e05-1265-4b79-8ac3-b7ab46217655"\
}\
],
"msg": "success"
}
[Wallet API\
\
Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Wallet API\
\
Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
---
# Building an On-Chain Data Dashboard | Quick Start | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[Preparation](/web3/build/docs/waas/walletapi-quickstart-preparation)
[Building an On-Chain Data Dashboard](/web3/build/docs/waas/walletapi-quickstart-dashboard)
[Build Inscription Wallet](/web3/build/docs/waas/walletapi-quickstart-inscription)
[Building a Web3 Wallet](/web3/build/docs/waas/walletapi-quickstart-multi-chain)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
Building an On-Chain Data Dashboard
Building an On-Chain Data Dashboard[#](#building-an-on-chain-data-dashboard)
=============================================================================
Ensure that you have completed the [preparation work](/web3/build/docs/waas/walletapi-quickstart-preparation)
. You can use this example to familiarize yourself with various methods of on-chain data queries.
Method 1: Query by Address[#](#method-1:-query-by-address)
-----------------------------------------------------------
### Query Assets[#](#query-assets)
Call the API to get [asset data](/web3/build/docs/waas/walletapi-api-all-token-balances-by-address)
integrated with 60+ chains, updated in seconds.
### Query Coin Prices and Information[#](#query-coin-prices-and-information)
Call the API to get [coin price data](/web3/build/docs/waas/walletapi-api-intro-tokendata)
from multiple data sources including major exchanges, DEXs, and markets.
### Query Owned UTXOs and Inscriptions[#](#query-owned-utxos-and-inscriptions)
Call the API to get [owned UTXOs](/web3/build/docs/waas/walletapi-api-utxos)
and [inscription details](/web3/build/docs/waas/walletapi-api-utxo-detail)
.
### Query Transaction History[#](#query-transaction-history)
Call the API to get [full transaction history](/web3/build/docs/waas/walletapi-api-transactions-by-address)
for each address on the chain since creation.
### Query Authorizations[#](#query-authorizations)
Call the API to view [authorization details](/web3/build/docs/waas/walletapi-api-get-approval-detail)
on the address.
Method 2: Batch Query by Account[#](#method-2:-batch-query-by-account)
-----------------------------------------------------------------------
### Step 1: Create an Account[#](#step-1:-create-an-account)
Create a wallet account ([AccountId](/web3/build/docs/waas/walletapi-resources-definitions#accountid)
) to aggregate the addresses you want to view and perform batch queries for token balances and transaction history.
Implementation: Call the API to [create a wallet account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
.
For example, subscribe to the same address across different chains as follows:
// Define your parameters
const addresses = [\
{\
"chainIndex":"1",\
"address":"0x561815e02bac6128bbbbc551005ddfd92a5c24db",\
},\
{\
"chainIndex":"10",\
"address":"0x561815e02bac6128bbbbc551005ddfd92a5c24db",\
}\
];
const getCreateWalletAccountBody = {
addresses: addresses
};
// Define the helper function
const getCreateWalletAccountData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/account/create-wallet-account'
);
return fetch(apiRequestUrl, {
method: 'post',
headers: headersParams,
body: JSON.stringify(getCreateWalletAccountBody),
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: createWalletAccountData } = await getCreateWalletAccountData();
### Step 2: Query Balances
The wallet account can directly call the API to view the tokens held in the account. [Click here to check wallet account token balances](./walletapi-api-wallet-all-token-balances) for details.
```javascript
// Define parameters
const getAssetsParams = {
accountId: '13886e05-1265-4b79-8ac3-b7ab46211001',
};
// Define the helper function
const getAssetsData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/asset/wallet-all-token-balances',
getAssetsParams
);
return fetch(apiRequestUrl, {
method: 'GET',
headers: headersParams,
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: getAssetsData } = await getAssetsData();
When querying assets, you will receive a response like this:
{
"code": "0",
"data": [\
{\
"chainIndex": "1",\
"tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",\
"symbol": "USDT",\
"balance": "0.688467",\
"tokenPrice": "0.99993",\
"tokenType": "1"\
},\
{\
"chainIndex": "1",\
"tokenAddress": "0x514910771af9ca656af840dff83e8264ecf986ca",\
"symbol": "LINK",\
"balance": "0.000000366257612925",\
"tokenPrice": "14.108071299717093",\
"tokenType": "1"\
}\
],
"msg": "success"
}
Step 3: Query Transaction History
After sending a transaction, use the `GET /api/v5/wallet/post-transaction/transaction-detail-by-txhash` endpoint and provide the `txHash` to retrieve the transaction details.
// Define your parameters
const params = {
txhash: '0x9ab8ccccc9f778ea91ce4c0f15517672c4bd06d166e830da41ba552e744d29a5',
chainIndex: '42161'
};
// Define helper function
const getTransactionDetailData = async () => {
const apiRequestUrl = getRequestUrl(
apiBaseUrl,
'/api/v5/wallet/post-transaction/transaction-detail-by-txhash',
params
);
return fetch(apiRequestUrl, {
method: 'get',
headers: headersParams,
})
.then((res) => res.json())
.then((res) => {
return res;
});
};
const { data: transactionDetailData } = await getTransactionDetailData();
When querying transaction history, you will receive a response like this:
{
"code": "0",
"msg": "success",
"data": [\
{\
"chainIndex": "42161",\
"height": "245222398",\
"txTime": "1724253417000",\
"txhash": "0x9ab8ccccc9f778ea91ce4c0f15517672c4bd06d166e830da41ba552e744d29a5",\
"gasLimit": "2000000",\
"gasUsed": "2000000",\
"gasPrice": "10000000",\
"nonce": "0",\
"symbol": "ETH",\
"amount": "0",\
"txStatus": "success",\
"methodId": "0xc9f95d32",\
"l1OriginHash": "0xa6a87ba2f18cc32bbae8f3b2253a29a9617ed1eb0940d80443f6e3bf9873dbad",\
"fromDetails": [\
{\
"address": "0xd297fa914353c44b2e33ebe05f21846f1048cfeb",\
"vinIndex": "",\
"preVoutIndex": "",\
"txHash": "",\
"isContract": false,\
"amount": ""\
}\
],\
"toDetails": [\
{\
"address": "0x000000000000000000000000000000000000006e",\
"voutIndex": "",\
"isContract": false,\
"amount": ""\
}\
],\
"internalTransactionDetails": [\
{\
"from": "0x0000000000000000000000000000000000000000",\
"to": "0xd297fa914353c44b2e33ebe05f21846f1048cfeb",\
"isFromContract": false,\
"isToContract": false,\
"amount": "0.02",\
"state": "success"\
},\
{\
"from": "0xd297fa914353c44b2e33ebe05f21846f1048cfeb",\
"to": "0x428ab2ba90eba0a4be7af34c9ac451ab061ac010",\
"isFromContract": false,\
"isToContract": false,\
"amount": "0.00998",\
"state": "success"\
},\
{\
"from": "0xd297fa914353c44b2e33ebe05f21846f1048cfeb",\
"to": "0x428ab2ba90eba0a4be7af34c9ac451ab061ac010",\
"isFromContract": false,\
"isToContract": false,\
"amount": "0.009977946366846017",\
"state": "success"\
}\
],\
"tokenTransferDetails": []\
}\
]
}
By now, you have basically implemented the basic functionality needed to develop an on-chain data dashboard.
Additionally, the wallet API provides a rich set of interfaces to fully meet the needs of exchange wallet developers. Please refer to the sections below for more information.
[Wallet API\
\
Preparation](/web3/build/docs/waas/walletapi-quickstart-preparation)
[Wallet API\
\
Build Inscription Wallet](/web3/build/docs/waas/walletapi-quickstart-inscription)
Table of contents
[Method 1: Query by Address](#method-1:-query-by-address)
[Method 2: Batch Query by Account](#method-2:-batch-query-by-account)
---
# Sui | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
[Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
Connect to App or Mini Wallet
[Connection Prerequisites](/web3/build/docs/sdks/app-connect-preparation)
[EVM-Compatible Chains](/web3/build/docs/sdks/app-connect-evm)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/app-connect-bitcoin)
[Solana-Compatible Chains](/web3/build/docs/sdks/app-connect-solana)
[TON](/web3/build/docs/sdks/app-connect-ton)
[SUI](/web3/build/docs/sdks/app-connect-sui)
[SDK](/web3/build/docs/sdks/app-connect-sui-sdk)
[UI](/web3/build/docs/sdks/app-connect-sui-ui)
[Aptos/Movement](/web3/build/docs/sdks/app-connect-aptos)
[Cosmos/Sei](/web3/build/docs/sdks/app-connect-cosmos)
[Tron](/web3/build/docs/sdks/app-connect-tron)
[Starknet](/web3/build/docs/sdks/app-connect-starknet)
[Troubleshooting](/web3/build/docs/sdks/app-connect-faq)
Connect to Extension Wallet
[Preparation](/web3/build/docs/sdks/web-detect-okx-wallet)
[EVM Compatible Chains](/web3/build/docs/sdks/chains/evm/introduce)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/chains/bitcoin/introduce)
[Tron](/web3/build/docs/sdks/chains/tron/introduce)
[Solana-Compatible Chains](/web3/build/docs/sdks/chains/solana/introduce)
[TON](/web3/build/docs/sdks/chains/ton/introduce)
[Aptos/Movement](/web3/build/docs/sdks/chains/aptos/introduce)
[Cosmos/Sei](/web3/build/docs/sdks/chains/cosmos/introduce)
[SUI](/web3/build/docs/sdks/chains/sui/introduce)
[Stacks](/web3/build/docs/sdks/chains/stacks/introduce)
[Starknet](/web3/build/docs/sdks/chains/starknet/introduce)
[Cardano](/web3/build/docs/sdks/chains/cardano/introduce)
[Nostr](/web3/build/docs/sdks/chains/nostr/introduce)
[NEAR](/web3/build/docs/sdks/chains/near/introduce)
[WAX](/web3/build/docs/sdks/chains/wax/introduce)
[Display DApp icon](/web3/build/docs/sdks/web-display-dapp-icon)
Connect to App or Mini Wallet
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Connect to App or Mini Wallet
Sui
SUI[#](#sui)
=============
Sui (or Sui Network) is the first Layer 1 blockchain designed from the ground up to enable creators and developers to build experiences that cater for the next billion users in Web3. Sui is horizontally scalable to support a wide range of DApp development with fast speeds and low costs. The platform brings users a general-purpose blockchain with high throughput, instant settlement speeds, rich on-chain assets, and user-friendly Web3 experiences. Sui is a step-function advancement in blockchain, designed from the bottom up to meet the needs of everyone involved in crypto.
* If connecting via SDK, add a "Connect OKX Wallet" button within the DApp. Clicking this button will launch the mobile App Wallet and enable interaction with the OKX Wallet, such as retrieving addresses, initiating wallet signatures, and other functions.
* In addition to SDK, we also provide a UI interface. If using the UI connection, and the DApp is operating in Telegram, users can choose to open the mobile App Wallet or stay in Telegram and launch the OKX Mini Wallet.
[SDK](/web3/build/docs/sdks/app-connect-sui-sdk)
[UI](/web3/build/docs/sdks/app-connect-sui-ui)
[Connect to App or Mini Wallet\
\
UI](/web3/build/docs/sdks/app-connect-ton-ui)
[Connect to App or Mini Wallet\
\
SDK](/web3/build/docs/sdks/app-connect-sui-sdk)
---
# Delete Account | Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Create Account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
[Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
[Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
[Get Accounts](/web3/build/docs/waas/walletapi-api-accounts)
[Get Addresses Under Account](/web3/build/docs/waas/walletapi-api-account-detail)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
Delete Account
Delete Account[#](#delete-account)
===================================
Delete an existing account.
### Request Path[#](#request-path)
POST `https://www.okx.com/api/v5/wallet/account/delete-account`
### Request Parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| accountId | String | Yes | Unique identifier of the account |
### Response Parameters[#](#response-parameters)
None
[Wallet API\
\
Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
[Wallet API\
\
Get Accounts](/web3/build/docs/waas/walletapi-api-accounts)
### Request Example[#](#request-example)
shell
curl --location --request POST 'https://www.okx.com/api/v5/wallet/account/delete-account' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data-raw '{
"accountId": "13886e05-1265-4b79-8ac3-b7ab46217655"
}'
### Response Example[#](#response-example)
200
{
"code": "0",
"data": [],
"msg": "success"
}
[Wallet API\
\
Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
[Wallet API\
\
Get Accounts](/web3/build/docs/waas/walletapi-api-accounts)
---
# Supported bridges | DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[API reference](/web3/build/docs/waas/dex-crosschain-api)
[Supported bridges](/web3/build/docs/waas/dex-crosschain-supported-bridges)
[Smart contract](/web3/build/docs/waas/dex-crosschain-smart-contract)
[Error codes](/web3/build/docs/waas/dex-crosschain-error-code)
[FAQ](/web3/build/docs/waas/dex-crosschain-faq)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[DEX cross-chain](/web3/build/docs/waas/dex-crosschain-aggregator)
Supported bridges
Supported bridges[#](#supported-bridges)
=========================================
Information of the cross-chain bridges supported by OKX’s DEX.
| Supported bridges | Status |
| --- | --- |
| Stargate | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| CCTP | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| Across | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| Swft | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| Cbridge | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| Wanchain | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| Hyphen | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| Meson | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| Wormhole | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| Connext | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
| XLayer bridge | [Supported](/web3/build/docs/waas/dex-get-supported-bridges) |
[DEX API\
\
Get transaction status](/web3/build/docs/waas/dex-get-transaction-status)
[DEX API\
\
Smart contract](/web3/build/docs/waas/dex-crosschain-smart-contract)
---
# Changelog | More resources | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
More resources
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
More resources
Changelog
Changelog[#](#changelog)
=========================
### March 11, 2025[#](#march-11,-2025)
**API/DEX API**Update
* Single-chain swaps now support the Sonic chain.
### March 6, 2025[#](#march-6,-2025)
**API/DEX API**Update
* The single-chain swap interface now supports collecting positive slippage. You can enable this feature by setting the `enablePositiveSlippage` parameter.
### February 11, 2025[#](#february-11,-2025)
**API/DEX API**Update
* The single-chain swap interface now supports the `/swap-instruction` endpoint on the Solana chain, allowing you to customize transaction instructions.
### January 23, 2025[#](#january-23,-2025)
**API/DEX API**Update
* The single-chain swap API now supports specifying a single liquidity pool for swaps. You can achieve this by setting the `directRoute` parameter.
* The single-chain swap API now supports the Transaction querying feature.
### December 26, 2024[#](#december-26,-2024)
**API/DEX API**Update
* The single-chain swap API now supports an automatic slippage feature.
### November 25, 2024[#](#november-25,-2024)
**API/DEX API**Update
* The single-chain swap API parameter `swapReceiverAddress` now supports the Solana chain. It is now possible to specify a different recipient address for a swap transaction on the Solana chain.
### November 12, 2024[#](#november-12,-2024)
**API/DEX API**Update
* Added a new referral wallet address parameter for the single-chain swap API. Both Sol and SPL tokens now support direct use of wallet addresses for referral fee collection.
* APIs for retrieving the single-chain liquidity list and the cross-chain bridge list now support protocol logos.
* Single-chain quote and swap APIs now recognize and return risk tokens with honeypot mechanisms or tokens with 100% buy/sell tax.
### October 29, 2024[#](#october-29,-2024)
**API/DEX API**Update
* Single-chain swaps now support the Sui chain.
### July 1, 2024[#](#july-1,-2024)
**API/DEX API**Update
* The ETH dexRouter contract 0xf3de3c0d654fda23dad170f0f320a92172509127 will no longer function normally after August 1, 2024. Please switch to the latest version.
### June 19, 2024[#](#june-19,-2024)
**API/DEX API**Update
* Swap API DEX Router eth contract address update
### May 7, 2024[#](#may-7,-2024)
**API/DEX API**Update
* Solana mainnet supports commission-sharing
### April 19, 2024[#](#april-19,-2024)
**API/DEX API**Update
* Cross-chain swap support SUI chain
### April 19, 2024[#](#april-19,-2024)
**API/DEX API**Update
* Cross-chain swap support X Layer chain
### April 12, 2024[#](#april-12,-2024)
**API/DEX API**Update
* Cross-chain slippage request parameter range adjusted to 0.002-0.5
* Cross-chain swap support Merlin chain
### April 12, 2024[#](#april-12,-2024)
**API/DeFi API**Update
* Added new response parameters (quoteCompareList) to DEX swap endpoint
### April 8, 2024[#](#april-8,-2024)
**API/DeFi API**Update
* Added new response parameters (toTokenReferrerAddress) to DEX swap endpoint
### April 2, 2024[#](#april-2,-2024)
**API/DeFi API**Update
* Updated DEX swap trading support Merlin Chain
### March 22, 2024[#](#march-22,-2024)
**API/DeFi API**Update
* Added new response parameters (callDataMemo) to DEX swap endpoint
### March 22, 2024[#](#march-22,-2024)
**API/DeFi API**Update
* Added new request parameters (sort) to cross-chain Get route information and Cross-chain swap endpoint
* DEX XBridge contract address update
### March 13, 2024[#](#march-13,-2024)
**API/DeFi API**Update
* Added new response parameters (sourceChainGasfee, destinationChainGasfee, crossChainFee) to cross-chain Get transaction status endpoint
* Added new request parameters (onlyBridge) and new response parameters (minmumReceive,maxPriorityFeePerGas)
* Cross-chain API Smart contract part added cross-chain contract address (DEX XBridge contract address)
* Cross-chain API added new Get the list of tokens supported by the cross-chain bridges endpoint
### March 07, 2024[#](#march-07,-2024)
**API/DeFi API**Update
* Added new request parameters (priceImpactProtectionPercentage) to Cross-chain & Single-chain swap endpoint
### February 29, 2024[#](#february-29,-2024)
**API/DeFi API**Update
* Added new response parameters (decimal) to DEX swap endpoint
### February 22, 2024[#](#february-22,-2024)
**API/DeFi API**Update
* Added new response parameters (maxPriorityFeePerGas) to DEX swap endpoint
### February 01, 2024[#](#february-01,-2024)
**API/DeFi API**Update
* Updated DEX swap trading support solana, added new request parameters (solTokenAccountAddress)
* Added DEX swap trading support solana quick start
### January 17, 2024[#](#january-17,-2024)
**API/DeFi API**Update
* Added new request parameters (feePercent, referrerAddress) to Cross-chain swap endpoint
### January 11, 2024[#](#january-11,-2024)
**API/DeFi API**Update
* Cross-chain slippage range adjusted to 0.005-0.5
### January 02, 2024[#](#january-02,-2024)
**API/DeFi API**Update
* Added new request parameters (receiveAddress) to Cross-chain swap endpoint
* Added new request parameters (chainld) to cross-chain Get transaction status endpoint
### December 28, 2023[#](#december-28,-2023)
**API/DeFi API**Update
* Launched the first edition of OKX Web3 DeFi API documentation
* Added functionality for investment, redemption, and reward claiming processes via DeFi API
* Added methods for querying information, calculating estimated data, generating transaction data, and querying user information
### December 20, 2023[#](#december-20,-2023)
**API/DEX API**Update
* Added new response parameters (crossChainFeeTokenAddress) to cross-chain Get route information endpoint and Cross-chain swap endpoint
* Added new response parameters (status) to cross-chain Get transaction status endpoint
### December 14, 2023[#](#december-14,-2023)
**API/DEX API**Update
* Added DEX Iframe
### December 14, 2023[#](#december-14,-2023)
**API/DEX API**Update
* Added new optional parameter (swapReceiverAddress) to DEX swap interface
### December 08, 2023[#](#december-08,-2023)
**API/DEX API**Update
* Added DEX limit order list query
* Added DEX limit order get cancellation calldata
### December 06, 2023[#](#december-06,-2023)
**API/DEX API**Update
* Added new response parameters (toDexRouterList) to cross-chain Get route information endpoint
* Added new response parameters (toAmount, errorMsg) to cross-chain Get transaction status endpoint
* Added cross-chain refund issues to cross-chain FAQ
### November 24, 2023[#](#november-24,-2023)
**API/DEX API**Update
* The Order API has been expanded with a new listing module, enabling listings on OpenSea and OKX.
* Added more detailed description to order structure
### November 23, 2023[#](#november-23,-2023)
**API/DEX API**Update
* Added DEX cross-chain API quick start guidelines
### November 21, 2023[#](#november-21,-2023)
**API/DEX API**Update
* Added DEX cross-chain API quick start guidelines
### November 15, 2023[#](#november-15,-2023)
**API/DEX API**Update
* Added new response parameters (crossChainFee) to cross chain Get route information endpoint cross-chain/quote
* Added new response parameters (crossChainFee) to cross chain Cross-chain swap endpoint cross-chain/quote
### November 10, 2023[#](#november-10,-2023)
**API/DEX API**Update
* Added DEX API quick start guidelines
### November 7, 2023[#](#november-7,-2023)
**API/DEX API**Update
* Added DEX cross-chain aggregator API
### October 31, 2023[#](#october-31,-2023)
**API/DEX API**Update
* Added DEX limit order API
### October 23, 2023[#](#october-23,-2023)
**API/DEX API**Update
* Added smart contract information, including contract addresses and ABI
### September 27, 2023[#](#september-27,-2023)
**DApps integration docs updated**Update
* Updated the content of integrating DApps with OKX Wallet on the mobile app
* Added guide and sub pages for integrating DApps with OKX Wallet on the mobile app
* * *
### August 17, 2023[#](#august-17,-2023)
**API/Marketplace API**Update
* Updated the API key authentication mechanism. Moving forward, all endpoints will require an API key generated from the Web3 developer portal.
* Updated the URI of all endpoints to reflect the latest versioning
* Updated error codes
**API/DEX API**Update
* Added API key authentication. Moving forward, all endpoints will require an API key generated from the Web3 developer portal
* Updated error codes
**API/Bitcoin ecosystem**Update
* Updated the API key authentication mechanism. Moving forward, all Web3 API endpoints will require an API key generated from the Web3 developer portal
* Updated the URI of all endpoints to reflect the latest versioning
* * *
### May 29, 2023[#](#may-29,-2023)
**API/Bitcoin ecosystem**Update
* Added new BRC-20 endpoint: `brc20/token-list`
* Added new response parameters (index, location) to BRC-20 endpoint `brc20/transaction-list`
* Added new response parameters (location) to BRC-20 endpoint `brc20/inscriptions-list`
* * *
[More resources\
\
App Universal Link](/web3/build/docs/waas/app-universal-link)
[More resources\
\
OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
---
# Smart contract | DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[API reference](/web3/build/docs/waas/dex-crosschain-api)
[Supported bridges](/web3/build/docs/waas/dex-crosschain-supported-bridges)
[Smart contract](/web3/build/docs/waas/dex-crosschain-smart-contract)
[Error codes](/web3/build/docs/waas/dex-crosschain-error-code)
[FAQ](/web3/build/docs/waas/dex-crosschain-faq)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[DEX cross-chain](/web3/build/docs/waas/dex-crosschain-aggregator)
Smart contract
Smart contract[#](#smart-contract)
===================================
The contract addresses of OKX DEX router and ABI
The contract addresses of the DEX router and token approval may be subject to replacement due to contract upgrades. To ensure uninterrupted use of the API, we recommend using the contract addresses returned by the response parameters: `/approve-transaction` API and `/build-tx` API for approvals and transactions.
### DEX router[#](#dex-router)
The contract addresses of OKX DEX router,check [here](/web3/build/docs/waas/dex-smart-contract)
to get detail.
### Token approval[#](#token-approval)
A list of smart contracts for ERC-20 token approval,check [here](/web3/build/docs/waas/dex-smart-contract)
to get detail.
### DEX XBridge address[#](#dex-xbridge-address)
The contract addresses of OKX Xbridge,used for signing cross-chain transactions
| Chain | DEX XBridge contract address |
| --- | --- |
| Ethereum | 0xFc99f58A8974A4bc36e60E2d490Bb8D72899ee9f |
| BNB Chain | 0xFc99f58A8974A4bc36e60E2d490Bb8D72899ee9f |
| OKTC | 0xf956D9FA19656D8e5219fd6fa8bA6cb198094138 |
| Polygon | 0x89f423567c2648BB828c3997f60c47b54f57Fa6e |
| Fantom | 0xf956D9FA19656D8e5219fd6fa8bA6cb198094138 |
| Arbitrum | 0xFc99f58A8974A4bc36e60E2d490Bb8D72899ee9f |
| Optimism | 0xf956D9FA19656D8e5219fd6fa8bA6cb198094138 |
| Cronos | 0xf956D9FA19656D8e5219fd6fa8bA6cb198094138 |
| Avalanche C | 0xf956D9FA19656D8e5219fd6fa8bA6cb198094138 |
| TRON | TVaV2BBs8tpthbp19QAy7ibmXLoYsomKDD |
| Solana | okxBd18urPbBi2vsExxUDArzQNcju2DugV9Mt46BxYE |
| zkSync Era | 0x4040bEC373F6e8be2F913324de94A7b9242E5E92 |
| Polygon zkEvm | 0x5965851f21DAE82eA7C62f87fb7C57172E9F2adD |
| Linea | 0xf956D9FA19656D8e5219fd6fa8bA6cb198094138 |
| Mantle | 0xf956D9FA19656D8e5219fd6fa8bA6cb198094138 |
| Base | 0x5965851f21DAE82eA7C62f87fb7C57172E9F2adD |
| Manta | 0x91EcECC4F2363770c621a8a061A80d67cfEafEC7 |
| Metis | 0xa50FD06d2b099a4B06d54177C7d3AB08D3D3F004 |
| SUI | 0x3d097b26cd6a13a0c37e983e81be72cd2965c4dc717a03471e3a7388c21c9263 |
| Scroll | 0xf956D9FA19656D8e5219fd6fa8bA6cb198094138 |
| Starknet | 0x00e704db07356df9a2ba8cd2a131e0192b9d9d9ddb518eb3bd4e8fb4a1f0901c |
| Blast | 0xf956d9fa19656d8e5219fd6fa8ba6cb198094138 |
| Merlin | 0xf956d9fa19656d8e5219fd6fa8ba6cb198094138 |
| X Layer | 0x5965851f21DAE82eA7C62f87fb7C57172E9F2adD |
The Application Binary Interface of Contract (ABI)[#](#the-application-binary-interface-of-contract-(abi))
-----------------------------------------------------------------------------------------------------------
Please refer to: [https://github.com/okx/OKX-DEX-Aggregator-ABI](https://github.com/okx/OKX-DEX-Aggregator-ABI)
[DEX API\
\
Supported bridges](/web3/build/docs/waas/dex-crosschain-supported-bridges)
[DEX API\
\
Error codes](/web3/build/docs/waas/dex-crosschain-error-code)
Table of contents
[The Application Binary Interface of Contract (ABI)](#the-application-binary-interface-of-contract-(abi))
---
# Use crosschain API | Build swap applications | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Build swap applications](/web3/build/docs/waas/dex-api-quick-start-reference)
[Build bridge applications](/web3/build/docs/waas/dex-crosschain-api-quick-start-reference)
[Build bridge applications](/web3/build/docs/waas/dex-use-crosschain-quick-start)
[Send multi-signature transactions on the Solana chain](/web3/build/docs/waas/dex-use-crosschain-solana-quick-start)
[Build limit order applications](/web3/build/docs/waas/dex-limit-order-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[Build swap applications](/web3/build/docs/waas/dex-aggregation-root-quick-start)
Use crosschain API
Build bridge applications[#](#build-bridge-applications)
=========================================================
[Build bridge applications\
\
Build bridge applications](/web3/build/docs/waas/dex-use-crosschain-quick-start)
[Send multi-signature transactions on the Solana chain\
\
Send multi-signature transactions on the Solana chain](/web3/build/docs/waas/dex-use-crosschain-solana-quick-start)
[DEX API\
\
Build swap applications on the Ton network](/web3/build/docs/waas/dex-use-swap-ton-quick-start)
[DEX API\
\
Build bridge applications](/web3/build/docs/waas/dex-use-crosschain-quick-start)
---
# Tron | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
[Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
Connect to App or Mini Wallet
[Connection Prerequisites](/web3/build/docs/sdks/app-connect-preparation)
[EVM-Compatible Chains](/web3/build/docs/sdks/app-connect-evm)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/app-connect-bitcoin)
[Solana-Compatible Chains](/web3/build/docs/sdks/app-connect-solana)
[TON](/web3/build/docs/sdks/app-connect-ton)
[SUI](/web3/build/docs/sdks/app-connect-sui)
[Aptos/Movement](/web3/build/docs/sdks/app-connect-aptos)
[Cosmos/Sei](/web3/build/docs/sdks/app-connect-cosmos)
[Tron](/web3/build/docs/sdks/app-connect-tron)
[SDK](/web3/build/docs/sdks/app-connect-tron-sdk)
[UI](/web3/build/docs/sdks/app-connect-tron-ui)
[Starknet](/web3/build/docs/sdks/app-connect-starknet)
[Troubleshooting](/web3/build/docs/sdks/app-connect-faq)
Connect to Extension Wallet
[Preparation](/web3/build/docs/sdks/web-detect-okx-wallet)
[EVM Compatible Chains](/web3/build/docs/sdks/chains/evm/introduce)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/chains/bitcoin/introduce)
[Tron](/web3/build/docs/sdks/chains/tron/introduce)
[Solana-Compatible Chains](/web3/build/docs/sdks/chains/solana/introduce)
[TON](/web3/build/docs/sdks/chains/ton/introduce)
[Aptos/Movement](/web3/build/docs/sdks/chains/aptos/introduce)
[Cosmos/Sei](/web3/build/docs/sdks/chains/cosmos/introduce)
[SUI](/web3/build/docs/sdks/chains/sui/introduce)
[Stacks](/web3/build/docs/sdks/chains/stacks/introduce)
[Starknet](/web3/build/docs/sdks/chains/starknet/introduce)
[Cardano](/web3/build/docs/sdks/chains/cardano/introduce)
[Nostr](/web3/build/docs/sdks/chains/nostr/introduce)
[NEAR](/web3/build/docs/sdks/chains/near/introduce)
[WAX](/web3/build/docs/sdks/chains/wax/introduce)
[Display DApp icon](/web3/build/docs/sdks/web-display-dapp-icon)
Connect to App or Mini Wallet
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Connect to App or Mini Wallet
Tron
Tron[#](#tron)
===============
Tron aims to build a decentralized content entertainment ecosystem. The Tron network employs a Delegated Proof of Stake (DPoS) consensus mechanism, which allows it to achieve high throughput and low transaction fees. As a smart contract platform, Tron is fully compatible with the Ethereum Virtual Machine (EVM), enabling developers to easily migrate decentralized applications (DApps) from Ethereum to the Tron network. Tron's native token is TRX, which is used for network governance, transaction fee payment, and value transfer. The platform focuses particularly on applications in the digital content, entertainment, and social media sectors, aiming to create an intermediary-free content distribution system. With its efficient performance and active developer community, Tron has become an important platform for decentralized finance (DeFi), non-fungible tokens (NFTs), and decentralized applications.
* If connecting via SDK, add a "Connect OKX Wallet" button within the DApp. Clicking this button will launch the mobile App Wallet and enable interaction with the OKX Wallet, such as retrieving addresses, initiating wallet signatures, and other functions.
* In addition to SDK, we also provide a UI interface. If using the UI connection, and the DApp is operating in Telegram, users can choose to open the mobile App Wallet or stay in Telegram and launch the OKX Mini Wallet.
[SDK](/web3/build/docs/sdks/app-connect-tron-sdk)
[UI](/web3/build/docs/sdks/app-connect-tron-ui)
[Connect to App or Mini Wallet\
\
UI](/web3/build/docs/sdks/app-connect-cosmos-ui)
[Connect to App or Mini Wallet\
\
SDK](/web3/build/docs/sdks/app-connect-tron-sdk)
---
# Aptos | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
[Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
Connect to App or Mini Wallet
[Connection Prerequisites](/web3/build/docs/sdks/app-connect-preparation)
[EVM-Compatible Chains](/web3/build/docs/sdks/app-connect-evm)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/app-connect-bitcoin)
[Solana-Compatible Chains](/web3/build/docs/sdks/app-connect-solana)
[TON](/web3/build/docs/sdks/app-connect-ton)
[SUI](/web3/build/docs/sdks/app-connect-sui)
[Aptos/Movement](/web3/build/docs/sdks/app-connect-aptos)
[SDK](/web3/build/docs/sdks/app-connect-aptos-sdk)
[UI](/web3/build/docs/sdks/app-connect-aptos-ui)
[Cosmos/Sei](/web3/build/docs/sdks/app-connect-cosmos)
[Tron](/web3/build/docs/sdks/app-connect-tron)
[Starknet](/web3/build/docs/sdks/app-connect-starknet)
[Troubleshooting](/web3/build/docs/sdks/app-connect-faq)
Connect to Extension Wallet
[Preparation](/web3/build/docs/sdks/web-detect-okx-wallet)
[EVM Compatible Chains](/web3/build/docs/sdks/chains/evm/introduce)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/chains/bitcoin/introduce)
[Tron](/web3/build/docs/sdks/chains/tron/introduce)
[Solana-Compatible Chains](/web3/build/docs/sdks/chains/solana/introduce)
[TON](/web3/build/docs/sdks/chains/ton/introduce)
[Aptos/Movement](/web3/build/docs/sdks/chains/aptos/introduce)
[Cosmos/Sei](/web3/build/docs/sdks/chains/cosmos/introduce)
[SUI](/web3/build/docs/sdks/chains/sui/introduce)
[Stacks](/web3/build/docs/sdks/chains/stacks/introduce)
[Starknet](/web3/build/docs/sdks/chains/starknet/introduce)
[Cardano](/web3/build/docs/sdks/chains/cardano/introduce)
[Nostr](/web3/build/docs/sdks/chains/nostr/introduce)
[NEAR](/web3/build/docs/sdks/chains/near/introduce)
[WAX](/web3/build/docs/sdks/chains/wax/introduce)
[Display DApp icon](/web3/build/docs/sdks/web-display-dapp-icon)
Connect to App or Mini Wallet
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Connect to App or Mini Wallet
Aptos
Aptos/Movement[#](#aptos/movement)
===================================
Aptos is a layer 1 public blockchain project that aims to develop a safe, scalable, and upgradeable Web3 infrastructure. Developed by former engineers from the Facebook crypto project Diem (formerly Libra), Aptos contracts are written using Move. Common Aptos-compatible networks include Movement.
* If connecting via SDK, add a "Connect OKX Wallet" button within the DApp. Clicking this button will launch the mobile App Wallet and enable interaction with the OKX Wallet, such as retrieving addresses, initiating wallet signatures, and other functions.
* In addition to SDK, we also provide a UI interface. If using the UI connection, and the DApp is operating in Telegram, users can choose to open the mobile App Wallet or stay in Telegram and launch the OKX Mini Wallet.
[SDK](/web3/build/docs/sdks/app-connect-aptos-sdk)
[UI](/web3/build/docs/sdks/app-connect-aptos-ui)
[Connect to App or Mini Wallet\
\
UI](/web3/build/docs/sdks/app-connect-sui-ui)
[Connect to App or Mini Wallet\
\
SDK](/web3/build/docs/sdks/app-connect-aptos-sdk)
---
# Cosmos | Connect to App or Mini Wallet | Wallet Integration Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is Connecting Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
[Supported Networks](/web3/build/docs/sdks/okx-wallet-integration-supported-networks)
Connect to App or Mini Wallet
[Connection Prerequisites](/web3/build/docs/sdks/app-connect-preparation)
[EVM-Compatible Chains](/web3/build/docs/sdks/app-connect-evm)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/app-connect-bitcoin)
[Solana-Compatible Chains](/web3/build/docs/sdks/app-connect-solana)
[TON](/web3/build/docs/sdks/app-connect-ton)
[SUI](/web3/build/docs/sdks/app-connect-sui)
[Aptos/Movement](/web3/build/docs/sdks/app-connect-aptos)
[Cosmos/Sei](/web3/build/docs/sdks/app-connect-cosmos)
[SDK](/web3/build/docs/sdks/app-connect-cosmos-sdk)
[UI](/web3/build/docs/sdks/app-connect-cosmos-ui)
[Tron](/web3/build/docs/sdks/app-connect-tron)
[Starknet](/web3/build/docs/sdks/app-connect-starknet)
[Troubleshooting](/web3/build/docs/sdks/app-connect-faq)
Connect to Extension Wallet
[Preparation](/web3/build/docs/sdks/web-detect-okx-wallet)
[EVM Compatible Chains](/web3/build/docs/sdks/chains/evm/introduce)
[Bitcoin-Compatible Chains](/web3/build/docs/sdks/chains/bitcoin/introduce)
[Tron](/web3/build/docs/sdks/chains/tron/introduce)
[Solana-Compatible Chains](/web3/build/docs/sdks/chains/solana/introduce)
[TON](/web3/build/docs/sdks/chains/ton/introduce)
[Aptos/Movement](/web3/build/docs/sdks/chains/aptos/introduce)
[Cosmos/Sei](/web3/build/docs/sdks/chains/cosmos/introduce)
[SUI](/web3/build/docs/sdks/chains/sui/introduce)
[Stacks](/web3/build/docs/sdks/chains/stacks/introduce)
[Starknet](/web3/build/docs/sdks/chains/starknet/introduce)
[Cardano](/web3/build/docs/sdks/chains/cardano/introduce)
[Nostr](/web3/build/docs/sdks/chains/nostr/introduce)
[NEAR](/web3/build/docs/sdks/chains/near/introduce)
[WAX](/web3/build/docs/sdks/chains/wax/introduce)
[Display DApp icon](/web3/build/docs/sdks/web-display-dapp-icon)
Connect to App or Mini Wallet
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Connect to App or Mini Wallet
Cosmos
Cosmos/Sei[#](#cosmos/sei)
===========================
The Cosmos network consists of many independent, parallel blockchains, called zones, each powered by classical Byzantine fault-tolerant (BFT) consensus protocols like Tendermint (already used by platforms like ErisDB). Some zones act as hubs with respect to other zones, allowing many zones to interoperate through a shared hub. The architecture is a more general application of the Bitcoin sidechains concept, using classic BFT and Proof-of-Stake algorithms, instead of Proof-of-Work. Cosmos can interoperate with multiple other applications and cryptocurrencies, something other blockchains can't do well. By creating a new zone, you can plug any blockchain system into the Cosmos hub and pass tokens back and forth between those zones, without the need for an intermediary.
* If connecting via SDK, add a "Connect OKX Wallet" button within the DApp. Clicking this button will launch the mobile App Wallet and enable interaction with the OKX Wallet, such as retrieving addresses, initiating wallet signatures, and other functions.
* In addition to SDK, we also provide a UI interface. If using the UI connection, and the DApp is operating in Telegram, users can choose to open the mobile App Wallet or stay in Telegram and launch the OKX Mini Wallet.
[SDK](/web3/build/docs/sdks/app-connect-cosmos-sdk)
[UI](/web3/build/docs/sdks/app-connect-cosmos-ui)
[Connect to App or Mini Wallet\
\
UI](/web3/build/docs/sdks/app-connect-aptos-ui)
[Connect to App or Mini Wallet\
\
SDK](/web3/build/docs/sdks/app-connect-cosmos-sdk)
---
# Get Accounts | Wallet Account Management | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Create Account](/web3/build/docs/waas/walletapi-api-create-wallet-account)
[Update Account](/web3/build/docs/waas/walletapi-api-update-wallet-account)
[Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
[Get Accounts](/web3/build/docs/waas/walletapi-api-accounts)
[Get Addresses Under Account](/web3/build/docs/waas/walletapi-api-account-detail)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
Get Accounts
Get Accounts[#](#get-accounts)
===============================
List accounts created under the project.
### Request Path[#](#request-path)
GET `https://www.okx.com/api/v5/wallet/account/accounts`
### Request Parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| limit | String | No | Number of items to query each time, default is 50, maximum is 100 |
| cursor | String | No | Cursor position, defaults to the first one |
### Response Parameters[#](#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| cursor | String | Cursor |
| accounts | Array | List of accounts |
| \>accountId | String | Unique identifier of the account |
| \>accountType | String | `0`: Wallet account
`1`: Watch-only account |
[Wallet API\
\
Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
[Wallet API\
\
Get Addresses Under Account](/web3/build/docs/waas/walletapi-api-account-detail)
### Request Example[#](#request-example)
shell
curl --location --request GET 'https://www.okx.com/api/v5/wallet/account/accounts' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
### Response Example[#](#response-example)
200
{
"code": "0",
"data": [\
{\
"cursor": "50",\
"accounts": [\
{\
"accountId": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2",\
"accountType": "0"\
},\
{ \
"accountId": "0x04ad62387d1f1c7034087bbe4d16163d06fae42d",\
"accountType": "1"\
}\
]\
}\
],
"msg": "success"
}
[Wallet API\
\
Delete Account](/web3/build/docs/waas/walletapi-api-delete-account)
[Wallet API\
\
Get Addresses Under Account](/web3/build/docs/waas/walletapi-api-account-detail)
---
# Unsubscribe Data | Webhook | Wallet API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Subscribe Data](/web3/build/docs/waas/walletapi-api-webhook-subscribe)
[Unsubscribe Data](/web3/build/docs/waas/walletapi-api-webhook-unsubscribe)
[Subscription List](/web3/build/docs/waas/walletapi-api-webhook-get-subscriptions)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Wallet API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Wallet API
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
Unsubscribe Data
Unsubscribe Data[#](#unsubscribe-data)
=======================================
Unsubscribe data related to block events and transaction events. You can cancel up to 20 subscriptions at a time. After a successful unsubscription, messages will no longer be pushed through webhook.
### Request Path[#](#request-path)
POST `https://www.okx.com/api/v5/wallet/webhook/unsubscribe`
### Request Parameters[#](#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| id | String | Yes | Unique identifier of the subscription |
### Response Parameters[#](#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| id | String | Unique identifier of the subscription |
[Wallet API\
\
Subscribe Data](/web3/build/docs/waas/walletapi-api-webhook-subscribe)
[Wallet API\
\
Subscription List](/web3/build/docs/waas/walletapi-api-webhook-get-subscriptions)
### Request Example[#](#request-example)
shell
curl --location --request POST 'https://www.okx.com/api/v5/wallet/webhook/unsubscribe' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data-raw '[\
{\
"id":"1"\
}\
]'
### Response Example[#](#response-example)
200
{
"code":"0",
"data":[\
{\
"id":"1" \
}\
],
"msg":""
}
[Wallet API\
\
Subscribe Data](/web3/build/docs/waas/walletapi-api-webhook-subscribe)
[Wallet API\
\
Subscription List](/web3/build/docs/waas/walletapi-api-webhook-get-subscriptions)
---
# API reference | DEX cross-chain | DEX API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[API reference](/web3/build/docs/waas/dex-crosschain-api)
[Get supported chains](/web3/build/docs/waas/dex-get-supported-chains)
[Get tokens](/web3/build/docs/waas/dex-crosschain-get-tokens)
[Get the list of tokens supported by the cross-chain bridges](/web3/build/docs/waas/dex-get-supported-tokens)
[Get the list of tokens pairs supported by the cross-chain bridge](/web3/build/docs/waas/dex-get-supported-bridge-tokens-pairs)
[Get supported bridges](/web3/build/docs/waas/dex-get-supported-bridges)
[Get route information](/web3/build/docs/waas/dex-get-route-information)
[Approve transactions](/web3/build/docs/waas/dex-crosschain-approve-transaction)
[Cross-chain swap](/web3/build/docs/waas/dex-crosschain-swap)
[Get transaction status](/web3/build/docs/waas/dex-get-transaction-status)
[Supported bridges](/web3/build/docs/waas/dex-crosschain-supported-bridges)
[Smart contract](/web3/build/docs/waas/dex-crosschain-smart-contract)
[Error codes](/web3/build/docs/waas/dex-crosschain-error-code)
[FAQ](/web3/build/docs/waas/dex-crosschain-faq)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
DEX API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
DEX API
[DEX cross-chain](/web3/build/docs/waas/dex-crosschain-aggregator)
API reference
API reference[#](#api-reference)
=================================
[Get supported chains\
\
Get information from chains that support cross-chain transactions](/web3/build/docs/waas/dex-get-supported-chains)
[Get tokens\
\
Get tokens](/web3/build/docs/waas/dex-crosschain-get-tokens)
[Get the list of tokens supported by the cross-chain bridges\
\
Get token list only trade for bridge](/web3/build/docs/waas/dex-get-supported-tokens)
[Get the list of tokens pairs supported by the cross-chain bridge\
\
Get the list of tokens pairs supported by chains](/web3/build/docs/waas/dex-get-supported-bridge-tokens-pairs)
[Get supported bridges\
\
Get information of the cross-chain bridges supported by OKX’s DEX cross-chain aggregator protocole](/web3/build/docs/waas/dex-get-supported-bridges)
[Get route information\
\
Find the best route for a cross-chain swap through OKX’s DEX cross-chain aggregator](/web3/build/docs/waas/dex-get-route-information)
[Approve transactions\
\
Generate the relevant data for calling the contract](/web3/build/docs/waas/dex-crosschain-approve-transaction)
[Cross-chain swap\
\
Generate the data to execute a cross-chain swap](/web3/build/docs/waas/dex-crosschain-swap)
[Get transaction status\
\
Check the final status of the cross-chain swap according to txhash](/web3/build/docs/waas/dex-get-transaction-status)
[DEX API\
\
Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[DEX API\
\
Get supported chains](/web3/build/docs/waas/dex-get-supported-chains)
---
# Get Popular collections | Runes API | Marketplace API | WaaS Web3 API Docs | OKX
[](/web3)
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[DApp Connect Wallet](/web3/build/docs/sdks/okx-wallet-integration-introduction)
Introduction
[What is OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
[Preparation](/web3/build/docs/waas/okx-waas-requirement-standard)
[Supported Networks](/web3/build/docs/waas/okx-waas-supported-networks)
Wallet API
[Introduction](/web3/build/docs/waas/walletapi-introduction)
[Quick Start](/web3/build/docs/waas/walletapi-quickstart-intro)
[On-Chain Information Query](/web3/build/docs/waas/walletapi-api-intro-query-api)
[Wallet Account Management](/web3/build/docs/waas/walletapi-api-intro-account-api)
[Transaction Broadcasting](/web3/build/docs/waas/walletapi-api-intro-transaction-api)
[Webhook](/web3/build/docs/waas/walletapi-api-webhook-intro)
[Signing SDK](/web3/build/docs/waas/wallet-client-sdk)
[Resources](/web3/build/docs/waas/walletapi-resources)
DEX API
[Introduction](/web3/build/docs/waas/dex-introduction)
[Quick start](/web3/build/docs/waas/dex-aggregation-root-quick-start)
[Swap API](/web3/build/docs/waas/dex-aggregation)
[Cross-chain API](/web3/build/docs/waas/dex-crosschain-aggregator)
[Limit order API](/web3/build/docs/waas/dex-limit-order)
[DEX Widget](/web3/build/docs/waas/dex-widget-home)
Marketplace API
[Introduction](/web3/build/docs/waas/marketplace-introduction)
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
[Get Runes collection](/web3/build/docs/waas/marketplace-get-runes-collection)
[Get Popular collections](/web3/build/docs/waas/marketplace-runes-popular-collections)
[Get sale activity](/web3/build/docs/waas/marketplace-runes-trade-history)
[Get asset for an address](/web3/build/docs/waas/marketplace-runes-asset)
[Get Runes listing](/web3/build/docs/waas/marketplace-runes-listings)
[Create listing](/web3/build/docs/waas/marketplace-runes-create-listing)
[Market API](/web3/build/docs/waas/marketplace-api-reference)
[BTC Ordinals API](/web3/build/docs/waas/marketplace-ordinals-api)
[Fractal Ordinals API](/web3/build/docs/waas/marketplace-fractal-ordinals-api)
[Error codes](/web3/build/docs/waas/marketplace-error-code)
DeFi API
[Introduction](/web3/build/docs/waas/defi-introduction)
[Quickstart](/web3/build/docs/waas/defi-quickstart)
[API reference](/web3/build/docs/waas/defi-api-reference)
[Error code](/web3/build/docs/waas/defi-error-code)
More resources
[General specification](/web3/build/docs/waas/okx-waas-standard)
[Apply to display DApps](/web3/build/docs/waas/walletapi-resources-dapp-application)
[App Universal Link](/web3/build/docs/waas/app-universal-link)
[Changelog](/web3/build/docs/waas/changelog)
[OKX Web3 Build User Agreement](/web3/build/docs/waas/legal)
Marketplace API
[OKX OS](/web3/build/docs/waas/okx-waas-what-is-waas)
Marketplace API
[Runes API](/web3/build/docs/waas/marketplace-runes-api)
Get Popular collections
Get Popular collections[#](#get-popular-collections)
=====================================================
This API is used to get trading data of popular collections.
### Request address[#](#request-address)
GET `https://www.okx.com/api/v5/mktplace/nft/runes/get-hot-collection`
### Request param[#](#request-param)
| **Parameter** | **Type** | **Required** | **Description** |
| --- | --- | --- | --- |
| timeType | Integer | No | Returns data for N projects, sorted by transaction volume in the specified time range. Enum values: 1. 24h 2. 7d 3. 30d 4. all Defaults to 24h if not provided. |
| cursor | String | No | Cursor for pagination, default is empty. |
| limit | Integer | No | Page size for query results, default is 10. |
### Response parameters[#](#response-parameters)
| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| cusor | String | Cursor for pagination |
| runesId | String | runeid |
| name | String | Rune name |
| spaceName | String | Rune name with dots |
| maxMintNumber | String | Maximum mint number |
| mintedNumber | String | Minted number |
| limitPerMint | String | Limit per mint |
| deployedTime | Long | Deployment time |
| startBlock | String | Start block |
| endBlock | String | End block |
| symbol | String | Symbol |
| divisibility | Integer | Precision |
| collectionUrl | String | OKX collection link |
| totalVolume | String | Transaction volume in BTC and USD |
| usdTotalVolume | String | Transaction volume in USD |
| marketCap | String | Market cap in BTC |
| usdMarketCap | String | Market cap in USD |
| floorprice | String | Floor price in Sats |
| usdFloorPrice | String | Floor price in USD |
| holders | Integer | Number of holders |
| salesCount | Integer | Number of sales |
| volumeGains | String | Transaction volume growth |
[Marketplace API\
\
Get Runes collection](/web3/build/docs/waas/marketplace-get-runes-collection)
[Marketplace API\
\
Get sale activity](/web3/build/docs/waas/marketplace-runes-trade-history)
### Request example[#](#request-example)
shell
curl --location 'https://www.okx.com/api/v5/mktplace/nft/runes/get-hot-collection?timeType=2&cursor=Mg%3D%3D' \
--header 'OK-ACCESS-PASSPHRASE: xxxxxx' \
--header 'OK-ACCESS-KEY: xxxx' \
### Response example[#](#response-example)
200
{
"code":0,
"data":{
"items":[\
{\
"collectionUrl":"https://www.okx.com/web3/marketplace/runes/token/DOG•GO•TO•THE•MOON/840000:3",\
"deployedTime":1713571767,\
"divisibility":5,\
"marketData":{\
"floorPrice":"10.6509577683",\
"holders":72903,\
"marketCap":"10651.030343051788712385",\
"salesCount":35436,\
"totalVolume":"1124.64783456999999",\
"usdFloorPrice":"0.006598097922137557",\
"usdMarketCap":"659814288.103509427870310934",\
"usdTotalVolume":"69670133.915076187380516"\
},\
"maxMintNumber":"100000000000",\
"mintedNumber":"100000000000",\
"name":"DOG•GO•TO•THE•MOON",\
"runesId":"840000:3",\
"spaceName":"DOGGOTOTHEMOON",\
"startBlock":840000,\
"symbol":"🐕"\
}\
],
"cursor":""
},
"msg":""
}
[Marketplace API\
\
Get Runes collection](/web3/build/docs/waas/marketplace-get-runes-collection)
[Marketplace API\
\
Get sale activity](/web3/build/docs/waas/marketplace-runes-trade-history)
[Marketplace API\
\
Get Runes collection](/web3/build/docs/waas/marketplace-get-runes-collection)
[Marketplace API\
\
Get sale activity](/web3/build/docs/waas/marketplace-runes-trade-history)
---