{"id":42577672,"url":"https://github.com/tetherto/wdk-wallet-solana","last_synced_at":"2026-01-28T22:00:58.347Z","repository":{"id":320250971,"uuid":"996779849","full_name":"tetherto/wdk-wallet-solana","owner":"tetherto","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-19T17:08:07.000Z","size":496,"stargazers_count":1,"open_issues_count":5,"forks_count":10,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-19T23:18:13.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetherto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-05T13:00:59.000Z","updated_at":"2025-11-23T08:26:38.000Z","dependencies_parsed_at":"2025-10-22T20:41:23.691Z","dependency_job_id":null,"html_url":"https://github.com/tetherto/wdk-wallet-solana","commit_stats":null,"previous_names":["tetherto/wdk-wallet-solana"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/wdk-wallet-solana","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-wallet-solana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-wallet-solana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-wallet-solana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-wallet-solana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/wdk-wallet-solana/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-wallet-solana/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28853194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-28T22:00:57.491Z","updated_at":"2026-01-28T22:00:58.326Z","avatar_url":"https://github.com/tetherto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @tetherto/wdk-wallet-solana\n\n**Note**: This package is currently in beta. Please test thoroughly in development environments before using in production.\n\nA simple and secure package to manage BIP-44 wallets for the Solana blockchain. This package provides a clean API for creating, managing, and interacting with Solana wallets using BIP-39 seed phrases and Solana-specific derivation paths.\n\n## 🔍 About WDK\n\nThis module is part of the [**WDK (Wallet Development Kit)**](https://wallet.tether.io/) project, which empowers developers to build secure, non-custodial wallets with unified blockchain access, stateless architecture, and complete user control. \n\nFor detailed documentation about the complete WDK ecosystem, visit [docs.wallet.tether.io](https://docs.wallet.tether.io).\n\n## 🌟 Features\n\n- **Solana Derivation Paths**: Support for BIP-44 standard derivation paths for Solana (m/44'/501')\n- **Multi-Account Management**: Create and manage multiple accounts from a single seed phrase\n- **Transaction Management**: Send transactions and get fee estimates with recent blockhash\n- **SPL Token Support**: Query native SOL and SPL token balances using program interactions\n\n## ⬇️ Installation\n\nTo install the `@tetherto/wdk-wallet-solana` package, follow these instructions:\n\nYou can install it using npm:\n\n```bash\nnpm install @tetherto/wdk-wallet-solana\n```\n\n## 🚀 Quick Start\n\n### Importing from `@tetherto/wdk-wallet-solana`\n\n1. WalletManagerSolana: Main class for managing wallets\n2. WalletAccountSolana: Use this for full access accounts\n3. WalletAccountReadOnlySolana: Use this for read-only accounts\n\n### Creating a New Wallet\n\n```javascript\nimport WalletManagerSolana, { \n  WalletAccountSolana, \n  WalletAccountReadOnlySolana \n} from '@tetherto/wdk-wallet-solana'\n\n// Use a BIP-39 seed phrase (replace with your own secure phrase)\nconst seedPhrase = 'test only example nut use this real life secret phrase must random'\n\n// Create wallet manager with Solana RPC provider\nconst wallet = new WalletManagerSolana(seedPhrase, {\n  rpcUrl: 'https://api.mainnet-beta.solana.com', // or any Solana RPC endpoint\n  commitment: 'confirmed' // Optional: commitment level\n})\n\n// Get a full access account\nconst account = await wallet.getAccount(0)\n\n// Convert to a read-only account\nconst readOnlyAccount = await account.toReadOnlyAccount()\n```\n\n### Managing Multiple Accounts\n\n```javascript\nimport WalletManagerSolana from '@tetherto/wdk-wallet-solana'\n\n// Assume wallet is already created\n// Get the first account (index 0)\nconst account = await wallet.getAccount(0)\nconst address = await account.getAddress()\nconsole.log('Account 0 address:', address)\n\n// Get the second account (index 1)\nconst account1 = await wallet.getAccount(1)\nconst address1 = await account1.getAddress()\nconsole.log('Account 1 address:', address1)\n\n// Get account by custom derivation path\nconst customAccount = await wallet.getAccountByPath(\"0'/0/5\")\nconst customAddress = await customAccount.getAddress()\nconsole.log('Custom account address:', customAddress)\n\n// Note: All addresses are base58-encoded Solana public keys\n// All accounts inherit the provider configuration from the wallet manager\n```\n\n### Checking Balances\n\n#### Owned Account\n\nFor accounts where you have the seed phrase and full access:\n\n```javascript\nimport WalletManagerSolana from '@tetherto/wdk-wallet-solana'\n\n// Assume wallet and account are already created\n// Get native SOL balance (in lamports)\nconst balance = await account.getBalance()\nconsole.log('Native balance:', balance, 'lamports') // 1 SOL = 1000000000 lamports\n\n// Get SPL token balance\nconst tokenMint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'; // USDT mint address\nconst tokenBalance = await account.getTokenBalance(tokenMint);\nconsole.log('Token balance:', tokenBalance);\n\n// Note: Provider is required for balance checks\n// Make sure wallet was created with a provider configuration\n```\n\n#### Read-Only Account\n\nFor addresses where you don't have the seed phrase:\n\n```javascript\nimport { WalletAccountReadOnlySolana } from '@tetherto/wdk-wallet-solana'\n\n// Create a read-only account\nconst readOnlyAccount = new WalletAccountReadOnlySolana('publicKey', { // Base58-encoded public key\n  rpcUrl: 'https://api.mainnet-beta.solana.com',\n  commitment: 'confirmed'\n})\n\n// Check native SOL balance\nconst balance = await readOnlyAccount.getBalance()\nconsole.log('Native balance:', balance, 'lamports')\n\n// Check SPL token balance\nconst tokenBalance = await readOnlyAccount.getTokenBalance('EPjFWdd5...') // Token mint address\nconsole.log('Token balance:', tokenBalance)\n\n// Note: Token balances are returned in the token's smallest units\n// Make sure to adjust for the token's decimals when displaying\n```\n### Sending Transactions\n\n- Send SOL and estimate fees\n\n```javascript\n// Send native SOL\nconst result = await account.sendTransaction({\n  to: 'recipientPublicKey', // Recipient's base58-encoded public key\n  value: 1000000000n // 1 SOL in lamports (use BigInt)\n})\nconsole.log('Transaction hash:', result.hash)\nconsole.log('Transaction fee:', result.fee, 'lamports')\n\n// Quote transaction fee before sending\nconst quote = await account.quoteSendTransaction({\n  to: 'recipientPublicKey',\n  value: 1000000000n\n})\nconsole.log('Estimated fee:', quote.fee, 'lamports')\n```\n\n- Send Solana Transaction Message\n\n```javascript\nimport { \n  createTransactionMessage, \n  pipe, \n  appendTransactionMessageInstruction \n} from '@solana/kit'\nimport { getTransferSolInstruction } from '@solana-program/system'\n\n// Build a TransactionMessage with custom instructions\nconst fromAddress = await account.getAddress()\n\nconst transferInstruction = getTransferSolInstruction({\n  source: { address: fromAddress },\n  destination: 'DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK',\n  amount: 1000000n\n})\n\nconst txMessage = pipe(\n  createTransactionMessage({ version: 0 }),\n  tx =\u003e appendTransactionMessageInstruction(transferInstruction, tx)\n)\n\nconst result = await account.sendTransaction(txMessage)\nconsole.log('Transaction hash:', result.hash)\n```\n\n### Token Transfers\n\nTransfer SPL tokens and estimate fees using `WalletAccountSolana`. Uses Token Program instructions.\n\n```javascript\n// Transfer SPL tokens\nconst transferResult = await account.transfer({\n  token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // Token mint address\n  recipient: 'publicKey',  // Recipient's base58-encoded public key\n  amount: 1000000n     // Amount in token's base units (use BigInt for large numbers)\n}, {\n  commitment: 'confirmed' // Optional: commitment level\n});\nconsole.log('Transaction signature:', transferResult.signature);\nconsole.log('Transfer fee:', transferResult.fee, 'lamports');\n\n// Quote token transfer fee\nconst transferQuote = await account.quoteTransfer({\n  token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // Token mint address\n  recipient: 'publicKey',  // Recipient's base58-encoded public key\n  amount: 1000000n     // Amount in token's base units\n})\nconsole.log('Transfer fee estimate:', transferQuote.fee, 'lamports')\n\n// Note: If recipient doesn't have a token account, one will be created automatically\n```\n\n### Message Signing and Verification\n\nSign and verify messages using Ed25519 cryptography.\n\n```javascript\n// Sign a message\nconst message = 'Hello, Solana!'\nconst signature = await account.sign(message)\nconsole.log('Signature:', signature)\n\n// Verify a signature\nconst isValid = await account.verify(message, signature)\nconsole.log('Signature valid:', isValid)\n```\n\n### Fee Management\n\nRetrieve current fee rates using `WalletManagerSolana`. Rates are calculated based on recent blockhash and compute unit prices.\n\n```javascript\n// Get current fee rates\nconst feeRates = await wallet.getFeeRates();\nconsole.log('Normal fee rate:', feeRates.normal, 'lamports'); // Standard compute unit price\nconsole.log('Fast fee rate:', feeRates.fast, 'lamports');     // Priority compute unit price with higher unit limit\n```\n\n### Memory Management\n\nClear sensitive data from memory using `dispose` methods in `WalletAccountSolana` and `WalletManagerSolana`.\n\n```javascript\n// Dispose wallet accounts to clear private keys from memory\naccount.dispose()\n\n// Dispose entire wallet manager\nwallet.dispose()\n```\n\n## 📚 API Reference\n\n### Table of Contents\n\n| Class | Description | Methods |\n|-------|-------------|---------|\n| [WalletManagerSolana](#walletmanagersolana) | Main class for managing Solana wallets. Extends `WalletManager` from `@tetherto/wdk-wallet`. | [Constructor](#constructor), [Methods](#methods) |\n| [WalletAccountSolana](#walletaccountsolana) | Individual Solana wallet account implementation. Extends `WalletAccountReadOnlySolana` and implements `IWalletAccount`. | [Constructor](#constructor-1), [Methods](#methods-1), [Properties](#properties) |\n| [WalletAccountReadOnlySolana](#walletaccountreadonlysolana) | Read-only Solana wallet account. | [Constructor](#constructor-2), [Methods](#methods-2) |\n\n### WalletManagerSolana\n\nThe main class for managing Solana wallets.  \nExtends `WalletManager` from `@tetherto/wdk-wallet`.\n\n#### Constructor\n\n```javascript\nnew WalletManagerSolana(seed, config)\n```\n\n**Parameters:**\n- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or seed bytes\n- `config` (object): Configuration object\n  - `provider` (string | Connection): RPC endpoint URL or Solana Connection instance\n  - `commitment` (string, optional): Commitment level ('processed', 'confirmed', or 'finalized')\n  - `transferMaxFee` (number, optional): Maximum fee amount for transfer operations (in lamports)\n\n**Example:**\n```javascript\nconst wallet = new WalletManagerSolana(seedPhrase, {\n  rpcUrl: 'https://api.mainnet-beta.solana.com',\n  commitment: 'confirmed',\n  transferMaxFee: 5000 // Maximum fee in lamports\n})\n```\n\n#### Methods\n\n| Method | Description | Returns |\n|--------|-------------|---------|\n| `getAccount(index)` | Returns a wallet account at the specified index | `Promise\u003cWalletAccountSolana\u003e` |\n| `getAccountByPath(path)` | Returns a wallet account at the specified BIP-44 derivation path | `Promise\u003cWalletAccountSolana\u003e` |\n| `getFeeRates()` | Returns current fee rates for transactions | `Promise\u003c{normal: bigint, fast: bigint}\u003e` |\n| `dispose()` | Disposes all wallet accounts, clearing private keys from memory | `void` |\n\n##### `getAccount(index)`\nReturns a Solana wallet account at the specified index using BIP-44 derivation path m/44'/501'.\n\n**Parameters:**\n- `index` (number, optional): The index of the account to get (default: 0)\n\n**Returns:** `Promise\u003cWalletAccountSolana\u003e` - The Solana wallet account\n\n**Example:**\n```javascript\nconst account = await wallet.getAccount(0)\nconst address = await account.getAddress()\nconsole.log('Solana account address:', address)\n```\n\n##### `getAccountByPath(path)`\nReturns a Solana wallet account at the specified BIP-44 derivation path.\n\n**Parameters:**\n- `path` (string): The derivation path (e.g., \"0'/0/0\", \"1'/0/5\")\n\n**Returns:** `Promise\u003cWalletAccountSolana\u003e` - The Solana wallet account\n\n**Example:**\n```javascript\nconst account = await wallet.getAccountByPath(\"0'/0/1\")\nconst address = await account.getAddress()\nconsole.log('Custom path address:', address)\n```\n\n##### `getFeeRates()`\nReturns current fee rates for Solana transactions from the network.\n\n**Returns:** `Promise\u003c{normal: bigint, fast: bigint}\u003e` - Object containing fee rates in lamports\n- `normal`: Standard compute unit price for normal confirmation speed\n- `fast`: Priority compute unit price for faster confirmation\n\n**Example:**\n```javascript\nconst feeRates = await wallet.getFeeRates()\nconsole.log('Normal fee rate:', feeRates.normal, 'lamports')\nconsole.log('Fast fee rate:', feeRates.fast, 'lamports')\n\n// Use in transaction\nconst result = await account.sendTransaction({\n  recipient: '11111111111111111111111111111112',\n  value: 1000000000n // 1 SOL in lamports\n})\n```\n\n##### `dispose()`\nDisposes all Solana wallet accounts and clears sensitive data from memory.\n\n**Returns:** `void`\n\n**Example:**\n```javascript\nwallet.dispose()\n// All accounts and private keys are now securely wiped from memory\n```\n\n### WalletAccountSolana\n\nRepresents an individual Solana wallet account. Implements `IWalletAccount` from `@tetherto/wdk-wallet`.\n\n#### Constructor\n\n```javascript\nnew WalletAccountSolana(seed, path, config)\n```\n\n**Parameters:**\n- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or seed bytes\n- `path` (string): BIP-44 derivation path (e.g., \"0'/0/0\")\n- `config` (object): Configuration object\n  - `provider` (string | Connection): RPC endpoint URL or Solana Connection instance\n  - `commitment` (string, optional): Commitment level ('processed', 'confirmed', or 'finalized')\n  - `transferMaxFee` (number, optional): Maximum fee amount for transfer operations (in lamports)\n\n#### Methods\n\n| Method | Description | Returns |\n|--------|-------------|---------|\n| `getAddress()` | Returns the account's public key | `Promise\u003cstring\u003e` |\n| `sign(message)` | Signs a message using the account's private key | `Promise\u003cstring\u003e` |\n| `sendTransaction(tx)` | Sends a Solana transaction | `Promise\u003c{signature: string, fee: bigint}\u003e` |\n| `quoteSendTransaction(tx)` | Estimates the fee for a transaction | `Promise\u003c{fee: bigint}\u003e` |\n| `transfer(options)` | Transfers SPL tokens to another address | `Promise\u003c{signature: string, fee: bigint}\u003e` |\n| `quoteTransfer(options)` | Estimates the fee for an SPL token transfer | `Promise\u003c{fee: bigint}\u003e` |\n| `getBalance()` | Returns the native SOL balance (in lamports) | `Promise\u003cbigint\u003e` |\n| `getTokenBalance(tokenMint)` | Returns the balance of a specific SPL token | `Promise\u003cbigint\u003e` |\n| `dispose()` | Disposes the wallet account, clearing private keys from memory | `void` |\n\n##### `getAddress()`\nReturns the account's Solana public key (base58-encoded).\n\n**Returns:** `Promise\u003cstring\u003e` - The account's public key\n\n**Example:**\n```javascript\nconst address = await account.getAddress()\nconsole.log('Solana address:', address) // Base58 public key\n```\n\n##### `sign(message)`\nSigns a message using the account's Ed25519 private key.\n\n**Parameters:**\n- `message` (string): Message to sign\n\n**Returns:** `Promise\u003cstring\u003e` - Signature as base58 string\n\n**Example:**\n```javascript\nconst signature = await account.sign('Hello Solana!')\nconsole.log('Signature:', signature)\n```\n\n##### `sendTransaction(tx)`\nSends a Solana transaction and broadcasts it to the network.\n\n**Parameters:**\n- `tx` (object): The transaction object\n  - `recipient` (string): Recipient's public key (base58-encoded)\n  - `value` (number | bigint): Amount in lamports\n  - `commitment` (string, optional): Commitment level ('processed', 'confirmed', 'finalized')\n\n**Returns:** `Promise\u003c{signature: string, fee: bigint}\u003e` - Object containing signature and fee (in lamports)\n\n**Example:**\n```javascript\nconst result = await account.sendTransaction({\n  recipient: '11111111111111111111111111111112',\n  value: 1000000000n, // 1 SOL in lamports\n  commitment: 'confirmed'\n})\nconsole.log('Transaction signature:', result.signature)\nconsole.log('Fee paid:', result.fee, 'lamports')\n```\n\n##### `quoteSendTransaction(tx)`\nEstimates the fee for a Solana transaction without broadcasting it.\n\n**Parameters:**\n- `tx` (object): Same as sendTransaction parameters\n  - `recipient` (string): Recipient's public key (base58-encoded)\n  - `value` (number | bigint): Amount in lamports\n  - `commitment` (string, optional): Commitment level\n\n**Returns:** `Promise\u003c{fee: bigint}\u003e` - Object containing estimated fee (in lamports)\n\n**Example:**\n```javascript\nconst quote = await account.quoteSendTransaction({\n  recipient: '11111111111111111111111111111112',\n  value: 1000000000n // 1 SOL in lamports\n})\nconsole.log('Estimated fee:', quote.fee, 'lamports')\nconsole.log('Estimated fee in SOL:', Number(quote.fee) / 1e9)\n```\n\n##### `transfer(options)`\nTransfers SPL tokens to another address and broadcasts the transaction.\n\n**Parameters:**\n- `options` (object): Transfer options\n  - `token` (string): Token mint address (base58-encoded)\n  - `recipient` (string): Recipient's public key (base58-encoded)\n  - `amount` (number | bigint): Amount in token's smallest unit\n  - `commitment` (string, optional): Commitment level\n\n**Returns:** `Promise\u003c{signature: string, fee: bigint}\u003e` - Object containing signature and fee (in lamports)\n\n**Example:**\n```javascript\nconst result = await account.transfer({\n  token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // USDT\n  recipient: '11111111111111111111111111111112',\n  amount: 1000000n, // 1 USDT (6 decimals)\n  commitment: 'confirmed'\n})\nconsole.log('Transfer signature:', result.signature)\nconsole.log('Gas fee:', result.fee, 'lamports')\n```\n\n##### `quoteTransfer(options)`\nEstimates the fee for an SPL token transfer without broadcasting it.\n\n**Parameters:**\n- `options` (object): Same as transfer parameters\n  - `token` (string): Token mint address (base58-encoded)\n  - `recipient` (string): Recipient's public key (base58-encoded)\n  - `amount` (number | bigint): Amount in token's smallest unit\n  - `commitment` (string, optional): Commitment level\n\n**Returns:** `Promise\u003c{fee: bigint}\u003e` - Object containing estimated fee (in lamports)\n\n**Example:**\n```javascript\nconst quote = await account.quoteTransfer({\n  token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // USDT\n  recipient: '11111111111111111111111111111112',\n  amount: 1000000n // 1 USDT (6 decimals)\n})\nconsole.log('Estimated transfer fee:', quote.fee, 'lamports')\n```\n\n##### `getBalance()`\nReturns the account's native SOL balance in lamports.\n\n**Returns:** `Promise\u003cbigint\u003e` - Balance in lamports\n\n**Example:**\n```javascript\nconst balance = await account.getBalance()\nconsole.log('SOL balance:', balance, 'lamports')\nconsole.log('Balance in SOL:', Number(balance) / 1e9)\n```\n\n##### `getTokenBalance(tokenMint)`\nReturns the balance of a specific SPL token.\n\n**Parameters:**\n- `tokenMint` (string): The SPL token mint address (base58-encoded)\n\n**Returns:** `Promise\u003cbigint\u003e` - Token balance in token's smallest unit\n\n**Example:**\n```javascript\n// Get USDT balance (6 decimals)\nconst usdtBalance = await account.getTokenBalance('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')\nconsole.log('USDT balance:', Number(usdtBalance) / 1e6)\n```\n\n##### `dispose()`\nDisposes the wallet account, securely erasing the private key from memory.\n\n**Returns:** `void`\n\n**Example:**\n```javascript\naccount.dispose()\n// Private key is now securely wiped from memory\n```\n\n\n#### Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `index` | `number` | The derivation path's index of this account |\n| `path` | `string` | The full derivation path of this account |\n| `keyPair` | `Ed25519Keypair` | The account's Ed25519 key pair (⚠️ Contains sensitive data) |\n\n⚠️ **Security Note**: The `keyPair` property contains sensitive cryptographic material. Never log, display, or expose the private key.\n\n### WalletAccountReadOnlySolana\n\nRepresents a read-only Solana wallet account.\n\n#### Constructor\n\n```javascript\nnew WalletAccountReadOnlySolana(publicKey, config)\n```\n\n**Parameters:**\n- `publicKey` (string): The account's public key (base58-encoded)\n- `config` (object): Configuration object\n  - `provider` (string | Connection): RPC endpoint URL or Solana Connection instance\n  - `commitment` (string, optional): Commitment level ('processed', 'confirmed', or 'finalized')\n\n#### Methods\n\n| Method | Description | Returns |\n|--------|-------------|---------|\n| `getBalance()` | Returns the native SOL balance (in lamports) | `Promise\u003cbigint\u003e` |\n| `getTokenBalance(tokenMint)` | Returns the balance of a specific SPL token | `Promise\u003cbigint\u003e` |\n| `verify(message, signature)` | Verifies a message signature | `Promise\u003cboolean\u003e` |\n| `quoteSendTransaction(tx)` | Estimates the fee for a transaction | `Promise\u003c{fee: bigint}\u003e` |\n| `quoteTransfer(options)` | Estimates the fee for an SPL token transfer | `Promise\u003c{fee: bigint}\u003e` |\n\n##### `getBalance()`\nReturns the account's native SOL balance in lamports.\n\n**Returns:** `Promise\u003cbigint\u003e` - Balance in lamports\n\n**Example:**\n```javascript\nconst balance = await readOnlyAccount.getBalance()\nconsole.log('SOL balance:', balance, 'lamports')\nconsole.log('Balance in SOL:', Number(balance) / 1e9)\n```\n\n##### `getTokenBalance(tokenMint)`\nReturns the balance of a specific SPL token.\n\n**Parameters:**\n- `tokenMint` (string): The SPL token mint address (base58-encoded)\n\n**Returns:** `Promise\u003cbigint\u003e` - Token balance in token's smallest unit\n\n**Example:**\n```javascript\n// Get USDT balance (6 decimals)\nconst usdtBalance = await readOnlyAccount.getTokenBalance('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')\nconsole.log('USDT balance:', Number(usdtBalance) / 1e6)\n```\n\n##### `verify(message, signature)`\nVerifies a message signature using the account's Ed25519 public key.\n\n**Parameters:**\n- `message` (string): Original message\n- `signature` (string): Signature as hex string\n\n**Returns:** `Promise\u003cboolean\u003e` - True if signature is valid\n\n**Example:**\n```javascript\nconst isValid = await readOnlyAccount.verify('Hello Solana!', signature)\nconsole.log('Signature valid:', isValid)\n```\n\n##### `quoteSendTransaction(tx)`\nEstimates the fee for a Solana transaction without broadcasting it.\n\n**Parameters:**\n- `tx` (object): The transaction object\n  - `recipient` (string): Recipient's public key (base58-encoded)\n  - `value` (number | bigint): Amount in lamports\n  - `commitment` (string, optional): Commitment level\n\n**Returns:** `Promise\u003c{fee: bigint}\u003e` - Object containing estimated fee (in lamports)\n\n**Example:**\n```javascript\nconst quote = await readOnlyAccount.quoteSendTransaction({\n  recipient: '11111111111111111111111111111112',\n  value: 1000000000n, // 1 SOL in lamports\n  commitment: 'confirmed'\n})\nconsole.log('Estimated fee:', quote.fee, 'lamports')\nconsole.log('Estimated fee in SOL:', Number(quote.fee) / 1e9)\n```\n\n##### `quoteTransfer(options)`\nEstimates the fee for an SPL token transfer without broadcasting it.\n\n**Parameters:**\n- `options` (object): Transfer options\n  - `token` (string): Token mint address (base58-encoded)\n  - `recipient` (string): Recipient's public key (base58-encoded)\n  - `amount` (number | bigint): Amount in token's smallest unit\n  - `commitment` (string, optional): Commitment level\n\n**Returns:** `Promise\u003c{fee: bigint}\u003e` - Object containing estimated fee (in lamports)\n\n**Example:**\n```javascript\nconst quote = await readOnlyAccount.quoteTransfer({\n  token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // USDT\n  recipient: '11111111111111111111111111111112',\n  amount: 1000000n, // 1 USDT (6 decimals)\n  commitment: 'confirmed'\n})\nconsole.log('Estimated transfer fee:', quote.fee, 'lamports')\nconsole.log('Estimated fee in SOL:', Number(quote.fee) / 1e9)\n```\n\n## 🌐 Supported Networks\n\nThis package works with the Solana blockchain, including:\n\n- **Solana Mainnet Beta**\n  - RPC: https://api.mainnet-beta.solana.com\n  - Explorer: https://explorer.solana.com\n- **Solana Testnet**\n  - RPC: https://api.testnet.solana.com\n  - Explorer: https://explorer.solana.com?cluster=testnet\n- **Solana Devnet**\n  - RPC: https://api.devnet.solana.com\n  - Explorer: https://explorer.solana.com?cluster=devnet\n\n## 🔒 Security Considerations\n\n- **Seed Phrase Security**: Always store your seed phrase securely and never share it\n- **Private Key Management**: The package handles private keys internally with Ed25519 memory safety features\n- **Provider Security**: \n  - Use trusted RPC endpoints\n  - Consider running your own Solana validator for production\n  - Be aware of rate limits on public RPC endpoints\n- **Transaction Validation**:\n  - Always validate transaction details before signing\n  - Verify recent blockhash is not expired\n  - Check commitment levels for finality\n- **Memory Cleanup**: Use the `dispose()` method to clear private keys from memory when done\n- **Fee Limits**: \n  - Set `transferMaxFee` to prevent excessive transaction fees\n  - Account for rent-exempt minimums in transfers\n- **Token Safety**:\n  - Verify token mint addresses carefully\n  - Check token decimals before transfers\n  - Be aware of Associated Token Account creation costs\n- **Program Interaction**:\n  - Validate program IDs before interaction\n  - Understand instruction data formats\n  - Test complex transactions in devnet first\n\n## 🛠️ Development\n\n### Building\n\n```bash\n# Install dependencies\nnpm install\n\n# Build TypeScript definitions\nnpm run build:types\n\n# Lint code\nnpm run lint\n\n# Fix linting issues\nnpm run lint:fix\n```\n\n### Testing\n\n```bash\n# Run tests\nnpm test\n\n# Run tests with coverage\nnpm run test:coverage\n```\n\n\n## 📜 License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 🆘 Support\n\nFor support, please open an issue on the GitHub repository.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fwdk-wallet-solana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fwdk-wallet-solana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fwdk-wallet-solana/lists"}