Provider API
Introduce
By accessing the ton provider, you will get a tonconnect object:
const tonConnect = window.naboxTon.tonconnect();
interface TonConnectBridge {
deviceInfo: DeviceInfo;
walletInfo?: WalletInfo;
protocolVersion: number;
connect(protocolVersion: number, message: ConnectRequest): Promise<ConnectEvent>;
restoreConnection(): Promise<ConnectEvent>;
send(message: AppRequest): Promise<WalletResponse>;
listen(callback: (event: WalletEvent) => void): () => void;
};deviceInfo (device information)
{
platform: 'browser', // Current Environment
appName: 'Nabox Wallet', // wallet
appVersion: '1.2.19', // Current version number
maxProtocolVersion: 2, // Supported protocol types, currently 2
features: [ // Features currently supported by the wallet
'SendTransaction',
{
name: 'SendTransaction',
maxMessages: 4,
},
],
}walletInfo(wallet info)
protocolVersion
Currently supported protocol versions
connect(connect wallet)
restoreConnection (restore connection, often used for a second connection after a previous connection)
send(send transaction/disconnect)
listen
Last updated