sdk.solana
Solana blockchain operations module for interacting with the Solana network.createConnection
Create a connection to the Solana network.Returns
- SolanaConnection - Connection to the configured Solana network
Example
createSigner
Create a signer for a Solana wallet. The signer is used to sign messages and transactions.Parameters
- wallet (BaseWallet) - Solana wallet to create signer for
Returns
- SolanaSigner - Signer instance for the wallet
Example
SolanaConnection
Connection instance for Solana network operations.getLatestBlockhash
Get the latest blockhash from the network. Required for building transactions.Returns
- BlockhashResult - Object containing
blockhashstring property
Example
getBalance
Get the balance of a Solana account in lamports.Parameters
- publicKey (PublicKey) - Public key of the account
Returns
- UInt64 - Balance in lamports (1 SOL = 1,000,000,000 lamports)
Example
SolanaSigner
Signer for Solana wallet operations including message signing and transaction handling.signMessage
Sign an arbitrary message with the wallet.Parameters
- message (String) - Message to sign
Returns
- String - Base58-encoded signature
Example
signEncodedTransaction
Sign a base64-encoded transaction without broadcasting it.Parameters
- base64Transaction (String) - Base64-encoded serialized transaction
Returns
- String - Base64-encoded signed transaction
Example
signAndSendEncodedTransaction
Sign and broadcast a base64-encoded transaction to the network.Parameters
- base64Transaction (String) - Base64-encoded serialized transaction
Returns
- String - Transaction signature (can be used to track on explorer)
Example
sdk.networks.solana
Access configured Solana networks.Example
Building Transactions
Solana transactions require the SolanaWeb3 package for construction.Dependencies
Add the SolanaWeb3 package to your project:Using SolanaTransactionBuilder
The SDK provides a transaction builder for common operations:Complete Send SOL Example
Complete Sign Message Example
Complete Sign Transaction Example
SwiftUI Integration
Send SOL View
Sign Message View
Lamports Conversion
Solana uses lamports as its smallest unit:Transaction Explorer
Error Handling
Signer Methods Summary
| Method | Description |
|---|---|
signMessage(message:) | Sign an arbitrary message |
signEncodedTransaction(base64Transaction:) | Sign a transaction without sending |
signAndSendEncodedTransaction(base64Transaction:) | Sign and broadcast a transaction |
Connection Methods Summary
| Method | Description |
|---|---|
getLatestBlockhash() | Get latest blockhash for transactions |
getBalance(publicKey:) | Get account balance in lamports |
getAccountInfo(publicKey:) | Get detailed account information |
Next Steps
- Send Solana Transactions - Detailed transaction guide
- Sign Solana Messages - Message signing guide
- Solana Connection - Connection setup
- Token Balances - Get SOL and SPL token balances