@certen.io/sdk 0.10.0 → 0.12.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 (80) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +57 -2
  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/browser.d.ts +17 -4
  8. package/dist/browser.d.ts.map +1 -1
  9. package/dist/browser.js +14 -2
  10. package/dist/browser.js.map +1 -1
  11. package/dist/chains.d.ts +20 -0
  12. package/dist/chains.d.ts.map +1 -1
  13. package/dist/chains.js +34 -0
  14. package/dist/chains.js.map +1 -1
  15. package/dist/client.d.ts +15 -1
  16. package/dist/client.d.ts.map +1 -1
  17. package/dist/client.js +17 -3
  18. package/dist/client.js.map +1 -1
  19. package/dist/doctor.d.ts +10 -1
  20. package/dist/doctor.d.ts.map +1 -1
  21. package/dist/doctor.js +6 -4
  22. package/dist/doctor.js.map +1 -1
  23. package/dist/effect.d.ts +99 -0
  24. package/dist/effect.d.ts.map +1 -0
  25. package/dist/effect.js +139 -0
  26. package/dist/effect.js.map +1 -0
  27. package/dist/error-codes.d.ts.map +1 -1
  28. package/dist/error-codes.js +11 -0
  29. package/dist/error-codes.js.map +1 -1
  30. package/dist/errors.d.ts.map +1 -1
  31. package/dist/errors.js +3 -0
  32. package/dist/errors.js.map +1 -1
  33. package/dist/evm-rpc.d.ts +55 -0
  34. package/dist/evm-rpc.d.ts.map +1 -0
  35. package/dist/evm-rpc.js +126 -0
  36. package/dist/evm-rpc.js.map +1 -0
  37. package/dist/funding.d.ts +171 -0
  38. package/dist/funding.d.ts.map +1 -1
  39. package/dist/funding.js +190 -8
  40. package/dist/funding.js.map +1 -1
  41. package/dist/key-page.d.ts +67 -0
  42. package/dist/key-page.d.ts.map +1 -0
  43. package/dist/key-page.js +154 -0
  44. package/dist/key-page.js.map +1 -0
  45. package/dist/readiness.d.ts +133 -0
  46. package/dist/readiness.d.ts.map +1 -0
  47. package/dist/readiness.js +467 -0
  48. package/dist/readiness.js.map +1 -0
  49. package/dist/receipt.d.ts +233 -0
  50. package/dist/receipt.d.ts.map +1 -0
  51. package/dist/receipt.js +318 -0
  52. package/dist/receipt.js.map +1 -0
  53. package/dist/resources/chains.d.ts +14 -1
  54. package/dist/resources/chains.d.ts.map +1 -1
  55. package/dist/resources/chains.js +21 -0
  56. package/dist/resources/chains.js.map +1 -1
  57. package/dist/resources/execute.d.ts +62 -1
  58. package/dist/resources/execute.d.ts.map +1 -1
  59. package/dist/resources/execute.js +102 -9
  60. package/dist/resources/execute.js.map +1 -1
  61. package/dist/resources/identity.d.ts +47 -2
  62. package/dist/resources/identity.d.ts.map +1 -1
  63. package/dist/resources/identity.js +63 -1
  64. package/dist/resources/identity.js.map +1 -1
  65. package/dist/resources/transaction.d.ts +12 -1
  66. package/dist/resources/transaction.d.ts.map +1 -1
  67. package/dist/resources/transaction.js +14 -0
  68. package/dist/resources/transaction.js.map +1 -1
  69. package/dist/shared-proof.d.ts.map +1 -1
  70. package/dist/shared-proof.js +21 -1
  71. package/dist/shared-proof.js.map +1 -1
  72. package/dist/types.d.ts +207 -0
  73. package/dist/types.d.ts.map +1 -1
  74. package/dist/verify.d.ts +126 -2
  75. package/dist/verify.d.ts.map +1 -1
  76. package/dist/verify.js +191 -2
  77. package/dist/verify.js.map +1 -1
  78. package/dist/version.d.ts +1 -1
  79. package/dist/version.js +1 -1
  80. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,105 @@
1
1
  # Changelog — @certen.io/sdk
2
2
 
3
+ ## 0.12.0 — the gateway asks: readiness, quote, credit top-up, gas drip, any-address balance, and the destination transaction (CLI UX, Phase G; 2026-10-17)
4
+
5
+ Additive. `@certen.io/cli` 0.12.0 and `@certen.io/mcp` 0.7.0 need this release, so it goes out first. Needs a gateway that serves the five operations (deployed 2026-10-16); against an older one each answers `ENDPOINT_NOT_ON_GATEWAY`. Two of the calls spend the platform's funds and are off unless the deployment's operator switched them on.
6
+
7
+ ### Added
8
+ - **`chains.balance(chain, address)`**: the native balance of any EVM address on a chain the gateway serves, as a decimal string (`'0'` is a successful read of an empty account). Needs an API key. A mistyped address is refused before any request with `INVALID_ADDRESS` (a mixed-case address whose EIP-55 checksum fails names the correct capitalisation); a node that did not answer is `BALANCE_UNREADABLE`, never a zero.
9
+ - **`identity.readiness(id, { chain? })`**: the identity, whether its key is on its key page, its credits, optionally one chain's account and native balance, and the organisation's spendable balance, in one read. It reports facts and says nothing like "ready"; each section carries its own `state`. It does not check the key page against Accumulate itself, which `client.readiness()` does.
10
+ - **`identity.topUpCredits(id, { credits, idempotencyKey? })`**: sponsor-paid credits for the identity's key page (1 credit = $0.01; `credits` is a count, never ACME). Refuses anything but a whole number of at least 1 before any request. The gateway requires an `Idempotency-Key`: the SDK always sends one, yours if given, otherwise one it generates (the same one on its own internal retries), even with `autoIdempotencyKey: false`. Answered 202; `status: 'unconfirmed'` is returned as data, because the credits may have been applied.
11
+ - **`identity.drip(id, chain, { idempotencyKey? })`**: a testnet gas drip to the identity's own deployed account. The request carries no body: the destination is the gateway's record and the amount is the operator's. `sent`, `skipped` and `unconfirmed` are all answers.
12
+ - **`transaction.quote({ intent, proofClass? })`**: what an intent would cost and whether it would be admitted, with nothing created, charged or signed. An estimate (`estimate: true`), with the gates it checked and the ones it did not.
13
+ - **`TransactionResponse.destination`** (`TransactionDestination`): the one transaction the intent made on its destination chain, **as the validators recorded it**. Not verified by the gateway; null until recorded and null for an intent on several chains.
14
+ - **The eleven error codes the gateway added are known to the SDK** (`BALANCE_UNREADABLE`, `CREDIT_TOPUP_DISABLED`, `CREDIT_TOPUP_LIMIT`, `DRIP_DISABLED`, `DRIP_LIMIT`, `DRIP_RECIPIENT_REJECTS`, `DRIP_TESTNET_ONLY`, `DRIP_UNAVAILABLE`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_ADDRESS`, `PROOF_V2_NOT_AVAILABLE`): they are in `VENDORED_ERROR_CODES`, so `doctor` no longer reports the gateway as ahead of the SDK for them, and in `docs/errors.md`.
15
+
16
+ ### Changed
17
+ - **`CertenError.isRetryable` is false for `CREDIT_TOPUP_DISABLED` and `DRIP_DISABLED`** (both 503): a feature the operator has not switched on does not switch on by retrying, so the client's automatic retry no longer repeats them.
18
+ - The vendored spec is refreshed to the deployed gateway (131 operations): the five above, `GET /v1/proof/{id}/v2` (no longer a pending route), `destination`, and `signing_data.transaction` / `signing_data.signature_metadata` on the prepare responses, which the SDK already read.
19
+
20
+ ### Known
21
+ - `CREDIT_TOPUP_LIMIT` and `DRIP_LIMIT` are 429s the gateway's catalogue marks retryable, so the client retries them a few times with backoff. They are daily and cooldown limits, which an immediate retry cannot clear, as `PLAN_QUOTA_EXCEEDED` already is. The SDK mirrors the catalogue (a test requires the two to agree); the fix belongs in the gateway's catalogue first.
22
+
23
+ ## 0.11.0 — readiness, gas, receipts and sending from an identity (CLI UX plan, 2026-10-16)
24
+
25
+ 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:
26
+ 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);
27
+ `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.
28
+ `@certen.io/cli` 0.11.0 and `@certen.io/mcp` 0.6.0 need this release, so it goes out first.
29
+
30
+ ### Included — a node for the recipient, and a share fetch that stays on its origin (CLI UX, Phase 6 follow-ups)
31
+
32
+ Additive, plus one hardening. A maintainer versions and publishes this; the MCP server's operator-configured node and share-origin rule need it.
33
+
34
+ ### Added
35
+ - **`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.
36
+
37
+ ### Changed
38
+ - **`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.
39
+
40
+ ### Included — a block header you fetched yourself (CLI UX, Phase 6)
41
+
42
+ 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.
43
+
44
+ ### Added
45
+ - **`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".
46
+ - **`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.
47
+
48
+ ### Fixed
49
+ - **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.
50
+ - `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.
51
+
52
+ ### Included — the error codes the gateway publishes, as a constant (CLI UX, Phase 5)
53
+
54
+ Additive. Nothing that works today changes. A maintainer versions and publishes this.
55
+
56
+ ### Added
57
+ - **`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).
58
+
59
+ ### Included — the receipt, and sending from an identity (CLI UX, Phase 4)
60
+
61
+ Additive, with one fix to a verifier that was too forgiving (below). Nothing else that works today changes. A maintainer versions and publishes this.
62
+
63
+ ### Added
64
+ - **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`, …).
65
+ - **`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.
66
+ - **`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.
67
+ - **`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.
68
+ - **`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.
69
+ - **`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 …").
70
+ - **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`.
71
+ - **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.
72
+ - **`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.
73
+
74
+ ### Fixed
75
+ - **`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.
76
+
77
+ ### Included — funding a gas gap (CLI UX, Phase 3)
78
+
79
+ Additive. Nothing that works today changes. A maintainer versions and publishes this.
80
+
81
+ ### Added
82
+ - **`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.
83
+ - **`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.
84
+ - **`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.
85
+
86
+
87
+ ### Included — readiness (CLI UX, Phase 2)
88
+
89
+ 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.
90
+
91
+ ### Added
92
+ - **`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.
93
+ - **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.
94
+ - **`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`.
95
+ - **`CertenUnderfundedAccountError`** (`ABSTRACT_ACCOUNT_UNDERFUNDED`, never retryable).
96
+ - **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.
97
+ - **`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.
98
+ - `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.
99
+
100
+ ### Changed
101
+ - **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.
102
+
3
103
  ## 0.10.0 — RB7b: verify what you trust, sign what you see (2026-10-09)
4
104
 
5
105
  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).
package/README.md CHANGED
@@ -32,6 +32,16 @@ await certen.execute.wait(intentId); // ~60-110s of real validat
32
32
  const proof = await certen.execute.proof(intentId); // hand this to your counterparty
33
33
  ```
34
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
+
35
45
  Prefer `execute.*` — it is the same flow every integration writes, with the details that are easy to
36
46
  get wrong already handled. The raw resources are there when you need to drive the steps yourself:
37
47
 
@@ -110,6 +120,26 @@ bundle is never read as a verdict (it comes back as `bundleStatements`), and nei
110
120
  proof v2 document for a proof, `proof.portable()` throws `PROOF_V2_EVIDENCE_NOT_SERVED` and `loadProofEvidence` reports it as `notServed`: the result is
111
121
  `no_evidence`, never a pass.
112
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
+
113
143
  ## What it does for you
114
144
 
115
145
  **Automatic idempotency on POSTs.** Every POST gets a generated `Idempotency-Key` so a retried network error
@@ -171,8 +201,9 @@ constructor argument. An escrow or any other contract ABI belongs on top of `cal
171
201
 
172
202
  | | |
173
203
  |---|---|
174
- | `certen.identity` | `create` · `get` · `update` · `retire` |
175
- | `certen.transaction` | `create` · `submitSignature` · `get` · `list` |
204
+ | `certen.identity` | `create` · `get` · `update` · `retire` · `readiness` · `topUpCredits` · `drip` |
205
+ | `certen.transaction` | `create` · `quote` · `submitSignature` · `get` · `list` |
206
+ | `certen.chains` | `list` · `get` · `enabled` · `balance` |
176
207
  | `certen.sign` | `create` · `submitSignature` |
177
208
  | `certen.governance` | `create` · `submitSignature` · `get` |
178
209
  | `certen.pending` | `list` |
@@ -205,6 +236,30 @@ throws `CertenUnfundedAccountError`; a gas balance it cannot identify (an unknow
205
236
  is not the chain's gas token, or an unreadable one) throws `CertenFundingUnverifiableError` rather than
206
237
  letting the intent through.
207
238
 
239
+ ## Reads, estimates, and two calls that spend the platform's funds
240
+
241
+ ```ts
242
+ // Reads (nothing is spent or created)
243
+ await certen.chains.balance('base-sepolia', '0x…'); // any address's native balance, as a decimal string: '0.25'; '0' is an empty account
244
+ await certen.identity.readiness(id, { chain: 'base-sepolia' }); // identity, key, credits, chain account + balance, org balance: one read, facts only
245
+ await certen.transaction.quote({ intent }); // what it would cost and whether it would be admitted: an ESTIMATE, nothing created
246
+
247
+ // Calls that spend the PLATFORM's funds. Each needs an Idempotency-Key and is OFF unless the deployment's operator switched it on.
248
+ await certen.identity.topUpCredits(id, { credits: 500, idempotencyKey: 'order-4411' }); // sponsor-paid ACME credits (1 credit = $0.01)
249
+ await certen.identity.drip(id, 'base-sepolia', { idempotencyKey: 'drip-77' }); // testnet gas to the identity's own account
250
+ ```
251
+
252
+ `balance` needs an API key (it reads through the gateway's node), and a node that did not answer is `BALANCE_UNREADABLE`, never a zero.
253
+ `readiness` reports **facts and says nothing like "ready"**; each section has its own `state`, and an `unreadable` one does not fail the others.
254
+ `client.readiness()` is the longer way to the same question: it checks the key page against Accumulate itself, which the gateway's aggregate does not.
255
+
256
+ `topUpCredits` and `drip` return `202` with `status: 'unconfirmed'` when nobody can say whether the money moved. **That is data, not an error:
257
+ read the balance before asking again**, because a new key is a second draw. Pass your own `idempotencyKey` so a retry after a crash reuses the
258
+ same one; left out, the SDK generates one for that call (and the same one on its own internal retries). Both are refused with a code you can
259
+ read when switched off (`CREDIT_TOPUP_DISABLED`, `DRIP_DISABLED`; not retried), limited (`CREDIT_TOPUP_LIMIT`, `DRIP_LIMIT`), or, for the drip,
260
+ aimed at something that is not a testnet (`DRIP_TESTNET_ONLY`). The drip sends nothing anywhere you name: the destination is the account the
261
+ gateway recorded for the identity and the amount is the operator's.
262
+
208
263
  ## Three things to know
209
264
 
210
265
  **Identity creation is asynchronous.** `identity.create` resolves with a `202`-shaped result and provisioning
@@ -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/browser.d.ts CHANGED
@@ -9,7 +9,15 @@
9
9
  */
10
10
  export { CertenClient, paginate, paginateWithTotal, DEFAULT_BASE_URL } from './client.js';
11
11
  export * from './types.js';
12
- export type { SignFn, ProofGatedCallParams, TransferParams, OpenedIntent, WaitUntil, IntentStateEvent } from './resources/execute.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';
13
21
  export { CertenError, CertenAuthError, CertenRateLimitError, CertenBadRequestError, CertenServerError, CertenPaymentRequiredError, CertenHeaderAuthorityNotExecutableError, CertenIntentFailedError, CertenWaitTimeoutError, CertenProofNotAvailableError, CertenForeignOriginError, HEADER_AUTHORITY_NOT_EXECUTABLE, } from './errors.js';
14
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';
15
23
  export { INTENT_STATUS_CLASS, classifyIntentStatus, isTerminalIntentStatus, intentOutcome, EXECUTION_PROOF_UNAVAILABLE, } from './intent-states.js';
@@ -17,6 +25,11 @@ export type { IntentStatusClass, KnownIntentStatus, IntentOutcome, IntentOutcome
17
25
  export { describeReasonCode, isTransactionReasonCode, REASON_CODE_DESCRIPTIONS } from './reason-codes.js';
18
26
  export type { PaymentResolution } from './errors.js';
19
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';
20
33
  export { parseShareTarget } from './share-target.js';
21
34
  export { verifyExecutionProof, checkAgainstHeader, executionComponentOf, decodeReceipt, verifyTrieProof, keccak256, rlpDecode, rlpEncodeUint, bytesFrom, } from './execution-proof.js';
22
35
  export type { ExecutionProofComponent, ExecutionVerification, DecodedReceipt, DecodedLog } from './execution-proof.js';
@@ -24,9 +37,9 @@ export { fetchOAuthToken, refreshOAuthToken, revokeOAuthToken } from './oauth.js
24
37
  export { parseMnemonicTarget } from './resources/identity.js';
25
38
  export { redeemRegistrationToken } from './registration.js';
26
39
  export { selfSignup, requestSignupChallenge, completeSignup } from './self-signup.js';
27
- export { CertenUnfundedAccountError, CertenFundingUnverifiableError, movesValue, normalizeChainId } from './funding.js';
28
- export type { FundingUnverifiableReason } from './funding.js';
29
- export { CHAIN_CATALOGUE, chainInfo, chainSlug, nativeSymbolFor, faucetForChain, defaultEnabledChains, enablableChains, parseEnabledChains, ChainConfigurationError, gatewayServes, chainAvailability, resolveEnabledChains, readNativeBalance, describeUnverifiable, } from './chains.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';
30
43
  export type { ChainCatalogueEntry, ChainSupport, ServedChain, ChainAvailability, BalanceRow, NativeBalanceReading, } from './chains.js';
31
44
  export { resolveSignTarget } from './sign-target.js';
32
45
  export type { SignTarget } from './sign-target.js';
@@ -1 +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,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1F,cAAc,YAAY,CAAC;AAC3B,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACtI,OAAO,EACL,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,uCAAuC,EACvC,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,GAChC,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,8BAA8B,EAAE,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,0BAA0B,EACxG,wBAAwB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,wBAAwB,GACnH,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,aAAa,EAAE,2BAA2B,GAC9G,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,iBAAiB,EAA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,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
package/dist/browser.js CHANGED
@@ -9,6 +9,13 @@
9
9
  */
10
10
  export { CertenClient, paginate, paginateWithTotal, DEFAULT_BASE_URL } from './client.js';
11
11
  export * from './types.js';
12
+ export { wholeUnitAmountProblem } from './resources/execute.js';
13
+ // EVM addresses (EIP-55), the caller's own node, and the receipt: what happened, whether the proof holds, whether the value arrived. The pure
14
+ // assembly is here; reading and verifying (`buildReceipt`) needs the verifier and is in `@certen.io/sdk/verify`. See receipt.ts.
15
+ export { toChecksumAddress, evmAddressProblem } from './address.js';
16
+ export { checkEvmRpcEndpoint, evmRpcCall, readEvmChainId, assertRpcChain, readEvmBalance, readEvmBlockHeader, } from './evm-rpc.js';
17
+ export { snapshotRecipient, checkNativeTransferEffect, noEffectToCheck } from './effect.js';
18
+ export { assembleReceipt, estimateFee, RECEIPT_VERSION, EXECUTION_SKU } from './receipt.js';
12
19
  export { CertenError, CertenAuthError, CertenRateLimitError, CertenBadRequestError, CertenServerError, CertenPaymentRequiredError, CertenHeaderAuthorityNotExecutableError, CertenIntentFailedError, CertenWaitTimeoutError, CertenProofNotAvailableError, CertenForeignOriginError, HEADER_AUTHORITY_NOT_EXECUTABLE, } from './errors.js';
13
20
  // Transaction-header fields (additional authorities, deadline): the validators the SDK runs before
14
21
  // sending, exported so the CLI and MCP apply the identical rules. See header-fields.ts.
@@ -17,6 +24,11 @@ export { normalizeAdditionalAuthorities, normalizeExpiresAt, parseDuration, expi
17
24
  export { INTENT_STATUS_CLASS, classifyIntentStatus, isTerminalIntentStatus, intentOutcome, EXECUTION_PROOF_UNAVAILABLE, } from './intent-states.js';
18
25
  export { describeReasonCode, isTransactionReasonCode, REASON_CODE_DESCRIPTIONS } from './reason-codes.js';
19
26
  export { runDoctor, CREDENTIALLED_CHECKS } from './doctor.js';
27
+ // Every error code this release knew the gateway to raise (the CLI uses it to tell a code `certen errors <CODE>` explains from one it cannot). See error-codes.ts.
28
+ export { VENDORED_ERROR_CODES } from './error-codes.js';
29
+ // Readiness for one identity on one chain, and the Accumulate key page read behind it. See readiness.ts and key-page.ts.
30
+ export { runReadiness, checkGas, summarizeReadiness, READINESS_CHECKS, CONTEXT_CHECKS } from './readiness.js';
31
+ export { readKeyPage, verifyKeyPageHolds, keyHashesOf } from './key-page.js';
20
32
  // Splitting a share link into token and gateway is pure string work; fetching and decoding one (which gunzips) is Node-only. See
21
33
  // share-target.ts and shared-proof.ts.
22
34
  export { parseShareTarget } from './share-target.js';
@@ -35,9 +47,9 @@ export { redeemRegistrationToken } from './registration.js';
35
47
  // Keypair-proof self-service signup — no browser, no email, nobody at CERTEN. Standalone for the
36
48
  // same reason: the caller holds nothing yet. See self-signup.ts.
37
49
  export { selfSignup, requestSignupChallenge, completeSignup } from './self-signup.js';
38
- export { CertenUnfundedAccountError, CertenFundingUnverifiableError, movesValue, normalizeChainId } from './funding.js';
50
+ export { CertenUnfundedAccountError, CertenUnderfundedAccountError, CertenFundingUnverifiableError, movesValue, normalizeChainId, assessGas, nativeAmountOf, nativeTransferUri, gasFundingPlan, } from './funding.js';
39
51
  // The chain catalogue: the single source the CLI and MCP derive every chain table from. See chains.ts.
40
- export { CHAIN_CATALOGUE, chainInfo, chainSlug, nativeSymbolFor, faucetForChain, defaultEnabledChains, enablableChains, parseEnabledChains, ChainConfigurationError, gatewayServes, chainAvailability, resolveEnabledChains, readNativeBalance, describeUnverifiable, } from './chains.js';
52
+ export { CHAIN_CATALOGUE, chainInfo, chainSlug, nativeSymbolFor, faucetForChain, defaultEnabledChains, enablableChains, parseEnabledChains, ChainConfigurationError, gatewayServes, chainAvailability, resolveEnabledChains, readNativeBalance, describeUnverifiable, gasReserveFor, parseUnits, formatUnits, } from './chains.js';
41
53
  // One resolver, shared by the CLI and MCP. Two copies of this would drift — see sign-target.ts.
42
54
  export { resolveSignTarget } from './sign-target.js';
43
55
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1F,cAAc,YAAY,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,uCAAuC,EACvC,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,GAChC,MAAM,aAAa,CAAC;AACrB,mGAAmG;AACnG,wFAAwF;AACxF,OAAO,EACL,8BAA8B,EAAE,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,0BAA0B,EACxG,wBAAwB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,wBAAwB,GACnH,MAAM,oBAAoB,CAAC;AAC5B,mIAAmI;AACnI,OAAO,EACL,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,aAAa,EAAE,2BAA2B,GAC9G,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE1G,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC9D,iIAAiI;AACjI,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,6FAA6F;AAC7F,0DAA0D;AAC1D,OAAO,EACL,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAC9F,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,SAA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,6FAA6F;AAC7F,0DAA0D;AAC1D,OAAO,EACL,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAC9F,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,GAC/C,MAAM,sBAAsB,CAAC;AAE9B,gGAAgG;AAChG,iEAAiE;AACjE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAClF,iGAAiG;AACjG,wFAAwF;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,6FAA6F;AAC7F,sEAAsE;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,iGAAiG;AACjG,iEAAiE;AACjE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EACL,0BAA0B,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAClJ,iBAAiB,EAAE,cAAc,GAClC,MAAM,cAAc,CAAC;AAEtB,uGAAuG;AACvG,OAAO,EACL,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,oBAAoB,EAAE,eAAe,EAC7G,kBAAkB,EAAE,uBAAuB,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,EACnG,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,GAChF,MAAM,aAAa,CAAC;AAIrB,gGAAgG;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/chains.d.ts CHANGED
@@ -42,6 +42,14 @@ export interface ChainCatalogueEntry {
42
42
  readonly blocksOnlyWithTraffic: boolean;
43
43
  /** Where to get testnet gas. Absent rather than guessed. */
44
44
  readonly faucet?: string;
45
+ /**
46
+ * The native balance, in whole units, an abstract account should hold on top of any amount it is about to move, for one execution
47
+ * to be plausible. **An estimate, never a quote**: the gateway publishes no per-execution gas figure (`/v1/quote` prices the
48
+ * platform's own legs in USD), so this is a planning figure chosen in the CLI UX Phase 2 work, not a measurement. Everything that
49
+ * shows it calls it an estimate, a caller can override it, and absent means "no estimate for this chain" - such a chain is checked on
50
+ * the amount alone and says so, rather than being given a number nobody has measured.
51
+ */
52
+ readonly gasReserve?: string;
45
53
  /**
46
54
  * Names people type for this chain that are NOT its slug. They SUGGEST and never substitute: a
47
55
  * mainnet name mapped silently to a testnet would be the client deciding where money goes.
@@ -71,6 +79,18 @@ export declare function chainSlug(value: string | number | null | undefined): st
71
79
  /** The native gas token's symbol, or undefined when the catalogue does not know the chain. */
72
80
  export declare function nativeSymbolFor(chain: string | number | null | undefined): string | undefined;
73
81
  export declare function faucetForChain(chain: string | number | null | undefined): string | undefined;
82
+ /** The gas reserve estimate for a chain, in whole native units, or undefined when the catalogue has none. See {@link ChainCatalogueEntry.gasReserve}. */
83
+ export declare function gasReserveFor(chain: string | number | null | undefined): string | undefined;
84
+ /**
85
+ * A non-negative decimal string ("0.0021", "3", "1.50") to base units, exactly, or undefined when it is not one.
86
+ *
87
+ * Returns undefined rather than throwing: a balance the gateway reported as "unavailable" or an amount typed with too many decimals is
88
+ * a fact to report as unknown, not an exception to unwind. Integer arithmetic only - `Number("0.1") * 10 ** 18` is wrong for values a
89
+ * wallet shows exactly.
90
+ */
91
+ export declare function parseUnits(value: string | number | null | undefined, decimals: number): bigint | undefined;
92
+ /** Base units to a whole-unit decimal string with no trailing zeros ("1500000000000000" at 18 decimals -> "0.0015"). */
93
+ export declare function formatUnits(value: bigint, decimals: number): string;
74
94
  /** Slugs the catalogue enables when configuration says nothing: the live chains, in order. */
75
95
  export declare function defaultEnabledChains(): string[];
76
96
  /** Slugs that configuration may enable: everything not retired. */
@@ -1 +1 @@
1
- {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[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IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,GACxB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,KAAK,EAAE,qBAAqB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GACnF;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,GAAG,IAAI,GACjD,oBAAoB,CAkBtB;AAED,+FAA+F;AAC/F,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,SAAS,CAYrG"}
package/dist/chains.js CHANGED
@@ -36,6 +36,7 @@ export const CHAIN_CATALOGUE = Object.freeze([
36
36
  blockSeconds: 12,
37
37
  blocksOnlyWithTraffic: false,
38
38
  faucet: 'https://sepoliafaucet.com',
39
+ gasReserve: '0.001',
39
40
  aliases: ['eth', 'ethereum', 'sepolia', 'eth-sepolia', 'mainnet'],
40
41
  support: 'live',
41
42
  enabledByDefault: true,
@@ -50,6 +51,7 @@ export const CHAIN_CATALOGUE = Object.freeze([
50
51
  blockSeconds: 2,
51
52
  blocksOnlyWithTraffic: false,
52
53
  faucet: 'https://www.alchemy.com/faucets/base-sepolia',
54
+ gasReserve: '0.0001',
53
55
  aliases: ['base', 'basesepolia'],
54
56
  support: 'live',
55
57
  enabledByDefault: true,
@@ -64,6 +66,7 @@ export const CHAIN_CATALOGUE = Object.freeze([
64
66
  blockSeconds: 0.25,
65
67
  blocksOnlyWithTraffic: false,
66
68
  faucet: 'https://www.alchemy.com/faucets/arbitrum-sepolia',
69
+ gasReserve: '0.0001',
67
70
  aliases: ['arb', 'arbitrum', 'arb-sepolia', 'arbsepolia'],
68
71
  support: 'live',
69
72
  enabledByDefault: true,
@@ -139,6 +142,37 @@ export function nativeSymbolFor(chain) {
139
142
  export function faucetForChain(chain) {
140
143
  return chainInfo(chain)?.faucet;
141
144
  }
145
+ /** The gas reserve estimate for a chain, in whole native units, or undefined when the catalogue has none. See {@link ChainCatalogueEntry.gasReserve}. */
146
+ export function gasReserveFor(chain) {
147
+ return chainInfo(chain)?.gasReserve;
148
+ }
149
+ /**
150
+ * A non-negative decimal string ("0.0021", "3", "1.50") to base units, exactly, or undefined when it is not one.
151
+ *
152
+ * Returns undefined rather than throwing: a balance the gateway reported as "unavailable" or an amount typed with too many decimals is
153
+ * a fact to report as unknown, not an exception to unwind. Integer arithmetic only - `Number("0.1") * 10 ** 18` is wrong for values a
154
+ * wallet shows exactly.
155
+ */
156
+ export function parseUnits(value, decimals) {
157
+ if (value === null || value === undefined)
158
+ return undefined;
159
+ const m = /^(\d+)(?:\.(\d+))?$/.exec(String(value).trim());
160
+ if (!m)
161
+ return undefined;
162
+ const frac = m[2] ?? '';
163
+ if (frac.length > decimals)
164
+ return undefined;
165
+ return BigInt(m[1]) * 10n ** BigInt(decimals) + BigInt(frac.padEnd(decimals, '0') || '0');
166
+ }
167
+ /** Base units to a whole-unit decimal string with no trailing zeros ("1500000000000000" at 18 decimals -> "0.0015"). */
168
+ export function formatUnits(value, decimals) {
169
+ const negative = value < 0n;
170
+ const abs = negative ? -value : value;
171
+ const digits = abs.toString().padStart(decimals + 1, '0');
172
+ const whole = digits.slice(0, digits.length - decimals);
173
+ const frac = digits.slice(digits.length - decimals).replace(/0+$/, '');
174
+ return `${negative ? '-' : ''}${whole}${frac ? `.${frac}` : ''}`;
175
+ }
142
176
  /** Slugs the catalogue enables when configuration says nothing: the live chains, in order. */
143
177
  export function defaultEnabledChains() {
144
178
  return CHAIN_CATALOGUE.filter((c) => c.enabledByDefault).map((c) => c.slug);
@@ -1 +1 @@
1
- {"version":3,"file":"chains.js","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAqCH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmC,MAAM,CAAC,MAAM,CAAC;IAC3E;QACE,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,QAAQ;QACjB,WAAW,EAAE,kBAAkB;QAC/B,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,KAAK;QACnB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,qBAAqB,EAAE,KAAK;QAC5B,MAAM,EAAE,2BAA2B;QACnC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,CAAC;QACjE,OAAO,EAAE,MAAM;QACf,gBAAgB,EAAE,IAAI;KACvB;IACD;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,KAAK;QACnB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,CAAC;QACf,qBAAqB,EAAE,KAAK;QAC5B,MAAM,EAAE,8CAA8C;QACtD,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;QAChC,OAAO,EAAE,MAAM;QACf,gBAAgB,EAAE,IAAI;KACvB;IACD;QACE,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C;SACzC,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,MAAM,CAAC,OAAO,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IAClH,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;AAC5H,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAAE,OAA6B;IAC/E,QAAQ,OAAO,CAAC,KAAK,EAAE,CAAC;QACtB,KAAK,gBAAgB;YACnB,OAAO,sDAAsD,OAAO,CAAC,KAAK,uDAAuD,CAAC;QACpI,KAAK,qBAAqB;YACxB,OAAO,wBAAwB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI;kBACnG,wBAAwB,OAAO,CAAC,MAAM,EAAE,CAAC;QAC/C,KAAK,YAAY;YACf,OAAO,kCAAkC,OAAO,CAAC,MAAM,eAAe,KAAK,kBAAkB,OAAO,CAAC,OAAO,IAAI,CAAC;QACnH;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
package/dist/client.d.ts CHANGED
@@ -17,6 +17,7 @@ import { DeviceResource } from './resources/device.js';
17
17
  import { OAuthClientsResource } from './resources/oauth-clients.js';
18
18
  import { RegistrationTokensResource } from './resources/registration-tokens.js';
19
19
  import { type DoctorReport } from './doctor.js';
20
+ import { type Readiness, type ReadinessParams } from './readiness.js';
20
21
  import type { CertenClientOptions, MeResponse } from './types.js';
21
22
  /**
22
23
  * The gateway this SDK talks to when the caller does not say.
@@ -120,7 +121,20 @@ export declare class CertenClient {
120
121
  * abandoned — an invisible leak of live credentials.
121
122
  */
122
123
  private bearerToken;
123
- doctor(): Promise<DoctorReport>;
124
+ doctor(options?: {
125
+ includeRegistry?: boolean;
126
+ }): Promise<DoctorReport>;
127
+ /**
128
+ * Is this identity, on this chain, able to act right now - and if not, what is the first thing in the way?
129
+ *
130
+ * Where `doctor()` answers organization-wide questions, this answers the one asked just before sending: the gateway, the credential, the
131
+ * identity, the chain, the key page (read from Accumulate as well as from the gateway), the key page's credits, the organization's
132
+ * balance, and the gas on the abstract account against the amount about to move. Ordered by dependency; `ready` only when every
133
+ * check is `ok` or `warn`. An answer that could not be had is `unknown`, never `ok`.
134
+ *
135
+ * Never throws for a failed check. See readiness.ts.
136
+ */
137
+ readiness(params: ReadinessParams): Promise<Readiness>;
124
138
  constructor(options: CertenClientOptions & {
125
139
  maxRetries?: number;
126
140
  baseBackoffMs?: number;