Node.js & Bare Quickstart

Get started with WDK in Node.js or Bare runtime environments in 3 minutes

What You'll Build

In this quickstart, you'll create a simple application that:


Prerequisites

Before we start, make sure you have:

Tool
Version
Why You Need It

Node.js

20+

To run JavaScript code

npm

Latest

To install packages

Code Editor

Any

To write code

You can try all features without real funds required. You can use the Pimlico or Candide faucets to get some Sepolia USD₮.

Get mock/test USD₮ on Pimlico Get mock/test USD₮ on Candide

See the configuration for quick setup and Sepolia testnet configuration.


Step 1: Set Up Your Project

First, we need to create a folder and initialize the project

Then install necessary WDK modules

Learn more about WDK modules:


Step 2: Create Your First Wallet

Create a file called app.js:

Now, add the following code to generate a seed phrase:

Now, let's register wallets for different blockchains:


Step 3: Check Balances

To check balances, we first need to get accounts and addresses. Let's get accounts and addresses for all blockchains:

Now, let's check balances across all chains:

Here is the complete app.js file:


Step 4: Run Your App

Execute your app:

You should see an output similar to this:


What Just Happened?

Congratulations! You've successfully created your first multi-chain WDK application that works in both Node.js and Bare runtime environments. Here's what happened:


Next Steps

Now that you have a basic multi-chain wallet running, here's what you can explore:

Add More Blockchains

For example, to add Solana support:

Estimate Transaction Costs

Send Transactions

Use DeFi Protocols


Troubleshooting

Common Issues

"Provider not connected"

  • Check your API keys and network connections

  • Ensure you're using the correct provider URLs

"Insufficient balance"

  • This is normal for new addresses

  • Use testnet faucets to get test tokens

"Module not found"

  • Make sure you've installed all required packages

  • Check your import statements

Need more help?