Invisible Infrastructure Issue 01 | Co-creation with global developers, comprehensive analysis of OKX Web3 wallet API

This article is machine translated
Show original

Driven by its innovative gene, the OKX Web3 wallet is improving both internally and externally: it continuously optimizes its products internally and explores extensive co-creation externally.  

OKX Web3 Wallet has been widely exploring co-creation, leading the open source of code on the one hand, and increasingly strengthening the construction of API on the other hand . 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, joint learning, progress and creation with global developers, thereby promoting the construction of crypto industry infrastructure.

Functions like APIs that are not easily perceived or visible to everyday 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 use dialogue to delve into the story behind the OKX Web3 team building the API .


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. 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 major modules such as wallets, DEX aggregators, Marketplace , DeFi , 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 API documentation: https://www.okx.com/zh-hans/web3/build/docs/waas/okx-waas-what-is-waas . Interested developers can click to view it 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 across apps , plug-ins and web pages. It covers five major sections: wallet, DEX aggregator, DeFi , NFT market and DApp exploration. It has also launched the Bitcoin inscription and rune trading market, and is 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 API provides the underlying technical solution 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 has the following three core functions in the wallet service: 1 ) Multi-chain address aggregation, providing the ability to count assets in millions of addresses; 2 ) Multiple scenarios, easy access to 60+ networks, support for heterogeneous multi-chain ecosystems and various BTC asset 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 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 Web3 wallet entry process can be simplified.  

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 wide range of services such as building, signing, broadcasting, tracking transactions, querying transaction history, supporting transactions on account model networks such as EVM , and supporting transactions on 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 management API to create wallet accounts and manage addresses under wallet accounts, aggregate and observe account addresses, update wallet accounts, update observed accounts, delete accounts, query the list of created accounts, query addresses under accounts, and more.

Second, in terms of asset management. This includes adding subscribed 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 additions or management are not possible, and only the asset balances of currencies that are supported by the current wallet API can be obtained.

Developers can use the asset management API to add currencies, obtain wallet account token balances, obtain observation account token balances, obtain specified currency balances, obtain total currency assets, delete currencies, query currency lists, and more.  

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 the data required for signatures, gas price , gas limit , nonce , etc., and perform address verification, query transaction details by transaction hash, query transaction details by order ID , query transaction list by account, query transaction list by address, etc.

Fourth, in other aspects, developers can also query chain-related information such as UTXO and currency information through APIs; or subscribe to relevant data of block events and transaction events through Webhooks , and can create up to 20 subscriptions in batches each time .

DEX Aggregator API  

OKX DEX aggregation is a one-stop multi-chain, DEX and cross-chain aggregator. It has aggregated 25+ cross-chain, 40+ public chains, more than 400 DEX , etc. Through X Routing intelligent routing, one transaction can use multiple DEX at the same time , providing users with better prices, better liquidity and 0 transaction service fees. It also has DEX market section, limit order, KYT security detection and other functions.  

Its core mainly includes single-chain Swap and Bridge . Both single-chain Swap and Bridge 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 documentation to build the required Web3 transaction services and applications, such as Web3 wallets, DApp projects, DeFi projects and other application scenarios.  

OKX DEX aggregator API has core highlights such as multi-chain support, multiple cross-chain bridges and multiple DEX support, as well as stability and high availability. Its response time is within 100 milliseconds, and it can provide a better inquiry path for free. Currently, OKX DEX aggregator API mainly covers: exchange API , cross-chain API , limit order API , which is convenient, easy to understand and safe to access and use.  

First, in terms of exchange functions, the OKX DEX aggregator aggregates liquidity sources from decentralized exchanges such as Uniswap , Curve , and Balancer , and can split a single transaction to multiple DEXs , providing users with better prices through efficient routing. The OKX DEX aggregator will automatically find a 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 a comprehensive comparison of DEX and PMM quotes, select the three dimensions of better quotes for users: greater liquidity, lower slippage, and better prices.

Developers can use the exchange API to obtain the chains, currency lists, liquidity lists, transaction authorizations, exchange prices, transaction data, etc. supported by the OKX DEX aggregator.  

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 intelligent 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 API to 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.  

The OKX DEX aggregator limit order API has the characteristics that the execution of limit orders needs to wait for the DEX aggregator users to take the orders, there is no slippage for the limit order creator, and partial order execution is supported. 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 covers the EVM NFT market, Runes market, Ordinals market and issuance market, and supports a total of 26 mainstream popular public chains including Bitcoin and Ethereum .

First, the 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 brings together the order depth of multiple mainstream markets and platforms, and includes 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 API provides two major functions: data query and transaction . The data aspect includes NFT and collection information query, transaction data query; transaction aspect: supports one-click order placement to multiple markets, and batch purchase 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, accessed networks and markets, query pending orders, bid orders, purchase orders, etc.  

Second, the OKX Runes market. The OKX Runes market is the industry's first platform to provide rune trading on the APP side, supporting users to carry out 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, and more.

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 Ordinals Market API to create Ordinals orders, obtain inscription asset lists, submit orders, obtain Ordinals collection lists, orders, transaction history and related models, etc.

DeFi API

OKX Web3 DeFi is the market's leading one-stop DeFi trading aggregation platform, making it easy for users to quickly and accurately find educational products that meet their needs. OKX Web3 DeFi currently has access 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, etc. Developers integrate 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 implement a variety of functions through the OKX Web3 DeFi API. First, in terms of querying information, it supports developers to 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 querying 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-based, working with global developers  

In today's rapidly developing blockchain and cryptocurrency fields, op

Sector:
Disclaimer: The content above is only the author's opinion which does not represent any position of Followin, and is not intended as, and shall not be understood or construed as, investment advice from Followin.
Like
9
Add to Favorites
4
Comments