WDK logoWDK documentation

Configuration

Configure WDK CLI paths, defaults, indexer access, wallet modules, and fiat ramps

WDK CLI stores its configuration and wallet data under one local configuration directory. Use wdk config for supported changes instead of editing config.json directly.

Local Paths

The default configuration directory is ~/.config/wdk-cli. If XDG_CONFIG_HOME is a non-empty environment variable, WDK CLI uses $XDG_CONFIG_HOME/wdk-cli instead.

DataPath
User configurationCONFIG_DIR/config.json
Wallet seedCONFIG_DIR/wallets/NAME/seed.enc
Daemon PIDCONFIG_DIR/daemon.pid
Daemon socket on Unix-like systemsCONFIG_DIR/daemon.sock
Daemon endpoint on Windows\\.\pipe\wdk-cli-daemon

Print the resolved config.json path:

Terminal
wdk config path

With JSON output:

Terminal
wdk config path --json
{"path":"/home/user/.config/wdk-cli/config.json"}

See Storage Format for seed-file and daemon-file permissions.

Configuration Precedence

WDK CLI resolves runtime values in this order:

ValueHighest to lowest precedence
Configuration directoryNon-empty XDG_CONFIG_HOME, then ~/.config
WalletCommand --wallet, then defaultWallet
Account indexCommand --index, then defaultIndex, then 0
Indexer API keyNon-empty WDK_INDEXER_API_KEY, then stored indexer.apiKey, then an empty value
Wallet passphraseNon-empty WDK_PASSPHRASE, then a hidden interactive prompt

--wallet and --index are options on wallet-dependent commands; they are not root flags.

An empty WDK_PASSPHRASE value does not override the prompt. To use an empty passphrase, enter it interactively. See Manage Wallets before choosing an empty passphrase.

Environment Variables

VariableEffect
XDG_CONFIG_HOMEChanges the parent directory used for WDK CLI data
WDK_INDEXER_API_KEYOverrides indexer.apiKey for the current process
WDK_PASSPHRASESupplies a non-empty passphrase instead of opening a prompt

There are no beta.1 environment-variable mappings for indexer.baseUrl, wallet defaults, account defaults, network configuration, or MoonPay configuration.

Environment variables can be inherited by child processes and may be visible to other processes running as the same OS user. Limit their lifetime and do not print them in shell history, CI logs, or agent transcripts.

Supported Keys

KeyExpected valueDefault or behavior
defaultWalletWallet nameThe first created or imported wallet becomes the default; use wdk wallet default to change it
defaultIndexNon-negative integer0
indexer.baseUrlIndexer base URLhttps://wdk-api.tether.io
indexer.apiKeyIndexer API keyEmpty; WDK_INDEXER_API_KEY overrides it
ramp.moonpay.apiKeyMoonPay publishable key (pk_test_... or pk_live_...)Empty; do not use a MoonPay secret key
ramp.moonpay.signUrlURL of an HTTP service that signs MoonPay widget URLsEmpty; the service must return a signedUrl
ramp.moonpay.environmentsandbox or productionEmpty; required by wdk buy and wdk sell
networks.NETWORKWallet-module configuration objectDefaults come from the installed wdk.config.json
networks.NETWORK.KEYOne wallet-module configuration valueDepends on the selected wallet module

Custom-network records and custom-token records also live in config.json. Manage them with wdk network and wdk token so the CLI can validate their shape and related state.

Read Configuration

Read one global key:

Terminal
wdk config get --key defaultIndex

Read one network configuration:

Terminal
wdk config get --network ethereum

Read a key inside one network configuration:

Terminal
wdk config get --network ethereum --key provider

Read the full configuration view:

Terminal
wdk config get --all

config get --all excludes the custom-token registry. Use wdk token list to read tokens.

config.json is plaintext. The CLI does not request an owner-only mode for this file, so its effective permissions follow the operating system and runtime defaults and may be 0644. config get --all can reveal stored API keys, signing URLs, and credentials embedded in provider URLs. Do not publish the file or command output.

Prefer WDK_INDEXER_API_KEY when you do not want to persist the indexer key. No environment override is available for MoonPay configuration in beta.1.

Set Configuration

Set a string:

Terminal
wdk config set --key indexer.baseUrl --value https://indexer.example.com

Set a number:

Terminal
wdk config set --key defaultIndex --value 1

Set a JSON object:

Terminal
wdk config set \
  --key ramp.moonpay \
  --value '{"apiKey":"pk_test_...","signUrl":"https://example.com/sign","environment":"sandbox"}'

config set parses a valid JSON value into its JSON type. If parsing fails, it stores the value as a string. Quote objects and arrays so the shell passes them as one argument.

Set a network-specific key:

Terminal
wdk config set \
  --network ethereum \
  --key provider \
  --value https://ethereum-rpc.publicnode.com

Replace a network's complete wallet-module configuration:

Terminal
wdk config set \
  --network ethereum \
  --value '{"chainId":1,"provider":"https://ethereum-rpc.publicnode.com","transferMaxFee":5000000000000000}'

Network configuration is passed to the selected WDK wallet module. Use only keys supported by that module.

Reset Configuration

Reset one global key:

Terminal
wdk config reset --key indexer.baseUrl

Reset one network key:

Terminal
wdk config reset --network ethereum --key provider

Reset configuration defaults:

Terminal
wdk config reset --all

config reset --all preserves the default-wallet selection, custom networks, and custom tokens. It resets the remaining values to their installed defaults.

Authorization and Wallet Locking

When at least one wallet exists, these configuration mutations verify the current default wallet's passphrase:

  • wdk config set
  • wdk config reset
  • wdk network create
  • wdk network delete
  • wdk token add
  • wdk token delete

Set WDK_PASSPHRASE for non-interactive local automation or enter the passphrase at the prompt.

Changing or resetting a key under networks locks all wallets so the next unlock initializes WDK with the new wallet-module configuration. config reset --all also locks all wallets.

Indexer

Within the CLI command set, only wdk get history uses the WDK Indexer API. The MCP get_history tool uses the same history path. Request an Indexer API key before connecting directly.

Connect Directly

The default indexer.baseUrl is https://wdk-api.tether.io. Store your API key:

Terminal
wdk config set --key indexer.apiKey --value YOUR_INDEXER_API_KEY

Alternatively, supply it to the current process without writing it to config.json:

Terminal
WDK_INDEXER_API_KEY=YOUR_INDEXER_API_KEY \
  wdk get history --network ethereum --wallet dev

Use an Indexer Proxy

Point the CLI at your own endpoint when you do not want Indexer API keys on developer machines:

Terminal
wdk config reset --key indexer.apiKey
wdk config set --key indexer.baseUrl --value https://indexer-proxy.example.com

Also ensure WDK_INDEXER_API_KEY is not set in the CLI process. A non-empty environment value overrides the stored empty value and causes the CLI to send an x-api-key header.

The proxy must accept both history request forms:

RequestUsed when
GET /api/v1/{blockchain}/{token}/{address}/token-transfers with optional limit, fromTs, and toTs query parameterswdk get history includes --token
POST /api/v1/batch/token-transfersThe command queries all Indexer-supported tokens

Forward the query parameters or JSON request body and the Indexer response unchanged. Add the Indexer x-api-key header when forwarding the request upstream.

WDK_INDEXER_BASE_URL is not read by beta.1.

MoonPay

wdk buy and wdk sell derive the selected wallet address and build a signed MoonPay widget URL. The CLI prints the URL, or returns it in JSON output; it does not open the browser or execute the fiat transaction. Open the URL to continue on MoonPay, which processes the transaction through the integration associated with your MoonPay account.

Get a publishable key from Developers → API Keys in the MoonPay dashboard. Use a pk_test_... or pk_live_... publishable key here, never the sk_test_... or sk_live_... secret key.

The commands require all three MoonPay values:

Terminal
wdk config set --key ramp.moonpay.apiKey --value pk_test_...
wdk config set --key ramp.moonpay.signUrl --value https://example.com/moonpay/sign
wdk config set --key ramp.moonpay.environment --value sandbox

Sign Widget URLs

Because the CLI includes a wallet address in the MoonPay widget URL, it sends the unsigned URL to your signing service. That service signs the URL with your MoonPay secret key and returns the complete signed URL. See MoonPay's on-ramp URL signing and off-ramp URL signing guides.

The CLI sends this request to ramp.moonpay.signUrl:

POST /moonpay/sign HTTP/1.1
Content-Type: application/json

{"urlForSignature":"https://..."}

Return a successful JSON response with the complete signed URL:

{"signedUrl":"https://...&signature=..."}

Returning only the signature is not supported.

Keep the MoonPay secret key in the signing service. Beta.1 does not send configurable authentication headers to signUrl, so bind the service locally, keep it on a private network, or restrict access with network-level controls. Do not expose an unauthenticated public signing endpoint.

Select an Environment

EnvironmentPublishable keyNetwork
sandboxpk_test_...Testnet
productionpk_live_...Mainnet

The CLI rejects a sandbox/mainnet or production/testnet mismatch. It does not validate the publishable-key prefix, so configure the matching key yourself.


Need Help?

On this page