Sponsored Tasks: CLI Reference
Every taskmarket sponsored-task subcommand, plus the task create flags for sponsored tasks.
Install the CLI as described in the CLI reference; these commands ship in
CLI 1.14.0 and later.
Contents
- Requirements by command
- sponsored-task create
- sponsored-task fund
- sponsored-task managers add
- sponsored-task managers remove
- sponsored-task managers list
- sponsored-task fee-bank deposit
- sponsored-task fee-bank balance
- sponsored-task fee-bank withdraw
- sponsored-task list
- sponsored-task show
- sponsored-task balance
- sponsored-task withdraw
- sponsored-task exit
- sponsored-task claim
- task create sponsored flags
Requirements by command
| Command | Keystore | TASKMARKET_RPC_URL | Native gas | Caller |
|---|---|---|---|---|
create | Yes | Yes | Yes | Anyone |
fund | Yes | Yes | Yes | Anyone |
managers add, managers remove | Yes | Yes | Yes | Vault owner |
managers list | No | No | No | Anyone |
fee-bank deposit, fee-bank withdraw | Yes | Yes | Yes | The manager |
fee-bank balance | Yes | Yes | No | The manager |
list, show, balance | No | No | No | Anyone |
withdraw, exit | Yes | Yes | Yes | Vault owner |
claim | Yes | No | No | The worker |
Commands that use TASKMARKET_RPC_URL stop with TASKMARKET_RPC_URL must be set to a chain RPC endpoint for vault administration commands when it is unset, and check that the endpoint's chain
matches --chain-id. Write commands simulate first, then send and wait for the receipt; a reverted
receipt fails with <function> reverted: <txHash>. Commands that need a keystore tell you to run taskmarket init when
there is none. Address flags must be
0x-prefixed 40-hex-digit addresses.
All amounts below are base units unless stated otherwise.
sponsored-task create
Create a new vault for a project token.
taskmarket sponsored-task create --factory <address> --chain-id <id> --token <address> [--owner <address>]| Option | Required | Meaning |
|---|---|---|
--factory <address> | Yes | SponsoredTaskFactory address. |
--chain-id <id> | Yes | Chain the factory is on. |
--token <address> | Yes | Project ERC-20 token. |
--owner <address> | No | Vault owner. Defaults to your wallet. |
Output: txHash, vault, vaultId, owner, token.
sponsored-task fund
Approve the vault and fund it with project tokens (two transactions).
taskmarket sponsored-task fund --vault <address> --token <address> --chain-id <id> --amount <baseUnits>| Option | Required | Meaning |
|---|---|---|
--vault <address> | Yes | Vault address. |
--token <address> | Yes | The vault's project token. |
--chain-id <id> | Yes | Chain the vault is on. |
--amount <baseUnits> | Yes | Amount in the token's base units. |
After the approval, the CLI waits up to 30 seconds for the RPC endpoint to report the allowance.
Output: txHash, vault, amount.
sponsored-task managers add
Authorize a manager, or change an existing manager's cap, and set it active.
taskmarket sponsored-task managers add --vault <address> --chain-id <id> --manager <address> --cap <baseUnits>| Option | Required | Meaning |
|---|---|---|
--vault <address> | Yes | Vault address. |
--chain-id <id> | Yes | Chain the vault is on. |
--manager <address> | Yes | Manager to authorize. |
--cap <baseUnits> | Yes | Lifetime spend cap in the token's base units. Must be at least the manager's current reserved plus spent. |
Output: txHash, manager, spendCap, active.
sponsored-task managers remove
Deactivate a manager. Does not reclaim tokens already reserved.
taskmarket sponsored-task managers remove --vault <address> --chain-id <id> --manager <address>The cap is pinned to the manager's current reserved plus spent. Output: txHash, manager,
spendCap, active.
sponsored-task managers list
taskmarket sponsored-task managers list --vault-id <vaultId>Output: an array of { vaultId, managerAddress, spendCap, spent, active }.
sponsored-task fee-bank deposit
Approve the fee bank and deposit USDC credit for creating sponsored tasks.
taskmarket sponsored-task fee-bank deposit --fee-bank <address> --usdc <address> --chain-id <id> --amount <baseUnits>| Option | Required | Meaning |
|---|---|---|
--fee-bank <address> | Yes | SponsoredTaskFeeBank address. |
--usdc <address> | Yes | USDC address on that chain. |
--chain-id <id> | Yes | Chain the fee bank is on. |
--amount <baseUnits> | Yes | USDC base units (6 decimals). |
Output: txHash, feeBank, deposited.
sponsored-task fee-bank balance
taskmarket sponsored-task fee-bank balance --fee-bank <address> --chain-id <id>Output: feeBank, manager (your wallet), creditBaseUnits.
sponsored-task fee-bank withdraw
Withdraw unused USDC credit.
taskmarket sponsored-task fee-bank withdraw --fee-bank <address> --chain-id <id> --amount <baseUnits> [--recipient <address>]--recipient defaults to your wallet. Output: txHash, recipient, withdrawn.
sponsored-task list
taskmarket sponsored-task list [--limit <n>] [--cursor <vaultId>] [--include-unverified]| Option | Default | Meaning |
|---|---|---|
--limit <n> | 50 | Maximum vaults to return. |
--cursor <vaultId> | none | Pagination cursor from a previous nextCursor. |
--include-unverified | off | Include vaults not yet curator-approved. |
Output: { vaults, nextCursor }.
sponsored-task show
taskmarket sponsored-task show <vaultId>Output: the vault object (see API reference).
sponsored-task balance
taskmarket sponsored-task balance <vaultId>Output: fundedTotal, availableBalance, reservedBalance.
sponsored-task withdraw
Withdraw unreserved project tokens (owner only).
taskmarket sponsored-task withdraw --vault <address> --chain-id <id> --amount <baseUnits> [--recipient <address>]--recipient defaults to your wallet. Output: txHash, recipient, withdrawn.
sponsored-task exit
Terminally exit a vault. Sweeps every token, including reserved and unclaimed ones, to the recipient and voids every outstanding reservation, claim signature and Merkle proof. There is no undo.
taskmarket sponsored-task exit --vault <address> --chain-id <id> --yes [--recipient <address>]| Option | Required | Meaning |
|---|---|---|
--vault <address> | Yes | Vault address. |
--chain-id <id> | Yes | Chain the vault is on. |
--yes | Yes in practice | Without it the command stops with This is irreversible. Re-run with --yes to confirm the exit. |
--recipient <address> | No | Defaults to your wallet. |
Output: txHash, recipient, status (exited).
sponsored-task claim
Claim your unclaimed sponsored reward in a vault, gaslessly.
taskmarket sponsored-task claim <vaultId> [--task-id <id>]| Option | Meaning |
|---|---|
--task-id <id> | Claim the entitlement for this task. Defaults to the first unclaimed one. |
Requires a registered withdrawal address. Output: txHash, destination, amount. See
Claiming rewards.
task create sponsored flags
taskmarket task create ... --sponsored-task <vaultId> --sponsored-task-tokens <amount>| Option | Meaning |
|---|---|
--sponsored-task <vaultId> | Fund this task from the vault, reserving --sponsored-task-tokens alongside the ordinary --reward. |
--sponsored-task-tokens <amount> | Whole-token amount to reserve, for example 100 for 100 tokens. Required with --sponsored-task. |
Cannot be combined with --hook-data. See
Creating sponsored tasks.