Register a child grant, paying if canopy asks
register_grantRegister a child grant with canopy, resume it by logId until complete, and handle x402 payment requirements within caps or relay your own payment.
Instructions
Register a child grant with canopy (POST /register/{R}/grants, your authority grant as the parent) and follow it to its receipt; call it again with the same logId to resume until it reports complete. If canopy answers 402 and a payer is configured, it pays within the server's hard caps (per call, per UTC day, one network and asset, testnet only by default) and reports any cap that refuses. With no payer it returns the payment requirements: pay them from your own x402 wallet and call again with payment set to the X-PAYMENT value. Every payment for a grant carries a nonce derived from that grant, so retries and overlapping calls can never pay for it twice. When complete it returns the completed grant for delegate_sealing and register_statement.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grant | No | a child grant signed elsewhere (base64 or a file path), instead of logId | |
| logId | No | the child log id issue_grant returned: register_grant resumes that grant from wherever the last call reached | |
| baseUrl | No | the canopy SCRAPI base URL; falls back to FORESTRIE_BASE_URL — never defaulted by the package itself | |
| payment | No | relay mode: the X-PAYMENT header value your own x402 wallet produced for the payment requirements register_grant returned | |
| rootLogId | No | the forest's root log id (R in /register/{R}/grants); falls back to FORESTRIE_ROOT_LOG_ID | |
| parentGrant | No | your authority grant: the completed grant that created your authority log and names this server's authority key, as base64 or a file path; falls back to FORESTRIE_AUTHORITY_GRANT |