Driven by the gene of innovation, OKX Web3 Wallet has been improving both internally and externally: continuously optimizing products internally and exploring co-creation externally.
In terms of extensive exploration of co-creation, OKX Web3 Wallet has been leading the open source of code on the one hand, and increasingly strengthening the construction of APIs on the other. This move is of great significance in the blockchain technology ecosystem, which not only promotes technological innovation and development efficiency, but also enhances the transparency, interoperability and security of the system, promotes the construction of the Web3 community and ecosystem, increases user experience, and promotes industry standardization.
In addition, the OKX Web3 wallet has lowered the development threshold and established extensive links through open source code and open API, thereby achieving linkage, common learning, progress and creation with global developers, thereby promoting the construction of infrastructure in the crypto industry.
Functions like API that are not easily perceived or not very obvious by daily users when using products are like the "invisible infrastructure" of the OKX Web3 wallet. Although important, they are rarely known to a wide range of users. Since there is no introduction to the OKX Web3 wallet API on the market, this article will focus on the API level. By comprehensively analyzing the OKX Web3 API functions, we hope to attract and help more developers to realize their ideas and implement innovations. This is the first issue of the OKX Web3 invisible infrastructure and the first issue of the OKX Web3 API series. The second issue will explore the story behind the OKX Web3 team building the API through dialogue.
OKX Web3WalletAPIFramework
API, short for Application Programming Interface, is a set of definitions and protocols for building and integrating application software. API allows communication and data exchange between different software systems. Through API, developers can take advantage of existing functions and data without having to write code from scratch. API can significantly improve development efficiency, promote system interoperability, and drive technological innovation.
As the industry's leading one-stop Web3 portal, OKX Web3 provides a complete set of Web3 development solutions - OnchainOS. As a multi-chain Web3 development engine, OnchainOS has achieved standardization in the access of chains and services, greatly reducing the development cycle and investment costs. It includes wallets, DEX aggregators, Marketplace, DeFi and other major modules, as well as transaction liquidity and on-chain data solutions. If developers want 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 graphic-basedAPIdocument:https://www.okx.com/zh-hans/web3/build/docs/waas/okx-waas-what-is-waas, developers interested can click to view at any time and follow the steps to use it.
OKX Web3 wallet now supports more than 100+ public chains, and provides a unified user experience of App, plug-ins and web pages, covering five major sections including wallets, DEX aggregators, DeFi, NFT markets and DApp exploration, and has launched the Bitcoin inscription and rune trading market, committed to providing users with comprehensive Web3 services.
Next, the article will take wallets, DEX aggregators, Marketplace, and DeFi sections as examples to introduce some API-related content.
Wallet API
As the core of the entire product, the wallet section 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, exchange wallet services, etc.
Wallet API, in the wallet service, has the following three core functions:1) Multi-chain address aggregation, providing million-level address asset statistics capabilities;2) Multiple scenarios, easy access to 60+ networks, support for heterogeneous multi-chain ecology and variousBTCasset protocols;3) High availability and high stability. Implement interface and system monitoring to ensure smooth access.
Developers can use the wallet API to efficiently and securely build wallets in just 3 steps, and 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 MPC wallets and AA smart wallet account capabilities and solutions. Through powerful wallet services, it can fully meet the developers' Web3 wallet development needs and simplify the Web3 wallet entry process.
Specifically, the wallet API covers multiple core modules to meet the basic asset management and transaction needs of users. For example: address and wallet generation, on-chain asset and currency price information query, transaction management, and other common data queries such as currency information, Gas price and address authorization information. Among them, the transaction management module provides a very rich service such as building, signing, broadcasting, tracking transactions, querying transaction history, supporting transactions of account model networks such as EVM, and supporting transactions of UTXO model networks such as BTC. In general, developers can use the wallet API to perform account management, asset management, transaction management, common information query, 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 a structured subscription query for multiple addresses. Developers can associate multiple addresses with one account and efficiently query asset status and transaction history in multi-chain scenarios. The wallet API provides two account types: wallet account and observation account. Among them, 1) the wallet account needs to provide a message signature for authentication, can freely add custom tokens, and can send transactions. 2) The observation account does not need to provide a message signature, and by default displays all tokens included in the OKX platform, and cannot send transactions.
Developers can use the account managementAPIto create wallet accounts and manage addresses under wallet accounts, aggregate observation account addresses, update wallet accounts, update observation accounts, delete accounts, query the list of created accounts, query addresses under accounts, etc.
Second, in terms of asset management.Including adding subscription currencies to accounts, obtaining the corresponding asset balance, 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 balance of the currency supported by the current wallet API can be obtained.
Developers can add currencies, obtain wallet account token balances, obtain observation account token balances, obtain specified currency balances, obtain currency total assets, delete currencies, query currency lists, etc. through the asset management API.
Third, in terms of transaction management. Including how to send transactions and query transaction records. Developers can obtain the data required for signatures, Gas price, Gas limit, Nonce, etc. through the transaction management API, and perform address verification, query transaction details according to transaction hash, query transaction details according to order ID, query transaction list according to account, query transaction list according to address, etc.
Fourth, in other aspects. Developers can also query chain-related information such as UTXO and currency information through API; or subscribe to relevant data of block events and transaction events through Webhook, and can create up to 20 subscriptions in batches each time.
DEXAggregatorAPI
OKX DEX aggregation is a one-stop multi-chain, DEX and cross-chain aggregator. It has aggregated 25+ cross-chains, 40+ public chains, more than 400 DEXs, etc. Through X Routing intelligent routing, one transaction can use multiple DEXs at the same time, providing users with better prices, better liquidity and 0 transaction service fees, and at the same time has DEX market section, limit order, KYT security detection and other functions.
Its core mainly includes single-chain Swap and Bridge, both of which require on-chain data analysis to complete the entire transaction process. Single-chain Swap and Bridge are combined into different transaction modes according to the exchanged currency pairs. For example, transactions can be completed through source chain Swap + Bridge, or through Bridge in one step, and cross-chain transactions can be completed in the form of source chain Swap + Bridge + target chain Swap. Among them, the XBridge contract developed by the OKX DEX aggregator is the core of the entire transaction. It supports cross-chain between mainstream EVM chains, cross-chain between heterogeneous chains, and cross-chain between EVM chains and heterogeneous chains.
Developers or professional users can use the DEX aggregator API document to build the required Web3 transaction services and applications, such as Web3 wallets, DApp projects, DeFi projects and other application scenarios.
OKX DEXAggregatorAPIhasmulti-chainsupport,multi-DEXsupport,stabilityandhighavailabilityandothercoresponsetimeiswithin100milliseconds,anditprovidesarultrasoundedatleastonce,OKXDEXaggregatorAPIisonce,itisconvenient,andeasytouse,itsandsafe.
First, in terms of exchange function, OKX DEX aggregator aggregates liquidity sources of decentralized exchanges such as Uniswap, Curve, Balancer, etc., and can split a single transaction to multiple DEXs, providing users with better prices through efficient routing. OKX DEX aggregator will automatically find the liquidity pool with better liquidity depth on the chain, comprehensively calculate the price, slippage and transaction cost, and through the intelligent order splitting algorithm, based on the comprehensive comparison of DEX and PMM quotes, select the three dimensions of better quotes for users: greater liquidity, lower slippage, and better price.
Developers can obtain the chains, currency lists, liquidity lists, transaction authorizations, exchange prices, transaction data, etc. supported by OKX DEX aggregator through the exchange API.
Second, in terms of cross-chain functions, the OKX DEX aggregator aggregates high-quality cross-chain bridges currently on the market, such as circle CCTP, Stargate, Across, Wormhole, SWFT, etc., to provide users with multiple cross-chain path options, which can realize source chain exchange first, then cross-chain bridge transactions, and then exchange for the tokens that users want on the target chain. The super-optimal algorithm X Routing independently developed by the OKX DEX aggregator can automatically find a deeper liquidity pool on the chain when trading on the source chain, comprehensively calculate the price, slippage and transaction cost, and obtain a better exchange quantity through the smart order splitting algorithm. After that, it will compare prices on multiple high-quality cross-chain bridges, and obtain a better cross-chain quotation after comprehensively calculating the cross-out quantity, cross-chain bridge fees, slippage and transaction costs.
Developers can use the cross-chain APIto obtain the chains, currency lists, bridge information, path information, transaction authorization, transaction data, query transaction status, etc. that the OKX DEX aggregator supports cross-chain exchange.
Third, in terms of the limit function, the OKX DEX aggregator limit order is a business process in which a user buys or sells tokens on a decentralized exchange at a specified target price. If the current market price can meet the target price specified by the user, 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.
OKX DEX aggregator limit order API has the characteristics of limit order execution requiring waiting for DEX aggregator users to take the order, no slippage for limit order creators, and support for partial order execution. Developers can use the limit order API to obtain the chain list, transaction authorization, currency list supported by the OKX DEX aggregator, create limit orders, query limit orders, etc.
Marketplace API
OKX Marketplace coversEVM NFT market,Runes market,Ordinals market and issuance market, supportingBitcoin,Ethereum and other26 mainstream popular public chains.
First, EVM NFT market. The OKX NFT market is a one-stop decentralized NFT aggregation trading platform that has aggregated Opensea, Magic Eden, Looksrare and other platforms, supporting NFT holders to list their NFT works on multiple markets at the same time and obtain higher liquidity at lower transaction costs. In addition, it also supports multi-chain NFT creation and cross-platform transactions, can provide users and developers with real-time on-chain data, and is committed to building a decentralized, multi-chain NFT ecosystem. At present, the OKX NFT market has brought together the order depth of multiple mainstream markets and platforms, and has collected a large amount of NFT collection data, which can provide developers and users with timely order data and real-time and accurate on-chain data.
OKX NFT APIprovides most of the functions of data query and transaction2. In terms of data, it includesNFT and collection information query, and transaction data query; in terms of transactions: it supports one-click order placement to multiple markets, and batch purchases of lower-priced orders in multiple markets at the same time. Developers can use the NFT market API to obtain NFT details and lists, collection details and lists, connected networks and markets, query pending orders, bid orders, purchase orders, etc.
Second, OKX Runes market. The OKX Runes market is the first platform in the industry to provide rune trading on the APP side, supporting users to perform Runes asset batch sweeping, etching and other functions with zero platform fees. 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 pending orders, etc.
Third, the OKX Web3 wallet Ordinals market is the largest BRC20 inscription and BTC NFT trading market. The OKX Ordinals market is completely decentralized, with no platform service fee for interaction, and supports multiple functions such as one-stop transfer, trading, and inscription of BRC-20 and BTC NFT.
Developers can use the OrdinalsmarketAPIto create Ordinalsorders, obtain inscription asset lists, submit orders, obtain Ordinalscollection lists, orders, transaction history and related models, etc.
DeFi API
OKX Web3 DeFi is the 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 connected to more than 80 protocols, including Aave, Compound, Curve, Yearn and Uniswap, and supports more than 15 networks such as Arbitrum, Ethereum and Polygon.
OKX Web3 DeFi API describes in detail the data interaction process of the user transaction process, including the subscription process, redemption process, and reward collection process. Developers integrate the OKX Web3 DeFi Open API into their applications, allowing users to easily and quickly access all DeFi protocols and enjoy the fun of earning coins in the process of trading DeFi.
Specifically, developers can use the OKX Web3 DeFi API to implement a variety of functions. First, in terms of querying information, developers can query the protocol list, token list, product list, product details, network list, etc. Second, in terms of calculation, it supports querying the estimated calculation information of subscription and the estimated calculation information of redemption. Third, in terms of transactions, it supports generating call data for pre-transaction authorization, generating call data for subscription transactions, generating call data for redemption transactions, and generating call data for receiving bonus transactions. Fourth, at the user level, it supports querying the user's position list, querying the user's balance list, and querying the user's redemption application list.
Innovation as the basis, walking with global developers
In today's rapidly developing blockchain and cryptocurrency fields, open source and open APIs have become an important driving force for technological innovation and industry development. By promoting open source code and open API, OKX Web3 Wallet not only provides global developers with stable and reliable technical support, rich resources and convenient tools, but also promotes transparency, interoperability and community cooperation in the entire industry.
Among them, the design and implementation of the OKX Web3 Wallet API is based on a deep understanding and continuous pursuit of innovation. Through API construction, 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 the existing basis and quickly develop and deploy new decentralized applications (DApps). For example, developers can use API interfaces to build innovative DeFi protocols, decentralized exchanges DEX and other blockchain applications. Allowing them to give full play to their creativity and technical strength in the field of blockchain and cryptocurrency, come up with new ideas and solutions, and jointly push the boundaries of technology.
At the same time, open APIs allow developers and users to clearly understand and use the various functions of OKX Web3 Wallet. This transparency helps to enhance users' trust in the platform and promote the popularity and use of the platform. For example, developers can learn about the specific functions and usage of each interface through API documentation, so as to better utilize these resources for development. By opening the API, OKX Web3 Wallet shows its open and transparent attitude to the community. This attitude not only enhances the credibility of the platform, but also attracts more developers and users to participate in the ecosystem, enriches the application scenarios of the entire ecosystem, and jointly promotes the development of the platform. In the long run, by attracting more developers and projects to join, OKX Web3 Wallet will be able to deeply integrate with other blockchain platforms and service providers to form an interconnected blockchain ecosystem, which will not only promote the technological progress and application expansion of the entire blockchain industry, but also lay a solid foundation for building a more open and collaborative ecosystem. It also promotes the prosperity of its own platform.
In short, OKX Web3's construction on API has shown a higher pattern, "What we do now is for the future."
Disclaimer
This article is for reference only. This article only represents the author's views and does not represent the position of OKX. This article is not intended to provide (i) investment advice or investment recommendations; (ii) offers or solicitations 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. Digital assets held (including stablecoins and NFTs) involve high risks and may fluctuate significantly. You should carefully consider whether trading or holding digital assets is suitable for you based on your financial situation. Please consult your legal/tax/investment professionals for your specific situation. Please be responsible for understanding and complying with local applicable laws and regulations.