WDK is a modular plug-in framework designed to simplify multi-chain wallet development. This package orchestrates all WDK modules.
WDK is a modular plug-in framework designed to simplify multi-chain wallet development. This package orchestrates all WDK modules.
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.
This module is part of the WDK (Wallet Development Kit) project, 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.
npm install @tetherto/wdk…PolicyViolationErrorsRegister policies on a WDK instance to gate write-facing operations on every wallet account. Each registered rule can ALLOW or DENY an attempted operation based on a condition function; matching DENYs throw a PolicyViolationError before the underlying method runs.
…javascript
// Before conditions: [({ params }) => params.to === '0x…']
// After conditions: [({ args }) => args[0].to === '0x…']
…js import { DEFAULT_POLICY_EXCLUSIONS } from '@tetherto/wdk'
…javascript const wdk = new WDK(seedPhrase, { policyExclusions: ['syncWalletBalance'] })
wdk.getPolicyExclusions() // frozen readonly string[] — defaults ∪ yours
…javascript wdk.registerPolicy({ id: 'permissive-baseline', name: 'Permissive baseline', scope: 'project', rules: [ { name: 'allow-all', operation: '*', action: 'ALLOW', conditions: [] }, { name: 'block-bad', operation: 'sendTransaction', action: 'DENY', conditions: [({ args }) => isSanctioned(args[0].to)] } ] })
…javascript try { await account.swap({ /* … */ }) } catch (err) { if (err.code === 'NO_APPLICABLE_RULE') { // Nothing allows swaps yet — add a rule or a catch-all baseline. } }
Both default-deny codes produce an error message that names the cause, explains why the engine denies unmatched operations, and includes the catch-all snippet above ready to paste. A `RULE_DENIED` error keeps the terse `Policy violation: /: ` form — you wrote that rule and know what it means.
The engine wraps accounts through an ES `Proxy` so internal SDK code that uses `this.method()` naturally bypasses enforcement — nested-call escape (e.g. `bridge` internally calling `sendTransaction`) works without any async-context tracking. The same code path runs on every JavaScript runtime that supports `Proxy`, including Bare.
Policy enforcement applies to the **surface of the proxy** returned by `getAccount` / `getAccountByPath`. Reaching for underscore-prefixed fields (e.g. `protocol._account`) bypasses enforcement by design — treat them as private. The same applies to account-level operations invoked from inside a protocol's own methods (e.g. `bridge.bridge(...)` internally calling `this._account.sendTransaction(...)`), which is the documented nested-call escape; it lets protocols use the account they were constructed with without re-entering the engine on every internal step.
## 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](https://docs.wdk.tether.io/sdk/core-module) |
| Usage | End-to-end integration walkthrough | [WDK Core Usage](https://docs.wdk.tether.io/sdk/core-module/usage) |
| Configuration | Wallet registration and manager configuration | [WDK Core Configuration](https://docs.wdk.tether.io/sdk/core-module/configuration) |
| API Reference | Complete class and type reference | [WDK Core API Reference](https://docs.wdk.tether.io/sdk/core-module/api-reference) |
## Examples
| Example | Description |
|---------|-------------|
| [Getting Started](https://github.com/tetherto/wdk-examples/blob/main/wdk/getting-started.ts) | Generate a seed phrase, validate it, and create a WDK instance |
| [Register Wallets](https://github.com/tetherto/wdk-examples/blob/main/wdk/register-wallets.ts) | Register Solana, TON, and TRON wallet managers in one WDK instance |
| [Manage Accounts](https://github.com/tetherto/wdk-examples/blob/main/wdk/manage-accounts.ts) | Retrieve accounts by index and path and inspect multi-chain balances |
| [Send Transactions](https://github.com/tetherto/wdk-examples/blob/main/wdk/send-transactions.ts) | Quote and optionally send native transactions across multiple chains |
| [Middleware](https://github.com/tetherto/wdk-examples/blob/main/wdk/middleware.ts) | Register middleware and inspect account access hooks |
| [Error Handling](https://github.com/tetherto/wdk-examples/blob/main/wdk/error-handling.ts) | Handle missing registrations and dispose selected wallets safely |
> For detailed walkthroughs, see the [Usage Guide](https://docs.wdk.tether.io/sdk/core-module/usage).
> See all runnable examples in the [wdk-examples](https://github.com/tetherto/wdk-examples) repository.
## Community
Join the [WDK Discord](https://discord.gg/arYXDhHB2w) to connect with other developers.
## Support
For support, please [open an issue](https://github.com/tetherto/wdk/issues) on GitHub or reach out via [email](mailto:[email protected]).
## 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](LICENSE) file for details.No open issues yet, or sync has not completed.