@certen.io/sdk 0.4.0 → 0.7.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.
- package/CHANGELOG.md +874 -185
- package/README.md +133 -119
- package/dist/client.d.ts +99 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +269 -20
- package/dist/client.js.map +1 -1
- package/dist/doctor.d.ts +53 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +451 -0
- package/dist/doctor.js.map +1 -0
- package/dist/error-codes.d.ts +14 -0
- package/dist/error-codes.d.ts.map +1 -0
- package/dist/error-codes.js +55 -0
- package/dist/error-codes.js.map +1 -0
- package/dist/errors.d.ts +91 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +130 -1
- package/dist/errors.js.map +1 -1
- package/dist/funding.d.ts +43 -0
- package/dist/funding.d.ts.map +1 -0
- package/dist/funding.js +116 -0
- package/dist/funding.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/oauth.d.ts +56 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +68 -0
- package/dist/oauth.js.map +1 -0
- package/dist/registration.d.ts +33 -0
- package/dist/registration.d.ts.map +1 -0
- package/dist/registration.js +49 -0
- package/dist/registration.js.map +1 -0
- package/dist/resources/admin.d.ts +52 -1
- package/dist/resources/admin.d.ts.map +1 -1
- package/dist/resources/admin.js +55 -0
- package/dist/resources/admin.js.map +1 -1
- package/dist/resources/billing.d.ts +242 -0
- package/dist/resources/billing.d.ts.map +1 -0
- package/dist/resources/billing.js +376 -0
- package/dist/resources/billing.js.map +1 -0
- package/dist/resources/chains.d.ts +38 -0
- package/dist/resources/chains.d.ts.map +1 -0
- package/dist/resources/chains.js +46 -0
- package/dist/resources/chains.js.map +1 -0
- package/dist/resources/device.d.ts +43 -0
- package/dist/resources/device.d.ts.map +1 -0
- package/dist/resources/device.js +49 -0
- package/dist/resources/device.js.map +1 -0
- package/dist/resources/execute.d.ts +39 -1
- package/dist/resources/execute.d.ts.map +1 -1
- package/dist/resources/execute.js +41 -1
- package/dist/resources/execute.js.map +1 -1
- package/dist/resources/health.d.ts +34 -0
- package/dist/resources/health.d.ts.map +1 -0
- package/dist/resources/health.js +43 -0
- package/dist/resources/health.js.map +1 -0
- package/dist/resources/identity.d.ts +83 -2
- package/dist/resources/identity.d.ts.map +1 -1
- package/dist/resources/identity.js +154 -2
- package/dist/resources/identity.js.map +1 -1
- package/dist/resources/oauth-clients.d.ts +71 -0
- package/dist/resources/oauth-clients.d.ts.map +1 -0
- package/dist/resources/oauth-clients.js +75 -0
- package/dist/resources/oauth-clients.js.map +1 -0
- package/dist/resources/pending.d.ts +13 -1
- package/dist/resources/pending.d.ts.map +1 -1
- package/dist/resources/pending.js +15 -0
- package/dist/resources/pending.js.map +1 -1
- package/dist/resources/proof.d.ts +75 -0
- package/dist/resources/proof.d.ts.map +1 -0
- package/dist/resources/proof.js +103 -0
- package/dist/resources/proof.js.map +1 -0
- package/dist/resources/registration-tokens.d.ts +51 -0
- package/dist/resources/registration-tokens.d.ts.map +1 -0
- package/dist/resources/registration-tokens.js +54 -0
- package/dist/resources/registration-tokens.js.map +1 -0
- package/dist/resources/transaction.d.ts +20 -0
- package/dist/resources/transaction.d.ts.map +1 -1
- package/dist/resources/transaction.js +28 -0
- package/dist/resources/transaction.js.map +1 -1
- package/dist/resources/transparency.d.ts +68 -0
- package/dist/resources/transparency.d.ts.map +1 -0
- package/dist/resources/transparency.js +83 -0
- package/dist/resources/transparency.js.map +1 -0
- package/dist/resources/webhooks.d.ts +97 -0
- package/dist/resources/webhooks.d.ts.map +1 -0
- package/dist/resources/webhooks.js +112 -0
- package/dist/resources/webhooks.js.map +1 -0
- package/dist/self-signup.d.ts +66 -0
- package/dist/self-signup.d.ts.map +1 -0
- package/dist/self-signup.js +76 -0
- package/dist/self-signup.js.map +1 -0
- package/dist/shared-proof.d.ts +34 -0
- package/dist/shared-proof.d.ts.map +1 -0
- package/dist/shared-proof.js +78 -0
- package/dist/shared-proof.js.map +1 -0
- package/dist/types.d.ts +901 -24
- package/dist/types.d.ts.map +1 -1
- package/dist/verify-receipt.d.ts +32 -0
- package/dist/verify-receipt.d.ts.map +1 -0
- package/dist/verify-receipt.js +176 -0
- package/dist/verify-receipt.js.map +1 -0
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,185 +1,874 @@
|
|
|
1
|
-
# Changelog — @certen.io/sdk
|
|
2
|
-
|
|
3
|
-
## 0.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
was
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
`
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
The
|
|
185
|
-
|
|
1
|
+
# Changelog — @certen.io/sdk
|
|
2
|
+
|
|
3
|
+
## 0.7.0 — one response shape, and nulls that stay null
|
|
4
|
+
|
|
5
|
+
**Breaking.** Requires a gateway from 2026-08 or later. An older gateway sends the previous shape and
|
|
6
|
+
this version will not read it; 0.6.0 and a current gateway are likewise incompatible. Upgrade both.
|
|
7
|
+
### Added — `selfSignup`: an organization from a keypair, with nobody in the loop
|
|
8
|
+
|
|
9
|
+
CERTEN is non-custodial, and every route to an organization still required a human — ours in an
|
|
10
|
+
approvals queue, theirs in a browser, or an existing customer handing over a registration token.
|
|
11
|
+
That made CERTEN a friction point in the one flow where it should be invisible.
|
|
12
|
+
|
|
13
|
+
The anchor is now an Ed25519 keypair: free to create, impossible for us to hold, needs no inbox and
|
|
14
|
+
no browser, and a credential the caller needs anyway since every CERTEN identity is an Ed25519 key.
|
|
15
|
+
One step does two jobs.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
const { org, api_key } = await selfSignup({
|
|
19
|
+
publicKey: myPublicKeyHex,
|
|
20
|
+
sign: (nonceHex) => signWithMyKey(nonceHex), // detached ed25519 over the nonce BYTES
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`sign` is a callback rather than a key parameter, deliberately: the private half never reaches this
|
|
25
|
+
SDK. `requestSignupChallenge` and `completeSignup` are exported for callers driving the two steps
|
|
26
|
+
themselves.
|
|
27
|
+
|
|
28
|
+
Challenge-response, because one step is not enough — a caller signing something they chose proves
|
|
29
|
+
possession at a moment of their choosing and can be replayed forever. The nonce is server-issued,
|
|
30
|
+
single-use, short-lived, and optionally bound to the key at issue time so an observer cannot race to
|
|
31
|
+
answer it. **It is consumed whether or not the signature verified**, so a retry needs a fresh
|
|
32
|
+
challenge; a nonce that survived a failed check would be an oracle. One key provisions one
|
|
33
|
+
organization, ever.
|
|
34
|
+
|
|
35
|
+
### Added — `redeemRegistrationToken`, `client.registrationTokens`
|
|
36
|
+
|
|
37
|
+
An organization could only be born in a browser. Creation happened inside the Firebase login
|
|
38
|
+
exchange, so a platform could not provision its customers, a CI job could not create a scratch org,
|
|
39
|
+
and an agent could not take its first step — every automated path stopped and waited for a person.
|
|
40
|
+
|
|
41
|
+
A human still decides an org may exist; the decision and the provisioning no longer have to happen
|
|
42
|
+
at the same keyboard. An owner mints a token with `client.registrationTokens.mint()` (scope
|
|
43
|
+
`org:invite`), and whatever holds it calls `redeemRegistrationToken(token)` once to get a new
|
|
44
|
+
organization and its first API key.
|
|
45
|
+
|
|
46
|
+
`redeem` is standalone rather than a client method, for the same reason as `fetchOAuthToken`: the
|
|
47
|
+
caller has no credential, and obtaining one is the entire purpose.
|
|
48
|
+
|
|
49
|
+
What the new org will be — its plan, and what its first key may do — is fixed by the MINTER. A
|
|
50
|
+
redeemer able to choose those would be choosing what someone else is billed for. Operator and
|
|
51
|
+
wildcard scopes cannot be granted this way, and neither can `org:invite` itself, so one decision
|
|
52
|
+
cannot become an unbounded tree of organizations.
|
|
53
|
+
|
|
54
|
+
Single-use and claimed atomically, so a race cannot produce two organizations; expiring; revocable
|
|
55
|
+
until redeemed. Unknown, expired, revoked and already-spent tokens are all reported identically, and
|
|
56
|
+
the SDK says so in the error rather than letting a bare 404 read as a wrong URL.
|
|
57
|
+
|
|
58
|
+
### Added — machine authentication end to end
|
|
59
|
+
|
|
60
|
+
With this and client-credentials auth, the whole first-run journey now runs unattended: redeem a
|
|
61
|
+
token, get a key, create an identity, pay, prove the work. That path had never been testable without
|
|
62
|
+
a human in the middle, which is why the one journey every customer walks was the one with no
|
|
63
|
+
automated coverage.
|
|
64
|
+
|
|
65
|
+
### Changed — `billing.quoteById` returns `seconds_remaining`
|
|
66
|
+
|
|
67
|
+
It returned `status` and `expires_at` and left the caller to parse a timestamp and subtract against a
|
|
68
|
+
clock — on the value that decides whether a submission is refused partway through the work. The
|
|
69
|
+
seconds are computed here instead. `null` when the gateway sent no expiry, which is not the same as
|
|
70
|
+
zero and must not be read as it.
|
|
71
|
+
|
|
72
|
+
### Fixed — a gateway older than the client now says so
|
|
73
|
+
|
|
74
|
+
`certen pricing` against production answered `Error [NOT_FOUND]: Not Found`. The command is
|
|
75
|
+
advertised in the CLI's own `--help`, and the message gave no way to tell whether the key lacked
|
|
76
|
+
access, the resource was missing, or — the actual cause — `GET /v1/pricing` was not deployed yet.
|
|
77
|
+
|
|
78
|
+
Both cases are 404s, but they are cleanly distinguishable: an unmatched route carries no `code` and
|
|
79
|
+
a `Route GET:/v1/x not found` message, while every handler-raised 404 carries a `code`. An unmatched
|
|
80
|
+
route now raises `ENDPOINT_NOT_ON_GATEWAY`, naming the method and path and saying the deployment is
|
|
81
|
+
behind this client.
|
|
82
|
+
|
|
83
|
+
Clients and the gateway deploy separately, so this is not an edge case — it is the state of things
|
|
84
|
+
during every release window.
|
|
85
|
+
|
|
86
|
+
### Fixed — `webhooks.deliveries` documented a scope that did not work
|
|
87
|
+
|
|
88
|
+
This method said it required `webhook:read`. It did not: `GET /v1/webhooks/deliveries` was missed
|
|
89
|
+
when the webhook group moved off `admin:*` and still demanded an admin scope, so a key holding
|
|
90
|
+
`webhook:read` could list endpoints and fetch one delivery by id, and could not list deliveries at
|
|
91
|
+
all — the one thing the group exists for.
|
|
92
|
+
|
|
93
|
+
The same off-by-one gave `POST /v1/admin/org` a `webhook:write` alternative, letting a key scoped to
|
|
94
|
+
webhooks create organizations. Both are fixed in the gateway, and both are now enforced by tests
|
|
95
|
+
rather than remembered. Requires the 2026-08 gateway.
|
|
96
|
+
|
|
97
|
+
### Added — `identity.retrieveMnemonic`
|
|
98
|
+
|
|
99
|
+
The most dangerous gap on the surface. Creating an identity with `signing_mode: "provider"` never
|
|
100
|
+
returns the mnemonic inline — it returns a `mnemonic_retrieval.url` whose token is consumed
|
|
101
|
+
atomically on first read and expires in about ten minutes. Nothing in this SDK could issue that
|
|
102
|
+
request, so a caller who did not hand-roll HTTP lost the seed permanently, on the one flow where
|
|
103
|
+
CERTEN generates the key material.
|
|
104
|
+
|
|
105
|
+
Takes the URL from the create response, or an id and token separately. `parseMnemonicTarget` is
|
|
106
|
+
exported for anyone who needs to split it themselves.
|
|
107
|
+
|
|
108
|
+
`createAndWait` now carries `mnemonic_retrieval` through instead of discarding it — but it is a
|
|
109
|
+
safety net, not the path: that call may wait five minutes against a token that lives ten. For
|
|
110
|
+
provider mode, `create()`, collect, then poll.
|
|
111
|
+
|
|
112
|
+
### Added — `client.oauthClients`
|
|
113
|
+
|
|
114
|
+
Tokens could be obtained and revoked from code; the client that issues them could only be created by
|
|
115
|
+
a human in the portal. So an integration could authenticate itself and not provision itself.
|
|
116
|
+
|
|
117
|
+
`list`, `create`, `remove`, `rotateSecret`.
|
|
118
|
+
|
|
119
|
+
**The operations moved from `/v1/admin/oauth-clients` to `/v1/oauth-clients`**, with the new
|
|
120
|
+
`oauth:read` alongside `oauth:write`. Same misfiling webhooks had: the rows are org-scoped and the
|
|
121
|
+
create route already refused to cross orgs without admin scope, so this was always a customer
|
|
122
|
+
capability wearing an operator's path. Listing your own clients also required a WRITE scope, which
|
|
123
|
+
it no longer does. Existing `admin:*` keys still work.
|
|
124
|
+
|
|
125
|
+
### Added — `admin.errors`
|
|
126
|
+
|
|
127
|
+
The error catalogue was published on the gateway and then had no client method for a release, so the
|
|
128
|
+
codes stayed exactly as discoverable as before — by provoking them. Reads from the LIVE gateway,
|
|
129
|
+
which is the point: the vendored `spec/errors.json` is only as current as this release, and a
|
|
130
|
+
deployment ahead of it raises codes the local copy has never seen.
|
|
131
|
+
|
|
132
|
+
### Added — `billing.quoteById`
|
|
133
|
+
|
|
134
|
+
A quote could be issued and never read back. Someone who priced work, was interrupted, and returned
|
|
135
|
+
had to guess whether their quote was still good or burn it and let the price move. `quote()` creates;
|
|
136
|
+
this reads. Returns `status` alongside `expires_at`, which are the two ways a quote stops being
|
|
137
|
+
usable.
|
|
138
|
+
|
|
139
|
+
### Added — `fetchOAuthToken`, `refreshOAuthToken`, `revokeOAuthToken`
|
|
140
|
+
|
|
141
|
+
The whole OAuth2 token lifecycle was unreachable. A service using client credentials could obtain a
|
|
142
|
+
token only by hand-rolling HTTP, and could not give one back at all — so the response to a suspected
|
|
143
|
+
leak was to open a browser.
|
|
144
|
+
|
|
145
|
+
Standalone functions rather than client methods, for the same reason as `fetchSharedProof`: both
|
|
146
|
+
endpoints carry their credential in the BODY and need no API key. A service using OAuth holds a
|
|
147
|
+
client id and secret, so routing these through a constructor demanding `apiKey` would ask for the
|
|
148
|
+
one credential such a caller does not have.
|
|
149
|
+
|
|
150
|
+
Two behaviours worth knowing, both documented on the functions. A refresh token is single-use, and
|
|
151
|
+
replaying a spent one revokes its entire descendant chain — deliberate theft detection, so store the
|
|
152
|
+
new pair before doing anything else. And revocation deliberately never reveals whether a token
|
|
153
|
+
existed: success means "not valid now", not "was valid before".
|
|
154
|
+
|
|
155
|
+
### Added — `client.webhooks`
|
|
156
|
+
|
|
157
|
+
CERTEN has pushed events all along, with a delivery queue, a retry policy and a published
|
|
158
|
+
signature-verification guide. None of it had a client surface, so an endpoint could be registered
|
|
159
|
+
nowhere and a failed delivery could be neither seen nor retried — the worst shape for a push
|
|
160
|
+
mechanism, because a dropped delivery and an event that never fired look identical from outside.
|
|
161
|
+
|
|
162
|
+
`list`, `register`, `update`, `remove`, `rotateSecret`, `verify`, `deliveries`, `deliveriesAll`,
|
|
163
|
+
`delivery`, `redeliver`.
|
|
164
|
+
|
|
165
|
+
**The operations moved from `/v1/admin/webhooks/*` to `/v1/webhooks/*`**, and from `admin:write` to
|
|
166
|
+
the new `webhook:read` / `webhook:write`. The data was always org-scoped — every endpoint belongs to
|
|
167
|
+
the calling organization — so both the path and the scope overstated what this is: reaching your own
|
|
168
|
+
webhooks required a scope that also grants revoking every API key in the organization, attributing
|
|
169
|
+
payments and publishing price books. Existing `admin:*` keys still work.
|
|
170
|
+
|
|
171
|
+
### Fixed — `isRetryable` was wrong for two codes, in both directions
|
|
172
|
+
|
|
173
|
+
HTTP status alone decides retryability correctly almost everywhere, and gets exactly two cases
|
|
174
|
+
backwards. Both are now decided by the code:
|
|
175
|
+
|
|
176
|
+
- `IDEMPOTENCY_KEY_IN_FLIGHT` is a 409, which reads as "do not retry" — but it means an identical
|
|
177
|
+
request is already running, and retrying the SAME key is the correct response. It was being
|
|
178
|
+
treated as terminal, failing a request that would have succeeded moments later.
|
|
179
|
+
- `PLAN_QUOTA_EXCEEDED` is a 429, which reads as "back off and retry" — but it is a quota for the
|
|
180
|
+
billing period, not a rate. Backing off never clears it, so the retries were spent for nothing.
|
|
181
|
+
|
|
182
|
+
### Added — 12 more error codes documented
|
|
183
|
+
|
|
184
|
+
The catalogue described 9 of the 40 codes the gateway can raise, and the gaps were the ones a client
|
|
185
|
+
most needs: `PAYMENT_REQUIRED`, `INSUFFICIENT_BALANCE`, `COMMITMENT_EXCEEDED`, `QUOTE_EXPIRED`,
|
|
186
|
+
`QUOTE_MISMATCH`, both idempotency codes, `SHARE_NO_LONGER_VALID`, and the throttles.
|
|
187
|
+
|
|
188
|
+
The gateway now publishes its catalogue at `GET /v1/errors`, and it is vendored here as
|
|
189
|
+
`spec/errors.json` exactly as the OpenAPI document is. A test relates the two: this SDK may not
|
|
190
|
+
document a code the gateway cannot raise, and the two may not disagree about status or
|
|
191
|
+
retryability. Previously they were unrelated lists, free to drift the moment either side changed.
|
|
192
|
+
|
|
193
|
+
### Fixed — the client-side rate-limit throttle, which had never worked and could hang a caller
|
|
194
|
+
|
|
195
|
+
Two bugs in the same few lines, found while making retries honour `Retry-After`.
|
|
196
|
+
|
|
197
|
+
`x-ratelimit-reset` is SECONDS REMAINING, not a Unix timestamp — the gateway sends `56` for a
|
|
198
|
+
60-second window. The SDK computed `Number(reset) * 1000`, producing an instant in 1970, so the
|
|
199
|
+
guard that waits for the window never fired. The throttle has never run.
|
|
200
|
+
|
|
201
|
+
Correcting the arithmetic alone would have been far worse than the bug: `reset` comes back on EVERY
|
|
202
|
+
response, so a corrected-but-unconditional version would sleep the full remaining window before
|
|
203
|
+
every request — turning a 60/min limit into roughly one request a minute. It now engages only once
|
|
204
|
+
`x-ratelimit-remaining` reaches zero.
|
|
205
|
+
|
|
206
|
+
Separately, that wait had no ceiling. A 429 carrying `Retry-After: 3600` parked the next request for
|
|
207
|
+
an hour inside the HTTP client, ignoring both `maxBackoffMs` and the per-request timeout, with no
|
|
208
|
+
way out. It is now capped at `maxBackoffMs`.
|
|
209
|
+
|
|
210
|
+
### Changed — retries honour `Retry-After`
|
|
211
|
+
|
|
212
|
+
Exponential backoff is a guess made without information; `Retry-After` is the gateway stating when
|
|
213
|
+
the window reopens. Retrying earlier cannot succeed, and each early attempt still counts against the
|
|
214
|
+
limit. The header wins when present, capped at `maxBackoffMs` and jittered.
|
|
215
|
+
|
|
216
|
+
### Changed — `error.details` carries the gateway's per-field validation entries
|
|
217
|
+
|
|
218
|
+
They arrived only on `body` before, which is not where anyone looks, so a tool rendering
|
|
219
|
+
`error.details` showed nothing for the one error class where per-field structure is most useful.
|
|
220
|
+
`retryAfter` keeps its place alongside.
|
|
221
|
+
|
|
222
|
+
### Added — `client.me()`
|
|
223
|
+
|
|
224
|
+
Who this credential is and what it may do, in one call: the organization (with its name), the
|
|
225
|
+
GRANTED scopes, and the key or the signed-in user depending on which credential was sent.
|
|
226
|
+
|
|
227
|
+
`GET /v1/me` accepted only a portal session until now, so a machine holding an API key could learn
|
|
228
|
+
neither its organization nor its own permissions — the two things anyone needs immediately after
|
|
229
|
+
minting a key. Clients resorted to probing endpoints and reading the 403s to guess.
|
|
230
|
+
|
|
231
|
+
Check `scopes` before starting a flow rather than after. A missing scope otherwise surfaces as a 403
|
|
232
|
+
partway through, by which point some of the work may already have happened.
|
|
233
|
+
|
|
234
|
+
### Changed — `identity.get()` takes `include`, and `createAndWait()` stops paying for data it discards
|
|
235
|
+
|
|
236
|
+
`GET /v1/identity/{id}` enriches with `governance`, `balances` and `pending` by default. Each is a
|
|
237
|
+
live query: governance and balances hit the network, and **balances runs once per linked chain**.
|
|
238
|
+
The parameter controlling this was neither in the OpenAPI document nor exposed here, so nobody could
|
|
239
|
+
opt out.
|
|
240
|
+
|
|
241
|
+
`createAndWait()` was the worst case. It polls every 3 seconds for up to 90 — around thirty rounds —
|
|
242
|
+
and reads exactly two fields, `status` and `can_sign`, both of which the gateway computes BEFORE any
|
|
243
|
+
enrichment runs. Every poll was fetching governance, per-chain balances and pending counts and
|
|
244
|
+
throwing them away. It now polls with `include: []` and does one enriched read at the end, so what
|
|
245
|
+
it returns is unchanged.
|
|
246
|
+
|
|
247
|
+
`identity.get(id, { include: [...] })` exposes the choice. Omitting the option omits the parameter
|
|
248
|
+
entirely, keeping the gateway default — sending `include=` and sending nothing are different
|
|
249
|
+
requests, and conflating them would strip enrichments from every ordinary read.
|
|
250
|
+
|
|
251
|
+
**This needs the matching gateway fix to do anything.** `?include=` arrives as an empty string,
|
|
252
|
+
which the route treated as falsy and turned back into the full default — so the one spelling that
|
|
253
|
+
reads as "give me nothing" was the spelling that fetched everything. Against a gateway older than
|
|
254
|
+
that fix, `include: []` is simply ignored rather than harmful.
|
|
255
|
+
|
|
256
|
+
### Changed — `transaction.listAll()` also stops on `has_more`
|
|
257
|
+
|
|
258
|
+
Every paged list on the gateway now publishes `pagination.has_more`, including `/v1/transactions`,
|
|
259
|
+
which previously echoed `limit` and `offset` with no way to tell the last page from a full one.
|
|
260
|
+
`listAll()` uses it and falls back to short-page inference against an older gateway.
|
|
261
|
+
|
|
262
|
+
### Changed — `paginate()` stops on `has_more` instead of guessing
|
|
263
|
+
|
|
264
|
+
The gateway now returns `pagination: { limit, offset, has_more, returned }` on the ledger, receipts
|
|
265
|
+
and payments lists. Eleven list endpoints paged three different ways and six reported nothing at
|
|
266
|
+
all, so walking one meant inferring the end from a short page.
|
|
267
|
+
|
|
268
|
+
That inference is wrong in one specific case, and it fails silently: **a final page that lands
|
|
269
|
+
exactly on the page size is indistinguishable from a full one.** So the walk either stops a page
|
|
270
|
+
early — reporting a partial ledger as complete, which for a reconciliation is worse than an error —
|
|
271
|
+
or spends an extra request discovering an empty page.
|
|
272
|
+
|
|
273
|
+
`paginate()`, `ledgerAll()` and `receiptsAll()` use `has_more` when it is present and fall back to
|
|
274
|
+
short-page inference when it is not, since the SDK is regularly pointed at an older gateway. A
|
|
275
|
+
server that reports `has_more: true` while returning no rows now terminates the loop rather than
|
|
276
|
+
spinning forever — a hang in an unattended script being worse than a wrong answer.
|
|
277
|
+
|
|
278
|
+
### Changed — `doctor()` distinguishes an entitlement outage from a component outage
|
|
279
|
+
|
|
280
|
+
The gateway now reports `entitlement_unpublished` and `entitlement_expired` as not-ready. When no
|
|
281
|
+
valid entitlement epoch is published, validators refuse EVERY intent on the fleet — an outage that
|
|
282
|
+
stops execution of work that already exists, as opposed to a dry sponsor, which stops identity
|
|
283
|
+
creation silently behind a 202. The two need different responses, so `doctor()` names them
|
|
284
|
+
differently instead of printing a reason token.
|
|
285
|
+
|
|
286
|
+
### Added — `fetchSharedProof()`, for the person a share link is FOR
|
|
287
|
+
|
|
288
|
+
The SDK could create a share, list shares and revoke a share — every operation for the sender — and
|
|
289
|
+
had nothing at all for the recipient, who is the reason the feature exists.
|
|
290
|
+
|
|
291
|
+
`fetchSharedProof(link)` is a standalone export, not a client method, and that is the point: the
|
|
292
|
+
endpoint takes no API key because "requiring a Certen credential to verify a Certen proof would
|
|
293
|
+
defeat the purpose", and putting the only client-side way to redeem behind a constructor that
|
|
294
|
+
demands an `apiKey` would have reimposed exactly that requirement.
|
|
295
|
+
|
|
296
|
+
Pass the link as received. The origin comes from the link itself — a proof shared from one
|
|
297
|
+
deployment is never fetched from another, where the token means nothing and the resulting 404 would
|
|
298
|
+
read as "this proof never existed". A bare token works too, with `baseUrl`.
|
|
299
|
+
|
|
300
|
+
A 410 is surfaced distinctly from a 404: the link WAS real and is now revoked, expired, or out of
|
|
301
|
+
views, so the recipient is told to ask for a fresh one rather than that the proof does not exist.
|
|
302
|
+
`proof.shared(link)` is the equivalent for a caller who already holds a client.
|
|
303
|
+
|
|
304
|
+
### Added — `client.health.ready()`, and a `doctor()` check that tells a CERTEN outage from your setup
|
|
305
|
+
|
|
306
|
+
`doctor()` proved the gateway was there with `GET /v1/chains`. That is a static registry read: it
|
|
307
|
+
keeps returning 200 while the database, the api-bridge, the proof service or Accumulate are down. So
|
|
308
|
+
a CERTEN-side outage and a broken local setup produced the same report — "gateway reachable: ok" —
|
|
309
|
+
and sent the reader hunting through their own configuration for a fault that was never theirs.
|
|
310
|
+
|
|
311
|
+
The new `platform ready` check reads the public readiness probe and names what is down, with a fix
|
|
312
|
+
that says explicitly there is nothing on your side to change.
|
|
313
|
+
|
|
314
|
+
The case that earns the round trip is `sponsor_below_floor`: when the onboarding sponsor runs dry,
|
|
315
|
+
identity creation returns 202 and then **never completes** — every visible signal says it worked.
|
|
316
|
+
Nothing else in the report could see it. A low-but-serving sponsor is a `warn` and does not fail the
|
|
317
|
+
run, because failing on it would train people to ignore the check.
|
|
318
|
+
|
|
319
|
+
`health.ready()` does NOT throw on 503. A not-ready answer IS the answer and carries the reasons;
|
|
320
|
+
turning it into an exception would discard the only useful part. It needs no API key, so a caller
|
|
321
|
+
whose credential is being rejected can still find out whether the platform is the problem.
|
|
322
|
+
|
|
323
|
+
### Changed — `createAndWait()` uses the cadence the gateway publishes
|
|
324
|
+
|
|
325
|
+
`POST /v1/identity` now returns a `polling` block: when to make the FIRST request, how often after
|
|
326
|
+
that, the typical total, and which statuses are terminal. It was a `status_url` and nothing else,
|
|
327
|
+
so every client invented a cadence — this one polled every 3 seconds starting immediately, against
|
|
328
|
+
an operation that is a chain of anchored Accumulate transactions and cannot complete in under a
|
|
329
|
+
minute. Roughly twenty requests spent before anything could possibly have changed.
|
|
330
|
+
|
|
331
|
+
An explicit `intervalMs` still overrides it completely, a gateway that sends no `polling` block
|
|
332
|
+
falls back to the previous numbers, and the published first-poll delay is clamped to the caller
|
|
333
|
+
timeout so a long advertised delay can never overshoot a short budget.
|
|
334
|
+
|
|
335
|
+
### Added — `client.transparency` and `billing.verifyReceipt()`
|
|
336
|
+
|
|
337
|
+
The transparency log had no client surface, which made the receipts unverifiable in practice. A
|
|
338
|
+
receipt's own instructions say to check its folded root against the signed head at that tree size —
|
|
339
|
+
and `/v1/transparency/heads/{treeSize}` was unreachable, so the instruction could not be followed
|
|
340
|
+
without hand-rolling HTTP. A verification procedure nobody can run is not a verification procedure.
|
|
341
|
+
|
|
342
|
+
`client.transparency` exposes `log()`, `heads()`, `head(treeSize)`, `consistency(first, second)`,
|
|
343
|
+
`priceBooks()` and `fx(id)`. None require an API key, deliberately: evidence obtainable only by
|
|
344
|
+
asking CERTEN could not settle a dispute with CERTEN.
|
|
345
|
+
|
|
346
|
+
`billing.verifyReceipt(id)` runs the whole procedure and returns a per-check report — digest
|
|
347
|
+
recomputed from the body, ed25519 signature checked against the PUBLISHED key set, salted leaf
|
|
348
|
+
recomputed, audit path folded and compared against a head fetched **separately**. Comparing the
|
|
349
|
+
proof with the `root_hash` that travelled inside it would prove nothing; the independent fetch is
|
|
350
|
+
the check.
|
|
351
|
+
|
|
352
|
+
It never throws for a failed check, and a check it could not run is `skipped` — which leaves both
|
|
353
|
+
`verified` and `complete` false. "I could not check" and "it checks out" are the two answers a
|
|
354
|
+
dispute must never confuse, so an unreachable log can never produce a pass.
|
|
355
|
+
|
|
356
|
+
Verified against a real signed receipt on a running gateway: digest, signature, inclusion and root
|
|
357
|
+
all reproduce; the anchor check correctly reports `skipped` when no anchored head covers the receipt
|
|
358
|
+
yet.
|
|
359
|
+
|
|
360
|
+
### Added — the evidence trail: `ledger`, `receipts`, `receipt`, `receiptProof`, `verificationKeys`
|
|
361
|
+
|
|
362
|
+
"What was I charged, and can I prove it?" The gateway has answered this from the start — an
|
|
363
|
+
append-only double-entry ledger, ed25519-signed receipts, RFC 6962 inclusion proofs against
|
|
364
|
+
Accumulate-anchored tree heads — and none of it had a client surface. For an audit or finance
|
|
365
|
+
function, evidence reachable only by hand-rolling HTTP may as well not exist.
|
|
366
|
+
|
|
367
|
+
- `ledger()` / `ledgerAll()` — every balance change, newest first. Corrections are new REVERSING
|
|
368
|
+
entries, never edits.
|
|
369
|
+
- `receipts()` / `receiptsAll()` — each carries `signed` and `logged`; `logged` is what decides
|
|
370
|
+
whether a proof can be fetched at all.
|
|
371
|
+
- `receipt(id)` — signature, computation inputs, and the gateway's own `verification` block.
|
|
372
|
+
- `receiptProof(id)` — the inclusion proof. **Store it with the receipt**: it stays valid forever
|
|
373
|
+
against a head pinned on Accumulate, so the evidence outlives CERTEN's cooperation.
|
|
374
|
+
- `verificationKeys()` — the public keys, so a signature can be checked without trusting the
|
|
375
|
+
response that carried it.
|
|
376
|
+
|
|
377
|
+
Read `covering_head`, not `head`, when asking whether a receipt is anchored. `head` is the head at
|
|
378
|
+
that tree size and may not itself be anchored, while a later anchored root still commits to the
|
|
379
|
+
leaf — so `head.anchor_status` reads "unanchored" for every receipt between anchors.
|
|
380
|
+
|
|
381
|
+
Verified against a real signed receipt from a running gateway using only what these methods return:
|
|
382
|
+
the digest recomputes from `body`, the ed25519 signature verifies against the published key, the
|
|
383
|
+
salted leaf hash matches, and the six-node audit path folds to `root_hash`. Nothing from the
|
|
384
|
+
gateway's own `verification` block was used — that block is CERTEN checking CERTEN, and its worth
|
|
385
|
+
is only that every check in it is reproducible, which is now what the SDK makes possible.
|
|
386
|
+
|
|
387
|
+
The list endpoints report no total and no `has_more`, so `ledgerAll()` and `receiptsAll()` infer
|
|
388
|
+
termination from a short page. That lives here once rather than in every caller that gets it subtly
|
|
389
|
+
wrong and reports a partial ledger as complete.
|
|
390
|
+
|
|
391
|
+
### Added — `billing.registerPayerAddress()` and `billing.payerAddresses()`
|
|
392
|
+
|
|
393
|
+
Register the wallet you pay from once, and every future deposit from it credits automatically — no
|
|
394
|
+
payment intent, no exact-amount matching, no expiry.
|
|
395
|
+
|
|
396
|
+
**The gateway's own 402 recommended this and no client could do it.** The PAYMENT_REQUIRED body
|
|
397
|
+
names `POST /v1/billing/deposit-addresses` under `how_to_pay.register_sender`, while this SDK
|
|
398
|
+
omitted it on the stated grounds that it required a signed-in portal owner rather than a machine
|
|
399
|
+
key. That was wrong — the endpoint authenticates with an API key carrying `billing:write`, which is
|
|
400
|
+
exactly what an autonomous caller settling its own refusal is holding. The advice in the refusal
|
|
401
|
+
pointed at a raw endpoint the reader had to call by hand.
|
|
402
|
+
|
|
403
|
+
An address belongs to ONE organization per chain; a duplicate is rejected with a 409 rather than
|
|
404
|
+
merged, because ambiguous attribution would credit the wrong customer.
|
|
405
|
+
|
|
406
|
+
### Changed — affordability is one call, and `doctor()` drops a round trip
|
|
407
|
+
|
|
408
|
+
`BalanceResponse` now carries `remaining_usd`, `pending_intents` and `uncovered_usd`. **Gate on
|
|
409
|
+
`remaining_usd`.** `spendable_usd` ignores work already committed, and CERTEN charges a
|
|
410
|
+
multi-signature intent when quorum is reached — which can be weeks after it was opened — so an
|
|
411
|
+
account can show a healthy spendable balance that is entirely spoken for and still be refused.
|
|
412
|
+
|
|
413
|
+
Reading the safe number used to require a second request to `/v1/billing/obligations`. `doctor()`
|
|
414
|
+
made exactly that call for exactly that one field; it no longer does, taking it from **5 round trips
|
|
415
|
+
to 4**. `obligations()` stays, and is still the way to see WHICH intents claimed the balance.
|
|
416
|
+
|
|
417
|
+
The fields are optional in the type because an older gateway does not send them. Clients fall back
|
|
418
|
+
to `obligations()` when `remaining_usd` is absent rather than treating `spendable_usd` as safe.
|
|
419
|
+
|
|
420
|
+
### Added — `billing.pricing()`, so prices stop having to be guessed
|
|
421
|
+
|
|
422
|
+
`quote()` prices ONE sku on ONE chain and needs the sku name up front. Nothing published those
|
|
423
|
+
names, and they are not guessable: it is `identity.provision`, not `identity.create`. Finding out
|
|
424
|
+
what onboarding cost meant guessing a name, reading the refusal, and guessing again.
|
|
425
|
+
|
|
426
|
+
`billing.pricing()` returns the whole catalogue in one call — every sku, every chain, and the
|
|
427
|
+
`price_book_version` and `price_book_hash` that quotes and receipts also carry, so a price seen here
|
|
428
|
+
can be traced through to the charge.
|
|
429
|
+
|
|
430
|
+
Read `mode` before reporting a number. `flat` means `platform_fee_usd` is the whole charge; `quoted`
|
|
431
|
+
means gas is measured at execution and added, so the figure is a floor. `max_charge_usd` is `null`
|
|
432
|
+
when uncapped and stays null — it is not flattened to a string or a zero.
|
|
433
|
+
|
|
434
|
+
Requires a gateway with `GET /v1/pricing` (2026-08 or later).
|
|
435
|
+
|
|
436
|
+
### Changed — `doctor()` asks the gateway one question once, and overlaps the rest
|
|
437
|
+
|
|
438
|
+
Measured against the live gateway before and after: **6 round trips to 5**, and **~1570ms to ~1195ms**
|
|
439
|
+
of wall time.
|
|
440
|
+
|
|
441
|
+
The credential check proved the key by reading the balance and then discarded the answer, so the
|
|
442
|
+
balance check fetched it again — two of six round trips spent asking one question twice. And the
|
|
443
|
+
remaining reads (portfolio, obligations, recent intents) answer unrelated questions but were awaited
|
|
444
|
+
one after another, so the command cost their sum.
|
|
445
|
+
|
|
446
|
+
They now run concurrently and the probe's balance is reused. The checks are still reported in the
|
|
447
|
+
same order with the same verdicts — only the I/O overlaps.
|
|
448
|
+
|
|
449
|
+
This is the command someone runs when they are already stuck, which is the worst moment to spend
|
|
450
|
+
latency on nothing.
|
|
451
|
+
|
|
452
|
+
### Added — `listAll()` iterators that need no adapter
|
|
453
|
+
|
|
454
|
+
```ts
|
|
455
|
+
for await (const tx of certen.transaction.listAll()) { … }
|
|
456
|
+
for await (const action of certen.pending.listAll({ identity })) { … }
|
|
457
|
+
for await (const { item, index, total } of certen.admin.auditLogAll({ from })) { … }
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
`paginate` has been exported since 0.2.0 and composed with nothing this SDK ships: it takes a
|
|
461
|
+
callback returning `{ items }`, and no method returns that shape — `list()` returns
|
|
462
|
+
`{ transactions }`, `shares()` returns `{ shares }`. Using it meant hand-writing the adapter it
|
|
463
|
+
should have contained, in every caller:
|
|
464
|
+
|
|
465
|
+
```ts
|
|
466
|
+
paginate((limit, offset) =>
|
|
467
|
+
certen.transaction.list({ limit, offset }).then((r) => ({ items: r.transactions })))
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
An exported helper that cannot be used as shipped is worse than none, because it reads as a solved
|
|
471
|
+
problem. `paginate` and `paginateWithTotal` remain exported for endpoints the SDK does not model and
|
|
472
|
+
for paginating your own API.
|
|
473
|
+
|
|
474
|
+
`auditLogAll` yields `{ item, index, total }` rather than bare entries — that endpoint returns a real
|
|
475
|
+
total, and an audit export is long enough to want a progress line and long enough that a silent
|
|
476
|
+
early stop matters.
|
|
477
|
+
|
|
478
|
+
### Breaking — identity and deposit responses are no longer wrapped
|
|
479
|
+
|
|
480
|
+
The gateway used to nest the resource under a single key on some endpoints and return it bare on
|
|
481
|
+
others, with no rule distinguishing them. Four operations were the odd ones out and have been
|
|
482
|
+
flattened.
|
|
483
|
+
|
|
484
|
+
```ts
|
|
485
|
+
// before
|
|
486
|
+
const { identity } = await client.identity.get(id);
|
|
487
|
+
identity.can_sign;
|
|
488
|
+
|
|
489
|
+
// after — the response IS the identity, with its sub-resources beside it
|
|
490
|
+
const identity = await client.identity.get(id);
|
|
491
|
+
identity.can_sign;
|
|
492
|
+
identity.governance; // unchanged: a joined sub-resource stays named
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
Affects `identity.create()`, `identity.get()`, `identity.update()`, `billing.payment()` and
|
|
496
|
+
`admin.createOrg()`. `IdentityResponse` now `extends Identity`, so an `IdentityResponse` is usable
|
|
497
|
+
anywhere an `Identity` was. `OrgResponse` carries `id` / `name` / `plan` / `created_at` directly.
|
|
498
|
+
|
|
499
|
+
`createAndWait()` and `execute.*` are unaffected — they return the same values as before.
|
|
500
|
+
|
|
501
|
+
The change is breaking, and was taken deliberately while there are no external integrators. The
|
|
502
|
+
alternatives were to break real callers later or to carry both shapes indefinitely. See the
|
|
503
|
+
gateway's `docs/api-conventions.md`.
|
|
504
|
+
|
|
505
|
+
### Fixed — a field with no value is `null`, not `""`
|
|
506
|
+
|
|
507
|
+
`proof_id`, `proof_bundle_url`, `accum_tx_hash` and `error_message` were typed `string` and arrived
|
|
508
|
+
as `""` when the gateway had no value. The gateway declared them `type: 'string'`, and its serializer
|
|
509
|
+
coerces a null to an empty string rather than rejecting it — so `proof_id` was `""` on all 205
|
|
510
|
+
intents in the production table, meaning every transaction response ever served.
|
|
511
|
+
|
|
512
|
+
`""` is falsy, so `if (tx.proof_id)` happened to work. `tx.proof_id != null` did not: it is **true**
|
|
513
|
+
for `""`, and that caller went on to request a proof by empty id. Worse for `error_message`, where a
|
|
514
|
+
completed transaction reported an error message that was merely empty rather than absent.
|
|
515
|
+
|
|
516
|
+
These are now `string | null` and the gateway sends a real null.
|
|
517
|
+
|
|
518
|
+
### Fixed — `can_sign: null` is no longer reported as `false`
|
|
519
|
+
|
|
520
|
+
`can_sign` is three-valued: `true`, `false`, and `null` meaning *the on-chain key page could not be
|
|
521
|
+
read*. The gateway declared it `type: 'boolean'`, and the serializer turned that null into `false` —
|
|
522
|
+
collapsing "we could not check" into "this identity cannot sign".
|
|
523
|
+
|
|
524
|
+
It rounded down rather than up, so nobody was told they could sign when they could not. What was
|
|
525
|
+
lost is the distinction: "definitively cannot sign, repair with `identity.update({ publicKey })`"
|
|
526
|
+
and "we could not check, retry" have different fixes, and callers were shown the first when the
|
|
527
|
+
truth was the second.
|
|
528
|
+
|
|
529
|
+
### Changed — `waitForPayment` no longer depends on watching the payments feed
|
|
530
|
+
|
|
531
|
+
The gateway now closes a deposit intent when its payment credits, however the payer was identified.
|
|
532
|
+
The feed watch is kept — the SDK is versioned independently and may be pointed at an older gateway,
|
|
533
|
+
and a deposit for the wrong amount still credits your balance without ever matching the intent.
|
|
534
|
+
|
|
535
|
+
## 0.6.0 — diagnosis, proofs, device authorization, and a guard that refuses to strand your money
|
|
536
|
+
|
|
537
|
+
### Added — `client.doctor()`
|
|
538
|
+
|
|
539
|
+
An ordered list of checks that **never throws for a failed check** — a diagnosis that cannot report
|
|
540
|
+
a broken setup is useless. Read `report.ok` and the per-check status. It catches, in order: gateway
|
|
541
|
+
unreachable, a credential rejected (401) or merely unscoped (403), no active identity, an abstract
|
|
542
|
+
account with no gas, a balance entirely committed to pending intents, an expired trial, and intents
|
|
543
|
+
that anchored but never executed.
|
|
544
|
+
|
|
545
|
+
The check list is the same length however far the run got, so a skipped check is visibly skipped
|
|
546
|
+
rather than absent. `CREDENTIALLED_CHECKS` is exported for callers that need to mark the same set.
|
|
547
|
+
|
|
548
|
+
### Added — `client.proof`, `client.chains`, `client.device`
|
|
549
|
+
|
|
550
|
+
`proof` covers the artifact, the bundle, custody, share links, and the Accumulate merkle receipt.
|
|
551
|
+
**A 5xx from the proof-service does not mean the proof is missing** — that service and Accumulate
|
|
552
|
+
fail independently, and the receipt keeps working when the proof-service does not.
|
|
553
|
+
|
|
554
|
+
`chains` is the public contract registry and needs no API key, which makes it usable before a
|
|
555
|
+
credential exists. `device` is the RFC 8628 device authorization grant, so a terminal can obtain its
|
|
556
|
+
own key without a human copying a secret.
|
|
557
|
+
|
|
558
|
+
### Added — `identity.createAndWait()`
|
|
559
|
+
|
|
560
|
+
`create()` returns 202 and provisioning continues, so its response says nothing about whether the
|
|
561
|
+
identity works. This waits for `status` terminal AND `can_sign === true`, and distinguishes all
|
|
562
|
+
three values of `can_sign`: `false` is a failure, `null` is UNKNOWN and never rounds up to ready,
|
|
563
|
+
and a timeout is neither success nor failure.
|
|
564
|
+
|
|
565
|
+
### Behavioural change — `execute.transfer` and `execute.contractCall` refuse an unfunded account
|
|
566
|
+
|
|
567
|
+
An intent that moves value from an empty abstract account is accepted, signed and submitted — every
|
|
568
|
+
call returns success — and then parks at `anchoring` forever, because the execution leg cannot run
|
|
569
|
+
on chain. Nothing in any API response says so.
|
|
570
|
+
|
|
571
|
+
Both methods now check first and throw `CertenUnfundedAccountError` before submitting. **The check
|
|
572
|
+
refuses only on a positively observed zero balance**: if the balance cannot be read, the intent
|
|
573
|
+
proceeds, because a guard that blocked on missing data would break real work every time the
|
|
574
|
+
portfolio view lagged. Opt out with `skipFundingCheck: true`.
|
|
575
|
+
|
|
576
|
+
It also normalizes the two spellings the gateway uses for a chain id — `GET /v1/portfolio` returns a
|
|
577
|
+
slug on some chain accounts and a numeric EVM id on others, in the same response.
|
|
578
|
+
|
|
579
|
+
## 0.5.0 — balance, funding, and a 402 that carries its own fix
|
|
580
|
+
|
|
581
|
+
### Added — `client.billing`
|
|
582
|
+
|
|
583
|
+
Balance, commitments, and adding funds. Two methods worth reading the docstrings for:
|
|
584
|
+
|
|
585
|
+
`obligations()` returns `remaining_usd` — spendable minus what pending intents will consume — and
|
|
586
|
+
that, not `balance()`, is the number to gate work on. A multi-signature intent can wait weeks for
|
|
587
|
+
quorum, so an account can hold a balance that is entirely committed and still be refused on its
|
|
588
|
+
next call.
|
|
589
|
+
|
|
590
|
+
`waitForPayment()` polls until a deposit is credited or its window closes, and RETURNS the terminal
|
|
591
|
+
status rather than throwing on expiry. An expired payment is an ordinary outcome the caller should
|
|
592
|
+
report, not an exception.
|
|
593
|
+
|
|
594
|
+
Registering a payer address is deliberately absent: it asserts that deposits from a wallet belong to
|
|
595
|
+
your organization, so it stays a signed-in owner/admin action in the portal rather than something a
|
|
596
|
+
machine key can do.
|
|
597
|
+
|
|
598
|
+
### Added — `CertenPaymentRequiredError`, and the response body on every error
|
|
599
|
+
|
|
600
|
+
**Behavioural change: HTTP 402 no longer arrives as `CertenBadRequestError`.** Code that caught
|
|
601
|
+
`CertenBadRequestError` to handle payment failures must catch `CertenPaymentRequiredError` instead.
|
|
602
|
+
The two were worth separating: nothing is wrong with a refused request — it is priced, valid, and
|
|
603
|
+
would succeed once funded — and a host product needs that distinction to choose between a top-up
|
|
604
|
+
prompt and a validation message.
|
|
605
|
+
|
|
606
|
+
The gateway mints a payment target with the refusal, and the SDK was discarding it: `details`
|
|
607
|
+
carried only `retryAfter`, so a body containing an address, an exact amount, a reference and a
|
|
608
|
+
deep link was reduced to a message string. `CertenError.body` now carries the parsed response for
|
|
609
|
+
every error, and the 402 subclass reads it through typed accessors — `shortfallUsd`, `quoteId`,
|
|
610
|
+
`resolution`, `portalUrl`, `cliCommand`, `pendingIntents`, `isCommitmentExceeded`, and a `summary`
|
|
611
|
+
fit to show a person.
|
|
612
|
+
|
|
613
|
+
`summary` exists so callers do not each re-derive the sentence and get the commitment case wrong:
|
|
614
|
+
under `COMMITMENT_EXCEEDED`, waiting for pending intents to settle frees the same capacity, so
|
|
615
|
+
advising only "add funds" is incomplete.
|
|
616
|
+
|
|
617
|
+
Never retryable, and it must not be retried: only money changes the outcome.
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
### Fixed — `execute.contractCall()` now works at all
|
|
621
|
+
|
|
622
|
+
**Breaking, type-level: `contractAddresses` is an object, not `string[]`.**
|
|
623
|
+
|
|
624
|
+
`execute.contractCall()` sent `contract_addresses: [contractCall.target]`. That field is an OBJECT
|
|
625
|
+
naming the CERTEN deployment (`anchor`, `anchorV2`, `abstractAccount`, `entryPoint`, `factory`) — not
|
|
626
|
+
your call target, and not a list. The endpoint rejected every such call with
|
|
627
|
+
`400 /contract_addresses must be object`, so the method had never worked on any chain.
|
|
628
|
+
|
|
629
|
+
It is no longer sent at all: the gateway applies the correct defaults. Pass `contractAddresses` only
|
|
630
|
+
to target a non-standard deployment.
|
|
631
|
+
|
|
632
|
+
Verified against production on base-sepolia: opened, signed and submitted, where the same call
|
|
633
|
+
returned 400 before.
|
|
634
|
+
|
|
635
|
+
### Fixed — `CreateIdentityParams.signingProvider` is an object
|
|
636
|
+
|
|
637
|
+
Declared `string` while the endpoint's schema is `{ type: 'object' }`, so a provider name was
|
|
638
|
+
rejected with a 400 naming a field the caller believed they had set correctly.
|
|
639
|
+
|
|
640
|
+
### Changed — the contract fixture now pins property TYPES
|
|
641
|
+
|
|
642
|
+
Both bugs above are the same class, and the contract test could not see either: it recorded property
|
|
643
|
+
*names* only, so it confirmed `contract_addresses` was an allowed key while the SDK sent it in a
|
|
644
|
+
shape the API rejects. The fixture now records each request property's JSON type and
|
|
645
|
+
`contract.test.ts` asserts it, with `number`/`integer` handled the way JSON Schema does.
|
|
646
|
+
|
|
647
|
+
### Fixed — `execute.transfer()` now works at all
|
|
648
|
+
|
|
649
|
+
**Breaking: `TransferParams.adiUrl` is required.** Not breaking in practice — every call that
|
|
650
|
+
omitted it failed, so there is no working code to break.
|
|
651
|
+
|
|
652
|
+
`execute.transfer()` returned a bodyless `502` on every invocation. The cause was not the gateway
|
|
653
|
+
being down: the upstream native-transfer path requires four fields that **do not appear in the
|
|
654
|
+
transfer shape the API documents** — `adiUrl`, `id`, `initiatedBy` and `timestamp` — and omitting any
|
|
655
|
+
one of them crashes it rather than returning a validation error. `adiUrl` is dereferenced with no
|
|
656
|
+
null check (`TypeError`), and `new Date(intent.timestamp).toISOString()` throws `RangeError` on
|
|
657
|
+
`undefined`. The equivalent multi-leg path defaults the last three for the caller; this one does not.
|
|
658
|
+
|
|
659
|
+
The SDK now supplies all four: you pass `adiUrl`, and `id`, `initiatedBy` and `timestamp` are
|
|
660
|
+
generated. Verified end-to-end against production — intent opened, signed externally, submitted,
|
|
661
|
+
`anchoring` → `completed` in 94s, and the resulting Accumulate transaction confirmed `delivered`
|
|
662
|
+
on kermit.
|
|
663
|
+
|
|
664
|
+
This is a workaround for certenIO/accumulate-api-bridge#1. Once that path defaults the three
|
|
665
|
+
generated fields, they become harmless no-ops rather than load-bearing.
|
|
666
|
+
|
|
667
|
+
`execute.contractCall()` was never affected — it sends the multi-leg shape, which is handled
|
|
668
|
+
correctly upstream.
|
|
669
|
+
|
|
670
|
+
### Changed — `Identity.can_sign` is now `boolean | null`
|
|
671
|
+
|
|
672
|
+
The gateway changed what this field means, and the type follows.
|
|
673
|
+
|
|
674
|
+
It used to be derived from a database column — effectively "was a public key supplied" — so it read
|
|
675
|
+
`true` from the moment the identity row existed. On 2026-08-01 an Accumulate outage killed
|
|
676
|
+
provisioning between "create the ADI under the sponsor key" and "swap the customer's key in",
|
|
677
|
+
leaving an ADI on chain held by the **CERTEN sponsor key** rather than the customer. The gateway
|
|
678
|
+
reported `status: "error"` and `can_sign: true` for it. On the one failure where the distinction
|
|
679
|
+
matters most, the field asserted the reassuring answer.
|
|
680
|
+
|
|
681
|
+
It is now derived from the on-chain key page: is this identity's key hash actually on it?
|
|
682
|
+
|
|
683
|
+
- `true` — the key is on the page. The identity can sign.
|
|
684
|
+
- `false` — the page was read and the key is not on it.
|
|
685
|
+
- **`null` — the page could not be read. Unknown, NOT usable.**
|
|
686
|
+
|
|
687
|
+
**Treat `null` as "do not proceed".** It is deliberately not `true`: an Accumulate outage is exactly
|
|
688
|
+
when a caller most needs to be told the truth is unavailable rather than handed an optimistic
|
|
689
|
+
default. If you were doing `if (identity.can_sign)`, that still behaves correctly — `null` is falsy.
|
|
690
|
+
If you were doing `if (identity.can_sign === false)`, add the null case.
|
|
691
|
+
|
|
692
|
+
## 0.4.0 — a reachable timeout, and error codes that match the documentation
|
|
693
|
+
|
|
694
|
+
Both of these were found by running the SDK against the live gateway. Neither is visible against a
|
|
695
|
+
mock that always answers JSON promptly, which is why neither was caught before.
|
|
696
|
+
|
|
697
|
+
### Added — `timeoutMs` client option
|
|
698
|
+
|
|
699
|
+
```ts
|
|
700
|
+
const certen = new CertenClient({ apiKey, timeoutMs: 90_000 });
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
The per-request timeout was hardcoded at 30s with no way to change it, and the ceiling was reachable
|
|
704
|
+
in ordinary use: `execute.proof()` falls back to fetching the Accumulate merkle receipt, which can
|
|
705
|
+
take longer than 30s. The call failed as `NETWORK_ERROR` and the caller could do nothing about it —
|
|
706
|
+
the SDK reported that a proof could not be retrieved when it existed and was simply slow.
|
|
707
|
+
|
|
708
|
+
This bounds a single HTTP request. It is not `execute.wait()`, which polls to its own budget
|
|
709
|
+
(default 360s).
|
|
710
|
+
|
|
711
|
+
### Changed — `execute.proof()` gets its own budget, and accepts an override
|
|
712
|
+
|
|
713
|
+
Proof fetches now allow 120s rather than the client default, and take an override:
|
|
714
|
+
|
|
715
|
+
```ts
|
|
716
|
+
await certen.execute.proof(intentId, { timeoutMs: 30_000 });
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
Retrieving evidence for an already-completed transaction is the call that should wait rather than
|
|
720
|
+
fail: nothing is pending on it, and the alternative is telling a caller their proof does not exist
|
|
721
|
+
when it does.
|
|
722
|
+
|
|
723
|
+
### Fixed — errors no longer report codes outside the documented catalog
|
|
724
|
+
|
|
725
|
+
An error response with no machine-readable `code` now maps to a documented code by HTTP status
|
|
726
|
+
(`502/503/504 → BAD_GATEWAY`, `500 → INTERNAL_ERROR`, `404 → NOT_FOUND`, and so on). A `code` the
|
|
727
|
+
gateway actually sends always wins; a status with no mapping still reports `UNKNOWN_ERROR`.
|
|
728
|
+
|
|
729
|
+
Previously any non-JSON error body left `data.code` undefined and produced `UNKNOWN_ERROR`. That is
|
|
730
|
+
not hypothetical — an edge-level 502 has a `text/plain` body, so **every edge 502 surfaced as
|
|
731
|
+
`UNKNOWN_ERROR`**, and code branching on `BAD_GATEWAY`, exactly as `docs/errors.md` instructs,
|
|
732
|
+
silently never matched.
|
|
733
|
+
|
|
734
|
+
`isRetryable` is derived from the HTTP status and was always correct, so retry behaviour does not
|
|
735
|
+
change. Only the reported `code` does. If you were special-casing `UNKNOWN_ERROR` to catch 5xx, you
|
|
736
|
+
can now branch on the documented codes instead.
|
|
737
|
+
|
|
738
|
+
## 0.3.1 — documentation links that work off GitHub
|
|
739
|
+
|
|
740
|
+
No code changes.
|
|
741
|
+
|
|
742
|
+
The README linked its guides with repository-relative paths (`../../docs/guides/...`). Those resolve
|
|
743
|
+
on GitHub and are **dead on the npm package page**, which renders the README standalone and where
|
|
744
|
+
`docs/` is not part of the tarball. Every guide link a reader followed from npm 404'd. They now point
|
|
745
|
+
at <https://docs.kompendium.co>, which publishes the same guides.
|
|
746
|
+
|
|
747
|
+
Also adds the documentation and API-key links to the top of the README, and corrects a link to the
|
|
748
|
+
policy signer that pointed at a GitHub org that does not exist.
|
|
749
|
+
|
|
750
|
+
## 0.3.0 — response types now describe what the API actually returns
|
|
751
|
+
|
|
752
|
+
**Breaking, at the type level only. No runtime behavior changed.**
|
|
753
|
+
|
|
754
|
+
Every response interface was camelCase (`intentId`, `signingData.dataToSign`, `adiUrl`,
|
|
755
|
+
`creditBalance`). The API is snake_case, and the resources do `return data` with no transformation —
|
|
756
|
+
so every one of those declared fields was `undefined` at runtime while TypeScript insisted it was a
|
|
757
|
+
`string`. The failure was silent in the worst way: code compiled, ran, and produced `undefined`
|
|
758
|
+
somewhere far from the cause.
|
|
759
|
+
|
|
760
|
+
`execute.*` was never affected. It was written against real responses and reads snake_case directly,
|
|
761
|
+
which is why the one flow that had been exercised end-to-end worked while the typed resources did not.
|
|
762
|
+
|
|
763
|
+
If you were already compensating with `as any` or reading snake_case at runtime, your code was
|
|
764
|
+
correct and keeps working — you can now delete the casts. If you were trusting the types, your code
|
|
765
|
+
was silently broken and will now fail to compile, which is the point.
|
|
766
|
+
|
|
767
|
+
### Changed — all response types are snake_case
|
|
768
|
+
|
|
769
|
+
`IdentityResponse` · `TransactionResponse` · `GovernanceResponse` · `SignResponse` ·
|
|
770
|
+
`PortfolioResponse` · `PendingActionsResponse` · `OrgResponse` · `ApiKeyResponse` ·
|
|
771
|
+
`ApiKeyListItem` · `AuditLogEntry` · `UsageSummaryResponse` · `ChainAccount` · `ChainBalance` ·
|
|
772
|
+
`PortfolioIdentity` · `PendingAction`.
|
|
773
|
+
|
|
774
|
+
### Changed — `create` and `get` no longer share a type
|
|
775
|
+
|
|
776
|
+
`POST /v1/transaction` and `GET /v1/transaction/{id}` return different shapes, and one
|
|
777
|
+
`TransactionResponse` covering both hid it. Same for governance.
|
|
778
|
+
|
|
779
|
+
- `transaction.create` → **`CreateTransactionResponse`** (`intent_id`, `signing_data`, `submit_url`, `idempotent`)
|
|
780
|
+
- `transaction.get` → `TransactionResponse` (`accum_tx_hash`, `proof`, timestamps)
|
|
781
|
+
- `transaction.submitSignature` → **`SubmitSignatureResponse`**
|
|
782
|
+
- `transaction.list` → **`ListTransactionsResponse`**. It declared `{ transactions, pagination }`; the endpoint returns `{ transactions, limit, offset }` and has no pagination object.
|
|
783
|
+
- `governance.create` → **`CreateGovernanceResponse`**, `governance.submitSignature` → **`SubmitGovernanceSignatureResponse`**
|
|
784
|
+
- `sign.submitSignature` → **`SubmitSignSignatureResponse`**
|
|
785
|
+
- `identity.retire` → **`DeleteIdentityResponse`**
|
|
786
|
+
|
|
787
|
+
### Changed — `SigningData` split in two
|
|
788
|
+
|
|
789
|
+
The two endpoints that return signing data carry the bytes under **different names**, and a single
|
|
790
|
+
shared type is what let that go unnoticed:
|
|
791
|
+
|
|
792
|
+
- **`IntentSigningData`** (`POST /v1/transaction`) — the bytes are in **`hash_to_sign`**
|
|
793
|
+
- **`SignRequestSigningData`** (`POST /v1/sign`) — the bytes are in **`data_for_signature`**
|
|
794
|
+
|
|
795
|
+
Both mean the same thing: sign the RAW BYTES of that hex. Do not hash it again; do not sign its
|
|
796
|
+
ASCII. `execute.*` handles the distinction for you.
|
|
797
|
+
|
|
798
|
+
### Added
|
|
799
|
+
|
|
800
|
+
- `Identity` and `DeleteIdentityResponse` types; `can_sign` and `error_message` on `Identity`.
|
|
801
|
+
`can_sign` derives from the on-chain key page, not the provisioning state machine, so it can read
|
|
802
|
+
`true` while `status` is still `creating` — check both.
|
|
803
|
+
- `user_has_signed`, `required_signatures`, `is_ready`, `identity_url` on `PendingAction`, and
|
|
804
|
+
`stats` on `PendingActionsResponse`.
|
|
805
|
+
- **`test/response-shape.test.ts`** — pins every declared response type against the gateway's own
|
|
806
|
+
OpenAPI response schemas. The existing contract test only ever checked the REQUEST direction,
|
|
807
|
+
which is precisely why this drifted. Verified to fail when a camelCase key is reintroduced.
|
|
808
|
+
- **`scripts/build-contract-fixture.mjs`** — regenerates the contract fixture from the live spec.
|
|
809
|
+
The old fixture was hand-shaped and captured no responses at all; the test file said "then
|
|
810
|
+
regenerate the fixture" without saying how.
|
|
811
|
+
|
|
812
|
+
## 0.2.0 — first published version
|
|
813
|
+
|
|
814
|
+
**0.1.0 was never published.** Three of its methods could not work against the live API. They were found
|
|
815
|
+
while preparing the package for release, by comparing what the SDK sends against the gateway's own OpenAPI
|
|
816
|
+
spec. Nothing in the existing test suite could have caught them: those tests exercise retry, idempotency,
|
|
817
|
+
and error mapping against a local mock that accepts any body, and a mock answering 200 to anything will
|
|
818
|
+
never tell you the request was wrong.
|
|
819
|
+
|
|
820
|
+
### Fixed — methods that could not work
|
|
821
|
+
|
|
822
|
+
- **`transaction.create` sent no `intent`.** It sent a flat `{ type, to, amount, token, chain, memo }` body.
|
|
823
|
+
`POST /v1/transaction` requires `identity_id` and `intent`, and accepts none of those six fields — so every
|
|
824
|
+
call returned 400. Now takes `{ identityId, intent, contractAddresses?, proofClass?, signerKeyPage?,
|
|
825
|
+
signerPublicKey?, idempotencyKey? }`, matching the API, including multi-leg and `contractCall` intents.
|
|
826
|
+
- **`governance.create` omitted both required fields.** It sent `{ identity_id, operation_type, payload }`;
|
|
827
|
+
the API requires `identity` (the ADI, not a uuid) and `operations` (an **array**, so several changes are
|
|
828
|
+
authorized under one quorum). Every call returned 400.
|
|
829
|
+
- **`identity.list` called a route that does not exist.** `GET /v1/identities` returns 404 — the gateway has
|
|
830
|
+
no plural collection route. **Removed** rather than shipped as a dead method. Track the ids you create.
|
|
831
|
+
|
|
832
|
+
### Fixed — silent no-ops
|
|
833
|
+
|
|
834
|
+
- **`identity.create` no longer sends `webhook_url`.** `POST /v1/identity` does not accept it, and Fastify
|
|
835
|
+
strips unknown properties, so the option did nothing while appearing to work. Set it via `identity.update()`,
|
|
836
|
+
which does accept it. `create` now also supports `signingMode`, `signingProvider`, and `idempotencyKey`.
|
|
837
|
+
- **`identity.get` no longer sends an `include` query parameter.** The route takes none; it was ignored.
|
|
838
|
+
|
|
839
|
+
### Added
|
|
840
|
+
|
|
841
|
+
- **`identity.retire(id)`** — `DELETE /v1/identity/{id}`, which frees the org's identity quota. Soft delete
|
|
842
|
+
inside Certen only: the on-chain ADI, key book, and key page are untouched.
|
|
843
|
+
- **`DEFAULT_BASE_URL` is exported**, and the base URL now resolves `options.baseUrl` → `$CERTEN_API_URL` →
|
|
844
|
+
`https://gateway.kompendium.co`. The previous default was `https://api.certen.io`, which resolves — to the
|
|
845
|
+
Certen marketing site. A client built without an explicit `baseUrl` returned HTML for every call.
|
|
846
|
+
- **`test/contract.test.ts`** — validates the request every method produces against a vendored snapshot of
|
|
847
|
+
the gateway's OpenAPI spec: path exists, method exists, required fields present, no field the endpoint
|
|
848
|
+
would strip. This is the guard that would have caught all of the above. Refresh it with the command at the
|
|
849
|
+
bottom of this file when the API changes.
|
|
850
|
+
- Publish metadata: `files`, `exports`, `engines`, repository, keywords, `prepack` build, README, LICENSE.
|
|
851
|
+
|
|
852
|
+
### Changed
|
|
853
|
+
|
|
854
|
+
- `license` corrected to **MIT**. `package.json` claimed Apache-2.0 while `LICENSE` is MIT.
|
|
855
|
+
|
|
856
|
+
## Also fixed, in the gateway
|
|
857
|
+
|
|
858
|
+
Six routes — `/v1/transactions`, `/v1/pending`, `/v1/portfolio`, `/v1/admin/usage`, `/v1/admin/audit-log`,
|
|
859
|
+
and `/v1/admin/webhooks/deliveries` — read query parameters but declared no `querystring` schema, so
|
|
860
|
+
`@fastify/swagger` emitted no `parameters` and the spec reported that they took none.
|
|
861
|
+
|
|
862
|
+
The routes worked. The damage was to everyone reading the spec instead of the source: a client generated
|
|
863
|
+
from it had no paging at all, and `/v1/pending` silently lost the `identity` and `category` filters a signer
|
|
864
|
+
needs to find its own work. All six now declare their parameters, guarded on both sides —
|
|
865
|
+
`test/integration/openapi-snapshot.test.ts` in the gateway, and `test/contract.test.ts` here.
|
|
866
|
+
|
|
867
|
+
Refresh this package's contract fixture after an API change, from the gateway root:
|
|
868
|
+
|
|
869
|
+
```bash
|
|
870
|
+
REGEN_SDK_CONTRACT=1 npx vitest run test/integration/openapi-snapshot.test.ts
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
The fixture is generated from `buildServer()` rather than from the deployed gateway on purpose: the SDK
|
|
874
|
+
must be tested against the code it ships beside, not against whatever happens to be live.
|