@certen.io/sdk 0.8.2 → 0.10.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 (146) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.md +81 -0
  3. package/dist/agent.d.ts +8 -0
  4. package/dist/agent.d.ts.map +1 -1
  5. package/dist/agent.js +12 -0
  6. package/dist/agent.js.map +1 -1
  7. package/dist/browser.d.ts +34 -0
  8. package/dist/browser.d.ts.map +1 -0
  9. package/dist/browser.js +43 -0
  10. package/dist/browser.js.map +1 -0
  11. package/dist/bytes.d.ts +14 -0
  12. package/dist/bytes.d.ts.map +1 -0
  13. package/dist/bytes.js +47 -0
  14. package/dist/bytes.js.map +1 -0
  15. package/dist/chains.d.ts +198 -0
  16. package/dist/chains.d.ts.map +1 -0
  17. package/dist/chains.js +261 -0
  18. package/dist/chains.js.map +1 -0
  19. package/dist/client.d.ts +2 -1
  20. package/dist/client.d.ts.map +1 -1
  21. package/dist/client.js +38 -6
  22. package/dist/client.js.map +1 -1
  23. package/dist/defaults.d.ts +3 -0
  24. package/dist/defaults.d.ts.map +1 -0
  25. package/dist/defaults.js +3 -0
  26. package/dist/defaults.js.map +1 -0
  27. package/dist/doctor.d.ts.map +1 -1
  28. package/dist/doctor.js +36 -23
  29. package/dist/doctor.js.map +1 -1
  30. package/dist/error-codes.d.ts.map +1 -1
  31. package/dist/error-codes.js +17 -0
  32. package/dist/error-codes.js.map +1 -1
  33. package/dist/errors.d.ts +76 -0
  34. package/dist/errors.d.ts.map +1 -1
  35. package/dist/errors.js +108 -0
  36. package/dist/errors.js.map +1 -1
  37. package/dist/execution-proof.d.ts +111 -0
  38. package/dist/execution-proof.d.ts.map +1 -0
  39. package/dist/execution-proof.js +311 -0
  40. package/dist/execution-proof.js.map +1 -0
  41. package/dist/funding.d.ts +43 -6
  42. package/dist/funding.d.ts.map +1 -1
  43. package/dist/funding.js +69 -29
  44. package/dist/funding.js.map +1 -1
  45. package/dist/header-fields.d.ts +68 -0
  46. package/dist/header-fields.d.ts.map +1 -0
  47. package/dist/header-fields.js +147 -0
  48. package/dist/header-fields.js.map +1 -0
  49. package/dist/index.d.ts +9 -15
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +11 -23
  52. package/dist/index.js.map +1 -1
  53. package/dist/intent-states.d.ts +75 -0
  54. package/dist/intent-states.d.ts.map +1 -0
  55. package/dist/intent-states.js +66 -0
  56. package/dist/intent-states.js.map +1 -0
  57. package/dist/internal.d.ts +18 -0
  58. package/dist/internal.d.ts.map +1 -1
  59. package/dist/internal.js +44 -0
  60. package/dist/internal.js.map +1 -1
  61. package/dist/origin.d.ts +19 -0
  62. package/dist/origin.d.ts.map +1 -0
  63. package/dist/origin.js +80 -0
  64. package/dist/origin.js.map +1 -0
  65. package/dist/random.d.ts +27 -0
  66. package/dist/random.d.ts.map +1 -0
  67. package/dist/random.js +30 -0
  68. package/dist/random.js.map +1 -0
  69. package/dist/reason-codes.d.ts +15 -0
  70. package/dist/reason-codes.d.ts.map +1 -0
  71. package/dist/reason-codes.js +30 -0
  72. package/dist/reason-codes.js.map +1 -0
  73. package/dist/resources/admin.d.ts +5 -2
  74. package/dist/resources/admin.d.ts.map +1 -1
  75. package/dist/resources/admin.js +8 -3
  76. package/dist/resources/admin.js.map +1 -1
  77. package/dist/resources/billing.d.ts.map +1 -1
  78. package/dist/resources/billing.js +5 -4
  79. package/dist/resources/billing.js.map +1 -1
  80. package/dist/resources/chains.d.ts +10 -0
  81. package/dist/resources/chains.d.ts.map +1 -1
  82. package/dist/resources/chains.js +15 -1
  83. package/dist/resources/chains.js.map +1 -1
  84. package/dist/resources/device.d.ts.map +1 -1
  85. package/dist/resources/device.js +2 -1
  86. package/dist/resources/device.js.map +1 -1
  87. package/dist/resources/execute.d.ts +49 -4
  88. package/dist/resources/execute.d.ts.map +1 -1
  89. package/dist/resources/execute.js +108 -29
  90. package/dist/resources/execute.js.map +1 -1
  91. package/dist/resources/governance.js +3 -3
  92. package/dist/resources/governance.js.map +1 -1
  93. package/dist/resources/identity.js +5 -5
  94. package/dist/resources/identity.js.map +1 -1
  95. package/dist/resources/oauth-clients.d.ts.map +1 -1
  96. package/dist/resources/oauth-clients.js +3 -2
  97. package/dist/resources/oauth-clients.js.map +1 -1
  98. package/dist/resources/proof.d.ts +10 -2
  99. package/dist/resources/proof.d.ts.map +1 -1
  100. package/dist/resources/proof.js +33 -11
  101. package/dist/resources/proof.js.map +1 -1
  102. package/dist/resources/registration-tokens.d.ts.map +1 -1
  103. package/dist/resources/registration-tokens.js +2 -1
  104. package/dist/resources/registration-tokens.js.map +1 -1
  105. package/dist/resources/sign.js +2 -2
  106. package/dist/resources/sign.js.map +1 -1
  107. package/dist/resources/transaction.d.ts.map +1 -1
  108. package/dist/resources/transaction.js +7 -3
  109. package/dist/resources/transaction.js.map +1 -1
  110. package/dist/resources/transparency.d.ts.map +1 -1
  111. package/dist/resources/transparency.js +3 -2
  112. package/dist/resources/transparency.js.map +1 -1
  113. package/dist/resources/webhooks.d.ts +5 -3
  114. package/dist/resources/webhooks.d.ts.map +1 -1
  115. package/dist/resources/webhooks.js +12 -8
  116. package/dist/resources/webhooks.js.map +1 -1
  117. package/dist/sha256.d.ts +10 -0
  118. package/dist/sha256.d.ts.map +1 -0
  119. package/dist/sha256.js +71 -0
  120. package/dist/sha256.js.map +1 -0
  121. package/dist/share-target.d.ts +10 -0
  122. package/dist/share-target.d.ts.map +1 -0
  123. package/dist/share-target.js +25 -0
  124. package/dist/share-target.js.map +1 -0
  125. package/dist/shared-proof.d.ts +7 -5
  126. package/dist/shared-proof.d.ts.map +1 -1
  127. package/dist/shared-proof.js +36 -17
  128. package/dist/shared-proof.js.map +1 -1
  129. package/dist/signing-check.d.ts +66 -0
  130. package/dist/signing-check.d.ts.map +1 -0
  131. package/dist/signing-check.js +171 -0
  132. package/dist/signing-check.js.map +1 -0
  133. package/dist/types.d.ts +139 -0
  134. package/dist/types.d.ts.map +1 -1
  135. package/dist/verify-receipt.d.ts.map +1 -1
  136. package/dist/verify-receipt.js +68 -28
  137. package/dist/verify-receipt.js.map +1 -1
  138. package/dist/verify.d.ts +82 -0
  139. package/dist/verify.d.ts.map +1 -0
  140. package/dist/verify.js +180 -0
  141. package/dist/verify.js.map +1 -0
  142. package/dist/version.d.ts +2 -0
  143. package/dist/version.d.ts.map +1 -0
  144. package/dist/version.js +4 -0
  145. package/dist/version.js.map +1 -0
  146. package/package.json +25 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,108 @@
1
1
  # Changelog — @certen.io/sdk
2
2
 
3
+ ## 0.10.0 — RB7b: verify what you trust, sign what you see (2026-10-09)
4
+
5
+ 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).
6
+
7
+ ### Breaking
8
+ - **Node 22 or 24.** `engines.node` is `>=22`; Node 18 and 20 are end of life and are no longer tested.
9
+ - **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
10
+ 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.
11
+ - **`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.
12
+ - **`proof.bundle()` is typed `Uint8Array`** (a `Buffer` under Node, so runtime behaviour is unchanged).
13
+ - **`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).
14
+ A timeout is `WAIT_TIMEOUT` and a missing proof assignment is `PROOF_NOT_ASSIGNED`; both are typed errors with the last status they saw.
15
+ - **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.
16
+ - **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.
17
+ - `admin.revokeApiKey`, `webhooks.remove` and the third 204 DELETE resolve `{ success: true }` / `{ deleted: true }` instead of `""`.
18
+ - Requires `axios >=1.20.0`.
19
+
20
+ ### Added
21
+ - `@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.
22
+ - `@certen.io/sdk/verify`, `proof.portable()`, `beforeSign` and the signing checks (below).
23
+ - 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.
24
+ - The SDK's own version in the `User-Agent` (none from a browser). `verifyReceipt` reports a runtime without ed25519 as `skipped`, never `ok`.
25
+
26
+ ### Fixed
27
+ - 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.
28
+ - Four load-sensitive tests (retry backoff, wait timeouts) no longer depend on machine load.
29
+ - `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`.
30
+
31
+ ### Included — every external-mode signature is checked first (RB7b Phase F)
32
+
33
+ ### Changed (breaking)
34
+ - `execute.contractCall`, `execute.transfer`, `execute.cosign` and `CertenAgent`'s governance operations rebuild the transaction the gateway returned, recompute every hash and
35
+ match it to the request before they sign, and refuse with `SIGNING_DATA_MISMATCH` (field named), `SIGNING_DATA_ABSENT`, `SIGNING_EXPECTATION_UNAVAILABLE` or
36
+ `SIGNING_VERIFIER_UNAVAILABLE`. There is no option to sign without the check. **This needs a gateway that returns `signing_data.transaction` and
37
+ `signing_data.signature_metadata`; against a gateway that does not, every external-mode signature is refused.** Release only after that gateway change is deployed.
38
+ - 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
39
+ (`SIGNING_VERIFIER_UNAVAILABLE`) until the verifier runs there.
40
+
41
+ ### Added
42
+ - `beforeSign(summary)` on `contractCall` / `transfer` / `cosign`: what the signature will authorise, after the check and before the signature; return `false` to decline (`SIGNING_DECLINED`).
43
+ `OpenedIntent.signing` carries the same summary.
44
+ - `checkIntentSigning`, `checkCosigning`, `checkGovernanceSigning`, `inspectSigningData`, `legsFromIntent`, `CertenSigningDataError`.
45
+ ### Included — verify a proof instead of trusting it (RB7b Phase E)
46
+
47
+ ### Added
48
+ - `@certen.io/sdk/verify`: `verifyBundle` (one verdict per layer from a bundle or a proof v2 document), `loadProofEvidence`, `bundleInputOf`,
49
+ `portableDocumentOf`, and everything `@certen.io/proof-verify` exports. An optional peer dependency, so the API client does not pull in the verifier.
50
+ - `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
51
+ the RB7b gateway notes and is not deployed yet, so it is listed in `tools/agentgen/pending-routes.json`.
52
+
53
+ ### Changed
54
+ - 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.
55
+ ### Included — transaction deadlines, header authorities, failure reasons
56
+
57
+ ### Added
58
+ - `expiresAt` (Date | RFC 3339 string) and `additionalAuthorities` (acc:// key books, max 8) on
59
+ `execute.contractCall`, `execute.transfer`, `transaction.create`, `agent.call`, `agent.transfer`
60
+ and `agent.token`, sent as `expires_at` / `additional_authorities` and validated before any request.
61
+ `expiresIn("30m")` and `parseDuration()` build a deadline. The checks mirror the gateway: authorities are
62
+ trimmed, lowercased, stripped of trailing slashes, need a non-empty host, at most 512 characters, and at
63
+ most 8 distinct after de-duplication; `expiresAt` must be 90 s (gateway minimum 60 s, plus latency margin)
64
+ to 7 days ahead.
65
+ - `CertenHeaderAuthorityNotExecutableError` for HTTP 422 `HEADER_AUTHORITY_NOT_EXECUTABLE`, with
66
+ `guidance`. The gateway refuses header authorities by default because validators do not yet execute
67
+ intents that carry them.
68
+ - `TransactionReasonCode` (now including `expired` and `expectation_unmet`), `CompletionBasis`,
69
+ `describeReasonCode()`; `TransactionResponse` gains `reason_code`, `additional_authorities`,
70
+ `expires_at` and `completion_basis`.
71
+
72
+ ### Changed
73
+ - `execute.wait()` throws `CertenIntentFailedError` (a `CertenError`, code `INTENT_FAILED`) on a failed
74
+ intent, carrying `reasonCode`; the message now includes the reason in parentheses.
75
+
76
+ ## 0.9.0 — verify the outcome from the bundle's own bytes
77
+
78
+ ### Added — `verifyExecutionProof`, `checkAgainstHeader`, `decodeSharedBundle`
79
+
80
+ A proof bundle now carries component 5, the execution proof: the receipt of the target-chain
81
+ transaction and the Merkle-Patricia inclusion proofs the validators' RB-2 gate verified against the
82
+ block header (raw trie nodes and the leaf value, so nothing has to be fetched). This module checks
83
+ it with no dependencies and no gateway:
84
+
85
+ ```ts
86
+ import { fetchSharedProof, decodeSharedBundle, executionComponentOf, verifyExecutionProof, checkAgainstHeader } from '@certen.io/sdk';
87
+
88
+ const shared = await fetchSharedProof(link); // no API key
89
+ const bundle = decodeSharedBundle(shared.bundle)!; // the share endpoint returns bytes
90
+ const v = verifyExecutionProof(executionComponentOf(bundle)!, { address: LEDGER, topic0: CLAIM_PAID });
91
+ // v.ok: the receipt with these logs is in a receipts trie with root v.receiptsRoot
92
+ // v.expectedLogFound: the event is in it
93
+ const header = (await rpc('eth_getBlockByNumber', ['0x' + v.blockNumber.toString(16), false])).result;
94
+ checkAgainstHeader(v, header).ok; // and that root IS block N's header
95
+ ```
96
+
97
+ What it proves and what it does not, in the function's own words (`caveats`): the receipt is in a
98
+ trie with that root; that the root is the header of block N is the validator's statement until you
99
+ compare it to a header from an RPC you trust. keccak-256, RLP and the trie walk are implemented in
100
+ the module (Node has SHA-3 but not Ethereum's keccak padding); the test walks a real Base Sepolia
101
+ receipt at index 23 of block 46437431 to its root and refuses a tampered root, receipt or proof.
102
+
103
+ Bundles from validators older than certen-validator PR #5 carry no component 5; the verifier says
104
+ so rather than guessing.
105
+
3
106
  ## 0.8.2 — waits that survive a slow poll
4
107
 
5
108
  ### Fixed — `execute.wait` and `identity.createAndWait` no longer give up on one failed poll
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
 
@@ -67,6 +69,47 @@ new CertenClient({
67
69
  **Base URL precedence:** `options.baseUrl` → `$CERTEN_API_URL` → `https://gateway.kompendium.co`. The env var
68
70
  is there so a deployment can be retargeted at staging or a self-hosted gateway without a code change.
69
71
 
72
+ **The client only talks to its own gateway.** Every request URL, every `submit_url` a response names, and every redirect must stay
73
+ on the base URL's origin; anything else is refused with `FOREIGN_ORIGIN_URL` before a credential is attached or anything is signed.
74
+ 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
75
+ with `INVALID_PATH_PARAMETER` instead of reaching a different route.
76
+
77
+ ## Browsers
78
+
79
+ `@certen.io/sdk` runs in a browser through the **`browser` export condition** (webpack, Vite, esbuild and rollup select it
80
+ automatically), or explicitly as `@certen.io/sdk/browser`. That entry is the client, its resources, the typed errors, the status
81
+ 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:
82
+ `CertenAgent` / `ed25519Signer` (a local signing key) and `fetchSharedProof` / `decodeSharedBundle` (gunzip). A browser sends no
83
+ `User-Agent` (it forbids scripts setting one). `verifyReceipt` uses Web Crypto's ed25519; a runtime without it reports the signature
84
+ check as `skipped`, never as `ok`. CI bundles the browser entry and runs it with `process`, `Buffer` and `require` removed.
85
+
86
+ ## Every signature is checked first
87
+
88
+ `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
89
+ (`signing_data.transaction`, `signing_data.signature_metadata`), recompute every hash and match what it would authorise to your request, then sign; any disagreement throws
90
+ `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
91
+ 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.
92
+
93
+ ## Verify a proof: `@certen.io/sdk/verify`
94
+
95
+ 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).
96
+
97
+ ```ts
98
+ import { CertenClient } from '@certen.io/sdk';
99
+ import { loadProofEvidence, verifyBundle, bundleInputOf } from '@certen.io/sdk/verify';
100
+
101
+ const client = new CertenClient({ apiKey });
102
+ const evidence = await loadProofEvidence(client, intentId); // bundle + proof v2 document (or why there is none)
103
+ const v = verifyBundle(bundleInputOf(evidence), { header }); // header: the execution chain's block header, from your own node
104
+ v.overall; // 'verified' | 'partial' | 'failed' | 'no_evidence'
105
+ v.layers; // one verdict per layer, with the evidence it was checked against
106
+ ```
107
+
108
+ 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
109
+ 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
110
+ proof v2 document for a proof, `proof.portable()` throws `PROOF_V2_EVIDENCE_NOT_SERVED` and `loadProofEvidence` reports it as `notServed`: the result is
111
+ `no_evidence`, never a pass.
112
+
70
113
  ## What it does for you
71
114
 
72
115
  **Automatic idempotency on POSTs.** Every POST gets a generated `Idempotency-Key` so a retried network error
@@ -140,6 +183,28 @@ The gateway serves ~80 endpoints; this covers the integration surface. For anyth
140
183
  [live spec](https://gateway.kompendium.co/docs/json) is authoritative and the client's `request` path will
141
184
  carry it.
142
185
 
186
+ ## Chains
187
+
188
+ One typed catalogue, `CHAIN_CATALOGUE`, holds every chain fact the SDK, the CLI and the MCP server use:
189
+ slug, numeric id, gas token and decimals, block time, faucet, aliases, and whether it is on by default.
190
+
191
+ | Chain | Id | Gas | Default |
192
+ |---|---|---|---|
193
+ | `ethereum-sepolia` | 11155111 | ETH | on |
194
+ | `base-sepolia` | 84532 | ETH | on |
195
+ | `arbitrum-sepolia` | 421614 | ETH | on |
196
+ | `telcoin-adiri` — Telcoin's **Adiri testnet** | 2017 | TEL (18 decimals) | off |
197
+
198
+ The catalogue says what a chain IS; the gateway says whether it may be used. Offer what
199
+ `client.chains.enabled(configured?)` returns: the configured chains (default: the three above) that
200
+ `GET /v1/chains` serves right now. `parseEnabledChains('…,telcoin-adiri')` turns a setting into that list
201
+ and refuses an unknown or retired chain by name.
202
+
203
+ The funding guard reads each chain's own gas token (`readNativeBalance`). On Adiri an empty TEL account
204
+ throws `CertenUnfundedAccountError`; a gas balance it cannot identify (an unknown chain, a balance row that
205
+ is not the chain's gas token, or an unreadable one) throws `CertenFundingUnverifiableError` rather than
206
+ letting the intent through.
207
+
143
208
  ## Three things to know
144
209
 
145
210
  **Identity creation is asynchronous.** `identity.create` resolves with a `202`-shaped result and provisioning
@@ -150,6 +215,22 @@ timeout.
150
215
 
151
216
  **`vote` is `approve` | `reject` | `abstain`** — a lowercase string, not a number, and not `accept`.
152
217
 
218
+ ## Deadlines, header authorities and failure reasons
219
+
220
+ `execute.contractCall`, `execute.transfer`, `transaction.create`, `agent.call` and `agent.transfer` accept
221
+ `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
222
+ books, at most 8). Both are validated before anything is sent.
223
+
224
+ - **`expiresAt`** — unsigned past the deadline, the intent ends `failed` with `reason_code: 'expired'`:
225
+ nothing executes, no fee or gas.
226
+ - **`additionalAuthorities` is refused by the gateway by default** — HTTP 422, thrown as
227
+ `CertenHeaderAuthorityNotExecutableError` (see its `guidance`). Validators do not yet count a header
228
+ authority's signature, so such an intent would never execute. Make a required co-signer an authority on
229
+ the account instead (`agent.governance.requireSigner`).
230
+ - **`execute.wait()` throws `CertenIntentFailedError`** on a failed intent, with `reasonCode`
231
+ (`'expired'`, `'expectation_unmet'`, `'target_reverted'`, …). `describeReasonCode()` renders it.
232
+ `expectation_unmet` means the call ran but its `expectedEvents` are missing: it is not a success.
233
+
153
234
  ## Guides
154
235
 
155
236
  - [Onboard an identity](https://docs.kompendium.co/onboard-an-identity.html)
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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AAC,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI3G,+GAA+G;IAC/G,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;IAI9E;;;;OAIG;IACG,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IAU/H;;;OAGG;IACH,QAAQ,CAAC,UAAU;QACjB,mFAAmF;iCAC1D,MAAM,SAAQ;YAAE,aAAa,CAAC,EAAE,MAAM,CAAA;SAAE;QAGjE,qBAAqB;oCACO,MAAM,SAAQ;YAAE,aAAa,CAAC,EAAE,MAAM,CAAA;SAAE;QAGpE,wCAAwC;kCACd,MAAM,SAAQ;YAAE,aAAa,CAAC,EAAE,MAAM,CAAA;SAAE;QAGlE;;;;;;;;;;WAUG;iCACsB,MAAM,SAAQ;YAAE,aAAa,CAAC,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,OAA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xH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,34 @@
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, OpenedIntent, WaitUntil, IntentStateEvent } from './resources/execute.js';
13
+ export { CertenError, CertenAuthError, CertenRateLimitError, CertenBadRequestError, CertenServerError, CertenPaymentRequiredError, CertenHeaderAuthorityNotExecutableError, CertenIntentFailedError, CertenWaitTimeoutError, CertenProofNotAvailableError, CertenForeignOriginError, HEADER_AUTHORITY_NOT_EXECUTABLE, } from './errors.js';
14
+ 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
+ export { INTENT_STATUS_CLASS, classifyIntentStatus, isTerminalIntentStatus, intentOutcome, EXECUTION_PROOF_UNAVAILABLE, } from './intent-states.js';
16
+ export type { IntentStatusClass, KnownIntentStatus, IntentOutcome, IntentOutcomeName } from './intent-states.js';
17
+ export { describeReasonCode, isTransactionReasonCode, REASON_CODE_DESCRIPTIONS } from './reason-codes.js';
18
+ export type { PaymentResolution } from './errors.js';
19
+ export { runDoctor, CREDENTIALLED_CHECKS } from './doctor.js';
20
+ export { parseShareTarget } from './share-target.js';
21
+ export { verifyExecutionProof, checkAgainstHeader, executionComponentOf, decodeReceipt, verifyTrieProof, keccak256, rlpDecode, rlpEncodeUint, bytesFrom, } from './execution-proof.js';
22
+ export type { ExecutionProofComponent, ExecutionVerification, DecodedReceipt, DecodedLog } from './execution-proof.js';
23
+ export { fetchOAuthToken, refreshOAuthToken, revokeOAuthToken } from './oauth.js';
24
+ export { parseMnemonicTarget } from './resources/identity.js';
25
+ export { redeemRegistrationToken } from './registration.js';
26
+ 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';
30
+ export type { ChainCatalogueEntry, ChainSupport, ServedChain, ChainAvailability, BalanceRow, NativeBalanceReading, } from './chains.js';
31
+ export { resolveSignTarget } from './sign-target.js';
32
+ export type { SignTarget } from './sign-target.js';
33
+ export type { DoctorReport, DoctorCheck, CheckStatus } from './doctor.js';
34
+ //# 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,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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B,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACxH,YAAY,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAE9D,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,GACxC,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,mBAAmB,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,oBAAoB,GACpG,MAAM,aAAa,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"}
@@ -0,0 +1,43 @@
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 { CertenError, CertenAuthError, CertenRateLimitError, CertenBadRequestError, CertenServerError, CertenPaymentRequiredError, CertenHeaderAuthorityNotExecutableError, CertenIntentFailedError, CertenWaitTimeoutError, CertenProofNotAvailableError, CertenForeignOriginError, HEADER_AUTHORITY_NOT_EXECUTABLE, } from './errors.js';
13
+ // Transaction-header fields (additional authorities, deadline): the validators the SDK runs before
14
+ // sending, exported so the CLI and MCP apply the identical rules. See header-fields.ts.
15
+ 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';
16
+ // Where an intent can be and what each status means: the one table wait(), the CLI and the MCP server share. See intent-states.ts.
17
+ export { INTENT_STATUS_CLASS, classifyIntentStatus, isTerminalIntentStatus, intentOutcome, EXECUTION_PROOF_UNAVAILABLE, } from './intent-states.js';
18
+ export { describeReasonCode, isTransactionReasonCode, REASON_CODE_DESCRIPTIONS } from './reason-codes.js';
19
+ export { runDoctor, CREDENTIALLED_CHECKS } from './doctor.js';
20
+ // Splitting a share link into token and gateway is pure string work; fetching and decoding one (which gunzips) is Node-only. See
21
+ // share-target.ts and shared-proof.ts.
22
+ export { parseShareTarget } from './share-target.js';
23
+ // execution-proof.ts: verify a bundle's component 5 (the receipt and its trie proof) with no
24
+ // dependencies and no gateway — what a counterparty runs.
25
+ export { verifyExecutionProof, checkAgainstHeader, executionComponentOf, decodeReceipt, verifyTrieProof, keccak256, rlpDecode, rlpEncodeUint, bytesFrom, } from './execution-proof.js';
26
+ // Standalone for the same reason: these carry their credential in the body and need no API key,
27
+ // so a caller using OAuth is not made to hold one. See oauth.ts.
28
+ export { fetchOAuthToken, refreshOAuthToken, revokeOAuthToken } from './oauth.js';
29
+ // Exported so a caller can split `mnemonic_retrieval.url` the same way the SDK does, rather than
30
+ // writing their own regex against a string whose parts they cannot afford to get wrong.
31
+ export { parseMnemonicTarget } from './resources/identity.js';
32
+ // Standalone for the same reason as the OAuth helpers: the caller has no credential yet, and
33
+ // obtaining its first one is the entire purpose. See registration.ts.
34
+ export { redeemRegistrationToken } from './registration.js';
35
+ // Keypair-proof self-service signup — no browser, no email, nobody at CERTEN. Standalone for the
36
+ // same reason: the caller holds nothing yet. See self-signup.ts.
37
+ export { selfSignup, requestSignupChallenge, completeSignup } from './self-signup.js';
38
+ export { CertenUnfundedAccountError, CertenFundingUnverifiableError, movesValue, normalizeChainId } from './funding.js';
39
+ // 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';
41
+ // One resolver, shared by the CLI and MCP. Two copies of this would drift — see sign-target.ts.
42
+ export { resolveSignTarget } from './sign-target.js';
43
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +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,oBA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E,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,EACnG,iBAAiB,EAAE,oBAAoB,GACxC,MAAM,aAAa,CAAC;AAIrB,gGAAgG;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Byte helpers that work the same in Node and in a browser.
3
+ *
4
+ * The client used to reach for `Buffer`, which a browser does not have; `Uint8Array`, `TextEncoder` and `atob` are in every runtime
5
+ * this SDK supports (Node >= 22 and current browsers). Nothing here touches the network or any key.
6
+ */
7
+ export declare function bytesToHex(bytes: Uint8Array): string;
8
+ /** Parse hex into bytes. Odd length or a non-hex character throws, rather than silently dropping the tail as `Buffer.from(x, 'hex')` does. */
9
+ export declare function hexToBytes(hex: string): Uint8Array;
10
+ export declare function concatBytes(...parts: Uint8Array[]): Uint8Array;
11
+ export declare function utf8(text: string): Uint8Array;
12
+ /** Standard base64 (the alphabet `Buffer.from(x, 'base64')` accepts, including URL-safe `-` and `_`). Throws on anything else. */
13
+ export declare function base64ToBytes(b64: string): Uint8Array;
14
+ //# sourceMappingURL=bytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../src/bytes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAIpD;AAED,8IAA8I;AAC9I,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAMlD;AAED,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,CAK9D;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAE7C;AAED,kIAAkI;AAClI,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAOrD"}
package/dist/bytes.js ADDED
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Byte helpers that work the same in Node and in a browser.
3
+ *
4
+ * The client used to reach for `Buffer`, which a browser does not have; `Uint8Array`, `TextEncoder` and `atob` are in every runtime
5
+ * this SDK supports (Node >= 22 and current browsers). Nothing here touches the network or any key.
6
+ */
7
+ const HEX = '0123456789abcdef';
8
+ export function bytesToHex(bytes) {
9
+ let out = '';
10
+ for (const b of bytes)
11
+ out += HEX[b >> 4] + HEX[b & 15];
12
+ return out;
13
+ }
14
+ /** Parse hex into bytes. Odd length or a non-hex character throws, rather than silently dropping the tail as `Buffer.from(x, 'hex')` does. */
15
+ export function hexToBytes(hex) {
16
+ const h = hex.startsWith('0x') || hex.startsWith('0X') ? hex.slice(2) : hex;
17
+ if (h.length % 2 !== 0 || /[^0-9a-fA-F]/.test(h))
18
+ throw new Error(`not valid hex (${h.length} characters)`);
19
+ const out = new Uint8Array(h.length / 2);
20
+ for (let i = 0; i < out.length; i++)
21
+ out[i] = parseInt(h.slice(i * 2, i * 2 + 2), 16);
22
+ return out;
23
+ }
24
+ export function concatBytes(...parts) {
25
+ const out = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));
26
+ let at = 0;
27
+ for (const p of parts) {
28
+ out.set(p, at);
29
+ at += p.length;
30
+ }
31
+ return out;
32
+ }
33
+ export function utf8(text) {
34
+ return new TextEncoder().encode(text);
35
+ }
36
+ /** Standard base64 (the alphabet `Buffer.from(x, 'base64')` accepts, including URL-safe `-` and `_`). Throws on anything else. */
37
+ export function base64ToBytes(b64) {
38
+ const clean = b64.replace(/-/g, '+').replace(/_/g, '/').replace(/\s+/g, '');
39
+ if (/[^A-Za-z0-9+/=]/.test(clean))
40
+ throw new Error('not valid base64');
41
+ const bin = atob(clean.padEnd(Math.ceil(clean.length / 4) * 4, '='));
42
+ const out = new Uint8Array(bin.length);
43
+ for (let i = 0; i < bin.length; i++)
44
+ out[i] = bin.charCodeAt(i);
45
+ return out;
46
+ }
47
+ //# sourceMappingURL=bytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes.js","sour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