WDK logoWDK documentation

API Reference

Complete WDK CLI beta.6 command and option reference

This page documents the 54 leaf commands in @tetherto/wdk-cli@1.0.0-beta.6. Run wdk COMMAND --help to inspect the installed command surface.

Root Options

OptionBehavior
--jsonRequests machine-readable output from the selected command; see JSON and exit behavior for exceptions
--verboseAdds a stack trace to handled errors; it does not enable general debug logging
-V, --versionPrints the CLI version followed by the installed WDK dependency versions
-h, --helpPrints help for the selected command

The WDK-specific global flags are --json and --verbose; version and help are also root options. Options such as --wallet and --index belong to individual commands.

Shared Wallet Selection

Wallet-dependent read, message, send, swap, bridge, buy, and sell commands use:

OptionBehavior
--wallet <name>Uses the named wallet; otherwise uses defaultWallet
--index <n>Uses a non-negative account index; otherwise uses defaultIndex, initially 0

The selected wallet must be unlocked before daemon-backed operations. See Manage Wallets.

Wallet Commands

wdk wallet create

Creates a named wallet from a newly generated BIP-39 seed phrase.

OptionRequiredDefaultDescription
--name <name>Yes—Wallet name
--words <count>No12Seed length; accepts 12 or 24

The first created wallet becomes the default. The command prompts for a passphrase and prints the seed phrase. With --json, the success object also contains seedPhrase.

wdk wallet import

Imports an existing 12-word or 24-word BIP-39 seed phrase.

OptionRequiredDescription
--name <name>YesWallet name
--seed-stdinNoRead one trimmed seed-phrase line from standard input instead of prompting

Without --seed-stdin, the command prompts for the seed phrase and a new storage passphrase. With --seed-stdin, a piped run must also set WDK_PASSPHRASE, because the same input stream cannot answer the passphrase prompt. The seed is never accepted as a command-line argument.

wdk wallet export

Decrypts and prints a wallet's seed phrase.

OptionRequiredDescription
--name <name>YesWallet name

With --json, the success object contains seedPhrase.

The output from wallet create and wallet export is secret material in both text and JSON modes. Do not log it, paste it into an agent transcript, or store it in CI output.

wdk wallet list

Lists local wallets with their default, lock, and TTL state. This command has no command-specific options.

wdk wallet delete

Deletes a named wallet after verifying its passphrase.

OptionRequiredDescription
--name <name>YesWallet name

If the deleted wallet was the default, the CLI selects the first remaining wallet as the new default. See Manage Wallets for the deletion and backup implications.

wdk wallet unlock

Unlocks a wallet and starts the daemon when needed.

OptionRequiredDefaultDescription
--name <name>Yes—Wallet name
--ttl <minutes>No5Non-negative session duration in minutes; 0 disables automatic expiry

Unlocking an already unlocked wallet resets that wallet's timer. The timer is absolute from unlock or reset; wallet activity does not extend it.

wdk wallet lock

Locks one wallet or every wallet.

OptionRequiredDescription
--name <name>One selector requiredWallet to lock
--allOne selector requiredLock every wallet

If both selectors are present, beta.6 applies --all.

wdk wallet default

Sets the default wallet after passphrase confirmation.

OptionRequiredDescription
--name <name>YesExisting wallet name

wdk wallet rename

Renames a wallet after verifying its passphrase. An unlocked source wallet is locked first.

OptionRequiredDescription
--name <name>YesCurrent wallet name
--new-name <name>YesNew wallet name

wdk wallet change-passphrase

Decrypts a wallet with its current passphrase, rewrites seed.enc with a new passphrase, and then attempts to lock that wallet's daemon session.

OptionRequiredDescription
--name <name>YesExisting wallet name
--new-passphrase-stdinNoRead one trimmed new-passphrase line from standard input instead of prompting and confirmation

Interactive use prompts for the current passphrase, then asks for and confirms the new passphrase. WDK_PASSPHRASE may supply only the current passphrase; it is deliberately ignored for the new passphrase. A piped --new-passphrase-stdin run must set WDK_PASSPHRASE and rejects an empty new passphrase.

Read Commands

wdk get address

Derives an address for one network or for a network group.

OptionRequiredDefaultDescription
--network <network>One selector required—Derive one network address
--allOne selector required—Derive addresses for all mainnets by default
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index
--testnetNoOffWith --all, select testnets instead of mainnets

When both --network and --all are supplied, beta.6 runs the single-network path. In aggregate mode, networks that fail address derivation are omitted from the result.

wdk get balance

Reads one registered asset balance or native balances across a network group.

OptionRequiredDefaultDescription
--network <network>One selector required—Query one network
--allOne selector required—Query native balances on all mainnets by default
--token <token>NoNative assetRegistered ticker for a single-network query
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index
--testnetNoOffWith --all, select testnets instead of mainnets

--token is ignored by the aggregate path, which queries native assets. Networks that fail in aggregate mode are omitted. A missing price produces a USD value of 0 rather than failing the balance lookup.

Single-network balance results include the account address. Aggregate balance entries also include their account address.

wdk get history

Reads token-transfer history through the configured indexer.

OptionRequiredDefaultDescription
--network <network>Yes—Network to query
--token <token>NoAll indexer-supported tokensExact metadata.indexerSlug code; the installed registry yields btc, usdt, and xaut, while custom entries can add other codes
--limit <n>No30Positive maximum number of transfers
--from-date <date>No—ISO 8601 start date
--to-date <date>No—ISO 8601 end date
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index

When --token is omitted, beta.6 batches the network's supported token requests, ignores failed batch items, merges successful transfers by timestamp, and then applies --limit.

wdk get transaction

Reads a normalized transaction receipt, optionally waiting for a finality target.

OptionRequiredDefaultDescription
--network <network>YesNoneNetwork containing the transaction
--hash <hash>YesNoneNon-empty transaction hash
--finality <target>NoCurrent receiptWait for confirmed or final
--timeout <ms>No150000 with --finalityPositive wait budget in milliseconds; valid only with --finality
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index

Without --finality, the command calls the account's current transaction lookup and returns without waiting for a later state. With --finality, it waits until the target, a dropped transaction, or the timeout. The text view shows the common receipt fields; use --json for the full module-specific receipt. Every returned bigint is serialized as a decimal string.

Send Command

wdk send

Previews or broadcasts a native or registered-token transfer.

OptionRequiredDefaultDescription
--network <network>Yes—Network to send on
--to <address>Yes—Recipient address
--amount <value>Yes—Positive decimal amount, or an integer when --base-units is set
--token <token>NoNative assetRegistered token ticker
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index
--base-unitsNoOffTreat --amount as raw base units
--dry-runNoOffEstimate fees and return a preview without broadcasting

Use --dry-run before broadcasting:

Terminal
wdk send \
  --network ethereum \
  --to 0x000000000000000000000000000000000000dEaD \
  --amount 0.001 \
  --dry-run

Without --dry-run, the command broadcasts immediately. There is no additional interactive confirmation.

Before either fee estimation or broadcast, beta.6 validates the recipient against the selected built-in network's CAIP-2 address rules. A format or mainnet/testnet mismatch fails with INVALID_ADDRESS after the unlocked-wallet check but before the estimate or send request. A custom network without a supported CAIP-2 validator is left to its wallet module for final validation.

Send previews and execution results include from, the sender address.

Message Commands

Both message commands require an unlocked wallet. They use the selected account's signing and verification methods.

wdk message sign

OptionRequiredDefaultDescription
--network <network>YesNoneNetwork whose account key signs the message
--message <message>YesNoneNon-empty message to sign
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index

Signing happens immediately. The command has no dry run, confirmation prompt, or second passphrase check. A signature can authorize actions on some chains, so review the exact message, network, wallet, and account index before running it.

The result includes the network, account index, signer address, original message, and signature.

wdk message verify

OptionRequiredDefaultDescription
--network <network>YesNoneNetwork whose account key verifies the message
--message <message>YesNoneOriginal signed message
--signature <signature>YesNoneSignature to verify
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index

The result reports valid: true or valid: false for that account, message, and signature.

Message verification results include the checked account address alongside valid.

Swap Command

wdk swap

Quotes or executes a token swap. Same-network swaps are the documented beta.6 path; see the warning below before using the accepted cross-network option.

OptionRequiredDefaultDescription
--network <network>YesNoneSource network
--from-token <token>YesNoneRegistered source token
--to-token <token>YesNoneRegistered destination token
--amount-in <value>One amount requiredNoneExact decimal amount to sell
--amount-out <value>One amount requiredNoneExact decimal amount to receive
--to-network <network>NoSource networkAccepted destination network; unsafe in beta.6 because same-chain candidates can receive no destination
--recipient <address>NoSelected accountDestination-network recipient
--protocol <name>NoBest routeRestrict quoting to one enabled provider name from wdk provider list
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index
--dry-runNoOffQuote without executing

Provide exactly one of --amount-in and --amount-out. Exact-input routing selects the successful quote with the highest output. Exact-output routing selects the quote with the lowest input. Separate gas and bridge fees are displayed but excluded from ranking because their denomination and inclusion differ between protocol types. Failed quote attempts appear under skipped when another protocol succeeds.

Without --dry-run, wdk swap executes immediately. Execution requests fresh quotes. Unless --protocol is set, the provider can change; amounts and fees can change even when it is set. Beta.6 exposes no CLI option that binds a minimum output, maximum input, fee, slippage limit, or expiry to the preview, and there is no daemon confirmation step.

Do not use --to-network for a beta.6 swap. Candidate selection can admit a same-chain swap provider, and the swap adapter omits the destination network from that provider's quote and execution options.

If --recipient is omitted, the daemon derives an address on the destination network from the selected wallet and the same account index. The preview includes the sender in from, but does not include that recipient, wallet, or index. Select all three explicitly and verify the destination address with wdk get address --network NETWORK --wallet WALLET --index INDEX before previewing.

Velora beta.6 requires a prior allowance when the input is an ERC-20 token. Beta.6 does not approve automatically or expose the provider spender. Resolve the chain-specific spender with Velora SDK 9's swap.getSpender() lookup, approve a bounded base-unit amount through the catalog-declared wallet method, verify a confirmed receipt with success: true, and read the allowance again. Native-token input has no ERC-20 allowance, and other protocols can manage approval differently. See Call Module Methods.

Use wdk provider list to discover provider names and wdk provider info to inspect effective configuration. Package installation with wdk module add and provider registration with wdk provider add are separate operations. See Swap and Bridge for the complete workflow.

Bridge Command

wdk bridge

Quotes or executes an exact-input transfer of the same registered token between different networks.

OptionRequiredDefaultDescription
--network <network>YesNoneSource network
--token <token>YesNoneRegistered token on both networks
--to-network <network>YesNoneDifferent destination network
--amount <value>YesNoneExact decimal input amount
--recipient <address>NoSelected accountDestination-network recipient
--protocol <name>NoBest routeRestrict quoting to one enabled provider name from wdk provider list
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index
--dry-runNoOffQuote without executing

The source and destination networks must differ. The omitted-recipient behavior, preview identity omission, ranking, skipped-protocol reporting, fresh execution quote, lack of CLI bounds relative to the preview, and immediate-execution warning are the same as for wdk swap.

Fiat Ramp Commands

wdk buy and wdk sell derive the selected wallet address and print a signed provider URL to open in a browser. Both require an unlocked wallet and valid MoonPay configuration.

wdk buy

OptionRequiredDefaultDescription
--network <network>Yes—Network to receive the asset on
--token <token>Yes—Registered asset code
--fiat-amount <value>One amount required—Fiat amount to spend
--crypto-amount <value>One amount required—Crypto amount to buy
--fiat-currency <currency>NousdFiat currency code
--module <module>NomoonpayFiat provider module
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index

wdk sell

OptionRequiredDefaultDescription
--network <network>Yes—Network holding the asset
--token <token>Yes—Registered asset code
--fiat-amount <value>One amount required—Target fiat amount
--crypto-amount <value>One amount required—Crypto amount to sell
--fiat-currency <currency>NousdFiat currency code
--module <module>NomoonpayFiat provider module
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index

For each command, provide exactly one of --fiat-amount and --crypto-amount. Beta.6 supports only the moonpay module.

Configuration Commands

See Configuration for keys, types, precedence, and storage considerations.

wdk config get

OptionRequiredDescription
--key <key>One selector requiredRead one dot-separated key
--network <network>One selector requiredRead a network object, or scope --key to a network
--allOne selector requiredRead the configuration view

--all cannot be combined with --key or --network. --network and --key can be combined.

wdk config set

OptionRequiredDescription
--value <value>YesJSON value when parseable; otherwise a string
--key <key>Without --networkDot-separated key
--network <network>NoScope --key, or replace the network's entire configuration object

wdk config reset

OptionRequiredDescription
--key <key>One selector requiredReset or remove one key
--network <network>NoScope --key to a network
--allOne selector requiredReset configuration while preserving the default wallet and custom network/token/provider records

--key and --all are mutually exclusive. --network can be combined only with --key.

wdk config path

Prints the resolved config.json path. This command has no command-specific options.

Network Commands

wdk network list

OptionDefaultDescription
--testnetOffShow only testnets
--mainnetOffShow only mainnets

With neither option, the command shows enabled networks and networks disabled directly. Networks hidden by a disabled module are omitted; re-enable their module first. If both are provided, beta.6 applies --testnet.

wdk network create <data>

Creates a custom network from an inline JSON object or a JSON file path. The <data> positional argument is required.

See Custom Networks for the network schema and validation rules.

wdk network delete

OptionRequiredDescription
--name <name>YesCustom network to delete

Built-in networks cannot be deleted. Deleting a custom network also removes its network configuration and custom token entries.

wdk network info

OptionRequiredDescription
--network <network>YesRegistered network to inspect

wdk network enable

Enable a built-in or custom network with required --name <name>. If its module is disabled, enable that module first. Enabling an orphaned override clears it.

wdk network disable

Disable a network with required --name <name>. This hides its tokens from normal token listings and prevents operations on the network. Both network toggles verify the default wallet passphrase when a wallet exists and lock a running daemon; unlock again to apply the registry change.

Token Commands

wdk token list

OptionDefaultDescription
--network <network>All networksFilter to one registered network

wdk token info

OptionRequiredDescription
--network <network>YesRegistered network
--token <token>YesRegistered token ticker

wdk token add <data>

Adds or overrides a token from an inline JSON object or a JSON file path. The <data> positional argument is required.

See Manage Tokens for the token schema and built-in override behavior.

wdk token delete

OptionRequiredDescription
--network <network>YesRegistered network
--token <token>YesCustom token ticker to delete

The command removes only a custom entry. If that entry overrides a built-in token, the built-in entry becomes effective again.

wdk token enable

Enable a token with required --network <network> and --token <token>. The network must be enabled. Enabling an orphaned token override clears it.

wdk token disable

Disable a built-in or custom token with required --network <network> and --token <token>. The registry entry stays stored. Both token toggles verify the default wallet passphrase when a wallet exists and lock a running daemon. Listing includes tokens disabled directly, but omits tokens whose network is disabled.

Wallet Module Method Commands

These commands expose chain-specific methods declared in the built-in module catalog. They do not discover arbitrary methods from a custom package at runtime.

wdk method list

Provide exactly one selector:

OptionRequiredDescription
--network <network>One of the two selectorsList the methods declared for the registered network's wallet module
--allOne of the two selectorsList every built-in module that declares methods

Each method entry reports its name, read or write kind, and required and optional parameters. Listing methods does not require an unlocked wallet.

wdk method call

OptionRequiredDefault or behavior
--network <network>YesRegistered network whose wallet module declares the method
--name <name>YesExact method name returned by wdk method list
--wallet <name>NoDefault wallet
--index <n>NoConfigured defaultIndex, then 0
--PARAM <value>As declaredOne flag for each declared method parameter; camel-case names become kebab-case flags

Scalar parameters accept string, number, boolean, or non-negative decimal bigint values. Pass scalar arrays as comma-separated values and structured parameters as JSON strings. Represent every bigint inside JSON as a quoted decimal string. Unknown, missing, or malformed parameters fail before the method reaches the daemon. Returned bigint values are serialized as decimal strings. JSON output contains { network, method, address, result }; address identifies the account that ran the method.

A method marked write can move funds or mutate state. wdk method call has no dry-run or confirmation prompt. Review the exact method and arguments, then call it only after explicit approval while the intended wallet is unlocked.

See Call Module Methods for examples and the write-method safety boundary.

Module Package Commands

wdk module list

Lists built-in and custom modules with their pinned version, installed version, status, and source. Statuses are ok, not installed, version mismatch, disabled, and stale override. A version override also exposes defaultVersion. This command has no command-specific options and does not require an unlocked wallet.

wdk module add

OptionRequiredDescription
--name <package>Yesnpm package name, optionally followed by a version string; use a reviewed literal version, not a tag or range

For a new custom package, omitting the version resolves npm's current version once. A supplied suffix is stored verbatim, so use a reviewed exact version rather than an accepted tag or range. To change an existing custom pin, remove it first. For a built-in package, supply an explicit version different from its current configured pin; the command records an override of the catalog version.

The command verifies the default wallet passphrase when a wallet exists, locks a running daemon, runs npm install --no-save PACKAGE@VERSION inside the CLI installation, and records the pin under customModules in config.json. A custom package registered but missing or mismatched on disk can be repaired by running module add again without changing its pin. Built-in overrides are stored under overrides.modules. Adding the current built-in pin is rejected even if its package is missing; reinstall the exact CLI version to repair a missing default package.

wdk module remove

OptionRequiredDescription
--name <package>YesCustom package to remove, or built-in package whose version override should be cleared

The command verifies the default wallet passphrase when a wallet exists, locks a running daemon, removes the custom-module record, and runs npm uninstall --no-save. For a built-in package with a version override, it instead clears the override and reinstalls the catalog version. It rejects a built-in package with no version override.

Adding or removing a package runs npm and can execute package lifecycle scripts; an added default export can later run inside the wallet daemon with access to unlocked accounts. Audit the exact package and version before adding it. Beta.6 only warns about a configured/installed version mismatch and still loads the installed package. Delete custom networks that depend on a module before removing that module.

Unset WDK_PASSPHRASE before module add or module remove and use the hidden interactive prompt. Beta.6 passes its environment to npm, so install or uninstall lifecycle scripts can otherwise inherit the wallet passphrase.

See Manage Modules for the trust boundary, repair behavior, and custom-network workflow.

wdk module enable

Enable a module with required --name <package>. Enabling an orphaned module override clears it. It does not install a missing package.

wdk module disable

Disable a module with required --name <package>. Its networks and providers become unavailable. Both module toggles verify the default wallet passphrase when a wallet exists and lock a running daemon. module list retains disabled modules and stale overrides so they can be inspected.

Provider Commands

Providers register installed modules for swap, bridge, or Swidge routing. These commands are available through the CLI, not as MCP tools.

wdk provider list

List names, kind, backing module, source, and enabled status. JSON output is { providers, count }. Providers disabled directly remain listed; providers hidden by a disabled module are omitted.

wdk provider info

Inspect a provider with required --name <name>. Returns its registry fields, merged general config, and effective per-network networks configuration, including disabled entries.

wdk provider add

Register a provider from an inline JSON object or JSON file path. The <data> argument is required.

FieldRequiredDescription
nameYesUnused lowercase alphanumeric name with optional hyphens; must start with a letter or digit
kindYesswap, bridge, or swidge
moduleYesRegistered and installed module package
configNoGeneral module configuration object
networksNoMap of network names to configuration overrides

The command verifies the default wallet passphrase when a wallet exists, imports the module to check its declared kind, saves the provider, and locks a running daemon. Importing executes package code: register only a package you have reviewed. The kind check is not a safety or chain-compatibility check. Adding a provider does not install its module.

wdk provider delete

Delete a custom provider with required --name <name>. Built-in providers cannot be deleted. This removes the registration, its configuration overrides, and its enable/disable override; the module package remains installed.

wdk provider enable

Enable a provider with required --name <name>. If its module is disabled, enable that module first. Enabling an orphaned provider override clears it.

wdk provider disable

Disable a provider with required --name <name> while retaining its registration. Delete, enable, and disable verify the default wallet passphrase when a wallet exists and lock a running daemon. Mutation JSON includes walletsLocked; unlock again to use the changed registry.

MCP Setup Commands

The accepted --ai-tool values are claude-desktop, claude-code, and openclaw.

wdk mcp setup

Adds the bundled MCP server to the selected client. --ai-tool <name> is required.

wdk mcp remove

Removes the bundled MCP server from the selected client. --ai-tool <name> is required.

wdk mcp verify-setup

Checks the selected client's configuration and tests the MCP server. --ai-tool <name> is required.

wdk mcp list

Shows setup status for all supported clients. This command has no command-specific options.

See Use the MCP Server for client-specific setup and the exposed tool surface.

JSON and Exit Behavior

Most command handlers print one JSON value to stdout when --json is set. The current contract has exceptions:

  • wdk mcp setup, remove, verify-setup, and list print human-readable success output even with --json.
  • Help and version output remains human-readable text. With --json, unknown commands, unknown options, missing required options, and invalid option values return an INVALID_ARGUMENT JSON envelope on stdout with status 1.
  • Interactive wallet prompts render on stdout. If a wallet command opens a prompt, prompt text and terminal-control bytes can precede any JSON result. Use wallet import --seed-stdin with WDK_PASSPHRASE for a non-interactive import.
  • wdk send --json suppresses its progress spinner and completion text; command errors and results remain on stdout as JSON.
  • A non-empty WDK_PASSPHRASE produces a notice on stderr.

Parse stdout separately from stderr and always check the exit status. See Handle Errors for the error envelope and exit-status contract.


Need Help?

On this page