WDK logoWDK documentation

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:

  • Node.js: version 18 or higher.
  • npm: usually comes with Node.js.

Install Package

Install @tetherto/wdk-wallet-solana
npm install @tetherto/wdk-wallet-solana

2. Create a Wallet

Import the module and create a WalletManagerSolana instance with a BIP-39 seed phrase and a Solana RPC endpoint.

Create Solana Wallet
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.

Get Account
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.

On this page