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.
| 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. |
npm install
npm run dev # tsx watch src/index.ts
npm run build # tsc → dist/
npm start # node dist/index.jsOptional environment variables:
ETH_RPC_URL— Ethereum JSON-RPC URL (default insrc/config.ts).DEBUG_WDK=1— verbose errors for quotes.WDK_SEND_ETH_MAINNET=1— allow live mainnet ETHsendTransaction(disabled by default).
Running a production build and starting the app:
npm run build
node dist/index.jsTypical console output (addresses and fees will differ each run):
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=1andETH_RPC_URLin Install & scripts. - Do not publish real seed phrases; redact them in screenshots you share.
| 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). |
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 WalletManagerSolanais not assignable totypeof 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.
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 auditfor actionable security fixes (may suggest breaking bumps).
