Solana-Compatible Wallet Integration Guide: Connect to App or Mini Wallet

ยท

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:

  1. Prerequisite: Update OKX App to version 6.90.1 or later
  2. 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

ParameterTypeDescription
namespacesObjectRequired chain specifications (Solana key: 'solana')
chainsstring[]Supported chain IDs
defaultChainstringPrimary chain selection

Successful connection returns:

Transaction Operations

Signature Methods

  1. Message Signing:

    signMessage(message: string, chain?: string)

    Returns: { publicKey, signature }

  2. Transaction Signing:

    signTransaction(transaction: Transaction, chain?: string)
  3. Batch Transactions:

    signAllTransactions(transactions: Transaction[], chain?: string)

๐Ÿ‘‰ Advanced Transaction Features

Account Management

Key Features

FunctionDescription
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.