Getting Started
Install and instantiate the WDK Core module.
This guide explains how to install the @tetherto/wdk package and create a new instance to start managing your wallets.
1. Installation
Prerequisites
Before you begin, ensure you have the following installed:
Install Package
To install the WDK Core package, run the following command in your terminal:
npm install @tetherto/wdkThis package allows you to manage different blockchain wallets and protocols through a single interface.
2. Instantiation
To use WDK, you must create an instance of the WDK class. This instance acts as the central manager for all your wallets and protocols.
Import the Module
First, import the WDK class from the package:
import WDK from '@tetherto/wdk'Initialize WDK
You can initialize WDK in two ways: with a new seed phrase or an existing one.
Generate a New Wallet
If you are creating a fresh wallet for a user, use the static getRandomSeedPhrase() method to generate a secure mnemonic.
// 1. Generate a secure random seed phrase
// Generate 24-word seed phrase for higher security
const seedPhrase = WDK.getRandomSeedPhrase(24)
// Or use 12-word seed phrase (default)
// const seedPhrase = WDK.getRandomSeedPhrase()
// 2. Initialize the WDK instance with the new seed
const wdk = new WDK(seedPhrase)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.
Restore an Existing Wallet
If a user already has a seed phrase (e.g., from a previous session or another wallet), you can pass it directly to the constructor.
// Replace this string with the user's actual seed phrase
const existingSeed = 'witch collapse practice feed shame open despair creek road again ice ...'
const wdk = new WDK(existingSeed)Next Steps
With your WDK instance ready, you can now register wallet modules to interact with specific blockchains like Ethereum, TON, or Bitcoin.