Getting Started
Install and create your first Solana wallet.
This guide explains how to install the @tetherto/wdk-wallet-solana package and create a new wallet instance.
1. Installation
Prerequisites
Before you begin, ensure you have the following installed:
Install Package
npm install @tetherto/wdk-wallet-solana2. Create a Wallet
Import the module and create a WalletManagerSolana instance with a BIP-39 seed phrase and a Solana RPC endpoint.
import WalletManagerSolana, {
WalletAccountSolana,
WalletAccountReadOnlySolana
} from '@tetherto/wdk-wallet-solana'
const seedPhrase = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'
const wallet = new WalletManagerSolana(seedPhrase, {
rpcUrl: 'https://api.mainnet-beta.solana.com',
commitment: 'confirmed' // Optional: commitment level
})Secure the Seed Phrase: You must securely store this seed phrase immediately. If it is lost, the user will permanently lose access to their funds.
3. Get Your First Account
Retrieve an account from the wallet and inspect its address.
const account = await wallet.getAccount(0)
const address = await account.getAddress()
console.log('Wallet address:', address)
const readOnlyAccount = await account.toReadOnlyAccount()All Solana addresses are base58-encoded public keys. Accounts inherit the provider configuration from the wallet manager.
Next Steps
With your wallet ready, learn how to manage multiple accounts.