Driven by innovative genes, OKX Web3 wallet is both internally and externally optimized: continuously improving products internally and extensively exploring co-creation externally.
In terms of extensive exploration of co-creation, OKX Web3 wallet not only continuously leads open-source code, but also increasingly strengthens the construction of APIs. This is of great significance in the blockchain technology ecosystem, as it not only promotes technological innovation and development efficiency, but also enhances the transparency, interoperability, and security of the system, driving the construction of the Web3 community and ecosystem, enhancing user experience, and promoting industry standardization.
In addition, through open-source code and open APIs, OKX Web3 wallet has lowered the development threshold and established extensive connections, enabling collaboration, mutual learning, progress, and innovation with global developers, thereby promoting the construction of the cryptocurrency industry's infrastructure.
Functionalities like APIs, which are not easily noticeable to daily users when using products, are like the "invisible infrastructure" of the OKX Web3 wallet. Despite their importance, they are rarely widely known by users. As there is currently no introduction to OKX Web3 wallet APIs available on the market, this article will focus on the API aspect, comprehensively analyzing the functions of OKX Web3 API, with the hope of attracting and assisting more developers in realizing their ideas and innovations.
This is the content of the first phase of OKX Web3's invisible infrastructure, as well as the first phase of OKX Web3 API series. The second phase will delve into the stories behind the construction of APIs by the OKX Web3 team through dialogue.
OKX Web3 Wallet API Framework
API, short for Application Programming Interface, is a set of definitions and protocols used to build and integrate application software. APIs allow communication and data exchange between different software systems. Through APIs, developers can utilize existing functions and data without having to write code from scratch. APIs can significantly improve development efficiency, promote system interoperability, and drive technological innovation.
As a leading one-stop Web3 gateway, OKX Web3 provides a complete Web3 development solution—OnchainOS. As a multi-chain Web3 development engine, OnchainOS has standardized access to chains and services, greatly reducing development cycles and costs, including wallets, DEX aggregators, Marketplaces, DeFi, and other major modules, as well as on-chain data solutions for trading liquidity. If developers wish to build their own Web3 services, using OnchainOS will be a more efficient and economical choice.
In order to better serve developers, greatly reduce the development threshold, and improve efficiency, OKX Web3 provides a very comprehensive, detailed, and visually combined API documentation. Interested developers can click to view it at any time and follow the steps to use it.
The OKX Web3 wallet now supports over 100+ public chains and provides a unified user experience across three platforms: App, plugin, and web, covering five major sections including wallets, DEX aggregators, DeFi, NFT markets, and DApp exploration. It has also launched the Bitcoin Inscription and Rune trading markets, dedicated to providing comprehensive Web3 services to users.
Next, the article will use the wallet, DEX aggregator, Marketplace, and DeFi sections as examples to introduce some API-related content.
Wallet API
As the core of the entire product, the wallet section's API provides the underlying technical solutions for non-custodial wallets, which can help developers easily build on-chain services and applications. For example, Web3 multi-chain wallets, DApp built-in wallets, multi-chain Web3 applications, and exchange wallet services, etc.
The wallet API has three core functions in wallet services: 1) Multi-chain address aggregation, providing the capability to aggregate assets of millions of addresses; 2) Multi-scenario, easy access to 60+ networks, supporting heterogeneous multi-chain ecosystems and various BTC asset protocols; 3) High availability and stability. Implementing interface and system monitoring to ensure smooth access.
By using the wallet API, developers can efficiently and securely build wallets in just 3 steps, easily access 60+ networks, including popular EVM, Solana, TRON, BTC, etc., and also support cutting-edge ecosystems such as Inscription. Subsequent wallet APIs will gradually provide the capabilities and solutions for MPC wallets and AA smart wallet accounts. Through powerful wallet services, developers' Web3 wallet development needs can be fully met, and the entry process for Web3 wallets can be simplified.
Specifically, the wallet API covers multiple core modules, meeting users' basic asset management and transaction needs. For example: address and wallet generation, on-chain asset and coin price information query, transaction management, as well as currency information, Gas prices, and address authorization information, and other commonly used data queries. Among them, the transaction management module provides very rich services such as building, signing, broadcasting, tracking transaction history, supporting transactions on EVM and UTXO model networks such as BTC, etc. Overall, developers can use the wallet API for account management, asset management, transaction management, common information queries, and Webhook (real-time subscription to on-chain data), etc.
First, in terms of account management. Different from the general single address query mode, the wallet API provides structured subscription queries for multiple addresses, allowing developers to associate multiple addresses with one account, efficiently query asset status and transaction history in multi-chain scenarios. The wallet API provides two types of accounts: wallet accounts and observation accounts. Among them, 1) Wallet accounts require message signatures for authentication, can freely add custom tokens, and can send transactions. 2) Observation accounts do not require message signatures, and by default display all tokens included in the OKX platform, and cannot send transactions.
Developers can use the account management API to create wallet accounts and manage addresses under wallet accounts, aggregate observation account addresses, update wallet accounts, update observation accounts, delete accounts, query created account lists, query addresses under accounts, etc.
Second, in terms of asset management. This includes adding subscribed currencies to accounts, obtaining corresponding asset balances, viewing total assets, and deleting assets that are no longer of interest. It is worth noting that for wallet accounts, developers can add and manage custom currencies. For observation accounts, custom addition or management is not possible, and only the asset balances of currencies supported by the current wallet API can be obtained.
Developers can use the asset management API to add currencies, obtain token balances for wallet accounts, obtain token balances for observation accounts, obtain balances for specific currencies, obtain total balances for currencies, delete currencies, query currency lists, etc.
Third, in terms of transaction management. This includes how to send transactions and query transaction records. Developers can use the transaction management API to obtain data required for signatures, Gas prices, Gas limits, Nonces, etc., and perform address verification, query transaction details by transaction hash, query transaction details by order ID, query transaction lists by account, query transaction lists by address, etc.
Fourth, in other aspects. Developers can also use the API for chain-related information queries such as UTXO, currency information, etc.; or through Webhook, subscribe to block events and transaction event-related data, and create up to 20 subscriptions at a time, etc.
DEX Aggregator API
OKX DEX Aggregator is a one-stop multi-chain, DEX, and cross-chain aggregator, which has now aggregated 25+ cross-chains, 40+ public chains, and 400+ DEX, etc., and uses X Routing smart routing to simultaneously use multiple DEX for a single transaction. It provides users with better prices, better liquidity, and zero transaction fees, and also includes DEX market sections, limit orders, KYT security checks, and other functions.
The core mainly includes single-chain Swap and Bridge, both of which require on-chain data parsing to complete the entire transaction process. Single-chain Swap and Bridge combine different transaction modes based on the exchange currency pairs, such as completing transactions through source chain Swap + Bridge, or completing transactions in one step through Bridge, as well as completing cross-chain transactions in the form of source chain Swap + Bridge + target chain Swap. The XBridge contract, independently developed by OKX DEX Aggregator, is the core of the entire transaction, supporting cross-chain transactions between mainstream EVM chains, heterogeneous chains, and between EVM chains and heterogeneous chains.
Developers or professional users can use the DEX Aggregator API documentation to build the required Web3 transaction services and applications, such as Web3 wallets, DApp projects, and DeFi projects in various application scenarios.
The OKX DEX Aggregator API has core highlights such as multi-chain support, multiple cross-chain bridges and support for multiple DEX, stability, and high availability. Its response time is within 100 milliseconds and can provide a more optimal pricing path for free. Currently, the main coverage of the OKX DEX Aggregator API includes: Exchange API, Cross-chain API, Limit Order API, which are convenient, easy to understand, and secure to access and use.
First, in terms of exchange functionality, the OKX DEX Aggregator aggregates liquidity sources from decentralized exchanges such as Uniswap, Curve, Balancer, etc., and can split a single transaction across multiple DEX to provide users with better prices through efficient routing. The OKX DEX Aggregator will automatically find liquidity pools with better depth on-chain, calculate prices, slippage, and transaction costs, and use smart order splitting algorithms to select better quotes for users based on three dimensions: greater liquidity, lower slippage, and better prices.
Developers can use the Exchange API to obtain the supported chains, currency lists, liquidity lists, trade authorizations, exchange prices, transaction data, and more supported by the OKX DEX Aggregator.
Second, in terms of cross-chain functionality, the OKX DEX Aggregator aggregates high-quality cross-chain bridges such as circle CCTP, Stargate, Across, Wormhole, SWFT, etc., to provide users with multiple cross-chain path options. It can achieve cross-chain transactions by first exchanging on the source chain, then conducting cross-chain bridge transactions, and finally exchanging for the desired tokens on the target chain. The OKX DEX Aggregator's proprietary X Routing algorithm can automatically find liquidity pools with better depth on the source chain, calculate prices, slippage, and transaction costs, and obtain better exchange quantities through smart order splitting algorithms. It then compares multiple high-quality cross-chain bridges to obtain better cross-chain quotes after calculating cross-chain quantities, cross-chain bridge fees, slippage, and transaction costs.
Developers can use the Cross-chain API to obtain the supported chains, currency lists, bridge information, path information, trade authorizations, transaction data, query transaction status, and more supported by the OKX DEX Aggregator.
Third, in terms of limit order functionality, the OKX DEX Aggregator's limit order is a process where users buy or sell tokens at a specified target price on decentralized exchanges. If the current market price meets the user's specified target price, the DEX Aggregator will automatically complete the transaction. Through the DEX limit order API, users can create and query limit orders through the interface and aggregate liquidity into the DEX Aggregator to enjoy better prices.
The OKX DEX Aggregator's limit order API features waiting for DEX Aggregator users to take orders, no slippage for limit order creators, and support for partial order execution. Developers can use the Limit Order API to obtain the supported chain lists, trade authorizations, currency lists, create limit orders, query limit orders, and more supported by the OKX DEX Aggregator.
Marketplace API
OKX Marketplace covers EVM NFT markets, Runes markets, Ordinals markets, and issuance markets, supporting a total of 26 mainstream popular public chains including Bitcoin and Ethereum.
First, in terms of the EVM NFT market, the OKX NFT market is a one-stop decentralized NFT aggregation trading platform that has aggregated platforms such as Opensea, Magic Eden, Looksrare, etc. It supports NFT holders to list their NFT works on multiple markets simultaneously and obtain higher liquidity at lower transaction costs. It also supports multi-chain NFT creation and cross-platform transactions, providing real-time on-chain data for users and developers, dedicated to building a decentralized, multi-chain NFT ecosystem. Currently, the OKX NFT market aggregates order depth from multiple mainstream markets and platforms, providing timely order data for developers and users, and offering real-time and accurate on-chain data.
The OKX NFT API provides data queries and transaction functionalities, including NFT and collection information queries, transaction data queries, and more. Developers can use the NFT market API to obtain NFT details and lists, collection details and lists, supported networks and markets, query orders, bid orders, purchase orders, and more.
Second, in terms of the OKX Runes market, it is the industry's first platform to provide rune trading on the app, supporting users to batch purchase Runes assets with zero platform fees and perform etching functions. In the future, the OKX Runes market will continue to optimize and add more new features based on user feedback.
Developers can use the OKX Runes market API to obtain collection information, popular collections, transaction history, wallet assets, order information, submit orders, and more.
Third, the OKX Web3 Wallet Ordinals market is the first BRC20 inscription and BTC NFT trading market. The OKX Ordinals market is completely decentralized, with no platform service fees, and supports a one-stop transfer, trading, and inscription of BRC-20 and BTC NFT, among other functions.
Developers can use the Ordinals market API to create Ordinals orders, obtain inscription asset lists, submit orders, obtain Ordinals collection lists, orders, transaction history, and related models, and more.
DeFi API
OKX Web3 DeFi is a leading one-stop DeFi trading aggregation platform in the market, making it easy for users to quickly and accurately find educational products that meet their needs. OKX Web3 DeFi has currently integrated over 80 protocols, including Aave, Compound, Curve, Yearn, and Uniswap, and supports over 15 networks such as Arbitrum, Ethereum, and Polygon.
The OKX Web3 DeFi API details the data interaction process of the user's transaction, including subscription, redemption, and reward claim processes. By integrating the OKX Web3 DeFi Open API into applications, users can easily and quickly access all DeFi protocols and enjoy the fun of earning coins while trading DeFi.
Specifically, developers can achieve various functions through the OKX Web3 DeFi API. First, in terms of information queries, it supports developers to query protocol lists, token lists, product lists, product details, network lists, and more. Second, in terms of calculations, it supports querying estimated subscription calculation information and estimated redemption calculation information. Third, in terms of transactions, it supports generating pre-authorization call data for transactions, generating pre-authorization call data for subscription transactions, redemption transactions, and reward claim transactions. Fourth, at the user level, it supports querying user holdings lists, user balance lists, and user redemption application lists.
Innovation as the Foundation, Walking Alongside Global Developers
In today's rapidly developing blockchain and cryptocurrency field, open source and open APIs have become important drivers for technology innovation and industry development. OKX Web3 Wallet, through promoting open source code and open APIs, not only provides stable and reliable technical support, rich resources, and convenient tools for global developers, but also promotes transparency, interoperability, and community collaboration in the entire industry.
The design and implementation of the OKX Web3 Wallet API are based on a deep understanding of innovation and a continuous pursuit of it. The API construction by OKX Web3 Wallet provides a powerful and flexible platform for global developers, a standardized interface for accessing and utilizing its platform functions, allowing developers to innovate on existing foundations, rapidly develop and deploy new decentralized applications (DApps). For example, developers can use the API interface to build innovative DeFi protocols, decentralized exchanges (DEX), and other blockchain applications, enabling them to unleash their creativity and technical prowess in the blockchain and cryptocurrency field, propose new ideas and solutions, and collectively push the boundaries of technology.
At the same time, open APIs allow developers and users to clearly understand and utilize the various functions of the OKX Web3 Wallet. This transparency helps enhance user trust in the platform, driving its popularity and usage. For example, developers can use the API documentation to understand the specific functions and usage methods of each interface, thus better utilizing these resources for development. Through open APIs, OKX Web3 Wallet demonstrates its open and transparent attitude to the community. This approach not only enhances the platform's credibility but also attracts more developers and users to participate in the ecosystem, enriching the application scenarios of the entire ecosystem and collectively driving the platform's development.
In the long run, by attracting more developers and projects to join, OKX Web3 Wallet can deeply integrate with other blockchain platforms and service providers, forming an interconnected blockchain ecosystem. This not only promotes technological progress and application expansion in the entire blockchain industry but also lays a solid foundation for building a more open and collaborative ecosystem. It also drives the prosperity of the platform itself.
In conclusion, the construction of OKX Web3 on APIs demonstrates a higher vision, "what we do now is for the future."
Disclaimer
This article is for reference only. The views expressed in this article are those of the author and do not represent the position of OKX. This article does not intend to provide (i) investment advice or recommendations; (ii) solicitations or offers to buy, sell, or hold digital assets; (iii) financial, accounting, legal, or tax advice. We do not guarantee the accuracy, completeness, or usefulness of such information. Holding digital assets (including stablecoins and NFTs) involves high risks and may experience significant fluctuations. You should carefully consider whether trading or holding digital assets is suitable for your financial situation. For your specific circumstances, please consult your legal/tax/investment professionals. Please take responsibility for understanding and complying with applicable local laws and regulations.
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。