Skip to content
项目

关于

Core wallet and protocol manager for WDK (Wallet Development Kit) by Tether.

商业与金融

这些数字如何统计

可以做什么

  • Wallet Registration: Register multiple blockchain wallet managers through one WDK instance
  • Unified Account Access: Retrieve accounts by chain, index, or derivation path through a consistent API
  • Multi-Chain Operations: Coordinate balances, fee lookups, and transaction flows across registered chains
  • Protocol Registration Support: Attach swap, bridge, lending, fiat, and swidge protocols to registered blockchains

实测星标增长

24小时
0
7天
+2
15天
+3
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

@tetherto/wdk

npm version npm downloads license docs

Note: This package is currently in beta. Please test thoroughly in development environments before using in production.

A flexible manager for orchestrating WDK wallet and protocol modules through a single interface. This package lets you register blockchain-specific wallet managers, derive accounts, and coordinate multi-chain wallet flows from one WDK instance.

About WDK

This module is part of WDK (Wallet Development Kit) by Tether, which empowers developers to build secure, non-custodial wallets with unified blockchain access, stateless architecture, and complete user control.

For detailed documentation about the complete WDK ecosystem, visit docs.wdk.tether.io.

Installation

npm install @tetherto/wdk

Quick Start

import WDK from '@tetherto/wdk'
import WalletManagerSolana from '@tetherto/wdk-wallet-solana'
import WalletManagerTon from '@tetherto/wdk-wallet-ton'
import WalletManagerTron from '@tetherto/wdk-wallet-tron'

const seedPhrase = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'

const wdk = new WDK(seedPhrase)
  .registerWallet('solana', WalletManagerSolana, {
    rpcUrl: 'https://api.devnet.solana.com',
    commitment: 'confirmed',
  })
  .registerWallet('ton', WalletManagerTon, {
    tonClient: { url: 'https://testnet.toncenter.com/api/v2/jsonRPC' },
  })
  .registerWallet('tron', WalletManagerTron, {
    provider: 'https://api.shasta.trongrid.io',
  })

const account = await wdk.getAccount('solana', 0)
const address = await account.getAddress()
console.log('Address:', address)

wdk.dispose()

Key Capabilities

  • Wallet Registration: Register multiple blockchain wallet managers through one WDK instance
  • Unified Account Access: Retrieve accounts by chain, index, or derivation path through a consistent API
  • Multi-Chain Operations: Coordinate balances, fee lookups, and transaction flows across registered chains
  • Protocol Registration Support: Attach swap, bridge, lending, fiat, and swidge protocols to registered blockchains
  • Middleware Hooks: Intercept account derivation with custom middleware
  • Seed Utilities: Generate and validate BIP-39 seed phrases
  • Selective Disposal: Dispose specific registered wallets or all of them

Middleware

registerMiddleware(blockchain, middleware) runs a function every time an account is retrieved, after its protocol getters are attached. The middleware receives the account and { blockchain, index, path }, and may return a replacement account, which later middlewares and the caller receive instead:

wdk.registerMiddleware('ethereum', async (account, { index }) => {
  console.log('account', index, 'retrieved')
  return account // or a wrapper around it; returning nothing keeps it
})

Transaction policies are no longer part of core. They live in @tetherto/wdk-policies, an opt-in package that installs itself through this hook.

Compatibility

  • WDK Wallet Modules including EVM, Solana, TON, TRON, and Bitcoin integrations
  • Protocol Modules registered through the WDK interface
  • Node.js and ESM-based applications that coordinate multiple wallet modules in one runtime

Documentation

Topic Description Link
Overview Module overview and feature summary WDK Core Overview
Usage End-to-end integration walkthrough WDK Core Usage
Configuration Wallet registration and manager configuration WDK Core Configuration
API Reference Complete class and type reference WDK Core API Reference

Examples

Example Description
Getting Started Generate a seed phrase, validate it, and create a WDK instance
Register Wallets Register Solana, TON, and TRON wallet managers in one WDK instance
Manage Accounts Retrieve accounts by index and path and inspect multi-chain balances
Send Transactions Quote and optionally send native transactions across multiple chains
Middleware Register middleware and inspect account access hooks
Error Handling Handle missing registrations and dispose selected wallets safely

For detailed walkthroughs, see the Usage Guide. See all runnable examples in the wdk-examples repository.

Community

Join the WDK Discord to connect with other developers.

Support

For support, please open an issue on GitHub or reach out via email.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

探索相关项目

加载中…