@certen.io/sdk 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/README.md +111 -0
  3. package/dist/address.d.ts +12 -0
  4. package/dist/address.d.ts.map +1 -0
  5. package/dist/address.js +48 -0
  6. package/dist/address.js.map +1 -0
  7. package/dist/agent.d.ts +8 -0
  8. package/dist/agent.d.ts.map +1 -1
  9. package/dist/agent.js +12 -0
  10. package/dist/agent.js.map +1 -1
  11. package/dist/browser.d.ts +47 -0
  12. package/dist/browser.d.ts.map +1 -0
  13. package/dist/browser.js +55 -0
  14. package/dist/browser.js.map +1 -0
  15. package/dist/bytes.d.ts +14 -0
  16. package/dist/bytes.d.ts.map +1 -0
  17. package/dist/bytes.js +47 -0
  18. package/dist/bytes.js.map +1 -0
  19. package/dist/chains.d.ts +218 -0
  20. package/dist/chains.d.ts.map +1 -0
  21. package/dist/chains.js +295 -0
  22. package/dist/chains.js.map +1 -0
  23. package/dist/client.d.ts +17 -2
  24. package/dist/client.d.ts.map +1 -1
  25. package/dist/client.js +54 -8
  26. package/dist/client.js.map +1 -1
  27. package/dist/defaults.d.ts +3 -0
  28. package/dist/defaults.d.ts.map +1 -0
  29. package/dist/defaults.js +3 -0
  30. package/dist/defaults.js.map +1 -0
  31. package/dist/doctor.d.ts +10 -1
  32. package/dist/doctor.d.ts.map +1 -1
  33. package/dist/doctor.js +42 -27
  34. package/dist/doctor.js.map +1 -1
  35. package/dist/effect.d.ts +99 -0
  36. package/dist/effect.d.ts.map +1 -0
  37. package/dist/effect.js +139 -0
  38. package/dist/effect.js.map +1 -0
  39. package/dist/error-codes.d.ts.map +1 -1
  40. package/dist/error-codes.js +17 -0
  41. package/dist/error-codes.js.map +1 -1
  42. package/dist/errors.d.ts +76 -0
  43. package/dist/errors.d.ts.map +1 -1
  44. package/dist/errors.js +108 -0
  45. package/dist/errors.js.map +1 -1
  46. package/dist/evm-rpc.d.ts +55 -0
  47. package/dist/evm-rpc.d.ts.map +1 -0
  48. package/dist/evm-rpc.js +126 -0
  49. package/dist/evm-rpc.js.map +1 -0
  50. package/dist/execution-proof.d.ts.map +1 -1
  51. package/dist/execution-proof.js +2 -1
  52. package/dist/execution-proof.js.map +1 -1
  53. package/dist/funding.d.ts +214 -6
  54. package/dist/funding.d.ts.map +1 -1
  55. package/dist/funding.js +251 -29
  56. package/dist/funding.js.map +1 -1
  57. package/dist/header-fields.d.ts +68 -0
  58. package/dist/header-fields.d.ts.map +1 -0
  59. package/dist/header-fields.js +147 -0
  60. package/dist/header-fields.js.map +1 -0
  61. package/dist/index.d.ts +9 -17
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +11 -26
  64. package/dist/index.js.map +1 -1
  65. package/dist/intent-states.d.ts +75 -0
  66. package/dist/intent-states.d.ts.map +1 -0
  67. package/dist/intent-states.js +66 -0
  68. package/dist/intent-states.js.map +1 -0
  69. package/dist/internal.d.ts +18 -0
  70. package/dist/internal.d.ts.map +1 -1
  71. package/dist/internal.js +44 -0
  72. package/dist/internal.js.map +1 -1
  73. package/dist/key-page.d.ts +67 -0
  74. package/dist/key-page.d.ts.map +1 -0
  75. package/dist/key-page.js +154 -0
  76. package/dist/key-page.js.map +1 -0
  77. package/dist/origin.d.ts +19 -0
  78. package/dist/origin.d.ts.map +1 -0
  79. package/dist/origin.js +80 -0
  80. package/dist/origin.js.map +1 -0
  81. package/dist/random.d.ts +27 -0
  82. package/dist/random.d.ts.map +1 -0
  83. package/dist/random.js +30 -0
  84. package/dist/random.js.map +1 -0
  85. package/dist/readiness.d.ts +133 -0
  86. package/dist/readiness.d.ts.map +1 -0
  87. package/dist/readiness.js +467 -0
  88. package/dist/readiness.js.map +1 -0
  89. package/dist/reason-codes.d.ts +15 -0
  90. package/dist/reason-codes.d.ts.map +1 -0
  91. package/dist/reason-codes.js +30 -0
  92. package/dist/reason-codes.js.map +1 -0
  93. package/dist/receipt.d.ts +233 -0
  94. package/dist/receipt.d.ts.map +1 -0
  95. package/dist/receipt.js +318 -0
  96. package/dist/receipt.js.map +1 -0
  97. package/dist/resources/admin.d.ts +5 -2
  98. package/dist/resources/admin.d.ts.map +1 -1
  99. package/dist/resources/admin.js +8 -3
  100. package/dist/resources/admin.js.map +1 -1
  101. package/dist/resources/billing.d.ts.map +1 -1
  102. package/dist/resources/billing.js +5 -4
  103. package/dist/resources/billing.js.map +1 -1
  104. package/dist/resources/chains.d.ts +10 -0
  105. package/dist/resources/chains.d.ts.map +1 -1
  106. package/dist/resources/chains.js +15 -1
  107. package/dist/resources/chains.js.map +1 -1
  108. package/dist/resources/device.d.ts.map +1 -1
  109. package/dist/resources/device.js +2 -1
  110. package/dist/resources/device.js.map +1 -1
  111. package/dist/resources/execute.d.ts +110 -4
  112. package/dist/resources/execute.d.ts.map +1 -1
  113. package/dist/resources/execute.js +207 -35
  114. package/dist/resources/execute.js.map +1 -1
  115. package/dist/resources/governance.js +3 -3
  116. package/dist/resources/governance.js.map +1 -1
  117. package/dist/resources/identity.js +5 -5
  118. package/dist/resources/identity.js.map +1 -1
  119. package/dist/resources/oauth-clients.d.ts.map +1 -1
  120. package/dist/resources/oauth-clients.js +3 -2
  121. package/dist/resources/oauth-clients.js.map +1 -1
  122. package/dist/resources/proof.d.ts +10 -2
  123. package/dist/resources/proof.d.ts.map +1 -1
  124. package/dist/resources/proof.js +33 -11
  125. package/dist/resources/proof.js.map +1 -1
  126. package/dist/resources/registration-tokens.d.ts.map +1 -1
  127. package/dist/resources/registration-tokens.js +2 -1
  128. package/dist/resources/registration-tokens.js.map +1 -1
  129. package/dist/resources/sign.js +2 -2
  130. package/dist/resources/sign.js.map +1 -1
  131. package/dist/resources/transaction.d.ts.map +1 -1
  132. package/dist/resources/transaction.js +7 -3
  133. package/dist/resources/transaction.js.map +1 -1
  134. package/dist/resources/transparency.d.ts.map +1 -1
  135. package/dist/resources/transparency.js +3 -2
  136. package/dist/resources/transparency.js.map +1 -1
  137. package/dist/resources/webhooks.d.ts +5 -3
  138. package/dist/resources/webhooks.d.ts.map +1 -1
  139. package/dist/resources/webhooks.js +12 -8
  140. package/dist/resources/webhooks.js.map +1 -1
  141. package/dist/sha256.d.ts +10 -0
  142. package/dist/sha256.d.ts.map +1 -0
  143. package/dist/sha256.js +71 -0
  144. package/dist/sha256.js.map +1 -0
  145. package/dist/share-target.d.ts +10 -0
  146. package/dist/share-target.d.ts.map +1 -0
  147. package/dist/share-target.js +25 -0
  148. package/dist/share-target.js.map +1 -0
  149. package/dist/shared-proof.d.ts +1 -5
  150. package/dist/shared-proof.d.ts.map +1 -1
  151. package/dist/shared-proof.js +27 -21
  152. package/dist/shared-proof.js.map +1 -1
  153. package/dist/signing-check.d.ts +66 -0
  154. package/dist/signing-check.d.ts.map +1 -0
  155. package/dist/signing-check.js +171 -0
  156. package/dist/signing-check.js.map +1 -0
  157. package/dist/types.d.ts +139 -0
  158. package/dist/types.d.ts.map +1 -1
  159. package/dist/verify-receipt.d.ts.map +1 -1
  160. package/dist/verify-receipt.js +68 -28
  161. package/dist/verify-receipt.js.map +1 -1
  162. package/dist/verify.d.ts +206 -0
  163. package/dist/verify.d.ts.map +1 -0
  164. package/dist/verify.js +369 -0
  165. package/dist/verify.js.map +1 -0
  166. package/dist/version.d.ts +2 -0
  167. package/dist/version.d.ts.map +1 -0
  168. package/dist/version.js +4 -0
  169. package/dist/version.js.map +1 -0
  170. package/package.json +25 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,158 @@
1
1
  # Changelog — @certen.io/sdk
2
2
 
3
+ ## 0.11.0 — readiness, gas, receipts and sending from an identity (CLI UX plan, 2026-10-16)
4
+
5
+ Additive: every item is described in the sections that follow, and nothing that works today is removed or renamed. Three behaviours get stricter, and each is a fix or can be bypassed:
6
+ the funding guard on `execute.contractCall` / `execute.transfer` now also refuses an account that is positively known to be short (`skipFundingCheck: true` bypasses it exactly as before);
7
+ `verifyEvidence` and `verifyBundle` no longer read a missing or empty block header as agreement; and `fetchSharedProof` refuses to be redirected off the origin it was pointed at.
8
+ `@certen.io/cli` 0.11.0 and `@certen.io/mcp` 0.6.0 need this release, so it goes out first.
9
+
10
+ ### Included — a node for the recipient, and a share fetch that stays on its origin (CLI UX, Phase 6 follow-ups)
11
+
12
+ Additive, plus one hardening. A maintainer versions and publishes this; the MCP server's operator-configured node and share-origin rule need it.
13
+
14
+ ### Added
15
+ - **`effectRpc` on `buildReceipt`**: a node used ONLY to read the recipient's balance (before the execution block and at it). It never closes the proof's execution layer; that is `header`'s job (or `rpc`'s). For a process that takes the block header from its caller but has a node of its own for the one thing a header cannot say, whether the value arrived. Where `rpc` is also given, the recipient is read from `effectRpc` and the proof layer from `rpc`. Checked and reported exactly as `rpc` is (the chain id first, no credential, no redirect, only the host shown). `header` together with `rpc` is still `CONFLICTING_OPTIONS`; `header` together with `effectRpc` is the case it is for.
16
+
17
+ ### Changed
18
+ - **`fetchSharedProof` refuses to be redirected off the origin it was pointed at** (`FOREIGN_ORIGIN_URL`, `source: 'redirect'`, not retryable). It sends no credential, so nothing could leak, but a host that was allowed (by a server's operator, or by a person typing a link) must not be able to send the request somewhere nobody chose by answering `302`. The authenticated client has refused this since RB7b; the standalone redeemer follows the same rule now. A redirect within the origin (a moved path) still works. A caller that relied on a share link redirecting to another host will now get that error.
19
+
20
+ ### Included — a block header you fetched yourself (CLI UX, Phase 6)
21
+
22
+ Additive. Nothing that works today changes. A maintainer versions and publishes this; the MCP server's `certen_receipt` and the checked `header` of `certen_proof_verify` need it.
23
+
24
+ ### Added
25
+ - **`header` on `verifyEvidence` and `buildReceipt` (`@certen.io/sdk/verify`)**: a block header you fetched from a node you trust, `{ receiptsRoot, hash?, number? }`, compared with the proof's execution layer. It is the way to close that layer when the process must not call a node of its own (a server an agent drives, which must not probe the network it sits in), where `rpc` has the SDK fetch the header itself. It cannot read the recipient's balance, so a transfer's effect stays `unchecked` and the receipt is not `verified`. `header` together with `rpc` is `CONFLICTING_OPTIONS`; in `buildReceipt` both this and a bad header are refused before the first request, so they are never turned into a "gap".
26
+ - **`assertComparableHeader(header)`** and the `ComparableHeader` type: the one check of a header a caller hands in. A header is a comparison only if it carries the receipts root the proof commits to (`0x` + 32 bytes). `hash` and `number` are checked when present, and a malformed one is refused rather than ignored. Throws `INVALID_HEADER` (status 0) naming the field, never the value. Returns only the three fields that are compared, with `number` as a string.
27
+
28
+ ### Fixed
29
+ - **A header with nothing to compare no longer reads as a comparison that passed.** `verifyBundle` compares the fields a header has and finds no disagreement in the ones it lacks, so `{}` (or a bare block number, which the bundle itself states) made the execution layer `verified` with `headerCheck.ok: true`. `verifyEvidence` and `buildReceipt` now refuse it with `INVALID_HEADER`; `verifyBundle` itself is unchanged (it takes whatever it is given: pass it a header through `assertComparableHeader`). This is the same hole the node fallback had before Phase 4 closed it.
30
+ - `verifyEvidence`'s `nodeConsulted` is now true only when a header was actually compared: a header handed in for a proof with no execution component compared nothing and no longer says it did.
31
+
32
+ ### Included — the error codes the gateway publishes, as a constant (CLI UX, Phase 5)
33
+
34
+ Additive. Nothing that works today changes. A maintainer versions and publishes this.
35
+
36
+ ### Added
37
+ - **`VENDORED_ERROR_CODES`**, exported from the default and browser entries: every error code this release knew the gateway to raise (the list `client.doctor()` already compares the live catalogue with, and which `packages/sdk/test/error-catalog.test.ts` holds equal to `spec/errors.json`). The CLI uses it to tell a code that `certen errors <CODE>` can explain from one it cannot, so that every failure can end with the one command to run next (`error.next`). A `readonly string[]`; it is a snapshot of this release, not the live catalogue (`client.admin.errors()` is that).
38
+
39
+ ### Included — the receipt, and sending from an identity (CLI UX, Phase 4)
40
+
41
+ Additive, with one fix to a verifier that was too forgiving (below). Nothing else that works today changes. A maintainer versions and publishes this.
42
+
43
+ ### Added
44
+ - **The receipt**: the one record of an intent, assembled. `assembleReceipt({ intentId, transaction, request?, proof?, effect?, registry?, previous?, … })` is **pure** (it makes no request) and returns a `Receipt` (`receipt_version: 1`): the ids to keep (the Accumulate transaction, the destination transaction with `destination_tx_source` saying whether it came from the **verified execution proof** or the validators' own `settlement_tx`, never a guess, and the proof id), four `stages`, the proof's verdict layer by layer, the `effect`, an explorer link where the registry names an EVM explorer, and a `verdict` of `verified` · `partial` · `failed` · `pending` · `unproven` with the `gaps` that explain it. **The verdict is the weakest honest reading**: a PARTIAL or NO EVIDENCE proof is never verified, a proof that could not be fetched is `unavailable` (not the same as there being none), and a verified proof whose value-arrival check was `unchecked`, `unreadable` or `not_observed` is PARTIAL, so `gaps` is `[]` whenever the verdict is `verified`. Assembling again from fresher inputs keeps `created_at`, the request and the pre-signing snapshot. Exported from the default and browser entries, with `RECEIPT_VERSION` and the types (`Receipt`, `ReceiptVerdict`, `ReceiptProof`, `ReceiptStage`, `ReceiptGap`, `ReceiptRequest`, …).
45
+ - **`buildReceipt(client, intentId, options)` and `verifyEvidence(evidence, options)` in `@certen.io/sdk/verify`**, where the verifier lives. `buildReceipt` reads the intent (unless you hand it the one you just read), and for a completed one loads its proof evidence and verifies it **here** with `verifyBundle` (never reading a flag in the bundle as a verdict), compares the proof's block header with a node you name, reads the recipient's balance from it, and assembles. Each step may fail without failing the receipt: a gap is data. `verifyEvidence` is the part of `certen proof verify` that used to be inline in the CLI (fetch the header of the block the bundle says the action ran in, from a node you name, and compare), so the CLI's `proof verify`, `send`, `watch` and `receipt` cannot disagree about what a header check means.
46
+ - **`loadProofEvidence(client, target, known?)`** takes a third parameter, the intent as the caller has just read it (`{ proof_id, accum_tx_hash }`), so the target is not read a second time.
47
+ - **`client.execute.send(params)`**, with `SendParams` and `SentIntent`: a native transfer from an identity, with the ADI and the abstract account derived from it (one identity read, skipped when you pass them), the same way `contractCall` has always been derived by the CLI. Everything it refuses, it refuses before anything is opened or signed: a recipient that is not an address or whose EIP-55 checksum fails (`INVALID_ADDRESS`), an asset that is not the chain's native token (`UNSUPPORTED_ASSET`: what a token transfer moves is chosen downstream and cannot be checked before signing), a wei-looking or zero amount (`INVALID_AMOUNT`), a chain the catalogue does not know (`UNSUPPORTED_CHAIN`), an identity that cannot sign (`IDENTITY_CANNOT_SIGN`) or has no abstract account on the chain (`NO_ABSTRACT_ACCOUNT`). It is `transfer()` underneath, so the signing check is not optional and `beforeSign` can decline.
48
+ - **`execute.wait(id, { signal })`**: stop waiting when an `AbortSignal` fires. It throws `CertenError` `WAIT_ABORTED` (`details.intent_id`, `details.last_status`), wakes from its sleep at once, and **does not cancel the intent**, which keeps running on the gateway. Without a signal the wait is exactly what it was.
49
+ - **`toChecksumAddress(address)` and `evmAddressProblem(value)`**: EIP-55. A mixed-case address whose checksum does not hold is refused with the correct capitalisation named; all-lower and all-upper addresses carry no checksum and are accepted. It never throws for a refusal (a non-string is "a value of type …").
50
+ - **Your own node**: `checkEvmRpcEndpoint`, `evmRpcCall`, `readEvmChainId`, `assertRpcChain`, `readEvmBalance` and `readEvmBlockHeader`, hardened like the Accumulate key-page read: http(s) only, no username or password in the URL, no redirect followed, the reply bounded in size and time, no CERTEN credential sent. **Only the node's host is ever put in a message**, because hosted providers carry an API key in the path. `assertRpcChain` refuses a node on another network (`EVM_RPC_WRONG_CHAIN`, with `expected` and `actual`). Codes: `EVM_RPC_INVALID`, `EVM_RPC_UNREADABLE`, `EVM_RPC_ERROR`, `EVM_RPC_WRONG_CHAIN`, `EVM_RPC_CHAIN_UNKNOWN`, `EVM_RPC_NO_BLOCK`.
51
+ - **Did the value arrive?** `snapshotRecipient({ rpc, chain, address })` takes the recipient's balance before signing, after checking the node is on the chain, and `checkNativeTransferEffect({ chain, recipient, amount, rpc?, before?, atBlock?, sender? })` judges it afterwards: `confirmed` (the balance rose by at least the amount; "exactly" or "at least", since other transfers can be included), `not_observed`, `unchecked` (no node given: the gateway cannot read another address, and its report is never counted as the recipient), `unreadable` or `not_applicable`. It never throws: a node that cannot be read is `unreadable`, which is not the same as the balance not having risen. The sender's side (the abstract account, as the gateway reports it) is supporting evidence and never decides the state.
52
+ - **`estimateFee(client, chain)`**: what a send will cost, as far as the gateway has published it: the price book's `proof.execute` entry for the chain (or `*`) and the catalogue's gas reserve, labelled an estimate. Never throws: a price book that cannot be read, or has no entry, is `state: 'unavailable'`, not a number.
53
+
54
+ ### Fixed
55
+ - **`verifyEvidence` (the code behind `proof verify --rpc`) no longer reads a node that has no such block as agreement.** When the node returned no block (pruned, lagging, or on another network), the header handed to the verifier was a bare block number, which `checkAgainstHeader` compared with itself, so the execution layer read `verified` against a node that never had the block. It now throws `EVM_RPC_NO_BLOCK`, and does the same for a header that carries no receipts root. In `buildReceipt` the node is then reported as not consulted (the gap `NODE_NOT_CONSULTED`, naming why) and the proof is checked without it.
56
+
57
+ ### Included — funding a gas gap (CLI UX, Phase 3)
58
+
59
+ Additive. Nothing that works today changes. A maintainer versions and publishes this.
60
+
61
+ ### Added
62
+ - **`gasFundingPlan({ chain, address, balance?, amount?, reserve? })`**: what to tell someone whose abstract account needs gas. The least that lets a transaction run (`minimum`: the catalogue's gas reserve, an **estimate**, plus any `amount` about to be moved), how much to send so the next few sends do not each need a faucet visit (`suggested`: ten reserves), what to send now given what the account already holds (`send`), whether the balance already clears the minimum (`satisfied`: an unknown balance is never satisfied), the faucet, an EIP-681 link, and the instructions in words, including the two-step route for a faucet that refuses a contract address. A chain with no estimate gets no number and says so, rather than a figure nobody measured. Words only: it names no CLI command.
63
+ - **`nativeTransferUri({ chain, address, amount? })`**: an EIP-681 request for a native transfer, `ethereum:<address>@<chainId>?value=<wei>`, with the amount as **integer wei computed with BigInt** (a float would print a value wallets refuse, and drop digits). `undefined`, never a guess, for a chain the catalogue does not know, an address that is not 20 bytes of hex, or an amount with more decimals than the token has. The address is used exactly as the gateway reported it.
64
+ - **`checkGas(client, { identityId, chain, amount?, tokenSymbol?, gasReserve? })`**: the gas check of `readiness()` on its own, for a caller waiting for one number to change. The same function `readiness()` calls, so a wait and `status` cannot disagree about when an account counts as funded; one request per call (the identity read). Never throws for a read that failed: an `unknown` check with the HTTP status in `data.status`, so a poller can tell a rejected key from a gateway having a bad moment.
65
+
66
+
67
+ ### Included — readiness (CLI UX, Phase 2)
68
+
69
+ Additive. Nothing that works today changes, except that the funding guard on `execute.contractCall` / `execute.transfer` now also refuses an account that is positively known to be short (below), which `skipFundingCheck: true` bypasses exactly as before. A maintainer versions and publishes this.
70
+
71
+ ### Added
72
+ - **`client.readiness({ identityId, chain, keyHash?, amount?, tokenSymbol?, gasReserve?, accumulateRpc?, scope? })`**: is this identity, on this chain, able to act right now, and if not, what is the first thing in the way? An ordered list of checks (`gateway`, `credential`, `identity`, `chain`, `key page`, `accumulate credits`, `gateway balance`, `gas`), each `ok` | `warn` | `fail` | `unknown` | `skipped` with a stable `code`, a `fix` in plain words (`text`, and a `url` where the SDK knows one) and the `data` the verdict was drawn from, plus `ready`, `state` (`ready` | `blocked` | `unconfirmed`), `first_blocker` and the resolved `context`. Never throws for a failed check, and **never ready over an unknown**: a check that could not be answered leaves the list `unconfirmed`. The same length however far the run got (a skipped check is reported, not omitted). `scope: 'context'` runs only what depends on the identity and chain. `summarizeReadiness(checks)` is the verdict rule, exported so a caller that adds a check of its own gets it from the same place. `READINESS_CHECKS` and `CONTEXT_CHECKS` list the names.
73
+ - **The key page, read from Accumulate**: `readKeyPage(url, { rpc })`, `verifyKeyPageHolds(url, keyHash, { rpc })` and `keyHashesOf(account)`. The documented `curl` to the Accumulate API as code. No CERTEN credential is sent to the node (it is a different origin), no redirect is followed, the reply is size-bounded and the wait is bounded. A page that could not be read is `unreadable`, never `absent`. It trusts the Accumulate node it asked and does not check a Merkle receipt; it does not use `@certen.io/proof-verify` (nothing is binary-encoded, and the verifier would put `node:crypto` in the browser entry). The gateway's two spellings of a key hash (a hex string, a serialised Node Buffer) are both read.
74
+ - **`assessGas({ chain, reading, amount?, reserve? })`** is the one comparison behind the SDK guard, the CLI guard and `readiness()`: `empty` | `short` (`kind: 'amount' | 'gas'`, with the `shortfall`) | `sufficient` (`estimated`: whether a gas reserve was part of the judgement) | `unknown` (carrying the reading). Exact integer arithmetic in base units; an unreadable balance is `unknown`, never zero and never funded. `nativeAmountOf` takes the native part of an amount (a token transfer's is none) and converts a wei `value`.
75
+ - **`CertenUnderfundedAccountError`** (`ABSTRACT_ACCOUNT_UNDERFUNDED`, never retryable).
76
+ - **The chain catalogue's `gasReserve`**, `gasReserveFor(chain)`, `parseUnits(value, decimals)` and `formatUnits(value, decimals)`. `gasReserve` is the native balance, in whole units, an abstract account should hold on top of any amount for one execution to be plausible. **It is an estimate, not a quote**: a planning figure (`ethereum-sepolia` 0.001, `base-sepolia` and `arbitrum-sepolia` 0.0001), not a measurement, because the gateway publishes no per-execution gas figure. Telcoin Adiri has none and is checked on the amount alone. Everything that shows it calls it an estimate and a caller can override it.
77
+ - **`doctor({ includeRegistry: true })`** also hands back the chain registry its first check read, and `readiness({ scope: 'context', registry })` takes one, so a caller that runs both pays for the public registry once. Without the option the report is exactly what it was.
78
+ - `wholeUnitAmountProblem(amount)`: the rule `execute.transfer` applies to a whole-unit amount (a decimal string; ten or more digits is wei), exported so anything that asks "could this be sent" applies the same one.
79
+
80
+ ### Changed
81
+ - **The funding guard compares the balance with the amount and an estimate of the gas, not only with zero.** `assertFundedForValue` (used by `execute.contractCall` and `execute.transfer`) still throws `CertenUnfundedAccountError` on a balance that is positively zero and `CertenFundingUnverifiableError` on one it cannot identify, and never blocks on a portfolio it could not read or an account with no balance reported yet. It now also throws `CertenUnderfundedAccountError` for a balance that is positive but below the amount being moved (a fact), or below the amount plus the gas estimate (an estimate, said so). A contract call's `value` is wei and a transfer's `amount` is whole units: the guard now takes the unit explicitly (`amountUnit: 'base' | 'whole'`) instead of leaving it to the digits, and does not count a token transfer's amount against the native balance (`tokenSymbol`). `skipFundingCheck: true` bypasses all of it.
82
+
83
+ ## 0.10.0 — RB7b: verify what you trust, sign what you see (2026-10-09)
84
+
85
+ Every item below is also described in the sections that follow, or in the 0.9.x entries it refines. **Breaking** changes are marked; the minor carries them (0.x).
86
+
87
+ ### Breaking
88
+ - **Node 22 or 24.** `engines.node` is `>=22`; Node 18 and 20 are end of life and are no longer tested.
89
+ - **Every external-mode signature is checked before it is made** (`SIGNING_DATA_MISMATCH`, `SIGNING_DATA_ABSENT`, `SIGNING_EXPECTATION_UNAVAILABLE`, `SIGNING_VERIFIER_UNAVAILABLE`). There is no way to sign without the check, and it needs
90
+ the optional peer `@certen.io/proof-verify` and a gateway that returns `signing_data.transaction` and `signing_data.signature_metadata`. Token transfers are refused rather than signed unchecked.
91
+ - **`ChainAvailability` state `not-served` is replaced by `unlisted` (`unknown_chain`) and `disabled` (`chain_not_enabled`).** A chain the gateway does not list and a chain it lists as switched off are different answers.
92
+ - **`proof.bundle()` is typed `Uint8Array`** (a `Buffer` under Node, so runtime behaviour is unchanged).
93
+ - **`execute.wait()`** knows `executed` (non-terminal, reported through `onState`; `until: 'executed'` is supported), `completed_unproven` (resolves, reason `execution_proof_unavailable`) and `expired` (a failure; it used to poll to the timeout).
94
+ A timeout is `WAIT_TIMEOUT` and a missing proof assignment is `PROOF_NOT_ASSIGNED`; both are typed errors with the last status they saw.
95
+ - **A request, a `submit_url` or a redirect that leaves the gateway's origin is refused** (`FOREIGN_ORIGIN_URL`) before anything is signed or any credential is attached.
96
+ - **An empty, null or dot-only id in a path is refused** (`INVALID_PATH_PARAMETER`); every id, hash and token is encoded as one path segment.
97
+ - `admin.revokeApiKey`, `webhooks.remove` and the third 204 DELETE resolve `{ success: true }` / `{ deleted: true }` instead of `""`.
98
+ - Requires `axios >=1.20.0`.
99
+
100
+ ### Added
101
+ - `@certen.io/sdk/browser`: a browser-safe entry (Web Crypto, portable byte helpers, a pure `sha256`), selected by the `browser` export condition. `CertenAgent`, `ed25519Signer`, `fetchSharedProof` and `decodeSharedBundle` stay Node-only.
102
+ - `@certen.io/sdk/verify`, `proof.portable()`, `beforeSign` and the signing checks (below).
103
+ - The chain catalogue, including Telcoin Adiri (a testnet; it needs `CERTEN_ENABLED_CHAINS` and the gateway listing it): `unknown_chain` and `chain_not_enabled`, checked before a request is sent.
104
+ - The SDK's own version in the `User-Agent` (none from a browser). `verifyReceipt` reports a runtime without ed25519 as `skipped`, never `ok`.
105
+
106
+ ### Fixed
107
+ - A foreign `submit_url` or a plain 307 redirect used to receive the API key; ids such as `proof.get("a/../admin")` used to call another endpoint.
108
+ - Four load-sensitive tests (retry backoff, wait timeouts) no longer depend on machine load.
109
+ - `loadProofEvidence` (so `certen proof verify` and `certen_proof_verify`) refused any bundle whose content type was not JSON, but the gateway serves a JSON bundle as `application/octet-stream`; the execution component was dropped and the outcome layer reported as having no execution proof. The bytes are now decoded (JSON or gzip-compressed JSON) whatever the content type. Found by the first live proof, which now verifies end to end (exit 0) with `--rpc`.
110
+
111
+ ### Included — every external-mode signature is checked first (RB7b Phase F)
112
+
113
+ ### Changed (breaking)
114
+ - `execute.contractCall`, `execute.transfer`, `execute.cosign` and `CertenAgent`'s governance operations rebuild the transaction the gateway returned, recompute every hash and
115
+ match it to the request before they sign, and refuse with `SIGNING_DATA_MISMATCH` (field named), `SIGNING_DATA_ABSENT`, `SIGNING_EXPECTATION_UNAVAILABLE` or
116
+ `SIGNING_VERIFIER_UNAVAILABLE`. There is no option to sign without the check. **This needs a gateway that returns `signing_data.transaction` and
117
+ `signing_data.signature_metadata`; against a gateway that does not, every external-mode signature is refused.** Release only after that gateway change is deployed.
118
+ - Signing needs the optional peer `@certen.io/proof-verify` (loaded on first use, so the API client keeps its one runtime dependency). In a browser, signing through the SDK is refused
119
+ (`SIGNING_VERIFIER_UNAVAILABLE`) until the verifier runs there.
120
+
121
+ ### Added
122
+ - `beforeSign(summary)` on `contractCall` / `transfer` / `cosign`: what the signature will authorise, after the check and before the signature; return `false` to decline (`SIGNING_DECLINED`).
123
+ `OpenedIntent.signing` carries the same summary.
124
+ - `checkIntentSigning`, `checkCosigning`, `checkGovernanceSigning`, `inspectSigningData`, `legsFromIntent`, `CertenSigningDataError`.
125
+ ### Included — verify a proof instead of trusting it (RB7b Phase E)
126
+
127
+ ### Added
128
+ - `@certen.io/sdk/verify`: `verifyBundle` (one verdict per layer from a bundle or a proof v2 document), `loadProofEvidence`, `bundleInputOf`,
129
+ `portableDocumentOf`, and everything `@certen.io/proof-verify` exports. An optional peer dependency, so the API client does not pull in the verifier.
130
+ - `proof.portable(proofId)` (`GET /v1/proof/{id}/v2`): the proof v2 portable document. A 404/501 is `PROOF_V2_EVIDENCE_NOT_SERVED`; the route is specified in
131
+ the RB7b gateway notes and is not deployed yet, so it is listed in `tools/agentgen/pending-routes.json`.
132
+
133
+ ### Changed
134
+ - Nothing in the default entry changes; a bundle's own `verified` flag is still returned as data and is not a verdict anywhere in the SDK.
135
+ ### Included — transaction deadlines, header authorities, failure reasons
136
+
137
+ ### Added
138
+ - `expiresAt` (Date | RFC 3339 string) and `additionalAuthorities` (acc:// key books, max 8) on
139
+ `execute.contractCall`, `execute.transfer`, `transaction.create`, `agent.call`, `agent.transfer`
140
+ and `agent.token`, sent as `expires_at` / `additional_authorities` and validated before any request.
141
+ `expiresIn("30m")` and `parseDuration()` build a deadline. The checks mirror the gateway: authorities are
142
+ trimmed, lowercased, stripped of trailing slashes, need a non-empty host, at most 512 characters, and at
143
+ most 8 distinct after de-duplication; `expiresAt` must be 90 s (gateway minimum 60 s, plus latency margin)
144
+ to 7 days ahead.
145
+ - `CertenHeaderAuthorityNotExecutableError` for HTTP 422 `HEADER_AUTHORITY_NOT_EXECUTABLE`, with
146
+ `guidance`. The gateway refuses header authorities by default because validators do not yet execute
147
+ intents that carry them.
148
+ - `TransactionReasonCode` (now including `expired` and `expectation_unmet`), `CompletionBasis`,
149
+ `describeReasonCode()`; `TransactionResponse` gains `reason_code`, `additional_authorities`,
150
+ `expires_at` and `completion_basis`.
151
+
152
+ ### Changed
153
+ - `execute.wait()` throws `CertenIntentFailedError` (a `CertenError`, code `INTENT_FAILED`) on a failed
154
+ intent, carrying `reasonCode`; the message now includes the reason in parentheses.
155
+
3
156
  ## 0.9.0 — verify the outcome from the bundle's own bytes
4
157
 
5
158
  ### Added — `verifyExecutionProof`, `checkAgainstHeader`, `decodeSharedBundle`
package/README.md CHANGED
@@ -9,6 +9,8 @@ cross-chain execution on Accumulate.
9
9
  npm install @certen.io/sdk
10
10
  ```
11
11
 
12
+ Requires **Node 22 or 24** (`engines.node >=22`). To sign through the SDK, also install the optional peer `@certen.io/proof-verify` (see *Every signature is checked first*).
13
+
12
14
  ```ts
13
15
  import { CertenClient } from '@certen.io/sdk';
14
16
 
@@ -30,6 +32,16 @@ await certen.execute.wait(intentId); // ~60-110s of real validat
30
32
  const proof = await certen.execute.proof(intentId); // hand this to your counterparty
31
33
  ```
32
34
 
35
+ `execute.send` is the same transfer with everything the identity already knows filled in: it derives the ADI and the abstract account from `identityId`, and refuses before the network is
36
+ touched or anything is signed a recipient that is not an address (or whose EIP-55 checksum fails), an asset that is not the chain's native token, an amount that is zero or looks like wei,
37
+ and a chain the catalogue does not know.
38
+
39
+ ```ts
40
+ const { intentId, fromAddress } = await certen.execute.send({
41
+ identityId, chain: 'base-sepolia', toAddress: '0xBe00…9251', amount: '0.001', sign: (hashHex) => ed25519Sign(hashHex), publicKey,
42
+ });
43
+ ```
44
+
33
45
  Prefer `execute.*` — it is the same flow every integration writes, with the details that are easy to
34
46
  get wrong already handled. The raw resources are there when you need to drive the steps yourself:
35
47
 
@@ -67,6 +79,67 @@ new CertenClient({
67
79
  **Base URL precedence:** `options.baseUrl` → `$CERTEN_API_URL` → `https://gateway.kompendium.co`. The env var
68
80
  is there so a deployment can be retargeted at staging or a self-hosted gateway without a code change.
69
81
 
82
+ **The client only talks to its own gateway.** Every request URL, every `submit_url` a response names, and every redirect must stay
83
+ on the base URL's origin; anything else is refused with `FOREIGN_ORIGIN_URL` before a credential is attached or anything is signed.
84
+ Every id, hash or token you pass is encoded as exactly one path segment; an empty one, or one made only of dots, is refused
85
+ with `INVALID_PATH_PARAMETER` instead of reaching a different route.
86
+
87
+ ## Browsers
88
+
89
+ `@certen.io/sdk` runs in a browser through the **`browser` export condition** (webpack, Vite, esbuild and rollup select it
90
+ automatically), or explicitly as `@certen.io/sdk/browser`. That entry is the client, its resources, the typed errors, the status
91
+ table, the chain catalogue and the pure helpers; it uses Web Crypto and no Node module. Two things need Node and are only in the default entry:
92
+ `CertenAgent` / `ed25519Signer` (a local signing key) and `fetchSharedProof` / `decodeSharedBundle` (gunzip). A browser sends no
93
+ `User-Agent` (it forbids scripts setting one). `verifyReceipt` uses Web Crypto's ed25519; a runtime without it reports the signature
94
+ check as `skipped`, never as `ok`. CI bundles the browser entry and runs it with `process`, `Buffer` and `require` removed.
95
+
96
+ ## Every signature is checked first
97
+
98
+ `execute.contractCall`, `execute.transfer`, `execute.cosign` and `CertenAgent`'s governance operations never sign a bare `hash_to_sign`. They rebuild the transaction the gateway returned
99
+ (`signing_data.transaction`, `signing_data.signature_metadata`), recompute every hash and match what it would authorise to your request, then sign; any disagreement throws
100
+ `SIGNING_DATA_MISMATCH` naming the field, and nothing is signed. `beforeSign(summary)` shows what the signature authorises and may decline. There is no option to sign without the check. It needs the
101
+ optional peer `@certen.io/proof-verify`, and a gateway that returns the unsigned transaction; in a browser, signing through the SDK is refused until the verifier runs there.
102
+
103
+ ## Verify a proof: `@certen.io/sdk/verify`
104
+
105
+ A separate entry point, so the API client stays light: it needs the optional peer `@certen.io/proof-verify` (and, under it, the Accumulate encoder).
106
+
107
+ ```ts
108
+ import { CertenClient } from '@certen.io/sdk';
109
+ import { loadProofEvidence, verifyBundle, bundleInputOf } from '@certen.io/sdk/verify';
110
+
111
+ const client = new CertenClient({ apiKey });
112
+ const evidence = await loadProofEvidence(client, intentId); // bundle + proof v2 document (or why there is none)
113
+ const v = verifyBundle(bundleInputOf(evidence), { header }); // header: the execution chain's block header, from your own node
114
+ v.overall; // 'verified' | 'partial' | 'failed' | 'no_evidence'
115
+ v.layers; // one verdict per layer, with the evidence it was checked against
116
+ ```
117
+
118
+ The Accumulate side is checked from the proof v2 portable document, the execution outcome from the bundle's own receipt. A `verified` field in a
119
+ bundle is never read as a verdict (it comes back as `bundleStatements`), and neither is the gateway's own receipt. When the gateway serves no
120
+ proof v2 document for a proof, `proof.portable()` throws `PROOF_V2_EVIDENCE_NOT_SERVED` and `loadProofEvidence` reports it as `notServed`: the result is
121
+ `no_evidence`, never a pass.
122
+
123
+ ### The receipt
124
+
125
+ `buildReceipt` is the whole answer to "what happened": it reads the intent, verifies its proof **here**, optionally reads the recipient's balance from **a node of yours**, and assembles one record
126
+ (`assembleReceipt` is the pure half, in the main entry, and needs no verifier).
127
+
128
+ ```ts
129
+ import { buildReceipt } from '@certen.io/sdk/verify';
130
+
131
+ const receipt = await buildReceipt(client, intentId, { rpc: process.env.MY_NODE, request });
132
+ receipt.verdict; // 'verified' | 'partial' | 'failed' | 'pending' | 'unproven'
133
+ receipt.gaps; // what is not established, one entry each: empty exactly when verdict is 'verified'
134
+ receipt.ids; // intent, Accumulate tx, destination tx (from the verified proof), proof id
135
+ ```
136
+
137
+ `verified` needs the proof to verify **and** the value to have arrived. The proof's execution layer stays unchecked until the receipts root is compared with a header from a node you named, so without
138
+ `rpc` a receipt is `partial` and says which layer. When the process must not call a node itself (a server an agent drives), fetch the block header from your own node and pass it as `header:
139
+ { receiptsRoot, hash?, number? }` instead: it closes the same layer, cannot read the recipient (so a transfer stays `partial`), is refused with `INVALID_HEADER` if it has no `receiptsRoot` (a header
140
+ with nothing to compare is not a comparison), and cannot be combined with `rpc`. `@certen.io/mcp`'s `certen_receipt` is this call. A proof that could not be fetched is `unavailable` (not "no evidence"), a recipient that could not be read is `unreadable`, and neither is ever turned
141
+ into a pass. `rpc` is yours: no CERTEN credential is sent to it, no redirect is followed, and its URL (which can carry a key) is never put in a message or the receipt, only its host.
142
+
70
143
  ## What it does for you
71
144
 
72
145
  **Automatic idempotency on POSTs.** Every POST gets a generated `Idempotency-Key` so a retried network error
@@ -140,6 +213,28 @@ The gateway serves ~80 endpoints; this covers the integration surface. For anyth
140
213
  [live spec](https://gateway.kompendium.co/docs/json) is authoritative and the client's `request` path will
141
214
  carry it.
142
215
 
216
+ ## Chains
217
+
218
+ One typed catalogue, `CHAIN_CATALOGUE`, holds every chain fact the SDK, the CLI and the MCP server use:
219
+ slug, numeric id, gas token and decimals, block time, faucet, aliases, and whether it is on by default.
220
+
221
+ | Chain | Id | Gas | Default |
222
+ |---|---|---|---|
223
+ | `ethereum-sepolia` | 11155111 | ETH | on |
224
+ | `base-sepolia` | 84532 | ETH | on |
225
+ | `arbitrum-sepolia` | 421614 | ETH | on |
226
+ | `telcoin-adiri` — Telcoin's **Adiri testnet** | 2017 | TEL (18 decimals) | off |
227
+
228
+ The catalogue says what a chain IS; the gateway says whether it may be used. Offer what
229
+ `client.chains.enabled(configured?)` returns: the configured chains (default: the three above) that
230
+ `GET /v1/chains` serves right now. `parseEnabledChains('…,telcoin-adiri')` turns a setting into that list
231
+ and refuses an unknown or retired chain by name.
232
+
233
+ The funding guard reads each chain's own gas token (`readNativeBalance`). On Adiri an empty TEL account
234
+ throws `CertenUnfundedAccountError`; a gas balance it cannot identify (an unknown chain, a balance row that
235
+ is not the chain's gas token, or an unreadable one) throws `CertenFundingUnverifiableError` rather than
236
+ letting the intent through.
237
+
143
238
  ## Three things to know
144
239
 
145
240
  **Identity creation is asynchronous.** `identity.create` resolves with a `202`-shaped result and provisioning
@@ -150,6 +245,22 @@ timeout.
150
245
 
151
246
  **`vote` is `approve` | `reject` | `abstain`** — a lowercase string, not a number, and not `accept`.
152
247
 
248
+ ## Deadlines, header authorities and failure reasons
249
+
250
+ `execute.contractCall`, `execute.transfer`, `transaction.create`, `agent.call` and `agent.transfer` accept
251
+ `expiresAt` (a `Date` or RFC 3339 string, or `expiresIn('30m')`; 90 s to 7 days ahead — the gateway allows 60 s, the SDK keeps a margin) and `additionalAuthorities` (`acc://` key
252
+ books, at most 8). Both are validated before anything is sent.
253
+
254
+ - **`expiresAt`** — unsigned past the deadline, the intent ends `failed` with `reason_code: 'expired'`:
255
+ nothing executes, no fee or gas.
256
+ - **`additionalAuthorities` is refused by the gateway by default** — HTTP 422, thrown as
257
+ `CertenHeaderAuthorityNotExecutableError` (see its `guidance`). Validators do not yet count a header
258
+ authority's signature, so such an intent would never execute. Make a required co-signer an authority on
259
+ the account instead (`agent.governance.requireSigner`).
260
+ - **`execute.wait()` throws `CertenIntentFailedError`** on a failed intent, with `reasonCode`
261
+ (`'expired'`, `'expectation_unmet'`, `'target_reverted'`, …). `describeReasonCode()` renders it.
262
+ `expectation_unmet` means the call ran but its `expectedEvents` are missing: it is not a success.
263
+
153
264
  ## Guides
154
265
 
155
266
  - [Onboard an identity](https://docs.kompendium.co/onboard-an-identity.html)
@@ -0,0 +1,12 @@
1
+ /** The EIP-55 mixed-case spelling of an address (40 hex digits, with or without `0x`). Throws on anything that is not 40 hex digits. */
2
+ export declare function toChecksumAddress(address: string): string;
3
+ /**
4
+ * What is wrong with this as an EVM address, or undefined when nothing is.
5
+ *
6
+ * Two different mistakes, told apart: not an address at all (wrong length, not hex), and an address whose capitalisation claims a checksum it
7
+ * does not have. The second names the correct spelling, so a person who copied the address from somewhere reliable can see which characters
8
+ * differ and one who typed it can see what they most likely meant. It is never silently corrected: a corrected address would be the client
9
+ * deciding where value goes.
10
+ */
11
+ export declare function evmAddressProblem(value: unknown): string | undefined;
12
+ //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAiBA,wIAAwI;AACxI,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAcpE"}
@@ -0,0 +1,48 @@
1
+ import { keccak256 } from './execution-proof.js';
2
+ /**
3
+ * EVM addresses: is this one, and does its checksum hold?
4
+ *
5
+ * A recipient typed into `certen send` is the one value in the whole flow that nothing downstream can correct: the signature authorises exactly
6
+ * what was asked for, and what was asked for was a typo. EIP-55 puts a checksum in the capitalisation of an address, so a mixed-case address
7
+ * that does not match its own hash is a mistyped one, caught before anything is signed.
8
+ *
9
+ * An all-lower-case or all-upper-case address carries no checksum and is accepted: refusing it would refuse every address copied from a tool
10
+ * that does not capitalise, and those are most of them. The mixed-case form is the only one that makes a claim, so it is the only one checked.
11
+ */
12
+ const ADDRESS = /^0x[0-9a-fA-F]{40}$/;
13
+ const utf8 = (s) => new TextEncoder().encode(s);
14
+ /** The EIP-55 mixed-case spelling of an address (40 hex digits, with or without `0x`). Throws on anything that is not 40 hex digits. */
15
+ export function toChecksumAddress(address) {
16
+ const hex = address.replace(/^0x/i, '').toLowerCase();
17
+ if (!/^[0-9a-f]{40}$/.test(hex))
18
+ throw new Error(`certen: "${address}" is not 40 hex digits, so it has no checksum form.`);
19
+ const hash = Array.from(keccak256(utf8(hex)), (b) => b.toString(16).padStart(2, '0')).join('');
20
+ let out = '0x';
21
+ for (let i = 0; i < 40; i += 1)
22
+ out += parseInt(hash[i], 16) >= 8 ? hex[i].toUpperCase() : hex[i];
23
+ return out;
24
+ }
25
+ /**
26
+ * What is wrong with this as an EVM address, or undefined when nothing is.
27
+ *
28
+ * Two different mistakes, told apart: not an address at all (wrong length, not hex), and an address whose capitalisation claims a checksum it
29
+ * does not have. The second names the correct spelling, so a person who copied the address from somewhere reliable can see which characters
30
+ * differ and one who typed it can see what they most likely meant. It is never silently corrected: a corrected address would be the client
31
+ * deciding where value goes.
32
+ */
33
+ export function evmAddressProblem(value) {
34
+ const address = typeof value === 'string' ? value : '';
35
+ if (!ADDRESS.test(address)) {
36
+ // Not JSON.stringify(value) for a non-string: it throws on a BigInt and prints `undefined` for nothing, and a refusal must never throw.
37
+ const shown = typeof value === 'string' ? JSON.stringify(value) : `a value of type ${typeof value}`;
38
+ return `${shown} is not an EVM address. Expected 0x followed by 40 hex characters.`;
39
+ }
40
+ const body = address.slice(2);
41
+ const mixed = body !== body.toLowerCase() && body !== body.toUpperCase();
42
+ if (mixed && toChecksumAddress(address) !== address) {
43
+ return `${address} has capital letters that do not match its checksum (EIP-55), which means a character was mistyped or it was copied badly. `
44
+ + `The correctly capitalised address would be ${toChecksumAddress(address)}. Check the address; if it is right, write it in all lower case.`;
45
+ }
46
+ return undefined;
47
+ }
48
+ //# sourceMappingURL=address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.js","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;;;;;;;;GASG;AAEH,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAEtC,MAAM,IAAI,GAAG,CAAC,CAAS,EAAc,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEpE,wIAAwI;AACxI,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACtD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,qDAAqD,CAAC,CAAC;IAC3H,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/F,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC;QAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC;IACrG,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACvD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,wIAAwI;QACxI,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,OAAO,KAAK,EAAE,CAAC;QACpG,OAAO,GAAG,KAAK,oEAAoE,CAAC;IACtF,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;IACzE,IAAI,KAAK,IAAI,iBAAiB,CAAC,OAAO,CAAC,KAAK,OAAO,EAAE,CAAC;QACpD,OAAO,GAAG,OAAO,6HAA6H;cAC1I,8CAA8C,iBAAiB,CAAC,OAAO,CAAC,kEAAkE,CAAC;IACjJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
package/dist/agent.d.ts CHANGED
@@ -65,6 +65,14 @@ export interface ProvisionParams {
65
65
  }
66
66
  /** Common knobs on every proof-gated action. */
67
67
  interface ActionOpts {
68
+ /**
69
+ * Extra header authorities (`acc://` key books, at most 8). The gateway refuses these by default
70
+ * (`HEADER_AUTHORITY_NOT_EXECUTABLE`) — use `governance.requireSigner` to make a book an account
71
+ * authority instead. See `HeaderFields`.
72
+ */
73
+ additionalAuthorities?: string[];
74
+ /** Deadline: a Date or RFC 3339 string. Unsigned past it, the intent ends `failed/expired`. */
75
+ expiresAt?: string | Date;
68
76
  proofClass?: ProofClass;
69
77
  idempotencyKey?: string;
70
78
  /** Sign with a different page of the book, e.g. a priority page — the seat still has to be on it. */
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAEV,YAAY,EACZ,wBAAwB,EACxB,QAAQ,EACR,UAAU,EACV,UAAU,EACV,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAGpB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,6GAA6G;AAC7G,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAwBjF;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,sGAAsG;IACtG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0E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C,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;SAAE;QAGzG,+FAA+F;iCACtE,MAAM,SAAQ;YAAE,aAAa,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;SAAE;MAEzG;IAEF,uHAAuH;IACvH,OAAO,CAAC,eAAe;YAUT,YAAY;CAqB3B"}
package/dist/agent.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createHash, createPrivateKey, createPublicKey, sign as nodeSign, generateKeyPairSync } from 'node:crypto';
2
+ import { checkGovernanceSigning } from './signing-check.js';
2
3
  import { CertenError } from './errors.js';
3
4
  /**
4
5
  * An Ed25519 signer from a 32-byte seed (64 hex). The seed is the private half; keep it where the
@@ -142,6 +143,8 @@ export class CertenAgent {
142
143
  proofClass: p.proofClass,
143
144
  idempotencyKey: p.idempotencyKey,
144
145
  skipFundingCheck: p.skipFundingCheck,
146
+ additionalAuthorities: p.additionalAuthorities,
147
+ expiresAt: p.expiresAt,
145
148
  });
146
149
  }
147
150
  /**
@@ -164,6 +167,8 @@ export class CertenAgent {
164
167
  proofClass: p.proofClass,
165
168
  idempotencyKey: p.idempotencyKey,
166
169
  skipFundingCheck: p.skipFundingCheck,
170
+ additionalAuthorities: p.additionalAuthorities,
171
+ expiresAt: p.expiresAt,
167
172
  });
168
173
  }
169
174
  /**
@@ -275,6 +280,13 @@ export class CertenAgent {
275
280
  const hash = created.signing_data?.hash_to_sign;
276
281
  if (!hash)
277
282
  return created; // provider-signed, or nothing to sign
283
+ // Rebuilt and matched against the operation asked for before a signature exists; a mismatch throws and nothing is signed.
284
+ await checkGovernanceSigning(created.signing_data, {
285
+ adiUrl: this.state.adiUrl,
286
+ operations: [operation],
287
+ signerPublicKey: this.signer.publicKey,
288
+ signerKeyPage: opts.signerKeyPage,
289
+ });
278
290
  const signature = await this.signer.sign(hash);
279
291
  await this.client.governance.submitSignature(created.governance_op_id, { signature, publicKey: this.signer.publicKey });
280
292
  return created;
package/dist/agent.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,IAAI,IAAI,QAAQ,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAYnH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAuC1C;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,IAAI,IAAY,CAAC;IACjB,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QACtD,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE;YAAE,MAAM,IAAI,WAAW,CAAC,+CAA+C,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;IAChH,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,UAAU,EAAE,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACtD,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAW,CAAC;QAC1E,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,kFAAkF;IAClF,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5F,MAAM,UAAU,GAAG,gBAAgB,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC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,CAAC,OAAO,CAAC,YAAY,EAAE;YACjD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAO;YAC1B,UAAU,EAAE,CAAC,SAAyC,CAAC;YACvD,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS;YACtC,aAAa,EAAE,IAAI,CAAC,aAAa;SAClC,CAAC,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACxH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The browser-safe surface of the SDK: the client, its resources, the typed errors, the status table, the chain catalogue and every
3
+ * pure helper. Nothing reachable from here uses a Node built-in or a bare Node global (packages/sdk/test/browser-entry.test.ts
4
+ * bundles it for a browser and runs it with `process`, `Buffer` and `require` removed).
5
+ *
6
+ * `package.json` points the `browser` export condition here, and `@certen.io/sdk/browser` names it explicitly. The default entry
7
+ * (index.ts) is this plus the two modules that need Node: `CertenAgent` / `ed25519Signer` (local key handling with node:crypto) and
8
+ * `fetchSharedProof` / `decodeSharedBundle` (gunzip with node:zlib).
9
+ */
10
+ export { CertenClient, paginate, paginateWithTotal, DEFAULT_BASE_URL } from './client.js';
11
+ export * from './types.js';
12
+ export type { SignFn, ProofGatedCallParams, TransferParams, SendParams, SentIntent, OpenedIntent, WaitUntil, IntentStateEvent } from './resources/execute.js';
13
+ export { wholeUnitAmountProblem } from './resources/execute.js';
14
+ export { toChecksumAddress, evmAddressProblem } from './address.js';
15
+ export { checkEvmRpcEndpoint, evmRpcCall, readEvmChainId, assertRpcChain, readEvmBalance, readEvmBlockHeader, } from './evm-rpc.js';
16
+ export type { EvmRpcOptions } from './evm-rpc.js';
17
+ export { snapshotRecipient, checkNativeTransferEffect, noEffectToCheck } from './effect.js';
18
+ export type { EffectState, BalanceMove, ReceiptEffect, RecipientSnapshot, NativeEffectParams } from './effect.js';
19
+ export { assembleReceipt, estimateFee, RECEIPT_VERSION, EXECUTION_SKU } from './receipt.js';
20
+ export type { Receipt, ReceiptVerdict, ReceiptRequest, ReceiptSigner, ReceiptStage, ReceiptProof, ReceiptProofLayer, ReceiptProofInput, ReceiptGap, ProofVerdict, StageState, VerificationLike, AssembleReceiptInput, FeeEstimate, } from './receipt.js';
21
+ export { CertenError, CertenAuthError, CertenRateLimitError, CertenBadRequestError, CertenServerError, CertenPaymentRequiredError, CertenHeaderAuthorityNotExecutableError, CertenIntentFailedError, CertenWaitTimeoutError, CertenProofNotAvailableError, CertenForeignOriginError, HEADER_AUTHORITY_NOT_EXECUTABLE, } from './errors.js';
22
+ export { normalizeAdditionalAuthorities, normalizeExpiresAt, parseDuration, expiresIn, MAX_ADDITIONAL_AUTHORITIES, MAX_AUTHORITY_URL_LENGTH, GATEWAY_EXPIRY_MIN_S, GATEWAY_EXPIRY_MAX_S, LOCAL_EXPIRY_MIN_S, HEADER_FIELD_ERROR_CODES, } from './header-fields.js';
23
+ export { INTENT_STATUS_CLASS, classifyIntentStatus, isTerminalIntentStatus, intentOutcome, EXECUTION_PROOF_UNAVAILABLE, } from './intent-states.js';
24
+ export type { IntentStatusClass, KnownIntentStatus, IntentOutcome, IntentOutcomeName } from './intent-states.js';
25
+ export { describeReasonCode, isTransactionReasonCode, REASON_CODE_DESCRIPTIONS } from './reason-codes.js';
26
+ export type { PaymentResolution } from './errors.js';
27
+ export { runDoctor, CREDENTIALLED_CHECKS } from './doctor.js';
28
+ export { VENDORED_ERROR_CODES } from './error-codes.js';
29
+ export { runReadiness, checkGas, summarizeReadiness, READINESS_CHECKS, CONTEXT_CHECKS } from './readiness.js';
30
+ export type { Readiness, ReadinessCheck, ReadinessContext, ReadinessFix, ReadinessParams, ReadinessState, ReadinessStatus, } from './readiness.js';
31
+ export { readKeyPage, verifyKeyPageHolds, keyHashesOf } from './key-page.js';
32
+ export type { KeyPageReading, KeyPageHold, KeyPageReadOptions } from './key-page.js';
33
+ export { parseShareTarget } from './share-target.js';
34
+ export { verifyExecutionProof, checkAgainstHeader, executionComponentOf, decodeReceipt, verifyTrieProof, keccak256, rlpDecode, rlpEncodeUint, bytesFrom, } from './execution-proof.js';
35
+ export type { ExecutionProofComponent, ExecutionVerification, DecodedReceipt, DecodedLog } from './execution-proof.js';
36
+ export { fetchOAuthToken, refreshOAuthToken, revokeOAuthToken } from './oauth.js';
37
+ export { parseMnemonicTarget } from './resources/identity.js';
38
+ export { redeemRegistrationToken } from './registration.js';
39
+ export { selfSignup, requestSignupChallenge, completeSignup } from './self-signup.js';
40
+ export { CertenUnfundedAccountError, CertenUnderfundedAccountError, CertenFundingUnverifiableError, movesValue, normalizeChainId, assessGas, nativeAmountOf, nativeTransferUri, gasFundingPlan, } from './funding.js';
41
+ export type { FundingUnverifiableReason, GasAssessment, GasFundingPlan } from './funding.js';
42
+ export { CHAIN_CATALOGUE, chainInfo, chainSlug, nativeSymbolFor, faucetForChain, defaultEnabledChains, enablableChains, parseEnabledChains, ChainConfigurationError, gatewayServes, chainAvailability, resolveEnabledChains, readNativeBalance, describeUnverifiable, gasReserveFor, parseUnits, formatUnits, } from './chains.js';
43
+ export type { ChainCatalogueEntry, ChainSupport, ServedChain, ChainAvailability, BalanceRow, NativeBalanceReading, } from './chains.js';
44
+ export { resolveSignTarget } from './sign-target.js';
45
+ export type { SignTarget } from './sign-target.js';
46
+ export type { DoctorReport, DoctorCheck, CheckStatus } from './doctor.js';
47
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,E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