Mobile Dapp Provider

Sender injects a global JavaScript API into websites visited by its users using the window.sender.ton provider object. This API allows websites to request users' Ton accounts, read data from blockchains the user is connected to, and suggest that the user sign messages and transactions.

Properties

deviceInfo

Developer can get deviceInfo from window.sender.ton object.

// Some code
export declare interface DeviceInfo {
  platform: 'iphone' | 'ipad' | 'android' | 'windows' | 'mac' | 'linux' | 'browser';
  appName: string;
  appVersion: string;
  maxProtocolVersion: number;
  features: Feature[];
}

protocolVersion

This is protocol version number, and current protocol version is 2

isWalletBrowser

Check current Provider API if it's wallet browser, the default value is true

Methods

connect

The third dapp can use connect method to connect Sender Wallet. And this method will respond a ConnectEvent object.

restoreConnection

This method can restore app connection automatically if dapp is connected before, so that user don't need to connect dapp again. And this method will respond a ConnectEvent object.

disconnect

send

This method can be used as sendTransaction or signData method, and dapp can use send method to send transaction or sign data.

Last updated