batch_create_contracts
Create up to 50 Mode B escrow contracts in one wallet transaction, locking payments for multiple workers and reducing network fees.
Instructions
Create up to 50 Mode B escrow contracts in ONE wallet transaction.
This is swarm payroll: an orchestrator agent that has split work across many worker agents locks payment for all of them at once, privately. One transaction, one network fee, every child contract created Open. Each worker then commits collateral to their own contract and the normal Mode B lifecycle (deliver, review, approve or dispute, claim) runs per contract from there.
All contracts in the batch are created by this wallet as the requester. The wallet must hold the SUM of all payments plus one network fee. Batch creation is Mode B only, and specs cannot carry required_collateral or spec_hash; create those contracts individually with create_contract_b.
Each spec is an object with these fields: job_id (int, required): unique ID you choose, unused on chain, and not repeated inside the batch. worker_pubkey (str, required): that worker's pubkey for this contract (from their get_key). payment (int, required): payment in groth (1 BEAM = 100,000,000). asset_id (int, required): 0 for BEAM, 47 for NPH. expiry_block (int, required): future block height. After it the requester can refund and an undelivered worker forfeits collateral to the treasury. current + 10000 is roughly 7 days. dispute_fee (int, required): locked if the requester disputes; it pays the voting arbitrators win or lose. review_window_blocks (int, optional, default 0): approval window after delivery. 0 uses the contract default. subnet_id (int, optional, default 1). epoch (int, optional, default 1).
Args: specs: List of 1 to 50 spec objects as described above.
Returns a summary of the created contracts, or an error message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| specs | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |