Bitcoin-Compatible Chain Integration with OKX Connect UI

·

Integrating a Bitcoin-compatible chain into your decentralized application (DApp) has never been easier. With OKX Connect, developers can seamlessly link their apps to secure wallet solutions—whether through a full mobile App Wallet or the lightweight OKX Mini Wallet within Telegram. This guide walks you through the complete integration process using the OKX Universal Connect UI, offering step-by-step instructions for connection, transaction signing, account management, and more.

Whether you're building on Bitcoin, Fractal, or other BTC-ecosystem chains, this documentation ensures smooth interoperability while maintaining user experience and security.


Installation and Initialization

To begin integrating OKX Connect into your DApp, ensure that users have the OKX App version 6.92.0 or higher installed. This is required to access the latest features of the Universal Connect UI.

You can install the SDK via npm:

npm install @okxweb3/connect

Before initiating any wallet interaction, create an instance of OKXUniversalConnectUI. This object provides the necessary interface for connecting wallets, sending transactions, and managing user sessions.

Request Parameters

Return Value

👉 Discover how to set up seamless wallet connections in minutes


Connecting to the OKX Wallet

Establishing a wallet connection allows your DApp to retrieve the user's address and obtain permission to sign transactions securely.

Request Parameters

Return Value

A Promise resolving to:


Connect and Sign in One Step

This method combines wallet connection with immediate data signing—ideal for authentication flows. The result triggers the 'connect_signResponse' event.

Additional Parameters

Returns the same session data as standard connection, plus signed output via event callback.


Check Wallet Connection Status

Determine whether a wallet is currently connected.

Return Value

Use this before attempting transactions or fetching account data.


Prepare for Trading Operations

After establishing a session, instantiate an OKXBtcProvider object using the initialized okxUniversalConnectUI. This provider enables Bitcoin-specific actions like sending BTC or signing PSBTs.

const btcProvider = new OKXBtcProvider(okxUniversalConnectUI);

Retrieve Wallet Account Information

Fetch public wallet details such as address and public key.

Request Parameters

Return Value

Ideal for displaying user identity or preparing transaction inputs.

👉 Learn how to integrate Bitcoin wallet functionality effortlessly


Sign a Message

Securely sign arbitrary messages—commonly used for login authentication.

Parameters

Return Value

Supports both legacy and Taproot-based addresses.


Send Bitcoin Transactions

Enable users to transfer BTC directly from your DApp.

Parameters

Return Value

Perfect for peer-to-peer transfers, payments, or withdrawals.


Sign PSBT (Partially Signed Bitcoin Transaction)

Sign pre-built transactions without broadcasting—giving full control over transaction flow.

Parameters

Return Value

Useful for multi-sig setups or advanced DeFi interactions.


Sign Multiple PSBTs

Batch-sign several PSBTs in one request.

Parameters

Return Value

Efficient for batch operations like NFT mints or portfolio rebalancing.


Sign and Broadcast PSBT

Signs the transaction and automatically pushes it to the network.

Requires OKX App version 6.93.0 or later

Parameters

Same as signPsbt, with automatic broadcast upon completion.

Return Value