Sui Provider (Beta)

The Tomo Telegram SDK provides the SUI provider for getting addresses, signing, and sending transactions.

// get provider 
const sui= window.tomo_sui;

Connect with the Wallet

Before using the provider, the user needs to log in to the wallet through the modal by following the method:

// connect wallet
await sui?.connectWallet();

Query Address

You can get the address of the user by one cal

const address = sui.getAddress();

Signing Methods

In Solana providers, we provide three signing methods:

  • signMessage

  • signTransaction

  • signAndExecuteTransaction

Sign message

signMessage method will create a simple signed transaction for one message and return the signed transaction in hex.

Sign transaction

signTransaction supports signing arbitrary PTB transactions if they are well formed. Please check this for the general construction of transactions. We provide two examples:

After signing the transaction, you can send it to your client or add other signatures. In addition, you can use signAndExecuteTransaction the method to send the signed transaction directly.

Last updated