Solana Provider
Last updated
Last updated
The Tomo Telegram SDK provides a Solana Provider for querying and sending SOL and SPL tokens.
Before using the provider, the user needs to log in to the wallet through the modal by following the method:
Solana providers support two query methods:
getAddress
getBalance
In Solana providers, we provide four signing methods:
signMessage
signTransaction
signTransactions
signTokenTransaction
signMessage
the method will create an offchain signature for one message and return the signed transaction in hex.
To verify the signature, you need to add the header "\xffsolana offchain" before the `signMsg`
signTransaction
is typically used to send SOL to another address and return the signed transaction. You can also use signTransactions
it to pass an array of transactions for signing.
and signTokenTransaction
supports signing transactions for sending SPL tokens. You need to provide a mint address for this transaction.
After signing transactions, you can use sendTransaction
it to send the transaction. The return value is the transaction hash: