Skip to content

enlomy/wdk-multi-chain-wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wdk-multi-chain-wallet

TypeScript playground for Tether WDK (@tetherto/wdk): one seed phrase, multiple chains (Ethereum, TRON, Bitcoin, Solana), optional Velora swap quotes (@tetherto/wdk-protocol-swap-velora-evm), fee quotes, and a gated mainnet ETH send demo.


Prerequisites

Tool Version / notes
Node.js 20+ recommended. WDK’s own quickstart targets modern Node (docs.wdk.tether.io/start-building/nodejs-bare-quickstart). Older Node (e.g. 18) may fail on some transitive native / runtime packages (e.g. Bare-related tooling).
npm Ships with Node; install dependencies with npm install. Yarn / pnpm can work if you regenerate the matching lockfile, but this repo is maintained with package-lock.json + npm.

Install & scripts

npm install
npm run dev    # tsx watch src/index.ts
npm run build # tsc → dist/
npm start     # node dist/index.js

Optional environment variables:

  • ETH_RPC_URL — Ethereum JSON-RPC URL (default in src/config.ts).
  • DEBUG_WDK=1 — verbose errors for quotes.
  • WDK_SEND_ETH_MAINNET=1 — allow live mainnet ETH sendTransaction (disabled by default).

Example output

Running a production build and starting the app:

npm run build
node dist/index.js

Typical console output (addresses and fees will differ each run):

wdk-multi-chain-wallet — terminal session after npm run build and node dist/index.js

Notes:

  • Bitcoin may show Unable to estimate — No unspent outputs until that address has received funds (no UTXOs yet).
  • Velora may show insufficient funds or RPC errors on an empty wallet or under rate limits; see DEBUG_WDK=1 and ETH_RPC_URL in Install & scripts.
  • Do not publish real seed phrases; redact them in screenshots you share.

Repository layout

Path Role
src/index.ts WdkMultiChainApp, wallet registration, quotes, gated send, main().
src/config.ts RPCs, Velora swap token addresses, chain list.
src/utils.ts Shared helpers (e.g. one-line error formatting).
docs/assets/ Documentation images (e.g. terminal screenshot).
package.json Direct dependencies and overrides (see below).

Why package.json has overrides

Different WDK npm packages declare different compatible ranges for @tetherto/wdk-wallet. npm can then install more than one physical copy of @tetherto/wdk-wallet (e.g. 1.0.0-beta.7 nested under @tetherto/wdk-wallet-solana, and 1.0.0-beta.8 at the project root).

In TypeScript, WalletManager from package instance A is not assignable to WalletManager from instance B, because private fields such as _seed are nominally typed per declaration site. Symptoms:

  • typeof WalletManagerSolana is not assignable to typeof WalletManager
  • “Types have separate declarations of a private property '_seed'`

The overrides section forces @tetherto/wdk-wallet@1.0.0-beta.8 everywhere in the tree, including subtrees pulled in via @tetherto/wdk-wallet-solana and @tetherto/wdk-wallet-evm-erc-4337 (brought in by @tetherto/wdk-protocol-swap-velora-evm). After changing overrides, rm -rf node_modules package-lock.json && npm install is the reliable reset if duplicates reappear.


npm deprecation messages (install warnings)

Installing may print warnings like:

npm warn deprecated @gelatonetwork/relay-sdk@5.7.0: This package is deprecated. Use @gelatocloud/gasless instead.
npm warn deprecated @velora-dex/sdk@9.0.0: 9.4.1

These come from transitive dependencies (not from direct entries in this package.json): Velora / account-abstraction tooling bundles older @gelatonetwork/relay-sdk and @velora-dex/sdk majors. Publishers recommend migrating Gelato callers to @gelatocloud/gasless and newer @velora-dex/sdk lines; @tetherto/wdk-protocol-swap-velora-evm would need a release aligned with those bumps.

Until upstream packages update:

  • Treat the warnings as informational.
  • Optionally run npm audit for actionable security fixes (may suggest breaking bumps).

Learning resources

About

Multi-chain WDK Playground — One seed phrase, EVM + Solana + TRON + Bitcoin. Includes swap quotes (Velora) and test transactions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors