Integrate Sui Wallet with UI: Connect Web3 Apps & Mini Wallets Seamlessly

·

In today’s fast-evolving Web3 ecosystem, seamless wallet integration is no longer optional—it's essential. For developers building decentralized applications (DApps) on the Sui blockchain, offering a smooth, user-friendly connection experience can dramatically improve engagement and retention. With OKX Connect UI, you can effortlessly integrate Sui-compatible wallets into your DApp, supporting both mobile app connections and Telegram Mini Wallets for in-app interactions.

Whether your DApp runs natively or within Telegram, OKX’s universal interface enables users to connect via the OKX App or stay directly inside Telegram using the OKX Telegram Mini Wallet—all without friction.

👉 Discover how to enable one-click wallet access for your Sui-based DApp


Installation and Initialization

Before integrating the UI, ensure that users have OKX App version 6.90.1 or higher installed. This guarantees compatibility with the latest features and security updates.

To begin, install the SDK via npm:

npm install @okxweb3/connect-ui

After installation, initialize the OKXUniversalConnectUI object. This instance will manage all UI-driven interactions, including wallet connection, transaction signing, and session handling.

Initialize the UI Instance

OKXUniversalConnectUI.init(dappMetaData, actionsConfiguration, uiPreferences, language);

Parameters

Returns

An initialized OKXUniversalConnectUI instance for further operations.


Connect Wallet

Connecting a wallet allows your DApp to retrieve the user’s address—essential for identification and signing transactions.

Use the following method to open the connection modal:

okxUniversalConnectUI.openModal(connectParams);

Parameters

Returns (Promise)

Upon successful connection:

This structured response ensures your app can dynamically adapt based on user capabilities.


Connect and Sign in One Step

For enhanced UX, combine wallet connection with an immediate signing request—ideal for login flows or authentication.

okxUniversalConnectUI.openModal(connectParams, signRequest);

Additional Parameter

The signature result is delivered via the connect_signResponse event.

Use Case Example

Authenticate users by requesting a signature on a unique challenge string. Once verified, grant access—no password needed.

👉 Learn how to implement secure, non-custodial login with Sui


Check Connection Status

Verify whether a wallet is currently connected:

okxUniversalConnectUI.isConnected();

Returns

Use this before sensitive operations to ensure session validity.


Disconnect Wallet

Allow users to end their session securely:

okxUniversalConnectUI.disconnect();

This removes all session data and clears the connection. Always call this before attempting to switch accounts or reconnect.


Prepare and Send Transactions

After connection, create a provider instance to interact with the Sui network:

const suiProvider = new OKXSuiProvider(okxUniversalConnectUI);

This provider enables account queries and transaction handling.


Get Account Information

Retrieve the connected user’s details:

const account = await suiProvider.getAccount();

Returns

This data powers personalized experiences—from balance displays to NFT galleries.


Sign Messages

Support secure messaging and authentication with two signing methods.

1. Sign Message

const result = await suiProvider.signMessage({ message: new TextEncoder().encode("Hello Sui") });

Returns

2. Sign Personal Message

Ideal for login systems requiring human-readable content:

const result = await suiProvider.signPersonalMessage({ message: new TextEncoder().encode("Login to MyApp") });

Returns


Sign Transaction

Prepare a transaction without broadcasting:

const { signature, transactionBlockBytes } = await suiProvider.signTransaction(preparedTx);

Useful for multi-party approvals or offline signing scenarios.


Sign and Broadcast Transaction

For immediate execution:

const result = await suiProvider.signAndExecuteTransaction(tx);

Returns

Perfect for swaps, mints, and real-time interactions.


Event Handling

Monitor key lifecycle events such as:

These events help synchronize UI states and trigger post-action workflows.

👉 See full list of supported events and error codes

🔔 Note: Event documentation mirrors EVM-compatible chains. Refer to OKX’s unified SDK guide for comprehensive details.

Core Keywords for SEO

These terms reflect high-intent search queries from developers exploring Web3 integrations.


Frequently Asked Questions (FAQ)

Q: Can I use this UI in Telegram Mini Apps?

Yes. The OKX Connect UI fully supports Telegram Mini Apps. Users can connect via the embedded OKX Telegram Mini Wallet, staying within the chat interface without switching apps.

Q: What chains does this support?

Currently optimized for Sui Testnet and Mainnet. You can define required and optional chains using the namespaces parameter during initialization.

Q: Is user data secure during connection?

Absolutely. No private keys leave the user’s device. All operations are cryptographically signed locally, ensuring full non-custodial security.

Q: Do I need to handle different languages manually?

No. The UI automatically adapts based on the language setting you provide. Over 15 languages are supported out of the box.

Q: Can I customize the appearance of the connection modal?

Yes. You can set the theme (DARK, LIGHT, or SYSTEM) and pass your DApp’s icon and name for brand consistency.

Q: What happens if a user rejects a transaction?

The promise rejects gracefully. Listen for 'error' events or catch exceptions to display friendly feedback in your interface.


By integrating OKX Universal Connect UI, developers gain a powerful, secure, and localized way to onboard users across platforms—especially within messaging ecosystems like Telegram. With native Sui support, robust eventing, and clean separation between connection and execution layers, it's the ideal toolkit for modern Web3 builders.

Start streamlining your DApp’s onboarding flow today—your users will thank you.