Solana Integrations

The SolanaProvider defined in Tomo Connect SDK contains all the necessary functions to interact with Solana chain. Core functions are:

Get Wallet Public Key

async getPublicKey()

Send SOL

async sendSol(to: string, amount: string, mintAddress?: string): Promise<string>

Sign Transaction

import { Transaction, VersionedTransaction } from "@solana/web3.js";

async signTransaction<T extends Transaction | VersionedTransaction>(
    transaction: T
): Promise<T>

Sign All Transactions

async signAllTransactions<T extends Transaction | VersionedTransaction>(
    transactions: T[]
): Promise<T[]>

Sign and Send Transaction

import { 
      Transaction,
      VersionedTransaction,
      SendOptions,
      TransactionSignature
} from "@solana/web3.js";

async signAndSendTransaction<T extends Transaction | VersionedTransaction>(
      transaction: T,
      options?: SendOptions
): Promise<{ signature: TransactionSignature }>

Sign Message

async signMessage(message: Uint8Array): Promise<{ signature: Uint8Array }>

Connect

async connect(): Promise<void>

Disconnect

async disconnect(): Promise<void>

Last updated