WDK logoWDK documentation

API Reference

Complete WDK CLI beta.5 command and option reference

This page documents the 42 leaf commands in @tetherto/wdk-cli@1.0.0-beta.5. 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>YesWallet 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>YesWallet 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.5 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 requiredDerive one network address
--allOne selector requiredDerive 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.5 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 requiredQuery one network
--allOne selector requiredQuery 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.

wdk get history

Reads token-transfer history through the configured indexer.

OptionRequiredDefaultDescription
--network <network>YesNetwork 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>NoISO 8601 start date
--to-date <date>NoISO 8601 end date
--wallet <name>NoDefault walletWallet selection
--index <n>NoConfigured index, initially 0Non-negative account index

When --token is omitted, beta.5 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>YesNetwork to send on
--to <address>YesRecipient address
--amount <value>YesPositive 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.5 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.

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.

Swap Command

wdk swap

Quotes or executes a token swap. Same-network swaps are the documented beta.5 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.5 because same-chain candidates can receive no destination
--recipient <address>NoSelected accountDestination-network recipient
--protocol <name>NoBest routeRestrict quoting to one short key in the exact installed catalog; beta.5 has no protocol-list command
--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.5 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.5 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 output 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.5 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.

Beta.5 has no protocol-list command or MCP tool. Read the protocols object in its exact released catalog and compare it with the installed wdk.config.json; wdk module list does not list routing keys. wdk module add cannot add a routing entry or repair a built-in package. Reinstall @tetherto/wdk-cli@1.0.0-beta.5 if a built-in dependency is missing. 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 short key in the exact installed catalog; beta.5 has no protocol-list command
--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>YesNetwork to receive the asset on
--token <token>YesRegistered asset code
--fiat-amount <value>One amount requiredFiat amount to spend
--crypto-amount <value>One amount requiredCrypto 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>YesNetwork holding the asset
--token <token>YesRegistered asset code
--fiat-amount <value>One amount requiredTarget fiat amount
--crypto-amount <value>One amount requiredCrypto 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.5 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 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 every registered network. If both are provided, beta.5 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

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.

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.

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. 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

When no version is supplied, the command resolves npm's current version once and stores that exact pin. When a suffix is supplied, beta.5 stores it verbatim and does not require exact semver, so tags and ranges are accepted even though they are unsafe for artifact pinning. It refuses to replace a built-in module or change an existing custom value in place. Remove the custom module before selecting a different literal 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 packages are rejected; reinstall the exact CLI version to repair them.

wdk module remove

OptionRequiredDescription
--name <package>YesPreviously added custom package name

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. Built-in modules cannot be removed.

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.5 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.5 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.

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