Skip to main content

Synopsis

cowboy trading-post drives the CIP-33 Trading Post: creators declare actors hireable with pricing terms, stores distribute them under grants, hirers pay in CBY or CIP-20 tokens, and attesters vouch for manifest roots. Write subcommands sign with the key found by key auto-discovery, with limits from the node’s estimate, and print the transaction hash and the node response. declaration-id and the get-* subcommands need no key. declare, version, register-store, grant, register-artifact, pause, resume, revoke and attest accept --prepare: sign the transaction and print it as one JSON object (transaction_hex, digest, sender, nonce, chain_id) without submitting it. Global flags:

Shared argument formats

  • 32-byte hex (--salt, --manifest-root, --volume-id, --claimed-root, --declaration-id, --token-id, --job): 64 hex chars, 0x optional.
  • Pricing term (--term): free, one-shot:cby:<amount>, subscription:cby:<amount>:<period_blocks>, per-call:cby:<amount>, or the CIP-20 forms one-shot:cip20:<token_id>:<base_units>, subscription:cip20:<token_id>:<base_units>:<period_blocks>, per-call:cip20:<token_id>:<base_units>.
  • CBY amounts accept up to 9 decimal places (1.5 = 1,500,000,000 base units); CIP-20 amounts are raw base units and must not contain a decimal point.
  • Split / referral entries: <address>:<bps>.
  • Bytes inputs (--capability-schema-*, --ibe-ciphertext-*, --metadata*, --policy-uri*, --session-receipt-*): give at most one of the -hex, -file, or plain-text forms.

Subcommands

cowboy trading-post declaration-id

Compute the deterministic declaration id for a creator, actor, and salt. Local only; no network call. Flags: Example:

cowboy trading-post declare

Declare a hireable actor and its first version and artifact. Behavior:
  1. Derive the creator from the signing key and compute the declaration id; print it (unless --prepare).
  2. Build the version fields (manifest root, visibility, capability schema, terms, default split) and the artifact escrow (volume, claimed root, IBE ciphertext).
  3. Enforce the visibility pairing locally: private requires an IBE ciphertext; public requires it to be omitted. A ciphertext that is only whitespace is rejected.
  4. Sign and submit TradingPostDeclare.
Flags: Example:

cowboy trading-post version

Declare a new version and artifact for an existing declaration. Takes the same version and artifact flags as declare (--manifest-root, --code-visibility, --capability-schema-*, --term, --split, --volume-id, --claimed-root, --ibe-ciphertext-*) plus:

cowboy trading-post retire

Retire a declaration.

cowboy trading-post register-store

Register a distribution store. The three forms conflict; omitting all of them registers empty metadata.

cowboy trading-post grant

Grant a store distribution rights for a declaration.

cowboy trading-post revoke-grant


cowboy trading-post register-artifact

Register a store artifact for an existing declaration version. The visibility pairing cannot be checked locally here (the version’s visibility lives on chain); consensus enforces it.

cowboy trading-post retire-artifact


cowboy trading-post hire

Hire a declaration version. Behavior:
  1. Parse the chosen --term spec and the payment (--asset, --amount, --token-id); print the parsed payment.
  2. Sign and submit TradingPostHire.
Flags: Example:

cowboy trading-post deposit

Deposit more funds into a hire.

cowboy trading-post withdraw, renew, pause, resume, revoke

Each takes a single flag: withdraw returns unused prepaid funds; renew renews the hire; pause/resume toggle it; revoke ends it.

cowboy trading-post set-renewal

Enable or disable hire auto-renewal. Exactly one of --on or --off is required.

cowboy trading-post settle

Settle a per-call hire with a session receipt. The receipt is required and must be non-empty.

cowboy trading-post attest

Attest a manifest root.

Read subcommands

Each get-* subcommand issues a GET against the RPC URL and pretty-prints the JSON response. No private key is used. get-lease-authorize additionally prints allowed and reason fields before the JSON body. Example:

Edge Cases

  • declare and version fail locally if --code-visibility private has no IBE ciphertext, or if public has one; register-artifact defers that check to consensus.
  • An IBE ciphertext consisting only of whitespace (for example a file holding a stray newline) is rejected.
  • --token-id with --asset cby is an error; --asset cip20 without --token-id is an error.
  • A CBY amount with more than 9 decimal places, or a CIP-20 amount containing a decimal point, is rejected.
  • set-renewal with neither or both of --on/--off is rejected before submission.
  • settle requires a non-empty session receipt.
  • A --term that does not match one of the documented formats fails with the expected format in the error.