This guide provides a comprehensive overview of integrating Solana-compatible wallet solutions through UI interfaces, including mobile App Wallets and Mini Wallets within Telegram environments.
Installation and Initialization
To begin using OKX Connect in your DApp:
- Prerequisite: Update OKX App to version 6.90.1 or later
- Integration: Use npm package manager for seamless installation
Configuration Object Setup
Create a provider object with these parameters:
{
dappMetaData: {
name: "YourAppName",
icon: "https://yourdomain.com/app-icon.png" // 180x180px PNG recommended
},
actionsConfiguration: {
modals: ['before', 'success', 'error'], // Transaction alert modes
returnStrategy: 'tg://resolve', // Deep link behavior
tmaReturnUrl: 'back' // Telegram Mini Wallet return behavior
},
uiPreferences: {
theme: 'SYSTEM', // DARK, LIGHT, or SYSTEM
language: 'en_US' // 18 supported locales
}
}๐ Explore Wallet Integration Solutions
Wallet Connection Process
Core Connection Parameters
| Parameter | Type | Description |
|---|---|---|
| namespaces | Object | Required chain specifications (Solana key: 'solana') |
| chains | string[] | Supported chain IDs |
| defaultChain | string | Primary chain selection |
Successful connection returns:
- Session topic (identifier)
- Namespace information
- Account details
- Supported methods
Transaction Operations
Signature Methods
Message Signing:
signMessage(message: string, chain?: string)Returns:
{ publicKey, signature }Transaction Signing:
signTransaction(transaction: Transaction, chain?: string)Batch Transactions:
signAllTransactions(transactions: Transaction[], chain?: string)
๐ Advanced Transaction Features
Account Management
Key Features
| Function | Description |
|---|---|
getAccount() | Retrieves wallet address/public key |
connected() | Checks active connection status |
disconnect() | Terminates current session |
Error Handling
Refer to standard EVM-compatible chain error codes for troubleshooting connection or transaction issues.
FAQ
Q: Can users stay within Telegram during wallet access?
A: Yes, the UI supports evoking mobile App Wallets or Ouyi Mini Wallets without leaving Telegram.
Q: What image formats are supported for dapp icons?
A: PNG and ICO formats (180x180px recommended). SVG is not supported.
Q: How many transactions can be signed simultaneously?
A: The system supports batch signing of multiple transactions in single operation.
Q: What happens if a requested chain isn't supported?
A: Required chains will reject connection, while optional chains will still connect.
Q: Can users switch connected wallets?
A: Yes, but must disconnect current wallet first through disconnect() method.
Q: Is dark mode supported?
A: Yes, via THEME.DARK, THEME.LIGHT, or SYSTEM preference settings.