Call Module Methods
Discover and invoke chain-specific wallet-module methods through WDK CLI
WDK CLI beta.3 exposes selected chain-specific wallet methods that do not fit the generic address, balance, history, and send commands. The bundled catalog declares each allowed method, its read or write kind, and its parameter schema.
Discover Before Calling
List one network's declared methods:
wdk method list --network ethereumOr inspect every built-in module that declares methods:
wdk method list --allProvide exactly one of --network and --all. Listing does not require an unlocked wallet.
The method catalog is an allowlist. wdk method call rejects a method or parameter that is not declared; it does not reflect over arbitrary package exports. Beta.3's method catalog covers built-in modules only, even when a custom module backs a custom network.
Call A Read Method
First inspect the exact schema:
wdk method list --network ethereumThen pass one flag for each required parameter:
wdk method call \
--network ethereum \
--name getAllowance \
--token 0xTOKEN_ADDRESS \
--spender 0xSPENDER_ADDRESSThe selected wallet must be unlocked because method calls run against a wallet account in the daemon. Use --wallet <name> and --index <n> when the default selection is not the intended account.
Format Parameters
| Declared type | CLI value |
|---|---|
string | Non-empty string |
number | Finite numeric value |
boolean | Explicit true or false value |
bigint | Non-negative decimal integer string in base units |
Scalar array such as string[] | Comma-separated values |
| Object or structured array | One JSON string; quote every nested bigint as a decimal string |
Camel-case parameter names become kebab-case flags. For example, maxFeeSats becomes --max-fee-sats. Optional parameters may be omitted, but every flag you provide must have a value, including boolean flags.
Returned bigint values become decimal strings in both normal object output and --json output.
Call A Write Method
A method labeled write can move funds or mutate on-chain state. The label is discovery metadata, not an authorization control. wdk method call has no dry-run, fee-preview requirement, confirmation prompt, or second passphrase check after unlock.
Before calling a write method:
- Run
wdk method list --network NETWORKand verify the method is markedwrite. - Resolve and display the exact wallet, account index, network, method, and arguments.
- Use a module-specific quote or read method when the catalog provides one.
- Ask the user to confirm those exact values.
- Call the method once, then verify its returned identifier and resulting state.
For example, an EVM approval is a write method and the amount is in token base units:
wdk method call \
--network ethereum \
--name approve \
--token 0xTOKEN_ADDRESS \
--spender 0xSPENDER_ADDRESS \
--amount 1000000Review the token, spender, allowance amount, network, and account before running this command. Avoid unlimited allowances unless the user explicitly requires and understands them.
Use JSON Output
wdk --json method list --network spark
wdk --json method call --network spark --name getStaticDepositAddressA successful call returns the network, method name, and result. Unknown methods, unknown parameters, missing required parameters, and malformed values return structured CLI errors. Do not retry by guessing method names or parameter shapes; list the catalog again.
Use The Same Surface Over MCP
The bundled MCP server exposes list_methods and call_method. MCP arguments use the declared camel-case keys inside an args object rather than CLI-style kebab-case flags.
call_method has the same unlocked-wallet and write-method risks as the CLI command. See Use the MCP Server for the confirmation boundary.