@t3foundry/tasra-sdk 0.3.1-next.1 → 0.4.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 +1067 -28
- package/README.md +15 -0
- package/dist/app/approvals.d.ts +66 -4
- package/dist/app/approvals.js +153 -16
- package/dist/app/authorization.d.ts +1 -1
- package/dist/app/authorization.js +1 -1
- package/dist/app/browser.d.ts +63 -0
- package/dist/app/browser.js +242 -0
- package/dist/app/client.d.ts +114 -13
- package/dist/app/client.js +302 -76
- package/dist/app/identity.js +21 -9
- package/dist/app/index.d.ts +28 -3
- package/dist/app/index.js +16 -1
- package/dist/app/memory-store.d.ts +7 -0
- package/dist/app/memory-store.js +55 -0
- package/dist/app/node.d.ts +34 -6
- package/dist/app/node.js +387 -64
- package/dist/app/paid-allowance.d.ts +325 -0
- package/dist/app/paid-allowance.js +1290 -0
- package/dist/app/paid-approval.d.ts +122 -0
- package/dist/app/paid-approval.js +379 -0
- package/dist/app/paid-journal.d.ts +51 -0
- package/dist/app/paid-journal.js +117 -0
- package/dist/app/paid-keys.d.ts +12 -0
- package/dist/app/paid-keys.js +20 -0
- package/dist/app/paid-operation.d.ts +821 -0
- package/dist/app/paid-operation.js +1720 -0
- package/dist/app/paid-reservation.d.ts +157 -0
- package/dist/app/paid-reservation.js +323 -0
- package/dist/app/paid-session.d.ts +147 -0
- package/dist/app/paid-session.js +578 -0
- package/dist/app/payer-queue.d.ts +11 -0
- package/dist/app/payer-queue.js +27 -0
- package/dist/app/policy-bootstrap.d.ts +342 -0
- package/dist/app/policy-bootstrap.js +365 -0
- package/dist/app/policy-operation.d.ts +47 -0
- package/dist/app/policy-operation.js +101 -0
- package/dist/app/ready-slot.d.ts +12 -0
- package/dist/app/ready-slot.js +5 -2
- package/dist/app/rotation-lock.d.ts +38 -0
- package/dist/app/rotation-lock.js +42 -0
- package/dist/app/session-decrypt.d.ts +135 -0
- package/dist/app/session-decrypt.js +335 -0
- package/dist/app/session-grants.d.ts +349 -0
- package/dist/app/session-grants.js +811 -0
- package/dist/app/signing-intents.d.ts +78 -0
- package/dist/app/signing-intents.js +95 -0
- package/dist/app/store-commit.d.ts +63 -0
- package/dist/app/store-commit.js +126 -0
- package/dist/app/store-errors.d.ts +8 -0
- package/dist/app/store-errors.js +11 -0
- package/dist/app/tasra-client.d.ts +2 -0
- package/dist/app/tasra-client.js +1 -1
- package/dist/app/wallet.js +4 -1
- package/dist/auth/holderProof.d.ts +3 -0
- package/dist/auth/holderProof.js +8 -7
- package/dist/auth/verifier.d.ts +4 -2
- package/dist/auth/verifier.js +5 -2
- package/dist/chain/abis/index.d.ts +6178 -4101
- package/dist/chain/abis/index.js +3 -0
- package/dist/chain/abis/keyRegistry.d.ts +256 -0
- package/dist/chain/abis/keyRegistry.js +333 -0
- package/dist/chain/abis/prepaidFaultOracle.d.ts +321 -0
- package/dist/chain/abis/prepaidFaultOracle.js +413 -0
- package/dist/chain/abis/settlement.d.ts +2203 -703
- package/dist/chain/abis/settlement.js +2685 -764
- package/dist/chain/allowance.d.ts +358 -0
- package/dist/chain/allowance.js +800 -0
- package/dist/chain/billing.d.ts +85 -0
- package/dist/chain/billing.js +197 -0
- package/dist/chain/chainId.d.ts +13 -0
- package/dist/chain/chainId.js +26 -0
- package/dist/chain/client.d.ts +15 -1
- package/dist/chain/client.js +57 -1
- package/dist/chain/commitmentRecovery.d.ts +51 -0
- package/dist/chain/commitmentRecovery.js +38 -0
- package/dist/chain/committeeClient.d.ts +17 -10
- package/dist/chain/committeeClient.js +64 -16
- package/dist/chain/committeeDraw.d.ts +12 -0
- package/dist/chain/committeeDraw.js +56 -0
- package/dist/chain/custodyHealth.d.ts +212 -0
- package/dist/chain/custodyHealth.js +365 -0
- package/dist/chain/deployments.js +2 -0
- package/dist/chain/events.js +2 -0
- package/dist/chain/headFollower.d.ts +77 -0
- package/dist/chain/headFollower.js +219 -0
- package/dist/chain/headPrefetch.d.ts +23 -0
- package/dist/chain/headPrefetch.js +67 -0
- package/dist/chain/index.d.ts +50 -8
- package/dist/chain/index.js +28 -3
- package/dist/chain/keeperExecution.d.ts +44 -0
- package/dist/chain/keeperExecution.js +127 -0
- package/dist/chain/keeperRecovery.d.ts +78 -0
- package/dist/chain/keeperRecovery.js +91 -0
- package/dist/chain/node.d.ts +24 -1
- package/dist/chain/node.js +88 -43
- package/dist/chain/offchain.d.ts +2 -0
- package/dist/chain/paidAgentTransport.d.ts +38 -0
- package/dist/chain/paidAgentTransport.js +1 -0
- package/dist/chain/paidEpoch.d.ts +66 -0
- package/dist/chain/paidEpoch.js +139 -0
- package/dist/chain/paidPacing.d.ts +81 -0
- package/dist/chain/paidPacing.js +136 -0
- package/dist/chain/pinnedReads.d.ts +49 -0
- package/dist/chain/pinnedReads.js +218 -0
- package/dist/chain/prepaid.d.ts +383 -0
- package/dist/chain/prepaid.js +1046 -0
- package/dist/chain/prepaidEscape.d.ts +274 -0
- package/dist/chain/prepaidEscape.js +432 -0
- package/dist/chain/prepaidFault.d.ts +94 -0
- package/dist/chain/prepaidFault.js +148 -0
- package/dist/chain/receipt.d.ts +24 -0
- package/dist/chain/receipt.js +82 -0
- package/dist/chain/registeredAgent.d.ts +68 -3
- package/dist/chain/registeredAgent.js +143 -42
- package/dist/chain/registeredOperation.d.ts +10 -1
- package/dist/chain/registeredOperation.js +18 -3
- package/dist/chain/registeredPaidAgent.d.ts +254 -0
- package/dist/chain/registeredPaidAgent.js +889 -0
- package/dist/chain/registeredRelay.d.ts +31 -1
- package/dist/chain/registeredRelay.js +164 -43
- package/dist/chain/relayVoucher.d.ts +64 -0
- package/dist/chain/relayVoucher.js +69 -0
- package/dist/chain/reservation.d.ts +239 -0
- package/dist/chain/reservation.js +746 -0
- package/dist/chain/reshareRoster.d.ts +64 -0
- package/dist/chain/reshareRoster.js +85 -0
- package/dist/chain/revertReason.d.ts +8 -0
- package/dist/chain/revertReason.js +2 -1
- package/dist/chain/rotationLock.d.ts +130 -0
- package/dist/chain/rotationLock.js +168 -0
- package/dist/chain/serviceRequestPolicy.d.ts +47 -0
- package/dist/chain/serviceRequestPolicy.js +86 -0
- package/dist/chain/services.d.ts +7 -0
- package/dist/chain/services.js +44 -4
- package/dist/chain/slotClient.js +11 -2
- package/dist/chain/slotHandoff.d.ts +81 -0
- package/dist/chain/slotHandoff.js +166 -0
- package/dist/chain/slotSeed.d.ts +47 -5
- package/dist/chain/slotSeed.js +173 -42
- package/dist/chain/verifierSnapshot.d.ts +36 -0
- package/dist/chain/verifierSnapshot.js +197 -0
- package/dist/chain/write.d.ts +111 -21
- package/dist/chain/write.js +378 -146
- package/dist/committee/blsSharing.d.ts +53 -0
- package/dist/committee/blsSharing.js +90 -0
- package/dist/committee/client.d.ts +62 -23
- package/dist/committee/client.js +288 -72
- package/dist/committee/dual-operation.d.ts +165 -0
- package/dist/committee/dual-operation.js +229 -0
- package/dist/committee/dual-sign.d.ts +26 -1
- package/dist/committee/dual-sign.js +85 -7
- package/dist/committee/ecdsa.d.ts +38 -0
- package/dist/committee/ecdsa.js +87 -15
- package/dist/committee/evidence.d.ts +30 -0
- package/dist/committee/evidence.js +65 -0
- package/dist/committee/execution.d.ts +414 -0
- package/dist/committee/execution.js +446 -0
- package/dist/committee/extraction.js +33 -26
- package/dist/committee/index.d.ts +30 -7
- package/dist/committee/index.js +18 -6
- package/dist/committee/keeperExecution.d.ts +37 -0
- package/dist/committee/keeperExecution.js +141 -0
- package/dist/committee/oauth.d.ts +14 -4
- package/dist/committee/oauth.js +17 -5
- package/dist/committee/payment.d.ts +369 -0
- package/dist/committee/payment.js +339 -0
- package/dist/committee/recovery.d.ts +136 -0
- package/dist/committee/recovery.js +204 -0
- package/dist/committee/recoveryJson.d.ts +2 -0
- package/dist/committee/recoveryJson.js +87 -0
- package/dist/committee/request.d.ts +63 -27
- package/dist/committee/request.js +77 -66
- package/dist/committee/session-grant.d.ts +320 -0
- package/dist/committee/session-grant.js +397 -0
- package/dist/committee/status-refresh.d.ts +257 -0
- package/dist/committee/status-refresh.js +619 -0
- package/dist/committee/token.d.ts +163 -15
- package/dist/committee/token.js +247 -10
- package/dist/crypto/bn254.d.ts +70 -0
- package/dist/crypto/bn254.js +222 -0
- package/dist/crypto/ibe.d.ts +32 -0
- package/dist/crypto/ibe.js +56 -8
- package/dist/crypto/index.d.ts +1 -1
- package/dist/crypto/index.js +1 -1
- package/dist/crypto/kem.d.ts +31 -0
- package/dist/crypto/kem.js +113 -7
- package/dist/crypto/recipient.d.ts +75 -0
- package/dist/crypto/recipient.js +107 -0
- package/dist/decryption/client.d.ts +10 -16
- package/dist/decryption/client.js +8 -76
- package/dist/decryption/index.d.ts +2 -0
- package/dist/decryption/index.js +2 -0
- package/dist/decryption/sealed.d.ts +72 -0
- package/dist/decryption/sealed.js +147 -0
- package/dist/decryption/session.d.ts +115 -0
- package/dist/decryption/session.js +358 -0
- package/dist/errors.d.ts +406 -1
- package/dist/errors.js +400 -5
- package/dist/index.d.ts +9 -2
- package/dist/index.js +6 -1
- package/dist/internal/bounded.d.ts +66 -0
- package/dist/internal/bounded.js +126 -0
- package/dist/internal/network.d.ts +4 -0
- package/dist/internal/network.js +40 -0
- package/dist/internal/retryAfter.d.ts +8 -0
- package/dist/internal/retryAfter.js +28 -0
- package/dist/internal/sleep.d.ts +6 -0
- package/dist/internal/sleep.js +15 -0
- package/dist/internal/typedData.d.ts +13 -0
- package/dist/internal/typedData.js +77 -0
- package/dist/internal/viemErrors.d.ts +26 -0
- package/dist/internal/viemErrors.js +49 -0
- package/dist/oid4vp/binding.d.ts +27 -1
- package/dist/oid4vp/binding.js +36 -1
- package/dist/oid4vp/jose.d.ts +4 -2
- package/dist/oid4vp/jose.js +39 -7
- package/dist/oid4vp/request-object.d.ts +61 -4
- package/dist/oid4vp/request-object.js +140 -5
- package/dist/oid4vp/verifier-agent.d.ts +18 -8
- package/dist/oid4vp/verifier-agent.js +48 -6
- package/dist/oid4vp/wallet.d.ts +2 -4
- package/dist/oid4vp/wallet.js +1 -0
- package/dist/retry.d.ts +78 -0
- package/dist/retry.js +137 -0
- package/dist/signing/frost.d.ts +1 -1
- package/dist/verifier-agent/index.d.ts +41 -5
- package/dist/verifier-agent/index.js +124 -9
- package/dist/verifier-agent/payment.d.ts +7 -0
- package/dist/verifier-agent/payment.js +17 -0
- package/docs/api.md +8 -2
- package/docs/application-api.md +25 -2
- package/docs/chain.md +155 -9
- package/docs/consumer-migrations.md +61 -0
- package/docs/encrypted-notes.md +3 -2
- package/docs/encryption.md +4 -2
- package/docs/errors.md +14 -1
- package/docs/flows.md +2 -2
- package/docs/funding.md +902 -0
- package/docs/native-approvals.md +63 -0
- package/docs/reference/README.md +9 -8
- package/docs/reference/app-browser.md +232 -0
- package/docs/reference/app-node.md +38 -8
- package/docs/reference/app.md +4621 -805
- package/docs/reference/chain-node.md +74 -16
- package/docs/reference/chain.md +6740 -1592
- package/docs/reference/committee.md +5630 -987
- package/docs/reference/main.md +1439 -140
- package/docs/reference/oid4vp.md +297 -144
- package/docs/reference/verifier-agent.md +77 -35
- package/docs/signing.md +6 -0
- package/examples/encrypted-notes.ts +21 -6
- package/examples/getting-started.ts +2 -7
- package/examples/live-config.ts +24 -17
- package/package.json +17 -5
package/docs/reference/main.md
CHANGED
|
@@ -9,18 +9,28 @@ Generated from public TypeScript exports.
|
|
|
9
9
|
Clients, adapters and error classes.
|
|
10
10
|
|
|
11
11
|
<details>
|
|
12
|
-
<summary>Browse
|
|
12
|
+
<summary>Browse 21 classes</summary>
|
|
13
13
|
|
|
14
14
|
- [RecipientStore](#recipientstore)
|
|
15
15
|
- [AuthDeniedError](#authdeniederror)
|
|
16
16
|
- [CommitteeAuthorizeError](#committeeauthorizeerror)
|
|
17
17
|
- [DcqlMalformedError](#dcqlmalformederror)
|
|
18
18
|
- [NodeUnreachableError](#nodeunreachableerror)
|
|
19
|
+
- [PaidApprovalUnresolvedError](#paidapprovalunresolvederror)
|
|
20
|
+
- [PaidBackoffError](#paidbackofferror)
|
|
21
|
+
- [PaidReservationQuotaError](#paidreservationquotaerror)
|
|
22
|
+
- [PrepaidEscapeError](#prepaidescapeerror)
|
|
23
|
+
- [PrepaidEscapeUncertainError](#prepaidescapeuncertainerror)
|
|
19
24
|
- [RegoEnvelopeError](#regoenvelopeerror)
|
|
25
|
+
- [RevocationStatusError](#revocationstatuserror)
|
|
26
|
+
- [RevocationStatusPreflightError](#revocationstatuspreflighterror)
|
|
20
27
|
- [SlotRotatedError](#slotrotatederror)
|
|
28
|
+
- [StatusRefreshError](#statusrefresherror)
|
|
21
29
|
- [TasraError](#tasraerror)
|
|
22
30
|
- [TasraHttpError](#tasrahttperror)
|
|
23
31
|
- [ThresholdNotMetError](#thresholdnotmeterror)
|
|
32
|
+
- [UnderfundedGasPayerError](#underfundedgaspayererror)
|
|
33
|
+
- [UnderfundedSlotError](#underfundedsloterror)
|
|
24
34
|
- [VerifierAgentSessionError](#verifieragentsessionerror)
|
|
25
35
|
|
|
26
36
|
</details>
|
|
@@ -66,7 +76,7 @@ static fromJwtBodies(bodies: Array<{
|
|
|
66
76
|
The credential was rejected: 401 or 403. Never retryable - the same token will
|
|
67
77
|
be refused again. Re-claim (redeem a fresh credential or renewal) instead.
|
|
68
78
|
|
|
69
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#
|
|
79
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L131)
|
|
70
80
|
|
|
71
81
|
Import: `import {AuthDeniedError} from '@t3foundry/tasra-sdk'`
|
|
72
82
|
|
|
@@ -87,6 +97,8 @@ declare class AuthDeniedError {
|
|
|
87
97
|
|
|
88
98
|
- ` readonly body: string; ` — Response body retained as diagnostic information.
|
|
89
99
|
|
|
100
|
+
- ` readonly retryAfterMs?: number; ` — Service-requested wait from `Retry-After`, in ms, when one was sent.
|
|
101
|
+
|
|
90
102
|
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
91
103
|
|
|
92
104
|
- ` name: string; `
|
|
@@ -107,7 +119,7 @@ Distinct from a generic HTTP error because the committee flow polls several
|
|
|
107
119
|
verifiers and tolerates individual refusals as long as a quorum co-signs - see
|
|
108
120
|
[ThresholdNotMetError](#thresholdnotmeterror) for the failure that means the quorum was missed.
|
|
109
121
|
|
|
110
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#
|
|
122
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#L78)
|
|
111
123
|
|
|
112
124
|
Import: `import {CommitteeAuthorizeError} from '@t3foundry/tasra-sdk'`
|
|
113
125
|
|
|
@@ -126,6 +138,8 @@ declare class CommitteeAuthorizeError {
|
|
|
126
138
|
|
|
127
139
|
- ` readonly body: string; ` — Response body retained as diagnostic information.
|
|
128
140
|
|
|
141
|
+
- ` readonly retryAfterMs?: number; ` — Service-requested wait from `Retry-After`, in ms, when one was sent.
|
|
142
|
+
|
|
129
143
|
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
130
144
|
|
|
131
145
|
- ` name: string; `
|
|
@@ -167,7 +181,7 @@ declare class DcqlMalformedError {
|
|
|
167
181
|
The request never got an HTTP answer - DNS failure, connection refused,
|
|
168
182
|
timeout, CORS. Retryable: the service may simply not be up yet.
|
|
169
183
|
|
|
170
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#
|
|
184
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L584)
|
|
171
185
|
|
|
172
186
|
Import: `import {NodeUnreachableError} from '@t3foundry/tasra-sdk'`
|
|
173
187
|
|
|
@@ -193,6 +207,236 @@ declare class NodeUnreachableError {
|
|
|
193
207
|
|
|
194
208
|
- ` cause?: unknown; `
|
|
195
209
|
|
|
210
|
+
### PaidApprovalUnresolvedError
|
|
211
|
+
|
|
212
|
+
A retained paid approval's outcome is unresolved, so the SDK will not send it (again).
|
|
213
|
+
|
|
214
|
+
Code `approval_outcome_unresolved`. An approval is resent only as the byte-identical retained body
|
|
215
|
+
and only under a durable, generation-bound, one-use permit that an exclusive claim consumes before
|
|
216
|
+
every send. Anything else (a lost claim, a moved generation, an unknown outcome, a legacy record)
|
|
217
|
+
lands here. Not retryable: reconcile the delivery by reading it, never by resending or re-signing.
|
|
218
|
+
|
|
219
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L429)
|
|
220
|
+
|
|
221
|
+
Import: `import {PaidApprovalUnresolvedError} from '@t3foundry/tasra-sdk'`
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
declare class PaidApprovalUnresolvedError {
|
|
225
|
+
constructor(args: {
|
|
226
|
+
reason: PaidApprovalUnresolvedReason;
|
|
227
|
+
proposalId?: string;
|
|
228
|
+
generation?: number;
|
|
229
|
+
key?: string;
|
|
230
|
+
message?: string;
|
|
231
|
+
cause?: unknown;
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
- ` readonly code: "approval_outcome_unresolved"; ` — Stable code.
|
|
237
|
+
|
|
238
|
+
- ` readonly reason: PaidApprovalUnresolvedReason; ` — Why nothing was sent.
|
|
239
|
+
|
|
240
|
+
- ` readonly proposalId?: string; ` — Agent delivery (proposal) identity, when known.
|
|
241
|
+
|
|
242
|
+
- ` readonly generation?: number; ` — Send generation concerned, when known.
|
|
243
|
+
|
|
244
|
+
- ` readonly key?: string; ` — Application-store journal entry of the approval, when known.
|
|
245
|
+
|
|
246
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
247
|
+
|
|
248
|
+
- ` name: string; `
|
|
249
|
+
|
|
250
|
+
- ` message: string; `
|
|
251
|
+
|
|
252
|
+
- ` stack?: string; `
|
|
253
|
+
|
|
254
|
+
- ` cause?: unknown; `
|
|
255
|
+
|
|
256
|
+
### PaidBackoffError
|
|
257
|
+
|
|
258
|
+
A paid request that the service definitely refused before acting on it (HTTP 429 or 503) could
|
|
259
|
+
not be repeated inside its existing deadline. Only requests that are safe to repeat are paced: the
|
|
260
|
+
paid verifier-agent reads, the byte-identical retained approval, the presentation continuation (429
|
|
261
|
+
only) and the accountant reservation `prepare`. The deadline is never extended and a valid
|
|
262
|
+
`Retry-After` / `x-ratelimit-after` hint is never shortened.
|
|
263
|
+
|
|
264
|
+
Nothing was sent after the refusal this error reports. A retained approval keeps its durable
|
|
265
|
+
permit, so a later resume may resend the identical body; never start the paid operation again.
|
|
266
|
+
|
|
267
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L361)
|
|
268
|
+
|
|
269
|
+
Import: `import {PaidBackoffError} from '@t3foundry/tasra-sdk'`
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
declare class PaidBackoffError {
|
|
273
|
+
constructor(args: {
|
|
274
|
+
code: PaidBackoffCode;
|
|
275
|
+
route: string;
|
|
276
|
+
httpStatus?: number;
|
|
277
|
+
retryAfterMs?: number;
|
|
278
|
+
remainingMs?: number;
|
|
279
|
+
neededMs?: number;
|
|
280
|
+
attempts: number;
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
- ` readonly code: PaidBackoffCode; ` — Stable reason.
|
|
286
|
+
|
|
287
|
+
- ` readonly route: string; ` — Route that was refused, without identifiers (for example `GET /v1/sessions/{id}`).
|
|
288
|
+
|
|
289
|
+
- ` readonly httpStatus?: number; ` — Last refusal status, when one was answered (absent for `no_time_to_send`).
|
|
290
|
+
|
|
291
|
+
- ` readonly retryAfterMs?: number; ` — Server-requested wait (strict integer seconds), in ms, when it sent a valid one.
|
|
292
|
+
|
|
293
|
+
- ` readonly remainingMs?: number; ` — Time left before the deadline when the decision was made, in ms.
|
|
294
|
+
|
|
295
|
+
- ` readonly neededMs?: number; ` — Time one attempt needs (or wait + attempt), in ms.
|
|
296
|
+
|
|
297
|
+
- ` readonly attempts: number; ` — Refusals waited out before this decision.
|
|
298
|
+
|
|
299
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
300
|
+
|
|
301
|
+
- ` name: string; `
|
|
302
|
+
|
|
303
|
+
- ` message: string; `
|
|
304
|
+
|
|
305
|
+
- ` stack?: string; `
|
|
306
|
+
|
|
307
|
+
- ` cause?: unknown; `
|
|
308
|
+
|
|
309
|
+
### PaidReservationQuotaError
|
|
310
|
+
|
|
311
|
+
The accountant refused a reservation `prepare` with its per-creator reservation quota (HTTP 429
|
|
312
|
+
with a valid `Retry-After` / `x-ratelimit-after`), and the identical prepare could not be repeated
|
|
313
|
+
inside its window (at most 150 s and half of the payment's remaining signed lifetime).
|
|
314
|
+
|
|
315
|
+
Code `reservation_quota`. Nothing was prepared, signed or put on chain: no reservation transaction
|
|
316
|
+
exists for this attempt. `reason` says why waiting stopped; `retryAfterMs` is the last hint.
|
|
317
|
+
|
|
318
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L468)
|
|
319
|
+
|
|
320
|
+
Import: `import {PaidReservationQuotaError} from '@t3foundry/tasra-sdk'`
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
declare class PaidReservationQuotaError {
|
|
324
|
+
constructor(args: {
|
|
325
|
+
reason: PaidBackoffCode;
|
|
326
|
+
url: string;
|
|
327
|
+
retryAfterMs: number;
|
|
328
|
+
cause?: unknown;
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
- ` readonly code: "reservation_quota"; ` — Stable code.
|
|
334
|
+
|
|
335
|
+
- ` readonly reason: PaidBackoffCode; ` — Why the prepare was not repeated.
|
|
336
|
+
|
|
337
|
+
- ` readonly url: string; ` — Accountant endpoint that refused.
|
|
338
|
+
|
|
339
|
+
- ` readonly retryAfterMs: number; ` — The accountant's last requested wait, in ms.
|
|
340
|
+
|
|
341
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
342
|
+
|
|
343
|
+
- ` name: string; `
|
|
344
|
+
|
|
345
|
+
- ` message: string; `
|
|
346
|
+
|
|
347
|
+
- ` stack?: string; `
|
|
348
|
+
|
|
349
|
+
- ` cause?: unknown; `
|
|
350
|
+
|
|
351
|
+
### PrepaidEscapeError
|
|
352
|
+
|
|
353
|
+
A prepaid timeout escape was refused before anything was sent for the refused call: by the local
|
|
354
|
+
preflight (`local: true`, read at one canonical block) or by the contract's own simulation
|
|
355
|
+
(`local: false`). Nothing about the refused call is journaled. In a multi-call escape, calls that
|
|
356
|
+
already confirmed are in their journal (`confirmed` checkpoints) and stay final.
|
|
357
|
+
|
|
358
|
+
Only `escape_not_open` is retryable: the same call succeeds once chain time reaches `opensAt`.
|
|
359
|
+
|
|
360
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L510)
|
|
361
|
+
|
|
362
|
+
Import: `import {PrepaidEscapeError} from '@t3foundry/tasra-sdk'`
|
|
363
|
+
|
|
364
|
+
```ts
|
|
365
|
+
declare class PrepaidEscapeError {
|
|
366
|
+
constructor(args: {
|
|
367
|
+
code: PrepaidEscapeCode;
|
|
368
|
+
local: boolean;
|
|
369
|
+
requestId?: string;
|
|
370
|
+
opensAt?: Date;
|
|
371
|
+
delaySeconds?: bigint;
|
|
372
|
+
message?: string;
|
|
373
|
+
cause?: unknown;
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
- ` readonly code: PrepaidEscapeCode; ` — Stable code.
|
|
379
|
+
|
|
380
|
+
- ` readonly sent: false; ` — Always false: no transaction was sent for the refused call.
|
|
381
|
+
|
|
382
|
+
- ` readonly local: boolean; ` — True for a local preflight refusal, false for a decoded contract revert.
|
|
383
|
+
|
|
384
|
+
- ` readonly requestId?: string; ` — Request the refusal names, when it names one.
|
|
385
|
+
|
|
386
|
+
- ` readonly opensAt?: Date; ` — When the named request's escape opens (`escape_not_open`).
|
|
387
|
+
|
|
388
|
+
- ` readonly delaySeconds?: bigint; ` — Refused delay in seconds (`invalid_escape_delay`).
|
|
389
|
+
|
|
390
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
391
|
+
|
|
392
|
+
- ` name: string; `
|
|
393
|
+
|
|
394
|
+
- ` message: string; `
|
|
395
|
+
|
|
396
|
+
- ` stack?: string; `
|
|
397
|
+
|
|
398
|
+
- ` cause?: unknown; `
|
|
399
|
+
|
|
400
|
+
### PrepaidEscapeUncertainError
|
|
401
|
+
|
|
402
|
+
A prepaid escape transaction may have been broadcast and its outcome is not proven. Code
|
|
403
|
+
`escape_uncertain`. Retain the prepared record and reconcile it by reading chain state
|
|
404
|
+
(`reconcileEscape`); never send it again blindly. An escape cannot refund twice (a second one
|
|
405
|
+
reverts `ReservationUnavailable`), but a blind resend still spends gas and can collide on the nonce.
|
|
406
|
+
|
|
407
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L562)
|
|
408
|
+
|
|
409
|
+
Import: `import {PrepaidEscapeUncertainError} from '@t3foundry/tasra-sdk'`
|
|
410
|
+
|
|
411
|
+
```ts
|
|
412
|
+
declare class PrepaidEscapeUncertainError {
|
|
413
|
+
constructor(args: {
|
|
414
|
+
escapeId: string;
|
|
415
|
+
requestIds: readonly string[];
|
|
416
|
+
transactionHash?: string;
|
|
417
|
+
cause?: unknown;
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
- ` readonly code: "escape_uncertain"; ` — Stable code.
|
|
423
|
+
|
|
424
|
+
- ` readonly escapeId: string; ` — Local journal key of the escape call.
|
|
425
|
+
|
|
426
|
+
- ` readonly requestIds: readonly string[]; ` — Requests the call named.
|
|
427
|
+
|
|
428
|
+
- ` readonly transactionHash?: string; ` — Transaction hash when known; absence does not prove that nothing was sent.
|
|
429
|
+
|
|
430
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
431
|
+
|
|
432
|
+
- ` name: string; `
|
|
433
|
+
|
|
434
|
+
- ` message: string; `
|
|
435
|
+
|
|
436
|
+
- ` stack?: string; `
|
|
437
|
+
|
|
438
|
+
- ` cause?: unknown; `
|
|
439
|
+
|
|
196
440
|
### RegoEnvelopeError
|
|
197
441
|
|
|
198
442
|
A refused envelope operation: the rule or its authored parts are malformed.
|
|
@@ -219,13 +463,118 @@ declare class RegoEnvelopeError {
|
|
|
219
463
|
|
|
220
464
|
- ` cause?: unknown; `
|
|
221
465
|
|
|
466
|
+
### RevocationStatusError
|
|
467
|
+
|
|
468
|
+
A keeper refused a committee grant because its verifiers' revocation-status attestations
|
|
469
|
+
(`keykeeper/committee-status-attestation/v1`) are missing (`revocation_status_missing`) or no
|
|
470
|
+
longer fresh for a quorum (`revocation_status_stale`). The credential was NOT judged revoked:
|
|
471
|
+
the grant outlived the 60 s revocation bound (or came from a path that does not carry the
|
|
472
|
+
attestations).
|
|
473
|
+
|
|
474
|
+
NOT retryable, and NOT proof that no keeper worked: another keeper of the committee may already
|
|
475
|
+
have started the operation before this one re-checked the grant, and a gateway can blur the
|
|
476
|
+
outcome. Never resend this grant, and never treat this error alone as authority to retry, refund
|
|
477
|
+
or clear a paid operation (its journal keeps the execution as uncertain until original-stage
|
|
478
|
+
evidence settles it). For an UNPAID operation the remedy is a new presentation and a new grant.
|
|
479
|
+
Not an [AuthDeniedError](#authdeniederror), and [isAuthDenied](#isauthdenied) returns false for it.
|
|
480
|
+
|
|
481
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L151)
|
|
482
|
+
|
|
483
|
+
Import: `import {RevocationStatusError} from '@t3foundry/tasra-sdk'`
|
|
484
|
+
|
|
485
|
+
```ts
|
|
486
|
+
declare class RevocationStatusError {
|
|
487
|
+
constructor(args: {
|
|
488
|
+
status: number;
|
|
489
|
+
url: string;
|
|
490
|
+
body?: string;
|
|
491
|
+
message?: string;
|
|
492
|
+
code: 'revocation_status_stale' | 'revocation_status_missing';
|
|
493
|
+
retryAfterMs?: number;
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
- ` readonly code: 'revocation_status_stale' | 'revocation_status_missing'; ` — The keeper's stable refusal code.
|
|
499
|
+
|
|
500
|
+
- ` readonly presentAgain: true; ` — Always true: a fresh grant needs a new presentation, never this token.
|
|
501
|
+
|
|
502
|
+
- ` readonly status: number; ` — HTTP status code returned by the service.
|
|
503
|
+
|
|
504
|
+
- ` readonly url: string; ` — Service URL that failed.
|
|
505
|
+
|
|
506
|
+
- ` readonly body: string; ` — Response body retained as diagnostic information.
|
|
507
|
+
|
|
508
|
+
- ` readonly retryAfterMs?: number; ` — Service-requested wait from `Retry-After`, in ms, when one was sent.
|
|
509
|
+
|
|
510
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
511
|
+
|
|
512
|
+
- ` name: string; `
|
|
513
|
+
|
|
514
|
+
- ` message: string; `
|
|
515
|
+
|
|
516
|
+
- ` stack?: string; `
|
|
517
|
+
|
|
518
|
+
- ` cause?: unknown; `
|
|
519
|
+
|
|
520
|
+
### RevocationStatusPreflightError
|
|
521
|
+
|
|
522
|
+
A committee grant was refused LOCALLY, before any keeper call, by the same rule a keeper in
|
|
523
|
+
production posture applies: its revocation-status attestations
|
|
524
|
+
(`keykeeper/committee-status-attestation/v1`) are missing (`revocation_status_missing`: absent,
|
|
525
|
+
`null` or empty), fewer than a quorum are valid and fresh (`revocation_status_stale`), or the
|
|
526
|
+
list is malformed, duplicated or carries a bad signature from a counted verifier
|
|
527
|
+
(`revocation_status_invalid`), or - for a journaled paid operation - an explicit status refresh
|
|
528
|
+
answered `status_refresh_refused` (`revocation_status_refused`: a verifier attests the holder's
|
|
529
|
+
credential status is refused NOW; the grant is refused however fresh its attestations still are,
|
|
530
|
+
until a later refresh succeeds).
|
|
531
|
+
|
|
532
|
+
Unlike [RevocationStatusError](#revocationstatuserror) (a keeper's reply after a send), nothing was sent: a paid
|
|
533
|
+
operation refused here stays in its pre-execution journal phase. Not retryable with this grant
|
|
534
|
+
and never a reason to start a new session or payment automatically: present again for a fresh
|
|
535
|
+
grant. `allowMissingStatusAttestations` (migration window only) waives `revocation_status_missing`
|
|
536
|
+
and nothing else.
|
|
537
|
+
|
|
538
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L184)
|
|
539
|
+
|
|
540
|
+
Import: `import {RevocationStatusPreflightError} from '@t3foundry/tasra-sdk'`
|
|
541
|
+
|
|
542
|
+
```ts
|
|
543
|
+
declare class RevocationStatusPreflightError {
|
|
544
|
+
constructor(args: {
|
|
545
|
+
code: RevocationStatusPreflightCode;
|
|
546
|
+
message: string;
|
|
547
|
+
requestId?: string;
|
|
548
|
+
cause?: unknown;
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
- ` readonly code: RevocationStatusPreflightCode; ` — Stable refusal code.
|
|
554
|
+
|
|
555
|
+
- ` readonly sent: false; ` — Always false: no keeper received the grant.
|
|
556
|
+
|
|
557
|
+
- ` readonly presentAgain: true; ` — Always true: a fresh grant needs a new presentation.
|
|
558
|
+
|
|
559
|
+
- ` readonly requestId?: string; ` — Paid operation identity, when the refusal stopped a journaled paid operation.
|
|
560
|
+
|
|
561
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
562
|
+
|
|
563
|
+
- ` name: string; `
|
|
564
|
+
|
|
565
|
+
- ` message: string; `
|
|
566
|
+
|
|
567
|
+
- ` stack?: string; `
|
|
568
|
+
|
|
569
|
+
- ` cause?: unknown; `
|
|
570
|
+
|
|
222
571
|
### SlotRotatedError
|
|
223
572
|
|
|
224
573
|
The slot was re-keyed (rotated) since the key in hand was assembled, so that
|
|
225
574
|
key cannot read anything encrypted after the rotation. Retryable: re-assemble
|
|
226
575
|
at the new epoch and try again - the managed [Session](#session) does this for you.
|
|
227
576
|
|
|
228
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#
|
|
577
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L632)
|
|
229
578
|
|
|
230
579
|
Import: `import {SlotRotatedError} from '@t3foundry/tasra-sdk'`
|
|
231
580
|
|
|
@@ -254,13 +603,66 @@ declare class SlotRotatedError {
|
|
|
254
603
|
|
|
255
604
|
- ` cause?: unknown; `
|
|
256
605
|
|
|
606
|
+
### StatusRefreshError
|
|
607
|
+
|
|
608
|
+
A status refresh for an already-issued committee grant produced no fresh quorum.
|
|
609
|
+
|
|
610
|
+
It changes nothing at any keeper and is NEVER evidence about keeper work: for a paid operation
|
|
611
|
+
the journal phase is unchanged (an `authorized` grant was not sent; an `executing` one stays
|
|
612
|
+
uncertain). `retryable` is a coarse hint for 429/503/transport failures only; the SDK never
|
|
613
|
+
retries a refresh automatically, and a new attempt always uses a new, journaled `seq`.
|
|
614
|
+
`status_refresh_refused` means a credential status reference is revoked or no longer
|
|
615
|
+
acceptable: present again (a new grant), never refresh this one.
|
|
616
|
+
|
|
617
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L297)
|
|
618
|
+
|
|
619
|
+
Import: `import {StatusRefreshError} from '@t3foundry/tasra-sdk'`
|
|
620
|
+
|
|
621
|
+
```ts
|
|
622
|
+
declare class StatusRefreshError {
|
|
623
|
+
constructor(args: {
|
|
624
|
+
code: StatusRefreshCode;
|
|
625
|
+
message: string;
|
|
626
|
+
httpStatus?: number;
|
|
627
|
+
retryAfterMs?: number;
|
|
628
|
+
reasons?: readonly StatusRefreshFailure[];
|
|
629
|
+
requestId?: string;
|
|
630
|
+
seq?: number;
|
|
631
|
+
retryable?: boolean;
|
|
632
|
+
cause?: unknown;
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
- ` readonly code: StatusRefreshCode; ` — Stable code (for a fan-out, the decisive one; see `reasons` for every verifier).
|
|
638
|
+
|
|
639
|
+
- ` readonly httpStatus?: number; ` — HTTP status of the decisive answer, when there was one.
|
|
640
|
+
|
|
641
|
+
- ` readonly retryAfterMs?: number; ` — Longest service-requested wait among the failures, in ms.
|
|
642
|
+
|
|
643
|
+
- ` readonly reasons: readonly StatusRefreshFailure[]; ` — Per-verifier (or relay) failures.
|
|
644
|
+
|
|
645
|
+
- ` readonly requestId?: string; ` — Paid operation identity, when the refresh belonged to a journaled paid operation.
|
|
646
|
+
|
|
647
|
+
- ` readonly seq?: number; ` — The journaled sequence number the failed proof used (never reused).
|
|
648
|
+
|
|
649
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
650
|
+
|
|
651
|
+
- ` name: string; `
|
|
652
|
+
|
|
653
|
+
- ` message: string; `
|
|
654
|
+
|
|
655
|
+
- ` stack?: string; `
|
|
656
|
+
|
|
657
|
+
- ` cause?: unknown; `
|
|
658
|
+
|
|
257
659
|
### TasraError
|
|
258
660
|
|
|
259
661
|
Base class for typed SDK failures with a retryability hint.
|
|
260
662
|
Some SDK errors extend plain Error, including relay and agent-session
|
|
261
663
|
reconciliation errors. A retryable failure does not make a write safe to repeat.
|
|
262
664
|
|
|
263
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#
|
|
665
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L36)
|
|
264
666
|
|
|
265
667
|
Import: `import {TasraError} from '@t3foundry/tasra-sdk'`
|
|
266
668
|
|
|
@@ -289,9 +691,10 @@ A node or verifier answered with a non-2xx status. `body` is the response body,
|
|
|
289
691
|
truncated to 200 characters - enough to carry the service's own error text
|
|
290
692
|
without dumping a page of HTML into a log line.
|
|
291
693
|
|
|
292
|
-
5xx and
|
|
694
|
+
5xx, 429 and 425 are marked retryable; so is a 409, 410 or 422 that carries
|
|
695
|
+
`Retry-After`. Other 4xx are not. `retryAfterMs` is the service-requested wait.
|
|
293
696
|
|
|
294
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#
|
|
697
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L103)
|
|
295
698
|
|
|
296
699
|
Import: `import {TasraHttpError} from '@t3foundry/tasra-sdk'`
|
|
297
700
|
|
|
@@ -303,6 +706,7 @@ declare class TasraHttpError {
|
|
|
303
706
|
body?: string;
|
|
304
707
|
message?: string;
|
|
305
708
|
retryable?: boolean;
|
|
709
|
+
retryAfterMs?: number;
|
|
306
710
|
});
|
|
307
711
|
}
|
|
308
712
|
```
|
|
@@ -313,6 +717,8 @@ declare class TasraHttpError {
|
|
|
313
717
|
|
|
314
718
|
- ` readonly body: string; ` — Response body retained as diagnostic information.
|
|
315
719
|
|
|
720
|
+
- ` readonly retryAfterMs?: number; ` — Service-requested wait from `Retry-After`, in ms, when one was sent.
|
|
721
|
+
|
|
316
722
|
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
317
723
|
|
|
318
724
|
- ` name: string; `
|
|
@@ -333,7 +739,7 @@ signing set.
|
|
|
333
739
|
this actionable: previously those were collected and then discarded, so a DNS
|
|
334
740
|
failure and a cold DKG produced the same opaque message.
|
|
335
741
|
|
|
336
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#
|
|
742
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L603)
|
|
337
743
|
|
|
338
744
|
Import: `import {ThresholdNotMetError} from '@t3foundry/tasra-sdk'`
|
|
339
745
|
|
|
@@ -365,13 +771,92 @@ declare class ThresholdNotMetError {
|
|
|
365
771
|
|
|
366
772
|
- ` cause?: unknown; `
|
|
367
773
|
|
|
774
|
+
### UnderfundedGasPayerError
|
|
775
|
+
|
|
776
|
+
The transaction payer lacks native currency for the quoted reservation gas.
|
|
777
|
+
Slot TASRA credit is a separate balance. Nothing was prepared or broadcast;
|
|
778
|
+
this error never authorizes resubmission of an uncertain transaction.
|
|
779
|
+
|
|
780
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L77)
|
|
781
|
+
|
|
782
|
+
Import: `import {UnderfundedGasPayerError} from '@t3foundry/tasra-sdk'`
|
|
783
|
+
|
|
784
|
+
```ts
|
|
785
|
+
declare class UnderfundedGasPayerError {
|
|
786
|
+
constructor(args: {
|
|
787
|
+
payer: string;
|
|
788
|
+
availableNativeUnits: bigint;
|
|
789
|
+
requiredNativeUnits: bigint;
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
- ` readonly code: "underfunded-gas-payer"; ` — Stable code distinguishing native gas from slot TASRA credit.
|
|
795
|
+
|
|
796
|
+
- ` readonly payer: string; ` — Address that would pay the reservation transaction's gas.
|
|
797
|
+
|
|
798
|
+
- ` readonly availableNativeUnits: bigint; ` — Pending native balance, in the chain's smallest native unit.
|
|
799
|
+
|
|
800
|
+
- ` readonly requiredNativeUnits: bigint; ` — Estimated gas multiplied by the actual transaction gas price.
|
|
801
|
+
|
|
802
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
803
|
+
|
|
804
|
+
- ` name: string; `
|
|
805
|
+
|
|
806
|
+
- ` message: string; `
|
|
807
|
+
|
|
808
|
+
- ` stack?: string; `
|
|
809
|
+
|
|
810
|
+
- ` cause?: unknown; `
|
|
811
|
+
|
|
812
|
+
### UnderfundedSlotError
|
|
813
|
+
|
|
814
|
+
A new payment cannot be prepared with the slot's available TASRA. Reserved
|
|
815
|
+
credit belongs to earlier jobs and is not available for a new reservation.
|
|
816
|
+
Top up and read fresh funding before starting another payment; this error
|
|
817
|
+
never authorizes resubmission of an uncertain transaction.
|
|
818
|
+
|
|
819
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L53)
|
|
820
|
+
|
|
821
|
+
Import: `import {UnderfundedSlotError} from '@t3foundry/tasra-sdk'`
|
|
822
|
+
|
|
823
|
+
```ts
|
|
824
|
+
declare class UnderfundedSlotError {
|
|
825
|
+
constructor(args: {
|
|
826
|
+
slotId: string;
|
|
827
|
+
availableTasraUnits?: bigint;
|
|
828
|
+
status?: 402;
|
|
829
|
+
url?: string;
|
|
830
|
+
message?: string;
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
- ` readonly slotId: string; ` — Slot whose new payment was refused.
|
|
836
|
+
|
|
837
|
+
- ` readonly availableTasraUnits?: bigint; ` — Unreserved TASRA base units, when observed during on-chain discovery.
|
|
838
|
+
|
|
839
|
+
- ` readonly status?: 402; ` — Accountant HTTP status, absent for a local funding observation.
|
|
840
|
+
|
|
841
|
+
- ` readonly url?: string; ` — Accountant endpoint, when a reservation request returned HTTP 402.
|
|
842
|
+
|
|
843
|
+
- ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
|
|
844
|
+
|
|
845
|
+
- ` name: string; `
|
|
846
|
+
|
|
847
|
+
- ` message: string; `
|
|
848
|
+
|
|
849
|
+
- ` stack?: string; `
|
|
850
|
+
|
|
851
|
+
- ` cause?: unknown; `
|
|
852
|
+
|
|
368
853
|
### VerifierAgentSessionError
|
|
369
854
|
|
|
370
855
|
A Verifier Agent session did not produce a compound token. `kind` says why;
|
|
371
856
|
`retryable` is true only for `timeout` and `unavailable` - the session may
|
|
372
857
|
still complete, so poll again. Extends [TasraError](#tasraerror).
|
|
373
858
|
|
|
374
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
859
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L152)
|
|
375
860
|
|
|
376
861
|
Import: `import {VerifierAgentSessionError} from '@t3foundry/tasra-sdk'`
|
|
377
862
|
|
|
@@ -402,7 +887,7 @@ declare class VerifierAgentSessionError {
|
|
|
402
887
|
Operations you can import and call.
|
|
403
888
|
|
|
404
889
|
<details>
|
|
405
|
-
<summary>Browse
|
|
890
|
+
<summary>Browse 104 functions</summary>
|
|
406
891
|
|
|
407
892
|
- [accessTokenHash](#accesstokenhash)
|
|
408
893
|
- [addressFromEoaPubkey](#addressfromeoapubkey)
|
|
@@ -412,7 +897,12 @@ Operations you can import and call.
|
|
|
412
897
|
- [buildTasraText](#buildtasratext)
|
|
413
898
|
- [canAccess](#canaccess)
|
|
414
899
|
- [canonicalizeDcql](#canonicalizedcql)
|
|
900
|
+
- [classifyRefusal](#classifyrefusal)
|
|
901
|
+
- [classifyRefusedWrite](#classifyrefusedwrite)
|
|
902
|
+
- [classifyRetry](#classifyretry)
|
|
903
|
+
- [collectSealedPartials](#collectsealedpartials)
|
|
415
904
|
- [combineDecryptShares](#combinedecryptshares)
|
|
905
|
+
- [createDecryptionRecipient](#createdecryptionrecipient)
|
|
416
906
|
- [createDpopKey](#createdpopkey)
|
|
417
907
|
- [createHolderProof](#createholderproof)
|
|
418
908
|
- [createOauthSession](#createoauthsession)
|
|
@@ -422,6 +912,8 @@ Operations you can import and call.
|
|
|
422
912
|
- [credentialsCommitment](#credentialscommitment)
|
|
423
913
|
- [decodeJwtClaims](#decodejwtclaims)
|
|
424
914
|
- [decryptCustody](#decryptcustody)
|
|
915
|
+
- [decryptionBinding](#decryptionbinding)
|
|
916
|
+
- [decryptWithCommitteePartials](#decryptwithcommitteepartials)
|
|
425
917
|
- [decryptWithMasterKey](#decryptwithmasterkey)
|
|
426
918
|
- [decryptWithShardDelivery](#decryptwithsharddelivery)
|
|
427
919
|
- [ed25519DidKey](#ed25519didkey)
|
|
@@ -456,21 +948,32 @@ Operations you can import and call.
|
|
|
456
948
|
- [isJwtExpiringSoon](#isjwtexpiringsoon)
|
|
457
949
|
- [isOauthEnvelope](#isoauthenvelope)
|
|
458
950
|
- [isOid4vpRule](#isoid4vprule)
|
|
951
|
+
- [isPaidApprovalUnresolved](#ispaidapprovalunresolved)
|
|
952
|
+
- [isPaidBackoffError](#ispaidbackofferror)
|
|
953
|
+
- [isPrepaidEscapeError](#isprepaidescapeerror)
|
|
459
954
|
- [isRetryable](#isretryable)
|
|
955
|
+
- [isRevocationStatusPreflightRefusal](#isrevocationstatuspreflightrefusal)
|
|
956
|
+
- [isRevocationStatusRefusal](#isrevocationstatusrefusal)
|
|
957
|
+
- [isStatusRefreshError](#isstatusrefresherror)
|
|
460
958
|
- [issueAdminCredential](#issueadmincredential)
|
|
461
959
|
- [isTasraPost](#istasrapost)
|
|
462
960
|
- [jsonCredential](#jsoncredential)
|
|
463
961
|
- [jwkThumbprint](#jwkthumbprint)
|
|
464
962
|
- [jwtExpMs](#jwtexpms)
|
|
963
|
+
- [kemContentDigest](#kemcontentdigest)
|
|
465
964
|
- [lintEnvelope](#lintenvelope)
|
|
466
965
|
- [loadRego](#loadrego)
|
|
467
966
|
- [packEnvelope](#packenvelope)
|
|
967
|
+
- [parseRetryAfter](#parseretryafter)
|
|
468
968
|
- [parseTasraPost](#parsetasrapost)
|
|
469
969
|
- [payloadDigest](#payloaddigest)
|
|
470
970
|
- [pollOid4vpSession](#polloid4vpsession)
|
|
971
|
+
- [recipientPayloadDigest](#recipientpayloaddigest)
|
|
471
972
|
- [redeemCredential](#redeemcredential)
|
|
472
973
|
- [redeemRenewalToken](#redeemrenewaltoken)
|
|
473
974
|
- [requestIbeExtractionPartials](#requestibeextractionpartials)
|
|
975
|
+
- [retryDelayMs](#retrydelayms)
|
|
976
|
+
- [retryIdempotent](#retryidempotent)
|
|
474
977
|
- [revokeRenewal](#revokerenewal)
|
|
475
978
|
- [revokeSlotUser](#revokeslotuser)
|
|
476
979
|
- [scopeCovers](#scopecovers)
|
|
@@ -591,7 +1094,7 @@ Returns: ` DpopSigner `.
|
|
|
591
1094
|
|
|
592
1095
|
Build a holder-proof compact-JWS (header.payload.signature).
|
|
593
1096
|
|
|
594
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#
|
|
1097
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L138)
|
|
595
1098
|
|
|
596
1099
|
Import: `import {buildHolderProof} from '@t3foundry/tasra-sdk'`
|
|
597
1100
|
|
|
@@ -671,11 +1174,94 @@ declare function canonicalizeDcql(rule: string): string;
|
|
|
671
1174
|
|
|
672
1175
|
Returns: ` string `.
|
|
673
1176
|
|
|
1177
|
+
### classifyRefusal
|
|
1178
|
+
|
|
1179
|
+
Retry only explicit "not now" refusals: 425/429/503, or 409/410/422 carrying
|
|
1180
|
+
`Retry-After`. Generic 5xx and transport failures are final. Suits requests whose
|
|
1181
|
+
repetition is harmless but whose callers expect a prompt failure otherwise.
|
|
1182
|
+
|
|
1183
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L115)
|
|
1184
|
+
|
|
1185
|
+
Import: `import {classifyRefusal} from '@t3foundry/tasra-sdk'`
|
|
1186
|
+
|
|
1187
|
+
```ts
|
|
1188
|
+
declare function classifyRefusal(error: unknown): RetryDecision;
|
|
1189
|
+
```
|
|
1190
|
+
|
|
1191
|
+
| Parameter | Type | Description |
|
|
1192
|
+
|---|---|---|
|
|
1193
|
+
| ` error ` | ` unknown ` | Failure thrown by one attempt. |
|
|
1194
|
+
|
|
1195
|
+
Returns: ` RetryDecision `.
|
|
1196
|
+
|
|
1197
|
+
### classifyRefusedWrite
|
|
1198
|
+
|
|
1199
|
+
Classification for a write whose refusal proves it was not processed: only HTTP 429, which
|
|
1200
|
+
the verifier uses for SP-11 capacity refusals before it stores anything. A 5xx or lost reply
|
|
1201
|
+
may follow processing, so it is final here.
|
|
1202
|
+
|
|
1203
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L127)
|
|
1204
|
+
|
|
1205
|
+
Import: `import {classifyRefusedWrite} from '@t3foundry/tasra-sdk'`
|
|
1206
|
+
|
|
1207
|
+
```ts
|
|
1208
|
+
declare function classifyRefusedWrite(error: unknown): RetryDecision;
|
|
1209
|
+
```
|
|
1210
|
+
|
|
1211
|
+
| Parameter | Type | Description |
|
|
1212
|
+
|---|---|---|
|
|
1213
|
+
| ` error ` | ` unknown ` | Failure thrown by one attempt. |
|
|
1214
|
+
|
|
1215
|
+
Returns: ` RetryDecision `.
|
|
1216
|
+
|
|
1217
|
+
### classifyRetry
|
|
1218
|
+
|
|
1219
|
+
Default classification for an idempotent request: retry 425/429/503, a 409/410/422 only
|
|
1220
|
+
when the service sent `Retry-After`, other 5xx and unreachable endpoints with backoff.
|
|
1221
|
+
Authorization refusals and other 4xx are final.
|
|
1222
|
+
|
|
1223
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L99)
|
|
1224
|
+
|
|
1225
|
+
Import: `import {classifyRetry} from '@t3foundry/tasra-sdk'`
|
|
1226
|
+
|
|
1227
|
+
```ts
|
|
1228
|
+
declare function classifyRetry(error: unknown): RetryDecision;
|
|
1229
|
+
```
|
|
1230
|
+
|
|
1231
|
+
| Parameter | Type | Description |
|
|
1232
|
+
|---|---|---|
|
|
1233
|
+
| ` error ` | ` unknown ` | Failure thrown by one attempt. |
|
|
1234
|
+
|
|
1235
|
+
Returns: ` RetryDecision `.
|
|
1236
|
+
|
|
1237
|
+
### collectSealedPartials
|
|
1238
|
+
|
|
1239
|
+
Collect the first threshold of distinct, locally opened and verified contributions.
|
|
1240
|
+
The whole fan-out is bounded to 15 seconds. Outstanding reads are cancelled at quorum;
|
|
1241
|
+
invalid, duplicate and late contributions are cleared. The caller owns returned values.
|
|
1242
|
+
|
|
1243
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/sealed.ts#L74)
|
|
1244
|
+
|
|
1245
|
+
Import: `import {collectSealedPartials} from '@t3foundry/tasra-sdk'`
|
|
1246
|
+
|
|
1247
|
+
```ts
|
|
1248
|
+
declare function collectSealedPartials(opts: SealedRequestOpts, action: 'decrypt' | 'ibe-extract', identity: Uint8Array, ciphertext?: Ciphertext): Promise<SealedPartial[]>;
|
|
1249
|
+
```
|
|
1250
|
+
|
|
1251
|
+
| Parameter | Type | Description |
|
|
1252
|
+
|---|---|---|
|
|
1253
|
+
| ` opts ` | ` SealedRequestOpts ` | - Original recipient-bound grant, trusted public shares and assigned endpoints. |
|
|
1254
|
+
| ` action ` | ` 'decrypt' \| 'ibe-extract' ` | - KEM decryption or IBE extraction; must match the signed token binding. |
|
|
1255
|
+
| ` identity ` | ` Uint8Array ` | - Original UTF-8 identity bytes bound by authorization. |
|
|
1256
|
+
| ` ciphertext? ` | ` Ciphertext ` | - Complete KEM ciphertext, required for the decrypt action. |
|
|
1257
|
+
|
|
1258
|
+
Returns: ` Promise<SealedPartial[]> `.
|
|
1259
|
+
|
|
674
1260
|
### combineDecryptShares
|
|
675
1261
|
|
|
676
1262
|
Interpolate distinct partial decryptions and authenticate the plaintext. Enable verify to check each share before combining; the caller supplies a sufficient threshold.
|
|
677
1263
|
|
|
678
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#
|
|
1264
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L374)
|
|
679
1265
|
|
|
680
1266
|
Import: `import {combineDecryptShares} from '@t3foundry/tasra-sdk'`
|
|
681
1267
|
|
|
@@ -694,6 +1280,25 @@ declare function combineDecryptShares(shares: DecryptShare[], ct: Ciphertext, id
|
|
|
694
1280
|
|
|
695
1281
|
Returns: ` Uint8Array `.
|
|
696
1282
|
|
|
1283
|
+
### createDecryptionRecipient
|
|
1284
|
+
|
|
1285
|
+
Create BEFORE requesting authorization. The private key stays in this closure and
|
|
1286
|
+
is never included in session or keeper requests. Generate a fresh instance per operation.
|
|
1287
|
+
|
|
1288
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L74)
|
|
1289
|
+
|
|
1290
|
+
Import: `import {createDecryptionRecipient} from '@t3foundry/tasra-sdk'`
|
|
1291
|
+
|
|
1292
|
+
```ts
|
|
1293
|
+
declare function createDecryptionRecipient(seed?: Uint8Array): Promise<ClientRecipient>;
|
|
1294
|
+
```
|
|
1295
|
+
|
|
1296
|
+
| Parameter | Type | Description |
|
|
1297
|
+
|---|---|---|
|
|
1298
|
+
| ` seed? ` | ` Uint8Array ` | - Optional client-held 32-byte random recovery seed for RFC 9180 DeriveKeyPair. Store it only in the client's private storage; the caller owns and must clear its buffer. |
|
|
1299
|
+
|
|
1300
|
+
Returns: ` Promise<ClientRecipient> `.
|
|
1301
|
+
|
|
697
1302
|
### createDpopKey
|
|
698
1303
|
|
|
699
1304
|
Generate an ES256 DPoP key pair with a non-extractable private key.
|
|
@@ -715,7 +1320,7 @@ Convenience: fetch a nonce and build the holder proof in one step. Returns the
|
|
|
715
1320
|
compact-JWS to put in the `holder_proof` field of a `verify-vp-jwt` /
|
|
716
1321
|
`committee-authorize` request.
|
|
717
1322
|
|
|
718
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#
|
|
1323
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L176)
|
|
719
1324
|
|
|
720
1325
|
Import: `import {createHolderProof} from '@t3foundry/tasra-sdk'`
|
|
721
1326
|
|
|
@@ -743,7 +1348,7 @@ Open an `oauth` session - same creator authorisation, same committee draw, same
|
|
|
743
1348
|
derived nonce, same poll contract as [createOid4vpSession](#createoid4vpsession). No QR, no Request
|
|
744
1349
|
Object, no JWE key: the client presents an access token its own IdP minted.
|
|
745
1350
|
|
|
746
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
1351
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L314)
|
|
747
1352
|
|
|
748
1353
|
Import: `import {createOauthSession} from '@t3foundry/tasra-sdk'`
|
|
749
1354
|
|
|
@@ -766,7 +1371,7 @@ The verifier-agent derives a nonce, generates an ECDH key for JWE, and returns a
|
|
|
766
1371
|
payload the wallet scans. The session ID and poll secret are used to poll
|
|
767
1372
|
for the result.
|
|
768
1373
|
|
|
769
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
1374
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L272)
|
|
770
1375
|
|
|
771
1376
|
Import: `import {createOid4vpSession} from '@t3foundry/tasra-sdk'`
|
|
772
1377
|
|
|
@@ -789,7 +1394,7 @@ replace the presentation's credentials. `slot_ids` (if given) are rotated via
|
|
|
789
1394
|
a webhook when the renewal is revoked.
|
|
790
1395
|
POST {verifier}/v1/renewals
|
|
791
1396
|
|
|
792
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
1397
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L58)
|
|
793
1398
|
|
|
794
1399
|
Import: `import {createRenewal} from '@t3foundry/tasra-sdk'`
|
|
795
1400
|
|
|
@@ -799,13 +1404,14 @@ declare function createRenewal(verifierUrl: string, body: {
|
|
|
799
1404
|
presentation: unknown;
|
|
800
1405
|
credentials?: string[];
|
|
801
1406
|
slot_ids?: string[];
|
|
802
|
-
}): Promise<RenewalGrant>;
|
|
1407
|
+
}, retry?: RetryPolicy | false): Promise<RenewalGrant>;
|
|
803
1408
|
```
|
|
804
1409
|
|
|
805
1410
|
| Parameter | Type | Description |
|
|
806
1411
|
|---|---|---|
|
|
807
1412
|
| ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
|
|
808
1413
|
| ` body ` | ` { dcql_rule: string; presentation: unknown; credentials?: string[]; slot_ids?: string[]; } ` | - Policy, presentation and optional signed credentials or revocation-bound slots. |
|
|
1414
|
+
| ` retry? ` | ` RetryPolicy \| false ` | Waits on an SP-11 capacity refusal (HTTP 429, nothing stored); `false` fails at once. Other failures are never retried. |
|
|
809
1415
|
|
|
810
1416
|
Returns: ` Promise<RenewalGrant> `.
|
|
811
1417
|
|
|
@@ -842,7 +1448,7 @@ MUST byte-for-byte match the verifier's `credentials_commitment`
|
|
|
842
1448
|
sides agree without JSON canonicalization. Binds a holder proof to the exact set of
|
|
843
1449
|
compact-JWS credentials being presented.
|
|
844
1450
|
|
|
845
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#
|
|
1451
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L44)
|
|
846
1452
|
|
|
847
1453
|
Import: `import {credentialsCommitment} from '@t3foundry/tasra-sdk'`
|
|
848
1454
|
|
|
@@ -860,7 +1466,7 @@ Returns: ` string `.
|
|
|
860
1466
|
|
|
861
1467
|
Decode JWT claims WITHOUT verifying the signature (for expiry/UX only).
|
|
862
1468
|
|
|
863
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
1469
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L278)
|
|
864
1470
|
|
|
865
1471
|
Import: `import {decodeJwtClaims} from '@t3foundry/tasra-sdk'`
|
|
866
1472
|
|
|
@@ -876,10 +1482,9 @@ Returns: ` JwtClaims | null `.
|
|
|
876
1482
|
|
|
877
1483
|
### decryptCustody
|
|
878
1484
|
|
|
879
|
-
|
|
880
|
-
returns the plaintext (one HTTP round-trip).
|
|
1485
|
+
Server-side custody decryption is retired.
|
|
881
1486
|
|
|
882
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#
|
|
1487
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L59)
|
|
883
1488
|
|
|
884
1489
|
Import: `import {decryptCustody} from '@t3foundry/tasra-sdk'`
|
|
885
1490
|
|
|
@@ -889,7 +1494,59 @@ declare function decryptCustody(opts: DecryptCustodyOpts): Promise<Uint8Array>;
|
|
|
889
1494
|
|
|
890
1495
|
| Parameter | Type | Description |
|
|
891
1496
|
|---|---|---|
|
|
892
|
-
| ` opts ` | ` DecryptCustodyOpts ` | -
|
|
1497
|
+
| ` opts ` | ` DecryptCustodyOpts ` | - Historical request options, refused before any HTTP request. |
|
|
1498
|
+
|
|
1499
|
+
Returns: ` Promise<Uint8Array> `.
|
|
1500
|
+
|
|
1501
|
+
### decryptionBinding
|
|
1502
|
+
|
|
1503
|
+
Prepare the digest and public session metadata before requesting authorization.
|
|
1504
|
+
|
|
1505
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L118)
|
|
1506
|
+
|
|
1507
|
+
Import: `import {decryptionBinding} from '@t3foundry/tasra-sdk'`
|
|
1508
|
+
|
|
1509
|
+
```ts
|
|
1510
|
+
declare function decryptionBinding(content: Uint8Array, epoch: number, client: ClientRecipient): {
|
|
1511
|
+
payloadDigest: Uint8Array;
|
|
1512
|
+
decryption: DecryptionBindingWire;
|
|
1513
|
+
};
|
|
1514
|
+
```
|
|
1515
|
+
|
|
1516
|
+
| Parameter | Type | Description |
|
|
1517
|
+
|---|---|---|
|
|
1518
|
+
| ` content ` | ` Uint8Array ` | - Complete KEM content digest or SHA-256 IBE identity digest. |
|
|
1519
|
+
| ` epoch ` | ` number ` | - Canonical ciphertext key epoch. |
|
|
1520
|
+
| ` client ` | ` ClientRecipient ` | - Original client-held recipient, retained for opening and recovery. |
|
|
1521
|
+
|
|
1522
|
+
Returns:
|
|
1523
|
+
|
|
1524
|
+
```ts
|
|
1525
|
+
{
|
|
1526
|
+
payloadDigest: Uint8Array;
|
|
1527
|
+
decryption: DecryptionBindingWire;
|
|
1528
|
+
}
|
|
1529
|
+
```
|
|
1530
|
+
|
|
1531
|
+
### decryptWithCommitteePartials
|
|
1532
|
+
|
|
1533
|
+
Collect and combine recipient-sealed KEM contributions locally, then clear all partials.
|
|
1534
|
+
Servers receive only the authorized public recipient and never the recovered plaintext.
|
|
1535
|
+
|
|
1536
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/sealed.ts#L166)
|
|
1537
|
+
|
|
1538
|
+
Import: `import {decryptWithCommitteePartials} from '@t3foundry/tasra-sdk'`
|
|
1539
|
+
|
|
1540
|
+
```ts
|
|
1541
|
+
declare function decryptWithCommitteePartials(opts: SealedRequestOpts & {
|
|
1542
|
+
ciphertext: Ciphertext;
|
|
1543
|
+
identity: Uint8Array;
|
|
1544
|
+
}): Promise<Uint8Array>;
|
|
1545
|
+
```
|
|
1546
|
+
|
|
1547
|
+
| Parameter | Type | Description |
|
|
1548
|
+
|---|---|---|
|
|
1549
|
+
| ` opts ` | ` SealedRequestOpts & { ciphertext: Ciphertext; identity: Uint8Array; } ` | - Recipient-bound quorum settings, complete ciphertext and original identity bytes. |
|
|
893
1550
|
|
|
894
1551
|
Returns: ` Promise<Uint8Array> `.
|
|
895
1552
|
|
|
@@ -897,7 +1554,7 @@ Returns: ` Promise<Uint8Array> `.
|
|
|
897
1554
|
|
|
898
1555
|
Decrypt with a reconstructed BLS master secret key and the original associated data. Reject malformed keys or failed authentication.
|
|
899
1556
|
|
|
900
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#
|
|
1557
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L215)
|
|
901
1558
|
|
|
902
1559
|
Import: `import {decryptWithMasterKey} from '@t3foundry/tasra-sdk'`
|
|
903
1560
|
|
|
@@ -915,10 +1572,9 @@ Returns: ` Uint8Array `.
|
|
|
915
1572
|
|
|
916
1573
|
### decryptWithShardDelivery
|
|
917
1574
|
|
|
918
|
-
|
|
919
|
-
node and combine the shares locally (the master key is never assembled).
|
|
1575
|
+
Unsealed JWT share delivery is retired.
|
|
920
1576
|
|
|
921
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#
|
|
1577
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L67)
|
|
922
1578
|
|
|
923
1579
|
Import: `import {decryptWithShardDelivery} from '@t3foundry/tasra-sdk'`
|
|
924
1580
|
|
|
@@ -928,7 +1584,7 @@ declare function decryptWithShardDelivery(opts: ShardDecryptOpts): Promise<Uint8
|
|
|
928
1584
|
|
|
929
1585
|
| Parameter | Type | Description |
|
|
930
1586
|
|---|---|---|
|
|
931
|
-
| ` opts ` | ` ShardDecryptOpts ` | -
|
|
1587
|
+
| ` opts ` | ` ShardDecryptOpts ` | - Historical request options, refused before any HTTP request. |
|
|
932
1588
|
|
|
933
1589
|
Returns: ` Promise<Uint8Array> `.
|
|
934
1590
|
|
|
@@ -937,7 +1593,7 @@ Returns: ` Promise<Uint8Array> `.
|
|
|
937
1593
|
A did:key identifier for an Ed25519 public key (multicodec 0xed01, base58btc). Useful
|
|
938
1594
|
when the holder is identified by a self-certifying did:key.
|
|
939
1595
|
|
|
940
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#
|
|
1596
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L205)
|
|
941
1597
|
|
|
942
1598
|
Import: `import {ed25519DidKey} from '@t3foundry/tasra-sdk'`
|
|
943
1599
|
|
|
@@ -1114,7 +1770,7 @@ Throws: If no shards are returned or interpolation fails.
|
|
|
1114
1770
|
Mint a single-use challenge nonce, optionally bound to a slot id + action (F4).
|
|
1115
1771
|
POST {verifier}/v1/nonce
|
|
1116
1772
|
|
|
1117
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#
|
|
1773
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L69)
|
|
1118
1774
|
|
|
1119
1775
|
Import: `import {fetchHolderNonce} from '@t3foundry/tasra-sdk'`
|
|
1120
1776
|
|
|
@@ -1122,13 +1778,14 @@ Import: `import {fetchHolderNonce} from '@t3foundry/tasra-sdk'`
|
|
|
1122
1778
|
declare function fetchHolderNonce(verifierUrl: string, opts?: {
|
|
1123
1779
|
slotId?: string;
|
|
1124
1780
|
action?: string;
|
|
1781
|
+
retry?: RetryPolicy | false;
|
|
1125
1782
|
}): Promise<HolderNonce>;
|
|
1126
1783
|
```
|
|
1127
1784
|
|
|
1128
1785
|
| Parameter | Type | Description |
|
|
1129
1786
|
|---|---|---|
|
|
1130
1787
|
| ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
|
|
1131
|
-
| ` opts? ` | ` { slotId?: string; action?: string; } ` | - Optional slot and action binding for the single-use challenge. |
|
|
1788
|
+
| ` opts? ` | ` { slotId?: string; action?: string; retry?: RetryPolicy \| false; } ` | - Optional slot and action binding for the single-use challenge. |
|
|
1132
1789
|
|
|
1133
1790
|
Returns: ` Promise<HolderNonce> `.
|
|
1134
1791
|
|
|
@@ -1312,7 +1969,7 @@ Combine k extraction partials and AEAD-decrypt `ct` - mirrors
|
|
|
1312
1969
|
`bls::ibe::combine_decrypt` (verify every share to Lagrange-combine to `T = e(sk_ID,U)`
|
|
1313
1970
|
to KDF to open). The intermediate `sk_ID` never leaves this function.
|
|
1314
1971
|
|
|
1315
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#
|
|
1972
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L348)
|
|
1316
1973
|
|
|
1317
1974
|
Import: `import {ibeCombineDecrypt} from '@t3foundry/tasra-sdk'`
|
|
1318
1975
|
|
|
@@ -1339,7 +1996,7 @@ this identity - prefer [ibeCombineDecrypt](#ibecombinedecrypt), which uses and d
|
|
|
1339
1996
|
every share first (a caller combining unverified shares could be fed garbage that
|
|
1340
1997
|
silently fails the AEAD later, unattributed).
|
|
1341
1998
|
|
|
1342
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#
|
|
1999
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L300)
|
|
1343
2000
|
|
|
1344
2001
|
Import: `import {ibeCombineExtract} from '@t3foundry/tasra-sdk'`
|
|
1345
2002
|
|
|
@@ -1381,7 +2038,7 @@ Returns: ` Promise<Uint8Array> `.
|
|
|
1381
2038
|
One-call identity-scoped decrypt (the read path): token to extraction fan-out
|
|
1382
2039
|
to verify each partial to combine to decrypt. The intermediate `sk_ID` never surfaces.
|
|
1383
2040
|
|
|
1384
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#
|
|
2041
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#L521)
|
|
1385
2042
|
|
|
1386
2043
|
Import: `import {ibeDecryptRequest} from '@t3foundry/tasra-sdk'`
|
|
1387
2044
|
|
|
@@ -1402,7 +2059,7 @@ Returns: ` Promise<Uint8Array> `.
|
|
|
1402
2059
|
Decrypt with an already-extracted identity key (48-byte compressed G1) - the
|
|
1403
2060
|
custody-opt-in path pairing with [ibeCombineExtract](#ibecombineextract).
|
|
1404
2061
|
|
|
1405
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#
|
|
2062
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L370)
|
|
1406
2063
|
|
|
1407
2064
|
Import: `import {ibeDecryptWithKey} from '@t3foundry/tasra-sdk'`
|
|
1408
2065
|
|
|
@@ -1423,7 +2080,7 @@ Returns: ` Uint8Array `.
|
|
|
1423
2080
|
Encrypt `message` to `identity` under the slot's master public key (96-byte
|
|
1424
2081
|
compressed G2). Offline and permissionless - the identity's key need not exist yet.
|
|
1425
2082
|
|
|
1426
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#
|
|
2083
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L210)
|
|
1427
2084
|
|
|
1428
2085
|
Import: `import {ibeEncrypt} from '@t3foundry/tasra-sdk'`
|
|
1429
2086
|
|
|
@@ -1449,7 +2106,7 @@ compressed G1).
|
|
|
1449
2106
|
ciphertext to this identity. Prefer [ibeDecryptRequest](#ibedecryptrequest), which combines,
|
|
1450
2107
|
decrypts and drops it. Zeroize the returned bytes when done.
|
|
1451
2108
|
|
|
1452
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#
|
|
2109
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#L503)
|
|
1453
2110
|
|
|
1454
2111
|
Import: `import {ibeExtractRequest} from '@t3foundry/tasra-sdk'`
|
|
1455
2112
|
|
|
@@ -1541,7 +2198,7 @@ Verify one extraction partial against its node's dual-group verifying share (the
|
|
|
1541
2198
|
96-byte G2 half): `e(D_i, G2) == e(Q_ID, Y_i)`. Throws naming the identifier -
|
|
1542
2199
|
identifiable abort: the caller knows WHICH node served a bad share.
|
|
1543
2200
|
|
|
1544
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#
|
|
2201
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L254)
|
|
1545
2202
|
|
|
1546
2203
|
Import: `import {ibeVerifyShare} from '@t3foundry/tasra-sdk'`
|
|
1547
2204
|
|
|
@@ -1563,7 +2220,7 @@ True when `e` is an auth rejection - i.e. retrying is pointless, re-claim
|
|
|
1563
2220
|
instead. Keyed on the HTTP status rather than the class, so it also catches
|
|
1564
2221
|
subclasses that carry their own name (e.g. `CommitteeAuthorizeError`).
|
|
1565
2222
|
|
|
1566
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#
|
|
2223
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L682)
|
|
1567
2224
|
|
|
1568
2225
|
Import: `import {isAuthDenied} from '@t3foundry/tasra-sdk'`
|
|
1569
2226
|
|
|
@@ -1581,102 +2238,212 @@ Returns: ` e is TasraHttpError `.
|
|
|
1581
2238
|
|
|
1582
2239
|
Guard for a nonce that can ride in a header (the agent's challenge carries it back).
|
|
1583
2240
|
|
|
1584
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L194)
|
|
2241
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L194)
|
|
2242
|
+
|
|
2243
|
+
Import: `import {isHeaderSafeNonce} from '@t3foundry/tasra-sdk'`
|
|
2244
|
+
|
|
2245
|
+
```ts
|
|
2246
|
+
declare function isHeaderSafeNonce(nonce: string): boolean;
|
|
2247
|
+
```
|
|
2248
|
+
|
|
2249
|
+
| Parameter | Type | Description |
|
|
2250
|
+
|---|---|---|
|
|
2251
|
+
| ` nonce ` | ` string ` | - Nonce text to check before using it as an HTTP header value. |
|
|
2252
|
+
|
|
2253
|
+
Returns: ` boolean `.
|
|
2254
|
+
|
|
2255
|
+
### isJwtExpiringSoon
|
|
2256
|
+
|
|
2257
|
+
True when the token is expired or within `skewMs` of expiring.
|
|
2258
|
+
|
|
2259
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L304)
|
|
2260
|
+
|
|
2261
|
+
Import: `import {isJwtExpiringSoon} from '@t3foundry/tasra-sdk'`
|
|
2262
|
+
|
|
2263
|
+
```ts
|
|
2264
|
+
declare function isJwtExpiringSoon(jwt: string, skewMs?: number): boolean;
|
|
2265
|
+
```
|
|
2266
|
+
|
|
2267
|
+
| Parameter | Type | Description |
|
|
2268
|
+
|---|---|---|
|
|
2269
|
+
| ` jwt ` | ` string ` | - Compact JWT to inspect without signature verification. |
|
|
2270
|
+
| ` skewMs? ` | ` number ` | - Refresh lead time in milliseconds. |
|
|
2271
|
+
|
|
2272
|
+
Returns: ` boolean `.
|
|
2273
|
+
|
|
2274
|
+
### isOauthEnvelope
|
|
2275
|
+
|
|
2276
|
+
Whether `rule` is a `kk_oauth` policy envelope: a JSON object whose only member is
|
|
2277
|
+
`kk_oauth`. Structural only - the envelope's contents are not validated (use
|
|
2278
|
+
[lintEnvelope](#lintenvelope)). Total: never throws.
|
|
2279
|
+
|
|
2280
|
+
Matches the network's grammar dispatch exactly, so the SDK commits an envelope the same way
|
|
2281
|
+
every keeper and verifier re-derives it. A duplicated `kk_oauth` member is not an envelope,
|
|
2282
|
+
and neither is anything longer than `MAX_RULE_LEN` UTF-8 bytes.
|
|
2283
|
+
|
|
2284
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L59)
|
|
2285
|
+
|
|
2286
|
+
Import: `import {isOauthEnvelope} from '@t3foundry/tasra-sdk'`
|
|
2287
|
+
|
|
2288
|
+
```ts
|
|
2289
|
+
declare function isOauthEnvelope(rule: string): boolean;
|
|
2290
|
+
```
|
|
2291
|
+
|
|
2292
|
+
| Parameter | Type | Description |
|
|
2293
|
+
|---|---|---|
|
|
2294
|
+
| ` rule ` | ` string ` | - Clear rule text to classify. |
|
|
2295
|
+
|
|
2296
|
+
Returns: ` boolean `.
|
|
2297
|
+
|
|
2298
|
+
### isOid4vpRule
|
|
2299
|
+
|
|
2300
|
+
True when `rule` parses as a supported OID4VP-DCQL query.
|
|
2301
|
+
|
|
2302
|
+
This is the grammar dispatch used by the commitment. It must stay a TOTAL function -
|
|
2303
|
+
a legacy kk-DCQL rule is not an error here, it is simply "not OID4VP".
|
|
2304
|
+
|
|
2305
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L998)
|
|
2306
|
+
|
|
2307
|
+
Import: `import {isOid4vpRule} from '@t3foundry/tasra-sdk'`
|
|
2308
|
+
|
|
2309
|
+
```ts
|
|
2310
|
+
declare function isOid4vpRule(rule: string): boolean;
|
|
2311
|
+
```
|
|
2312
|
+
|
|
2313
|
+
| Parameter | Type | Description |
|
|
2314
|
+
|---|---|---|
|
|
2315
|
+
| ` rule ` | ` string ` | - Policy text to check for a supported DCQL shape. |
|
|
2316
|
+
|
|
2317
|
+
Returns: ` boolean `.
|
|
2318
|
+
|
|
2319
|
+
### isPaidApprovalUnresolved
|
|
2320
|
+
|
|
2321
|
+
True for a [PaidApprovalUnresolvedError](#paidapprovalunresolvederror).
|
|
2322
|
+
|
|
2323
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L456)
|
|
2324
|
+
|
|
2325
|
+
Import: `import {isPaidApprovalUnresolved} from '@t3foundry/tasra-sdk'`
|
|
2326
|
+
|
|
2327
|
+
```ts
|
|
2328
|
+
declare function isPaidApprovalUnresolved(e: unknown): e is PaidApprovalUnresolvedError;
|
|
2329
|
+
```
|
|
2330
|
+
|
|
2331
|
+
| Parameter | Type | Description |
|
|
2332
|
+
|---|---|---|
|
|
2333
|
+
| ` e ` | ` unknown ` | - Caught value to classify. |
|
|
2334
|
+
|
|
2335
|
+
Returns: ` e is PaidApprovalUnresolvedError `.
|
|
2336
|
+
|
|
2337
|
+
### isPaidBackoffError
|
|
2338
|
+
|
|
2339
|
+
True for a [PaidBackoffError](#paidbackofferror).
|
|
2340
|
+
|
|
2341
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L404)
|
|
2342
|
+
|
|
2343
|
+
Import: `import {isPaidBackoffError} from '@t3foundry/tasra-sdk'`
|
|
2344
|
+
|
|
2345
|
+
```ts
|
|
2346
|
+
declare function isPaidBackoffError(e: unknown): e is PaidBackoffError;
|
|
2347
|
+
```
|
|
2348
|
+
|
|
2349
|
+
| Parameter | Type | Description |
|
|
2350
|
+
|---|---|---|
|
|
2351
|
+
| ` e ` | ` unknown ` | - Caught value to classify. |
|
|
2352
|
+
|
|
2353
|
+
Returns: ` e is PaidBackoffError `.
|
|
2354
|
+
|
|
2355
|
+
### isPrepaidEscapeError
|
|
2356
|
+
|
|
2357
|
+
True for a [PrepaidEscapeError](#prepaidescapeerror).
|
|
2358
|
+
|
|
2359
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L552)
|
|
1585
2360
|
|
|
1586
|
-
Import: `import {
|
|
2361
|
+
Import: `import {isPrepaidEscapeError} from '@t3foundry/tasra-sdk'`
|
|
1587
2362
|
|
|
1588
2363
|
```ts
|
|
1589
|
-
declare function
|
|
2364
|
+
declare function isPrepaidEscapeError(e: unknown): e is PrepaidEscapeError;
|
|
1590
2365
|
```
|
|
1591
2366
|
|
|
1592
2367
|
| Parameter | Type | Description |
|
|
1593
2368
|
|---|---|---|
|
|
1594
|
-
| `
|
|
2369
|
+
| ` e ` | ` unknown ` | - Caught value to classify. |
|
|
1595
2370
|
|
|
1596
|
-
Returns: `
|
|
2371
|
+
Returns: ` e is PrepaidEscapeError `.
|
|
1597
2372
|
|
|
1598
|
-
###
|
|
2373
|
+
### isRetryable
|
|
1599
2374
|
|
|
1600
|
-
True when
|
|
2375
|
+
True when a typed failure may be transient. Errors outside the TasraError
|
|
2376
|
+
hierarchy return false. This hint does not make a write safe to repeat.
|
|
1601
2377
|
|
|
1602
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/
|
|
2378
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L692)
|
|
1603
2379
|
|
|
1604
|
-
Import: `import {
|
|
2380
|
+
Import: `import {isRetryable} from '@t3foundry/tasra-sdk'`
|
|
1605
2381
|
|
|
1606
2382
|
```ts
|
|
1607
|
-
declare function
|
|
2383
|
+
declare function isRetryable(e: unknown): boolean;
|
|
1608
2384
|
```
|
|
1609
2385
|
|
|
1610
2386
|
| Parameter | Type | Description |
|
|
1611
2387
|
|---|---|---|
|
|
1612
|
-
| `
|
|
1613
|
-
| ` skewMs? ` | ` number ` | - Refresh lead time in milliseconds. |
|
|
2388
|
+
| ` e ` | ` unknown ` | - Caught value to inspect for a retryable Tasra error. |
|
|
1614
2389
|
|
|
1615
2390
|
Returns: ` boolean `.
|
|
1616
2391
|
|
|
1617
|
-
###
|
|
1618
|
-
|
|
1619
|
-
Whether `rule` is a `kk_oauth` policy envelope: a JSON object whose only member is
|
|
1620
|
-
`kk_oauth`. Structural only - the envelope's contents are not validated (use
|
|
1621
|
-
[lintEnvelope](#lintenvelope)). Total: never throws.
|
|
2392
|
+
### isRevocationStatusPreflightRefusal
|
|
1622
2393
|
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
and neither is anything longer than `MAX_RULE_LEN` UTF-8 bytes.
|
|
2394
|
+
True when a grant was refused locally for missing, stale or invalid revocation-status
|
|
2395
|
+
attestations before anything was sent.
|
|
1626
2396
|
|
|
1627
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/
|
|
2397
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L207)
|
|
1628
2398
|
|
|
1629
|
-
Import: `import {
|
|
2399
|
+
Import: `import {isRevocationStatusPreflightRefusal} from '@t3foundry/tasra-sdk'`
|
|
1630
2400
|
|
|
1631
2401
|
```ts
|
|
1632
|
-
declare function
|
|
2402
|
+
declare function isRevocationStatusPreflightRefusal(e: unknown): e is RevocationStatusPreflightError;
|
|
1633
2403
|
```
|
|
1634
2404
|
|
|
1635
2405
|
| Parameter | Type | Description |
|
|
1636
2406
|
|---|---|---|
|
|
1637
|
-
| `
|
|
1638
|
-
|
|
1639
|
-
Returns: ` boolean `.
|
|
2407
|
+
| ` e ` | ` unknown ` | - Caught value to classify. |
|
|
1640
2408
|
|
|
1641
|
-
|
|
2409
|
+
Returns: ` e is RevocationStatusPreflightError `.
|
|
1642
2410
|
|
|
1643
|
-
|
|
2411
|
+
### isRevocationStatusRefusal
|
|
1644
2412
|
|
|
1645
|
-
|
|
1646
|
-
|
|
2413
|
+
True when a keeper refused a grant only for stale or missing revocation-status attestations:
|
|
2414
|
+
present the credential again for a fresh grant and repeat the call.
|
|
1647
2415
|
|
|
1648
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/
|
|
2416
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L230)
|
|
1649
2417
|
|
|
1650
|
-
Import: `import {
|
|
2418
|
+
Import: `import {isRevocationStatusRefusal} from '@t3foundry/tasra-sdk'`
|
|
1651
2419
|
|
|
1652
2420
|
```ts
|
|
1653
|
-
declare function
|
|
2421
|
+
declare function isRevocationStatusRefusal(e: unknown): e is RevocationStatusError;
|
|
1654
2422
|
```
|
|
1655
2423
|
|
|
1656
2424
|
| Parameter | Type | Description |
|
|
1657
2425
|
|---|---|---|
|
|
1658
|
-
| `
|
|
2426
|
+
| ` e ` | ` unknown ` | - Caught value to classify. |
|
|
1659
2427
|
|
|
1660
|
-
Returns: `
|
|
2428
|
+
Returns: ` e is RevocationStatusError `.
|
|
1661
2429
|
|
|
1662
|
-
###
|
|
2430
|
+
### isStatusRefreshError
|
|
1663
2431
|
|
|
1664
|
-
True
|
|
1665
|
-
hierarchy return false. This hint does not make a write safe to repeat.
|
|
2432
|
+
True for a [StatusRefreshError](#statusrefresherror).
|
|
1666
2433
|
|
|
1667
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#
|
|
2434
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L335)
|
|
1668
2435
|
|
|
1669
|
-
Import: `import {
|
|
2436
|
+
Import: `import {isStatusRefreshError} from '@t3foundry/tasra-sdk'`
|
|
1670
2437
|
|
|
1671
2438
|
```ts
|
|
1672
|
-
declare function
|
|
2439
|
+
declare function isStatusRefreshError(e: unknown): e is StatusRefreshError;
|
|
1673
2440
|
```
|
|
1674
2441
|
|
|
1675
2442
|
| Parameter | Type | Description |
|
|
1676
2443
|
|---|---|---|
|
|
1677
|
-
| ` e ` | ` unknown ` | - Caught value to
|
|
2444
|
+
| ` e ` | ` unknown ` | - Caught value to classify. |
|
|
1678
2445
|
|
|
1679
|
-
Returns: `
|
|
2446
|
+
Returns: ` e is StatusRefreshError `.
|
|
1680
2447
|
|
|
1681
2448
|
### issueAdminCredential
|
|
1682
2449
|
|
|
@@ -1685,7 +2452,7 @@ Requires the verifier's admin secret. Pair with redeemCredential() to get a
|
|
|
1685
2452
|
JWT whose `sub` is the recipient DID you pass there.
|
|
1686
2453
|
POST {verifier}/v1/admin/credentials/issue (header: X-Admin-Secret)
|
|
1687
2454
|
|
|
1688
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
2455
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L149)
|
|
1689
2456
|
|
|
1690
2457
|
Import: `import {issueAdminCredential} from '@t3foundry/tasra-sdk'`
|
|
1691
2458
|
|
|
@@ -1775,7 +2542,7 @@ Returns: ` Promise<string> `.
|
|
|
1775
2542
|
|
|
1776
2543
|
Expiry as epoch-ms, or null if absent/unparseable.
|
|
1777
2544
|
|
|
1778
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
2545
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L293)
|
|
1779
2546
|
|
|
1780
2547
|
Import: `import {jwtExpMs} from '@t3foundry/tasra-sdk'`
|
|
1781
2548
|
|
|
@@ -1789,6 +2556,25 @@ declare function jwtExpMs(jwt: string): number | null;
|
|
|
1789
2556
|
|
|
1790
2557
|
Returns: ` number | null `.
|
|
1791
2558
|
|
|
2559
|
+
### kemContentDigest
|
|
2560
|
+
|
|
2561
|
+
Hash the complete KEM content with unambiguous field lengths.
|
|
2562
|
+
|
|
2563
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L99)
|
|
2564
|
+
|
|
2565
|
+
Import: `import {kemContentDigest} from '@t3foundry/tasra-sdk'`
|
|
2566
|
+
|
|
2567
|
+
```ts
|
|
2568
|
+
declare function kemContentDigest(ct: Ciphertext, identity: Uint8Array): Uint8Array;
|
|
2569
|
+
```
|
|
2570
|
+
|
|
2571
|
+
| Parameter | Type | Description |
|
|
2572
|
+
|---|---|---|
|
|
2573
|
+
| ` ct ` | ` Ciphertext ` | - Ciphertext including its group element, nonce and authenticated ciphertext. |
|
|
2574
|
+
| ` identity ` | ` Uint8Array ` | - Exact associated-data identity bytes used during encryption. |
|
|
2575
|
+
|
|
2576
|
+
Returns: ` Uint8Array `.
|
|
2577
|
+
|
|
1792
2578
|
### lintEnvelope
|
|
1793
2579
|
|
|
1794
2580
|
Run the schema and static gate and report whether a keeper would store the envelope today.
|
|
@@ -1855,6 +2641,27 @@ Returns: ` Promise<string> `.
|
|
|
1855
2641
|
|
|
1856
2642
|
Return details: The envelope string to pass as the slot's rule.
|
|
1857
2643
|
|
|
2644
|
+
### parseRetryAfter
|
|
2645
|
+
|
|
2646
|
+
Parse an HTTP `Retry-After` value (delta-seconds or an HTTP-date) into milliseconds.
|
|
2647
|
+
Returns undefined for a missing, malformed, negative or absurd (over one day) value; a date
|
|
2648
|
+
in the past is zero.
|
|
2649
|
+
|
|
2650
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/internal/retryAfter.ts#L12)
|
|
2651
|
+
|
|
2652
|
+
Import: `import {parseRetryAfter} from '@t3foundry/tasra-sdk'`
|
|
2653
|
+
|
|
2654
|
+
```ts
|
|
2655
|
+
declare function parseRetryAfter(value: string | null | undefined, nowMs?: number): number | undefined;
|
|
2656
|
+
```
|
|
2657
|
+
|
|
2658
|
+
| Parameter | Type | Description |
|
|
2659
|
+
|---|---|---|
|
|
2660
|
+
| ` value ` | ` string \| null \| undefined ` | Raw header value, or null/undefined when absent. |
|
|
2661
|
+
| ` nowMs? ` | ` number ` | Current time in ms, for the HTTP-date form. |
|
|
2662
|
+
|
|
2663
|
+
Returns: ` number | undefined `.
|
|
2664
|
+
|
|
1858
2665
|
### parseTasraPost
|
|
1859
2666
|
|
|
1860
2667
|
Decode a Tasra text payload into an envelope; return null for invalid input.
|
|
@@ -1880,7 +2687,7 @@ Compute the `payload_digest` for a given action and message.
|
|
|
1880
2687
|
For `sign` and `ibe-extract`, this is `sha256(message_bytes)` as 0x-hex.
|
|
1881
2688
|
Other actions should supply the digest directly.
|
|
1882
2689
|
|
|
1883
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
2690
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L249)
|
|
1884
2691
|
|
|
1885
2692
|
Import: `import {payloadDigest} from '@t3foundry/tasra-sdk'`
|
|
1886
2693
|
|
|
@@ -1897,14 +2704,14 @@ Returns: ` string `.
|
|
|
1897
2704
|
|
|
1898
2705
|
### pollOid4vpSession
|
|
1899
2706
|
|
|
1900
|
-
Fetch and validate one authorization session status. Transport failures and HTTP 502, 503 or 504 produce an unavailable error; malformed or other failed replies produce a protocol error. The polling secret is sent in the Authorization header.
|
|
2707
|
+
Fetch and validate one authorization session status. Transport failures, a request that exceeds its timeout and HTTP 502, 503 or 504 produce an unavailable error; malformed or other failed replies produce a protocol error; an aborted signal produces a cancelled error. The polling secret is sent in the Authorization header.
|
|
1901
2708
|
|
|
1902
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
2709
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L483)
|
|
1903
2710
|
|
|
1904
2711
|
Import: `import {pollOid4vpSession} from '@t3foundry/tasra-sdk'`
|
|
1905
2712
|
|
|
1906
2713
|
```ts
|
|
1907
|
-
declare function pollOid4vpSession(verifierAgentUrl: string, sessionId: string, pollSecret: string): Promise<SessionStatusResult>;
|
|
2714
|
+
declare function pollOid4vpSession(verifierAgentUrl: string, sessionId: string, pollSecret: string, opts?: PollSessionOpts): Promise<SessionStatusResult>;
|
|
1908
2715
|
```
|
|
1909
2716
|
|
|
1910
2717
|
| Parameter | Type | Description |
|
|
@@ -1912,15 +2719,36 @@ declare function pollOid4vpSession(verifierAgentUrl: string, sessionId: string,
|
|
|
1912
2719
|
| ` verifierAgentUrl ` | ` string ` | - Verifier-agent HTTP base URL. |
|
|
1913
2720
|
| ` sessionId ` | ` string ` | - Opened session identifier. |
|
|
1914
2721
|
| ` pollSecret ` | ` string ` | - Secret returned at session creation; do not expose it in logs. |
|
|
2722
|
+
| ` opts? ` | ` PollSessionOpts ` | - Long-poll request, cancellation and per-request timeout. |
|
|
1915
2723
|
|
|
1916
2724
|
Returns: ` Promise<SessionStatusResult> `.
|
|
1917
2725
|
|
|
2726
|
+
### recipientPayloadDigest
|
|
2727
|
+
|
|
2728
|
+
Bind a content digest to the ciphertext epoch and client recipient.
|
|
2729
|
+
|
|
2730
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L108)
|
|
2731
|
+
|
|
2732
|
+
Import: `import {recipientPayloadDigest} from '@t3foundry/tasra-sdk'`
|
|
2733
|
+
|
|
2734
|
+
```ts
|
|
2735
|
+
declare function recipientPayloadDigest(content: Uint8Array, epoch: number, recipient: RecipientWire): Uint8Array;
|
|
2736
|
+
```
|
|
2737
|
+
|
|
2738
|
+
| Parameter | Type | Description |
|
|
2739
|
+
|---|---|---|
|
|
2740
|
+
| ` content ` | ` Uint8Array ` | - Complete 32-byte KEM content digest or SHA-256 IBE identity digest. |
|
|
2741
|
+
| ` epoch ` | ` number ` | - Nonnegative canonical ciphertext key epoch. |
|
|
2742
|
+
| ` recipient ` | ` RecipientWire ` | - Supported suite and client X25519 public key. |
|
|
2743
|
+
|
|
2744
|
+
Returns: ` Uint8Array `.
|
|
2745
|
+
|
|
1918
2746
|
### redeemCredential
|
|
1919
2747
|
|
|
1920
2748
|
Redeem an admin-issued, single-use credential/invite token for a JWT.
|
|
1921
2749
|
POST {verifier}/v1/credentials/redeem {redemption_token, recipient_did}
|
|
1922
2750
|
|
|
1923
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
2751
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L117)
|
|
1924
2752
|
|
|
1925
2753
|
Import: `import {redeemCredential} from '@t3foundry/tasra-sdk'`
|
|
1926
2754
|
|
|
@@ -1941,7 +2769,7 @@ Returns: ` Promise<IssuedToken> `.
|
|
|
1941
2769
|
Redeem a long-lived renewal token for a fresh JWT.
|
|
1942
2770
|
POST {verifier}/v1/renewals/redeem {renewal_token}
|
|
1943
2771
|
|
|
1944
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
2772
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L99)
|
|
1945
2773
|
|
|
1946
2774
|
Import: `import {redeemRenewalToken} from '@t3foundry/tasra-sdk'`
|
|
1947
2775
|
|
|
@@ -1963,7 +2791,7 @@ down are skipped; throws - naming every node and its reason - only when NONE ser
|
|
|
1963
2791
|
The caller combines with `ibeCombineDecrypt`/`ibeCombineExtract`, which pairing-verify
|
|
1964
2792
|
each partial (identifiable abort names the node via the identifier).
|
|
1965
2793
|
|
|
1966
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#
|
|
2794
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#L770)
|
|
1967
2795
|
|
|
1968
2796
|
Import: `import {requestIbeExtractionPartials} from '@t3foundry/tasra-sdk'`
|
|
1969
2797
|
|
|
@@ -1977,12 +2805,83 @@ declare function requestIbeExtractionPartials(opts: IbeExtractOpts): Promise<Ibe
|
|
|
1977
2805
|
|
|
1978
2806
|
Returns: ` Promise<IbeExtractionPartial[]> `.
|
|
1979
2807
|
|
|
2808
|
+
### retryDelayMs
|
|
2809
|
+
|
|
2810
|
+
The wait before the next attempt, or undefined when the policy says to stop.
|
|
2811
|
+
A service `Retry-After` is a floor: the wait adds up to 20% (max 1 s) of jitter on top so
|
|
2812
|
+
that refused clients do not return in lockstep, and it is never shortened. A requested wait
|
|
2813
|
+
above `maxDelayMs` or beyond the remaining total budget stops retrying instead.
|
|
2814
|
+
Without a header the wait is full-jitter exponential backoff from `baseDelayMs`.
|
|
2815
|
+
|
|
2816
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L73)
|
|
2817
|
+
|
|
2818
|
+
Import: `import {retryDelayMs} from '@t3foundry/tasra-sdk'`
|
|
2819
|
+
|
|
2820
|
+
```ts
|
|
2821
|
+
declare function retryDelayMs(attempt: number, retryAfterMs: number | undefined, policy?: RetryPolicy, waitedMs?: number): number | undefined;
|
|
2822
|
+
```
|
|
2823
|
+
|
|
2824
|
+
| Parameter | Type | Description |
|
|
2825
|
+
|---|---|---|
|
|
2826
|
+
| ` attempt ` | ` number ` | Zero-based index of the attempt that just failed. |
|
|
2827
|
+
| ` retryAfterMs ` | ` number \| undefined ` | Service-requested wait, when any. |
|
|
2828
|
+
| ` policy? ` | ` RetryPolicy ` | Retry limits. |
|
|
2829
|
+
| ` waitedMs? ` | ` number ` | Sum of the waits already spent on this request. |
|
|
2830
|
+
|
|
2831
|
+
Returns: ` number | undefined `.
|
|
2832
|
+
|
|
2833
|
+
### retryIdempotent
|
|
2834
|
+
|
|
2835
|
+
Send one idempotent request, waiting between attempts as the service and policy allow.
|
|
2836
|
+
The last failure is rethrown unchanged when the policy is exhausted, the classification says
|
|
2837
|
+
stop, or the requested wait is longer than allowed. Only wrap a request that is safe to send
|
|
2838
|
+
again; this function cannot tell.
|
|
2839
|
+
|
|
2840
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L139)
|
|
2841
|
+
|
|
2842
|
+
Import: `import {retryIdempotent} from '@t3foundry/tasra-sdk'`
|
|
2843
|
+
|
|
2844
|
+
```ts
|
|
2845
|
+
declare function retryIdempotent<T>(work: (attempt: number) => Promise<T>, options?: {
|
|
2846
|
+
policy?: RetryPolicy;
|
|
2847
|
+
signal?: AbortSignal;
|
|
2848
|
+
classify?: (error: unknown) => RetryDecision;
|
|
2849
|
+
onRetry?: (event: {
|
|
2850
|
+
attempt: number;
|
|
2851
|
+
delayMs: number;
|
|
2852
|
+
error: unknown;
|
|
2853
|
+
}) => void;
|
|
2854
|
+
}): Promise<T>;
|
|
2855
|
+
```
|
|
2856
|
+
|
|
2857
|
+
| Parameter | Type | Description |
|
|
2858
|
+
|---|---|---|
|
|
2859
|
+
| ` work ` | ` (attempt: number) => Promise<T> ` | Sends the identical request; receives the zero-based attempt number. |
|
|
2860
|
+
| ` options? ` | See detailed type below. | Policy, cancellation and an optional classifier (default [classifyRetry](#classifyretry)). |
|
|
2861
|
+
|
|
2862
|
+
**` options? ` type**
|
|
2863
|
+
|
|
2864
|
+
```ts
|
|
2865
|
+
{
|
|
2866
|
+
policy?: RetryPolicy;
|
|
2867
|
+
signal?: AbortSignal;
|
|
2868
|
+
classify?: (error: unknown) => RetryDecision;
|
|
2869
|
+
onRetry?: (event: {
|
|
2870
|
+
attempt: number;
|
|
2871
|
+
delayMs: number;
|
|
2872
|
+
error: unknown;
|
|
2873
|
+
}) => void;
|
|
2874
|
+
}
|
|
2875
|
+
```
|
|
2876
|
+
|
|
2877
|
+
Returns: ` Promise<T> `.
|
|
2878
|
+
|
|
1980
2879
|
### revokeRenewal
|
|
1981
2880
|
|
|
1982
2881
|
Revoke a renewal token - future redeems are denied, and any bound slots get a
|
|
1983
2882
|
rotation webhook. POST {verifier}/v1/renewals/revoke {renewal_token}
|
|
1984
2883
|
|
|
1985
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
2884
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L81)
|
|
1986
2885
|
|
|
1987
2886
|
Import: `import {revokeRenewal} from '@t3foundry/tasra-sdk'`
|
|
1988
2887
|
|
|
@@ -2004,7 +2903,7 @@ Rotation is requested by default. A successful HTTP response confirms request
|
|
|
2004
2903
|
acceptance only; callers must confirm the new slot key and epoch before relying
|
|
2005
2904
|
on completed rotation. Resolve application handles to DIDs before calling.
|
|
2006
2905
|
|
|
2007
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
2906
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L179)
|
|
2008
2907
|
|
|
2009
2908
|
Import: `import {revokeSlotUser} from '@t3foundry/tasra-sdk'`
|
|
2010
2909
|
|
|
@@ -2177,7 +3076,7 @@ Throws `VerifierAgentSessionError`: `refused` when the agent reports the session
|
|
|
2177
3076
|
(the committee refused, or could not be reached — `message` says which; not retryable on
|
|
2178
3077
|
this session), `unavailable` for other 502/503/504, `protocol` for any other non-2xx.
|
|
2179
3078
|
|
|
2180
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
3079
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L387)
|
|
2181
3080
|
|
|
2182
3081
|
Import: `import {submitOauthResponse} from '@t3foundry/tasra-sdk'`
|
|
2183
3082
|
|
|
@@ -2300,7 +3199,7 @@ Returns: ` void `.
|
|
|
2300
3199
|
|
|
2301
3200
|
Check a partial decryption against its supplied verifying share using a pairing. Return false for missing or malformed material.
|
|
2302
3201
|
|
|
2303
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#
|
|
3202
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L261)
|
|
2304
3203
|
|
|
2305
3204
|
Import: `import {verifyDecryptShare} from '@t3foundry/tasra-sdk'`
|
|
2306
3205
|
|
|
@@ -2344,7 +3243,7 @@ verifier (a DCQL rule + a presentation/credentials); we pass it through
|
|
|
2344
3243
|
untouched so this stays agnostic to the credential format.
|
|
2345
3244
|
POST {verifier}/v1/verify
|
|
2346
3245
|
|
|
2347
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
3246
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L210)
|
|
2348
3247
|
|
|
2349
3248
|
Import: `import {verifyPresentation} from '@t3foundry/tasra-sdk'`
|
|
2350
3249
|
|
|
@@ -2352,14 +3251,13 @@ Import: `import {verifyPresentation} from '@t3foundry/tasra-sdk'`
|
|
|
2352
3251
|
declare function verifyPresentation(verifierUrl: string, body: {
|
|
2353
3252
|
dcql_rule: string;
|
|
2354
3253
|
presentation: unknown;
|
|
2355
|
-
credentials?: unknown;
|
|
2356
3254
|
}): Promise<IssuedToken>;
|
|
2357
3255
|
```
|
|
2358
3256
|
|
|
2359
3257
|
| Parameter | Type | Description |
|
|
2360
3258
|
|---|---|---|
|
|
2361
3259
|
| ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
|
|
2362
|
-
| ` body ` | ` { dcql_rule: string; presentation: unknown;
|
|
3260
|
+
| ` body ` | ` { dcql_rule: string; presentation: unknown; } ` | - Policy and credential presentation for verifier evaluation. |
|
|
2363
3261
|
|
|
2364
3262
|
Returns: ` Promise<IssuedToken> `.
|
|
2365
3263
|
|
|
@@ -2373,7 +3271,7 @@ evaluates the rule. `credentials` are compact JWS strings (e.g. from
|
|
|
2373
3271
|
`tasra-cli vc issue`).
|
|
2374
3272
|
POST {verifier}/v1/verify-vp-jwt
|
|
2375
3273
|
|
|
2376
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
3274
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L234)
|
|
2377
3275
|
|
|
2378
3276
|
Import: `import {verifyVpJwt} from '@t3foundry/tasra-sdk'`
|
|
2379
3277
|
|
|
@@ -2397,12 +3295,18 @@ Returns: ` Promise<IssuedToken> `.
|
|
|
2397
3295
|
|
|
2398
3296
|
Poll until the session reaches a terminal state (done or failed) - bounded by
|
|
2399
3297
|
`timeoutMs`, with a growing jittered interval so many clients never poll in lock-step.
|
|
3298
|
+
Every request asks the verifier-agent to hold its reply until the session moves
|
|
3299
|
+
(`?wait=1`). A reply whose phase moved forward is followed by the next request at once;
|
|
3300
|
+
an unchanged reply is followed by the backoff sleep, unless it took 15 s or more (the
|
|
3301
|
+
server's hold ended), when the next request also goes at once. A server without long-poll
|
|
3302
|
+
support answers at once and is polled on the backoff schedule. Any phase change resets the
|
|
3303
|
+
backoff to `intervalMs`.
|
|
2400
3304
|
A transient `unavailable` answer (a 503, a dropped connection) is retried within the
|
|
2401
3305
|
deadline; a `protocol` answer stops at once; the deadline is a `timeout` error; the
|
|
2402
3306
|
caller's `signal` is a `cancelled` error. A terminal `failed` is RETURNED (the caller
|
|
2403
3307
|
decides how to explain it) - see `awaitVerifierAgentResult` for the version that throws `refused`.
|
|
2404
3308
|
|
|
2405
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
3309
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L620)
|
|
2406
3310
|
|
|
2407
3311
|
Import: `import {waitForSession} from '@t3foundry/tasra-sdk'`
|
|
2408
3312
|
|
|
@@ -2426,12 +3330,13 @@ Returns: ` Promise<SessionStatusResult> `.
|
|
|
2426
3330
|
Options, data structures and return types.
|
|
2427
3331
|
|
|
2428
3332
|
<details>
|
|
2429
|
-
<summary>Browse
|
|
3333
|
+
<summary>Browse 83 types</summary>
|
|
2430
3334
|
|
|
2431
3335
|
- [BlsPeer](#blspeer)
|
|
2432
3336
|
- [BuildHolderProofOpts](#buildholderproofopts)
|
|
2433
3337
|
- [Ciphertext](#ciphertext)
|
|
2434
3338
|
- [ClaimResult](#claimresult)
|
|
3339
|
+
- [ClientRecipient](#clientrecipient)
|
|
2435
3340
|
- [CreateOauthSessionResult](#createoauthsessionresult)
|
|
2436
3341
|
- [CreateSessionParams](#createsessionparams)
|
|
2437
3342
|
- [CreateSessionResult](#createsessionresult)
|
|
@@ -2443,6 +3348,7 @@ Options, data structures and return types.
|
|
|
2443
3348
|
- [DcqlQuery](#dcqlquery)
|
|
2444
3349
|
- [DcqlSelection](#dcqlselection)
|
|
2445
3350
|
- [DecryptCustodyOpts](#decryptcustodyopts)
|
|
3351
|
+
- [DecryptionBindingWire](#decryptionbindingwire)
|
|
2446
3352
|
- [DecryptShare](#decryptshare)
|
|
2447
3353
|
- [DpopKey](#dpopkey)
|
|
2448
3354
|
- [DpopSigner](#dpopsigner)
|
|
@@ -2477,13 +3383,24 @@ Options, data structures and return types.
|
|
|
2477
3383
|
- [OauthTokens](#oauthtokens)
|
|
2478
3384
|
- [OauthTokenSpec](#oauthtokenspec)
|
|
2479
3385
|
- [OpenSessionOpts](#opensessionopts)
|
|
3386
|
+
- [PaidApprovalUnresolvedReason](#paidapprovalunresolvedreason)
|
|
3387
|
+
- [PaidBackoffCode](#paidbackoffcode)
|
|
3388
|
+
- [PollSessionOpts](#pollsessionopts)
|
|
3389
|
+
- [PrepaidEscapeCode](#prepaidescapecode)
|
|
2480
3390
|
- [PresentationDelegation](#presentationdelegation)
|
|
2481
3391
|
- [PresentationOperation](#presentationoperation)
|
|
3392
|
+
- [RecipientWire](#recipientwire)
|
|
2482
3393
|
- [RedemptionGrant](#redemptiongrant)
|
|
2483
3394
|
- [RegoEngine](#regoengine)
|
|
2484
3395
|
- [RenewalGrant](#renewalgrant)
|
|
3396
|
+
- [RetryDecision](#retrydecision)
|
|
3397
|
+
- [RetryPolicy](#retrypolicy)
|
|
3398
|
+
- [RevocationStatusPreflightCode](#revocationstatuspreflightcode)
|
|
2485
3399
|
- [ScopeNamespace](#scopenamespace)
|
|
2486
3400
|
- [SealedBlob](#sealedblob)
|
|
3401
|
+
- [SealedPartial](#sealedpartial)
|
|
3402
|
+
- [SealedRequestOpts](#sealedrequestopts)
|
|
3403
|
+
- [SealedShareWire](#sealedsharewire)
|
|
2487
3404
|
- [Session](#session)
|
|
2488
3405
|
- [SessionAuth](#sessionauth)
|
|
2489
3406
|
- [SessionStatusResult](#sessionstatusresult)
|
|
@@ -2491,6 +3408,8 @@ Options, data structures and return types.
|
|
|
2491
3408
|
- [ShardSignOpts](#shardsignopts)
|
|
2492
3409
|
- [SignCustodyOpts](#signcustodyopts)
|
|
2493
3410
|
- [SignOpts](#signopts)
|
|
3411
|
+
- [StatusRefreshCode](#statusrefreshcode)
|
|
3412
|
+
- [StatusRefreshFailure](#statusrefreshfailure)
|
|
2494
3413
|
- [TasraClient](#tasraclient)
|
|
2495
3414
|
- [TasraClientConfig](#tasraclientconfig)
|
|
2496
3415
|
- [UnpackedEnvelope](#unpackedenvelope)
|
|
@@ -2501,9 +3420,9 @@ Options, data structures and return types.
|
|
|
2501
3420
|
|
|
2502
3421
|
### BlsPeer
|
|
2503
3422
|
|
|
2504
|
-
|
|
3423
|
+
Legacy input retained for explicit runtime refusal.
|
|
2505
3424
|
|
|
2506
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#
|
|
3425
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L5)
|
|
2507
3426
|
|
|
2508
3427
|
```ts
|
|
2509
3428
|
export interface BlsPeer {
|
|
@@ -2521,7 +3440,7 @@ Fields:
|
|
|
2521
3440
|
|
|
2522
3441
|
Holder signing key, verifier challenge and credentials to bind into a proof.
|
|
2523
3442
|
|
|
2524
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#
|
|
3443
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L114)
|
|
2525
3444
|
|
|
2526
3445
|
```ts
|
|
2527
3446
|
export interface BuildHolderProofOpts {
|
|
@@ -2551,7 +3470,7 @@ Fields:
|
|
|
2551
3470
|
|
|
2552
3471
|
BLS group encryption ciphertext containing an ephemeral key, nonce and authenticated payload.
|
|
2553
3472
|
|
|
2554
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#
|
|
3473
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L129)
|
|
2555
3474
|
|
|
2556
3475
|
```ts
|
|
2557
3476
|
export interface Ciphertext {
|
|
@@ -2586,11 +3505,29 @@ Fields:
|
|
|
2586
3505
|
|
|
2587
3506
|
- **` found `**: Whether the claim path resolves; a present JSON null value counts as found.
|
|
2588
3507
|
|
|
3508
|
+
### ClientRecipient
|
|
3509
|
+
|
|
3510
|
+
Client-held opening capability; only its public recipient belongs in requests or journals.
|
|
3511
|
+
|
|
3512
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L39)
|
|
3513
|
+
|
|
3514
|
+
```ts
|
|
3515
|
+
export interface ClientRecipient {
|
|
3516
|
+
readonly recipient: RecipientWire;
|
|
3517
|
+
open(sealed: SealedShareWire, requestHash: Uint8Array, identifier: number, epoch: number, verifyingShare: Uint8Array): Promise<Uint8Array>;
|
|
3518
|
+
}
|
|
3519
|
+
```
|
|
3520
|
+
|
|
3521
|
+
Fields:
|
|
3522
|
+
|
|
3523
|
+
- **` recipient `**: Public recipient metadata that authorization must bind before any keeper work.
|
|
3524
|
+
- **` open `**: Open one contribution locally using the exact authorized request and keeper context. The caller must pairing-verify the recovered contribution and clear it after use.
|
|
3525
|
+
|
|
2589
3526
|
### CreateOauthSessionResult
|
|
2590
3527
|
|
|
2591
3528
|
an `oauth` session - the client brings a DPoP-bound access token.
|
|
2592
3529
|
|
|
2593
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
3530
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L93)
|
|
2594
3531
|
|
|
2595
3532
|
```ts
|
|
2596
3533
|
export interface CreateOauthSessionResult {
|
|
@@ -2614,10 +3551,13 @@ Fields:
|
|
|
2614
3551
|
|
|
2615
3552
|
Signed operation, optional delegation and payload submitted to the verifier agent.
|
|
2616
3553
|
|
|
2617
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
3554
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L63)
|
|
2618
3555
|
|
|
2619
3556
|
```ts
|
|
2620
3557
|
export interface CreateSessionParams {
|
|
3558
|
+
decryption?: DecryptionBindingWire;
|
|
3559
|
+
payment?: PaymentIntentWire;
|
|
3560
|
+
random?: string;
|
|
2621
3561
|
operation: PresentationOperation;
|
|
2622
3562
|
operationSig: string;
|
|
2623
3563
|
delegation?: PresentationDelegation;
|
|
@@ -2627,6 +3567,9 @@ export interface CreateSessionParams {
|
|
|
2627
3567
|
|
|
2628
3568
|
Fields:
|
|
2629
3569
|
|
|
3570
|
+
- **` decryption `**: Public decryption binding committed by the signed operation; never include private recipient material.
|
|
3571
|
+
- **` payment `**: Creator-signed intent for an already reserved TASRA payment. Requires random.
|
|
3572
|
+
- **` random `**: Fixed 32-byte hex presentation random committed before reservation.
|
|
2630
3573
|
- **` operation `**: Signed operation details presented for authorization.
|
|
2631
3574
|
- **` operationSig `**: 0x-hex 65-byte EIP-712 signature over the operation
|
|
2632
3575
|
- **` delegation `**: Optional EIP-712 delegation from the slot creator
|
|
@@ -2636,7 +3579,7 @@ Fields:
|
|
|
2636
3579
|
|
|
2637
3580
|
Wallet presentation link and polling credentials for an opened authorization session.
|
|
2638
3581
|
|
|
2639
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
3582
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L81)
|
|
2640
3583
|
|
|
2641
3584
|
```ts
|
|
2642
3585
|
export interface CreateSessionResult {
|
|
@@ -2798,9 +3741,9 @@ Fields:
|
|
|
2798
3741
|
|
|
2799
3742
|
### DecryptCustodyOpts
|
|
2800
3743
|
|
|
2801
|
-
|
|
3744
|
+
Legacy input retained for explicit runtime refusal.
|
|
2802
3745
|
|
|
2803
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#
|
|
3746
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L13)
|
|
2804
3747
|
|
|
2805
3748
|
```ts
|
|
2806
3749
|
export interface DecryptCustodyOpts {
|
|
@@ -2832,11 +3775,31 @@ Fields:
|
|
|
2832
3775
|
- **` targetKeykeeper `**: Optional 20-byte operator address to pin the intended keeper.
|
|
2833
3776
|
- **` requestId `**: Request identifier used to correlate or resume the operation.
|
|
2834
3777
|
|
|
3778
|
+
### DecryptionBindingWire
|
|
3779
|
+
|
|
3780
|
+
Public decryption context included in the signed authorization session.
|
|
3781
|
+
|
|
3782
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L23)
|
|
3783
|
+
|
|
3784
|
+
```ts
|
|
3785
|
+
export interface DecryptionBindingWire {
|
|
3786
|
+
recipient: RecipientWire;
|
|
3787
|
+
ciphertext_epoch: number;
|
|
3788
|
+
content_digest?: string;
|
|
3789
|
+
}
|
|
3790
|
+
```
|
|
3791
|
+
|
|
3792
|
+
Fields:
|
|
3793
|
+
|
|
3794
|
+
- **` recipient `**: Client recipient to which every keeper seals its contribution.
|
|
3795
|
+
- **` ciphertext_epoch `**: Nonnegative canonical key epoch of the ciphertext.
|
|
3796
|
+
- **` content_digest `**: Hex-encoded content digest: complete KEM ciphertext and identity, or SHA-256 of the IBE identity.
|
|
3797
|
+
|
|
2835
3798
|
### DecryptShare
|
|
2836
3799
|
|
|
2837
3800
|
One participant's partial BLS decryption and optional public verification material.
|
|
2838
3801
|
|
|
2839
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#
|
|
3802
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L242)
|
|
2840
3803
|
|
|
2841
3804
|
```ts
|
|
2842
3805
|
export interface DecryptShare {
|
|
@@ -3181,7 +4144,7 @@ Fields:
|
|
|
3181
4144
|
|
|
3182
4145
|
Single-use verifier challenge, expiry and optional disclosed slot policy.
|
|
3183
4146
|
|
|
3184
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#
|
|
4147
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L49)
|
|
3185
4148
|
|
|
3186
4149
|
```ts
|
|
3187
4150
|
export interface HolderNonce {
|
|
@@ -3233,7 +4196,7 @@ A signer for the holder DID's `authentication` key. Either the SDK holds the raw
|
|
|
3233
4196
|
Ed25519 secret, or the caller supplies a `sign` callback (HSM / wallet / WebCrypto)
|
|
3234
4197
|
that returns the raw JWS signature bytes for the given signing input.
|
|
3235
4198
|
|
|
3236
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#
|
|
4199
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L101)
|
|
3237
4200
|
|
|
3238
4201
|
```ts
|
|
3239
4202
|
export type HolderSigner = {
|
|
@@ -3293,7 +4256,7 @@ Fields:
|
|
|
3293
4256
|
|
|
3294
4257
|
Encrypted message - wire shape of `bls::ibe::Ciphertext`.
|
|
3295
4258
|
|
|
3296
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#
|
|
4259
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L47)
|
|
3297
4260
|
|
|
3298
4261
|
```ts
|
|
3299
4262
|
export interface IbeCiphertext {
|
|
@@ -3313,7 +4276,7 @@ Fields:
|
|
|
3313
4276
|
|
|
3314
4277
|
One node's partial `D_i = sk_i * Q_ID` (48-byte compressed G1).
|
|
3315
4278
|
|
|
3316
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#
|
|
4279
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L57)
|
|
3317
4280
|
|
|
3318
4281
|
```ts
|
|
3319
4282
|
export interface IbeDecryptionShare {
|
|
@@ -3331,7 +4294,7 @@ Fields:
|
|
|
3331
4294
|
|
|
3332
4295
|
One node's extraction partial, decoded from the wire.
|
|
3333
4296
|
|
|
3334
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#
|
|
4297
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#L621)
|
|
3335
4298
|
|
|
3336
4299
|
```ts
|
|
3337
4300
|
export interface IbeExtractionPartial {
|
|
@@ -3359,10 +4322,17 @@ Fields:
|
|
|
3359
4322
|
|
|
3360
4323
|
Committee authorization and keeper endpoints for extracting shares of one IBE identity key.
|
|
3361
4324
|
|
|
3362
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#
|
|
4325
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#L639)
|
|
3363
4326
|
|
|
3364
4327
|
```ts
|
|
3365
4328
|
export interface IbeExtractOpts {
|
|
4329
|
+
recipient?: ClientRecipient;
|
|
4330
|
+
chainId?: number | bigint;
|
|
4331
|
+
verifyingShares?: ReadonlyMap<number, Uint8Array>;
|
|
4332
|
+
evidenceCt?: string;
|
|
4333
|
+
threshold?: number;
|
|
4334
|
+
timeoutMs?: number;
|
|
4335
|
+
approveExecution?: KeeperExecutionApprover;
|
|
3366
4336
|
signal?: AbortSignal;
|
|
3367
4337
|
fetchImpl?: typeof fetch;
|
|
3368
4338
|
nodeUrls: string[];
|
|
@@ -3371,14 +4341,18 @@ export interface IbeExtractOpts {
|
|
|
3371
4341
|
userSignature?: Uint8Array;
|
|
3372
4342
|
ciphertextEpoch?: number;
|
|
3373
4343
|
verifierProofs?: VerifierProof[];
|
|
3374
|
-
clientPubkey?: Uint8Array;
|
|
3375
|
-
clientSignature?: Uint8Array;
|
|
3376
|
-
evidenceCt?: string;
|
|
3377
4344
|
}
|
|
3378
4345
|
```
|
|
3379
4346
|
|
|
3380
4347
|
Fields:
|
|
3381
4348
|
|
|
4349
|
+
- **` recipient `**: Original client-held recipient bound before authorization; required at runtime.
|
|
4350
|
+
- **` chainId `**: Deployment chain identifier used to validate the signed recipient-bound request hash.
|
|
4351
|
+
- **` verifyingShares `**: Independently authenticated 144-byte G2 || G1 public shares; reply-supplied keys alone are insufficient.
|
|
4352
|
+
- **` evidenceCt `**: Exact sealed presentation ciphertext returned with this authorization.
|
|
4353
|
+
- **` threshold `**: Stop after this many distinct, pairing-verified shares. Without this option, collect every successful reply. The low-level check uses returned verifying shares; use extractIdentityStrict for independently pinned keeper provenance.
|
|
4354
|
+
- **` timeoutMs `**: Deadline for the complete fan-out, including approvals and response bodies. Default 10000 ms. Cancellation cannot undo work a keeper already started.
|
|
4355
|
+
- **` approveExecution `**: Required for paid extraction: approve only the exact targeted assigned contributor.
|
|
3382
4356
|
- **` signal `**: Optional signal that cancels the request.
|
|
3383
4357
|
- **` fetchImpl `**: HTTP transport override; defaults to the global fetch implementation.
|
|
3384
4358
|
- **` nodeUrls `**: Base URLs of at least k keeper nodes holding the slot's BLS shards.
|
|
@@ -3387,18 +4361,22 @@ Fields:
|
|
|
3387
4361
|
- **` userSignature `**: Owner signature over `keccak256("keykeeper:ibe-extract:v1" || identity)` when the slot has a registered `user_pubkey`.
|
|
3388
4362
|
- **` ciphertextEpoch `**: Expected key epoch of the ciphertext; used to detect rotation.
|
|
3389
4363
|
- **` verifierProofs `**: Verifier membership proofs for the selected snapshot.
|
|
3390
|
-
- **` clientPubkey `**: 32-byte Ed25519 client public key used to verify clientSignature; supply both fields together.
|
|
3391
|
-
- **` clientSignature `**: Client signature over the slot and compound token binding.
|
|
3392
|
-
- **` evidenceCt `**: the sealed presentation beside the token (`VerifierAgentResult.evidenceCt`), posted as `evidence_ct`. Required by a keeper with `require_committee_evidence`.
|
|
3393
4364
|
|
|
3394
4365
|
### IbeExtractRequestOpts
|
|
3395
4366
|
|
|
3396
4367
|
Operation-specific fields for [ibeDecryptRequest](#ibedecryptrequest) / [ibeExtractRequest](#ibeextractrequest).
|
|
3397
4368
|
|
|
3398
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#
|
|
4369
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#L465)
|
|
3399
4370
|
|
|
3400
4371
|
```ts
|
|
3401
4372
|
export interface IbeExtractRequestOpts extends RequestCommitteeTokenOpts {
|
|
4373
|
+
recipient?: ClientRecipient;
|
|
4374
|
+
verifyingShares?: ReadonlyMap<number, Uint8Array>;
|
|
4375
|
+
threshold?: number;
|
|
4376
|
+
timeoutMs?: number;
|
|
4377
|
+
signal?: AbortSignal;
|
|
4378
|
+
fetchImpl?: typeof fetch;
|
|
4379
|
+
approveExecution?: KeeperExecutionApprover;
|
|
3402
4380
|
nodeUrls: string[];
|
|
3403
4381
|
identity: string;
|
|
3404
4382
|
userSignature?: Uint8Array;
|
|
@@ -3408,10 +4386,19 @@ export interface IbeExtractRequestOpts extends RequestCommitteeTokenOpts {
|
|
|
3408
4386
|
|
|
3409
4387
|
Fields:
|
|
3410
4388
|
|
|
4389
|
+
- **` recipient `**: Original client-held recipient bound by the authorization; required at runtime.
|
|
4390
|
+
- **` verifyingShares `**: Independently authenticated 144-byte G2 || G1 public shares indexed by participant identifier.
|
|
4391
|
+
- **` threshold `**: Keeper threshold from independently read slot metadata. When supplied, finish after that many distinct pairing-verified shares, cancelling the rest.
|
|
4392
|
+
- **` timeoutMs `**: Keeper extraction deadline in milliseconds; default 10000.
|
|
4393
|
+
- **` signal `**: Cancel the extraction fan-out. Does not undo already started keeper work.
|
|
4394
|
+
- **` fetchImpl `**: HTTP transport override for keeper extraction requests.
|
|
4395
|
+
- **` approveExecution `**: Client-owned exact-body approval capability for each paid extraction contributor.
|
|
3411
4396
|
- **` nodeUrls `**: Base URLs of at least k keeper nodes holding the slot's BLS shards.
|
|
3412
4397
|
- **` identity `**: The IBE identity to extract for - becomes the token's `scopedIdentity`, so a quorum attests exactly this identity and the keepers enforce the hash binding.
|
|
3413
4398
|
- **` userSignature `**: Owner signature over the identity-bound extract marker, when the slot has one.
|
|
3414
4399
|
- **` ciphertextEpoch `**: Expected key epoch of the ciphertext; used to detect rotation.
|
|
4400
|
+
- **` binding `**: Exact chain-, slot-, action- and payload-bound authorization preimage; decryption must include the recipient-bound digest.
|
|
4401
|
+
- **` payment `**: Original creator-signed payment intent for the already reserved operation.
|
|
3415
4402
|
- **` chain `**: Reader methods for the beacon and slot verifier policy.
|
|
3416
4403
|
- **` epochLag `**: Pin the draw to `latest - epochLag` (0 or 1). 1 = the previous epoch, always anchored: no wait for the accountants.
|
|
3417
4404
|
- **` verifiers `**: The active verifier set (index to URL; add operator+pubkey to enable trustless proofs). Asking the whole set is fine - non-drawn verifiers reply 403 and are skipped.
|
|
@@ -3423,14 +4410,13 @@ Fields:
|
|
|
3423
4410
|
- **` tokenType `**: Token type - default `'JWT'`.
|
|
3424
4411
|
- **` ttlSecs `**: Token TTL in seconds - default 300.
|
|
3425
4412
|
- **` nowSecs `**: Override "now" (unix seconds), mainly for tests.
|
|
3426
|
-
- **` clientSigner `**: sign the request bundle with the holder's key so the keeper + audit can verify the user authorized this operation. Omit to skip (keeper accepts unless it requires it).
|
|
3427
4413
|
- **` scopedIdentity `**: Identity string for an IBE-scoped operation. Verifiers bind its hash into the token and evaluate the credential scope. Omit for group signing and group decryption; ciphertext associated data is a separate field.
|
|
3428
4414
|
|
|
3429
4415
|
### IbeVerifyingShares
|
|
3430
4416
|
|
|
3431
4417
|
A node's dual-group verifying share - only the 96-byte G2 half is needed here.
|
|
3432
4418
|
|
|
3433
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#
|
|
4419
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L65)
|
|
3434
4420
|
|
|
3435
4421
|
```ts
|
|
3436
4422
|
export type IbeVerifyingShares = ReadonlyMap<number, Uint8Array>;
|
|
@@ -3440,7 +4426,7 @@ export type IbeVerifyingShares = ReadonlyMap<number, Uint8Array>;
|
|
|
3440
4426
|
|
|
3441
4427
|
Verifier-issued bearer JWT with its holder identifier and expiry in Unix seconds.
|
|
3442
4428
|
|
|
3443
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
4429
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L13)
|
|
3444
4430
|
|
|
3445
4431
|
```ts
|
|
3446
4432
|
export interface IssuedToken {
|
|
@@ -3460,7 +4446,7 @@ Fields:
|
|
|
3460
4446
|
|
|
3461
4447
|
Decoded JWT claims for local inspection. Their presence does not establish signature validity.
|
|
3462
4448
|
|
|
3463
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
4449
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L252)
|
|
3464
4450
|
|
|
3465
4451
|
```ts
|
|
3466
4452
|
export interface JwtClaims {
|
|
@@ -3595,11 +4581,86 @@ Fields:
|
|
|
3595
4581
|
- **` identity `**: AAD for envelopes this session encrypts. Default = the 32-byte slot id.
|
|
3596
4582
|
- **` skewMs `**: JWT refresh skew (ms) for isJwtExpiringSoon. Default 30_000.
|
|
3597
4583
|
|
|
4584
|
+
### PaidApprovalUnresolvedReason
|
|
4585
|
+
|
|
4586
|
+
Why a retained paid approval was not (re)sent (see [PaidApprovalUnresolvedError](#paidapprovalunresolvederror)).
|
|
4587
|
+
- `claim_lost`: another caller already claimed this send generation.
|
|
4588
|
+
- `generation_moved`: the durable permit is no longer for this generation.
|
|
4589
|
+
- `outcome_unknown`: a send had no definite answer (transport error, timeout, abort) or a
|
|
4590
|
+
generation is recorded in flight; it is never resent.
|
|
4591
|
+
- `no_permit`: there is no durable permit (crash before it was written) or the agent no longer
|
|
4592
|
+
shows the delivery pending.
|
|
4593
|
+
- `legacy_state`: the record or permit was written in an older or unknown format.
|
|
4594
|
+
- `conflict`: the agent answered 409 after a busy refusal and its delivery state is not accepted.
|
|
4595
|
+
|
|
4596
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L419)
|
|
4597
|
+
|
|
4598
|
+
```ts
|
|
4599
|
+
export type PaidApprovalUnresolvedReason = 'claim_lost' | 'generation_moved' | 'outcome_unknown' | 'no_permit' | 'legacy_state' | 'conflict';
|
|
4600
|
+
```
|
|
4601
|
+
|
|
4602
|
+
### PaidBackoffCode
|
|
4603
|
+
|
|
4604
|
+
Stable code of a paid backoff refusal (see [PaidBackoffError](#paidbackofferror)).
|
|
4605
|
+
- `deadline_exceeded`: waiting the server's hint (or the client's own backoff) and then allowing
|
|
4606
|
+
one attempt would reach the operation deadline; nothing was slept or sent.
|
|
4607
|
+
- `server_wait_too_long`: the server asked for longer than the client ever waits (120 s); the
|
|
4608
|
+
hint is never shortened, so nothing was slept or sent.
|
|
4609
|
+
- `no_time_to_send`: re-read immediately before a send (for example after an overrunning sleep),
|
|
4610
|
+
too little time was left before the deadline; that send did not happen.
|
|
4611
|
+
- `attempts_exhausted`: the attempt ceiling was reached inside the deadline.
|
|
4612
|
+
|
|
4613
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L349)
|
|
4614
|
+
|
|
4615
|
+
```ts
|
|
4616
|
+
export type PaidBackoffCode = 'deadline_exceeded' | 'server_wait_too_long' | 'no_time_to_send' | 'attempts_exhausted';
|
|
4617
|
+
```
|
|
4618
|
+
|
|
4619
|
+
### PollSessionOpts
|
|
4620
|
+
|
|
4621
|
+
Options for one session status request.
|
|
4622
|
+
|
|
4623
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L466)
|
|
4624
|
+
|
|
4625
|
+
```ts
|
|
4626
|
+
export interface PollSessionOpts {
|
|
4627
|
+
wait?: boolean;
|
|
4628
|
+
signal?: AbortSignal;
|
|
4629
|
+
timeoutMs?: number;
|
|
4630
|
+
}
|
|
4631
|
+
```
|
|
4632
|
+
|
|
4633
|
+
Fields:
|
|
4634
|
+
|
|
4635
|
+
- **` wait `**: Ask the verifier-agent to hold the reply until the session status or phase changes (`?wait=1`, up to 20 s). A server without that support answers at once.
|
|
4636
|
+
- **` signal `**: Cancel the request: rejects with `cancelled`.
|
|
4637
|
+
- **` timeoutMs `**: Per-request ceiling in milliseconds (default 30000, which covers the 20 s hold); a reply that does not arrive in time is `unavailable`.
|
|
4638
|
+
|
|
4639
|
+
### PrepaidEscapeCode
|
|
4640
|
+
|
|
4641
|
+
Stable code of a prepaid timeout-escape refusal (see [PrepaidEscapeError](#prepaidescapeerror)).
|
|
4642
|
+
- `escape_disabled`: the Settlement escape delay is zero (an upgraded deployment before governance
|
|
4643
|
+
enabled it); contract error `EscapeDisabled()`.
|
|
4644
|
+
- `escape_not_open`: a request's escape opens later, at `opensAt`; contract error
|
|
4645
|
+
`EscapeNotOpen(requestId, opensAt)`.
|
|
4646
|
+
- `reservation_unavailable`: a request was never reserved, or is already complete (reconciled,
|
|
4647
|
+
settled or escaped); contract error `ReservationUnavailable(requestId)`.
|
|
4648
|
+
- `invalid_escape_delay`: contract error `InvalidEscapeDelay(delay)` (governance setter only).
|
|
4649
|
+
- `too_many_requests`: more than 64 requests in one call; contract error `TooManyCovered`.
|
|
4650
|
+
- `empty_request`: no request IDs; contract error `EmptyBundle()`.
|
|
4651
|
+
- `escape_unsupported`: the Settlement has no escape getters (a version before "3").
|
|
4652
|
+
|
|
4653
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L499)
|
|
4654
|
+
|
|
4655
|
+
```ts
|
|
4656
|
+
export type PrepaidEscapeCode = 'escape_disabled' | 'escape_not_open' | 'reservation_unavailable' | 'invalid_escape_delay' | 'too_many_requests' | 'empty_request' | 'escape_unsupported';
|
|
4657
|
+
```
|
|
4658
|
+
|
|
3598
4659
|
### PresentationDelegation
|
|
3599
4660
|
|
|
3600
4661
|
EIP-712 delegation from the slot creator to a delegate address.
|
|
3601
4662
|
|
|
3602
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
4663
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L45)
|
|
3603
4664
|
|
|
3604
4665
|
```ts
|
|
3605
4666
|
export interface PresentationDelegation {
|
|
@@ -3627,7 +4688,7 @@ Fields:
|
|
|
3627
4688
|
|
|
3628
4689
|
Operation details signed by a slot creator or delegate for credential authorization.
|
|
3629
4690
|
|
|
3630
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
4691
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L29)
|
|
3631
4692
|
|
|
3632
4693
|
```ts
|
|
3633
4694
|
export interface PresentationOperation {
|
|
@@ -3649,11 +4710,29 @@ Fields:
|
|
|
3649
4710
|
- **` description `**: Human-readable description shown in transaction_data
|
|
3650
4711
|
- **` exp `**: Unix timestamp - when the authorization expires
|
|
3651
4712
|
|
|
4713
|
+
### RecipientWire
|
|
4714
|
+
|
|
4715
|
+
Public recipient metadata bound before holder and client execution authorization.
|
|
4716
|
+
|
|
4717
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L16)
|
|
4718
|
+
|
|
4719
|
+
```ts
|
|
4720
|
+
export interface RecipientWire {
|
|
4721
|
+
suite: string;
|
|
4722
|
+
public_key: string;
|
|
4723
|
+
}
|
|
4724
|
+
```
|
|
4725
|
+
|
|
4726
|
+
Fields:
|
|
4727
|
+
|
|
4728
|
+
- **` suite `**: Exact supported RFC 9180 suite name.
|
|
4729
|
+
- **` public_key `**: Hex-encoded 32-byte X25519 public key; never a private key or recovery seed.
|
|
4730
|
+
|
|
3652
4731
|
### RedemptionGrant
|
|
3653
4732
|
|
|
3654
4733
|
Single-use credential redemption token and its expiry in Unix seconds.
|
|
3655
4734
|
|
|
3656
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
4735
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L132)
|
|
3657
4736
|
|
|
3658
4737
|
```ts
|
|
3659
4738
|
export interface RedemptionGrant {
|
|
@@ -3695,7 +4774,7 @@ Fields:
|
|
|
3695
4774
|
|
|
3696
4775
|
Long-lived renewal token, authenticated holder, expiry and authorized scopes.
|
|
3697
4776
|
|
|
3698
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#
|
|
4777
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L37)
|
|
3699
4778
|
|
|
3700
4779
|
```ts
|
|
3701
4780
|
export interface RenewalGrant {
|
|
@@ -3713,6 +4792,58 @@ Fields:
|
|
|
3713
4792
|
- **` expiresAt `**: Expiry, Unix seconds.
|
|
3714
4793
|
- **` scopes `**: Scopes authorized by the renewal grant.
|
|
3715
4794
|
|
|
4795
|
+
### RetryDecision
|
|
4796
|
+
|
|
4797
|
+
Classification of one failed attempt.
|
|
4798
|
+
|
|
4799
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L34)
|
|
4800
|
+
|
|
4801
|
+
```ts
|
|
4802
|
+
export interface RetryDecision {
|
|
4803
|
+
retry: boolean;
|
|
4804
|
+
retryAfterMs?: number;
|
|
4805
|
+
}
|
|
4806
|
+
```
|
|
4807
|
+
|
|
4808
|
+
Fields:
|
|
4809
|
+
|
|
4810
|
+
- **` retry `**: Whether sending the same request again may succeed.
|
|
4811
|
+
- **` retryAfterMs `**: Service-requested minimum wait in ms, when it sent one.
|
|
4812
|
+
|
|
4813
|
+
### RetryPolicy
|
|
4814
|
+
|
|
4815
|
+
Limits for one retried request. Every field is optional and bounded.
|
|
4816
|
+
|
|
4817
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L20)
|
|
4818
|
+
|
|
4819
|
+
```ts
|
|
4820
|
+
export interface RetryPolicy {
|
|
4821
|
+
maxAttempts?: number;
|
|
4822
|
+
baseDelayMs?: number;
|
|
4823
|
+
maxDelayMs?: number;
|
|
4824
|
+
maxTotalWaitMs?: number;
|
|
4825
|
+
random?: () => number;
|
|
4826
|
+
}
|
|
4827
|
+
```
|
|
4828
|
+
|
|
4829
|
+
Fields:
|
|
4830
|
+
|
|
4831
|
+
- **` maxAttempts `**: Total sends including the first, 1..10 (default 4).
|
|
4832
|
+
- **` baseDelayMs `**: First backoff when the service gives no `Retry-After`, in ms (default 250).
|
|
4833
|
+
- **` maxDelayMs `**: Largest single wait in ms (default 10000). A longer `Retry-After` ends retrying.
|
|
4834
|
+
- **` maxTotalWaitMs `**: Largest sum of all waits in ms (default 30000, at most 600000).
|
|
4835
|
+
- **` random `**: Source of uniform randomness in [0, 1) for jitter; defaults to Math.random.
|
|
4836
|
+
|
|
4837
|
+
### RevocationStatusPreflightCode
|
|
4838
|
+
|
|
4839
|
+
Stable code of a local revocation-status preflight refusal.
|
|
4840
|
+
|
|
4841
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L164)
|
|
4842
|
+
|
|
4843
|
+
```ts
|
|
4844
|
+
export type RevocationStatusPreflightCode = 'revocation_status_missing' | 'revocation_status_stale' | 'revocation_status_invalid' | 'revocation_status_refused';
|
|
4845
|
+
```
|
|
4846
|
+
|
|
3716
4847
|
### ScopeNamespace
|
|
3717
4848
|
|
|
3718
4849
|
Identity-scope authority. The issuer mode restricts grants to the verified issuer DID namespace. The any mode permits other namespaces and requires an explicit issuer allowlist.
|
|
@@ -3741,6 +4872,94 @@ Fields:
|
|
|
3741
4872
|
- **` header `**: Metadata and wrapped data key required to open the blob.
|
|
3742
4873
|
- **` body `**: The concatenated encrypted chunks.
|
|
3743
4874
|
|
|
4875
|
+
### SealedPartial
|
|
4876
|
+
|
|
4877
|
+
Locally opened and verified contribution. Clear its value after combining or discarding it.
|
|
4878
|
+
|
|
4879
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/sealed.ts#L51)
|
|
4880
|
+
|
|
4881
|
+
```ts
|
|
4882
|
+
export interface SealedPartial {
|
|
4883
|
+
receipt?: OperationReceipt;
|
|
4884
|
+
identifier: number;
|
|
4885
|
+
value: Uint8Array;
|
|
4886
|
+
verifyingShare: Uint8Array;
|
|
4887
|
+
epoch: number;
|
|
4888
|
+
nodeUrl: string;
|
|
4889
|
+
}
|
|
4890
|
+
```
|
|
4891
|
+
|
|
4892
|
+
Fields:
|
|
4893
|
+
|
|
4894
|
+
- **` receipt `**: Validated operation receipt when the keeper includes one.
|
|
4895
|
+
- **` identifier `**: Distinct BLS participant identifier.
|
|
4896
|
+
- **` value `**: Sensitive unsealed contribution, held only on the client.
|
|
4897
|
+
- **` verifyingShare `**: Independently authenticated 144-byte G2 || G1 public verifying share.
|
|
4898
|
+
- **` epoch `**: Authorized canonical key epoch.
|
|
4899
|
+
- **` nodeUrl `**: Endpoint from which this verified contribution was received.
|
|
4900
|
+
|
|
4901
|
+
### SealedRequestOpts
|
|
4902
|
+
|
|
4903
|
+
Recipient-bound authorization and independently authenticated keeper quorum for local decryption.
|
|
4904
|
+
|
|
4905
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/sealed.ts#L17)
|
|
4906
|
+
|
|
4907
|
+
```ts
|
|
4908
|
+
export interface SealedRequestOpts {
|
|
4909
|
+
approveExecution?: KeeperExecutionApprover;
|
|
4910
|
+
signal?: AbortSignal;
|
|
4911
|
+
fetchImpl?: typeof fetch;
|
|
4912
|
+
nodeUrls: string[];
|
|
4913
|
+
chainId: number | bigint;
|
|
4914
|
+
committeeToken: CompoundTokenWire;
|
|
4915
|
+
recipient: ClientRecipient;
|
|
4916
|
+
ciphertextEpoch: number;
|
|
4917
|
+
verifyingShares: ReadonlyMap<number, Uint8Array>;
|
|
4918
|
+
threshold: number;
|
|
4919
|
+
verifierProofs?: VerifierProof[];
|
|
4920
|
+
targetKeykeeper?: string;
|
|
4921
|
+
userSignature?: Uint8Array;
|
|
4922
|
+
evidenceCt?: string;
|
|
4923
|
+
requestId?: string;
|
|
4924
|
+
}
|
|
4925
|
+
```
|
|
4926
|
+
|
|
4927
|
+
Fields:
|
|
4928
|
+
|
|
4929
|
+
- **` approveExecution `**: Client-owned exact-body approval capability, required for paid contributions.
|
|
4930
|
+
- **` signal `**: Cancel the complete fan-out, including approvals and response bodies.
|
|
4931
|
+
- **` fetchImpl `**: Guarded HTTP transport; defaults to global fetch.
|
|
4932
|
+
- **` nodeUrls `**: Distinct keeper endpoints resolved from the assigned operator roster.
|
|
4933
|
+
- **` chainId `**: Deployment chain identifier included in the signed request binding.
|
|
4934
|
+
- **` committeeToken `**: Holder authorization bound to this content, recipient, slot, chain and action.
|
|
4935
|
+
- **` recipient `**: Original client-held recipient created before requesting authorization.
|
|
4936
|
+
- **` ciphertextEpoch `**: Canonical key epoch authorized for the ciphertext.
|
|
4937
|
+
- **` verifyingShares `**: Authenticate this package against the slot's published commitment before use. Keys are keeper identifiers, values are 144-byte G2 || G1 verifying shares.
|
|
4938
|
+
- **` threshold `**: Required number of distinct authenticated and pairing-verified contributions.
|
|
4939
|
+
- **` verifierProofs `**: Registry membership proofs for the token's anchored verifier snapshot.
|
|
4940
|
+
- **` targetKeykeeper `**: Optional assigned operator address pinned by the operation policy.
|
|
4941
|
+
- **` userSignature `**: Slot-owner signature over the canonical KEM request when required by slot policy.
|
|
4942
|
+
- **` evidenceCt `**: Original sealed credential evidence associated with the compound token.
|
|
4943
|
+
- **` requestId `**: Use the same id when producing the KEM owner signature.
|
|
4944
|
+
|
|
4945
|
+
### SealedShareWire
|
|
4946
|
+
|
|
4947
|
+
Standard padded-base64 HPKE envelope carrying one encrypted contribution.
|
|
4948
|
+
|
|
4949
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L32)
|
|
4950
|
+
|
|
4951
|
+
```ts
|
|
4952
|
+
export interface SealedShareWire {
|
|
4953
|
+
enc: string;
|
|
4954
|
+
ciphertext: string;
|
|
4955
|
+
}
|
|
4956
|
+
```
|
|
4957
|
+
|
|
4958
|
+
Fields:
|
|
4959
|
+
|
|
4960
|
+
- **` enc `**: RFC 9180 encapsulated X25519 key, encoded as padded base64.
|
|
4961
|
+
- **` ciphertext `**: Authenticated encrypted contribution, encoded as padded base64.
|
|
4962
|
+
|
|
3744
4963
|
### Session
|
|
3745
4964
|
|
|
3746
4965
|
A live, managed access session for one key slot.
|
|
@@ -3823,35 +5042,43 @@ Fields:
|
|
|
3823
5042
|
|
|
3824
5043
|
Authorization session progress and optional committee result or failure detail.
|
|
3825
5044
|
|
|
3826
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
5045
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L110)
|
|
3827
5046
|
|
|
3828
5047
|
```ts
|
|
3829
5048
|
export interface SessionStatusResult {
|
|
5049
|
+
evidenceCt?: string;
|
|
3830
5050
|
status: 'pending' | 'done' | 'failed';
|
|
3831
5051
|
phase: SessionPhase;
|
|
3832
5052
|
compoundToken?: Record<string, unknown>;
|
|
3833
5053
|
verifierProofs?: unknown;
|
|
3834
5054
|
bindingPreimage?: Record<string, unknown>;
|
|
3835
5055
|
error?: string;
|
|
3836
|
-
|
|
5056
|
+
sessionGrant?: {
|
|
5057
|
+
grant?: {
|
|
5058
|
+
session_grant: SessionGrantWire;
|
|
5059
|
+
refresh_seq: 0;
|
|
5060
|
+
};
|
|
5061
|
+
error?: string;
|
|
5062
|
+
};
|
|
3837
5063
|
}
|
|
3838
5064
|
```
|
|
3839
5065
|
|
|
3840
5066
|
Fields:
|
|
3841
5067
|
|
|
5068
|
+
- **` evidenceCt `**: Sealed presentation (base64url `bincode(Ciphertext)`) the token's `evidence_hash` names, retained unchanged and posted to the keeper beside the token as `evidence_ct`.
|
|
3842
5069
|
- **` status `**: Pending, completed or failed authorization state.
|
|
3843
5070
|
- **` phase `**: Displayable progress within the authorization lifecycle.
|
|
3844
5071
|
- **` compoundToken `**: Committee token returned after successful authorization.
|
|
3845
5072
|
- **` verifierProofs `**: Verifier membership proofs for the selected snapshot.
|
|
3846
5073
|
- **` bindingPreimage `**: Operation context used to derive the request-binding hash.
|
|
3847
5074
|
- **` error `**: Optional failure detail reported by the verifier agent.
|
|
3848
|
-
- **`
|
|
5075
|
+
- **` sessionGrant `**: Session mode, once `done`: the grant the paid session client verified against the anchored draw (`refresh_seq` 0), or why none came with the token. Absent otherwise.
|
|
3849
5076
|
|
|
3850
5077
|
### ShardDecryptOpts
|
|
3851
5078
|
|
|
3852
|
-
|
|
5079
|
+
Legacy input retained for explicit runtime refusal.
|
|
3853
5080
|
|
|
3854
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#
|
|
5081
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L39)
|
|
3855
5082
|
|
|
3856
5083
|
```ts
|
|
3857
5084
|
export interface ShardDecryptOpts {
|
|
@@ -3926,7 +5153,7 @@ Fields:
|
|
|
3926
5153
|
- **` jwt `**: Compact bearer JWT authorizing the request.
|
|
3927
5154
|
- **` slotId `**: 0x-prefixed (or bare) bytes32 slot id.
|
|
3928
5155
|
- **` message `**: Raw message bytes to sign.
|
|
3929
|
-
- **` signingSet `**: Explicit signer set (u16 ids). Omit to
|
|
5156
|
+
- **` signingSet `**: Explicit signer set (u16 ids). Omit to let the keeper select responsive eligible signers. Passing MORE than k ids makes the node use the robust ROAST coordinator.
|
|
3930
5157
|
- **` userSignature `**: 64-byte Ed25519 user signature - required iff the slot has a registered owner pubkey. Build with signUserRequest().
|
|
3931
5158
|
- **` targetKeykeeper `**: 20-byte operator address to pin (anti-Sybil).
|
|
3932
5159
|
- **` requestId `**: Idempotency key. Required when userSignature is set.
|
|
@@ -3953,6 +5180,75 @@ Fields:
|
|
|
3953
5180
|
- **` targetKeykeeper `**: 20-byte operator address to pin (anti-Sybil).
|
|
3954
5181
|
- **` requestId `**: Idempotency key (required when userSignature is set).
|
|
3955
5182
|
|
|
5183
|
+
### StatusRefreshCode
|
|
5184
|
+
|
|
5185
|
+
Stable code of a status-refresh failure (`keykeeper/committee-status-refresh/v1`).
|
|
5186
|
+
|
|
5187
|
+
Server codes (verifier `POST /v1/committee/status-refresh`, or the verifier-agent relay
|
|
5188
|
+
`POST /v1/sessions/:id/status-refresh`):
|
|
5189
|
+
- `status_refresh_unknown` (404): the verifier holds no issuance record for this token.
|
|
5190
|
+
- `status_refresh_unavailable` (409): a legacy record without refresh facts; never clean.
|
|
5191
|
+
- `status_refresh_replayed` (409): the proof's `seq` is not above the verifier's last one.
|
|
5192
|
+
- `status_refresh_context_changed` (409): the verifier's roster index or the slot rule moved.
|
|
5193
|
+
- `status_refresh_expired` (410): a hard cap of the grant (minus the 5 s keeper skew) passed.
|
|
5194
|
+
- `status_refresh_unauthenticated` (403, or 401 from the relay): the proof does not verify
|
|
5195
|
+
under the principal recorded at issuance, or is not fresh.
|
|
5196
|
+
- `status_refresh_refused` (403): a status reference is revoked or no longer acceptable.
|
|
5197
|
+
- `status_refresh_unavailable_status` (503): a status list could not be read.
|
|
5198
|
+
- `status_refresh_quorum_unmet` (503 from the relay, or local): fewer than the token's quorum of
|
|
5199
|
+
original signers returned a valid, fresh, capped attestation.
|
|
5200
|
+
- `status_refresh_rate_limited` (429): per-token interval/cap or principal quota; see `retryAfterMs`.
|
|
5201
|
+
|
|
5202
|
+
Client codes:
|
|
5203
|
+
- `status_refresh_invalid_response`: a success reply that is malformed, unsigned, forged, from a
|
|
5204
|
+
signer that did not verify the original token, or past a cap. Never trusted.
|
|
5205
|
+
- `status_refresh_unreachable`: no HTTP answer (the verifier may still have consumed the `seq`).
|
|
5206
|
+
- `status_refresh_http`: any other HTTP status, or a refusal without a recognised code.
|
|
5207
|
+
|
|
5208
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L258)
|
|
5209
|
+
|
|
5210
|
+
```ts
|
|
5211
|
+
export type StatusRefreshCode =
|
|
5212
|
+
| 'status_refresh_unknown'
|
|
5213
|
+
| 'status_refresh_unavailable'
|
|
5214
|
+
| 'status_refresh_replayed'
|
|
5215
|
+
| 'status_refresh_context_changed'
|
|
5216
|
+
| 'status_refresh_expired'
|
|
5217
|
+
| 'status_refresh_unauthenticated'
|
|
5218
|
+
| 'status_refresh_refused'
|
|
5219
|
+
| 'status_refresh_unavailable_status'
|
|
5220
|
+
| 'status_refresh_quorum_unmet'
|
|
5221
|
+
| 'status_refresh_rate_limited'
|
|
5222
|
+
| 'status_refresh_invalid_response'
|
|
5223
|
+
| 'status_refresh_unreachable'
|
|
5224
|
+
| 'status_refresh_http'
|
|
5225
|
+
;
|
|
5226
|
+
```
|
|
5227
|
+
|
|
5228
|
+
### StatusRefreshFailure
|
|
5229
|
+
|
|
5230
|
+
Why one verifier (or the relay) did not contribute a fresh attestation.
|
|
5231
|
+
|
|
5232
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L274)
|
|
5233
|
+
|
|
5234
|
+
```ts
|
|
5235
|
+
export interface StatusRefreshFailure {
|
|
5236
|
+
verifierIndex?: number;
|
|
5237
|
+
code: StatusRefreshCode;
|
|
5238
|
+
httpStatus?: number;
|
|
5239
|
+
retryAfterMs?: number;
|
|
5240
|
+
message: string;
|
|
5241
|
+
}
|
|
5242
|
+
```
|
|
5243
|
+
|
|
5244
|
+
Fields:
|
|
5245
|
+
|
|
5246
|
+
- **` verifierIndex `**: Verifier registry index, when the failure belongs to one verifier.
|
|
5247
|
+
- **` code `**: Stable code.
|
|
5248
|
+
- **` httpStatus `**: HTTP status, when an answer arrived.
|
|
5249
|
+
- **` retryAfterMs `**: Service-requested wait (`Retry-After`), in ms.
|
|
5250
|
+
- **` message `**: Safe-to-log detail (no secrets, at most 200 characters of a service message).
|
|
5251
|
+
|
|
3956
5252
|
### TasraClient
|
|
3957
5253
|
|
|
3958
5254
|
A configured client. Holds no key material itself - each [Session](#session) it
|
|
@@ -4025,7 +5321,7 @@ Fields:
|
|
|
4025
5321
|
Why a session did not yield a token - the class the UI explains, with a NON-SECRET
|
|
4026
5322
|
correlation reference (the session id; the poll secret is never part of an error).
|
|
4027
5323
|
|
|
4028
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
5324
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L135)
|
|
4029
5325
|
|
|
4030
5326
|
```ts
|
|
4031
5327
|
export type VerifierAgentSessionErrorKind = 'timeout' | 'refused' | 'unavailable' | 'protocol' | 'cancelled';
|
|
@@ -4064,5 +5360,8 @@ Shared values and contract definitions.
|
|
|
4064
5360
|
| `MAX_IDENTITY_LEN` | Max BYTE length of a scope grant or an identity (the reference implementation's cap). Anything longer fails closed - a grant or identity this large is a bug or an attack, not a real subject path. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/identityScope.ts#L31) |
|
|
4065
5361
|
| `MAX_PLAINTEXT_LEN` | Largest plaintext one envelope carries: the AEAD ciphertext cap minus the 16-byte tag. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/envelope.ts#L310) |
|
|
4066
5362
|
| `OAUTH_ENVELOPE_KEY` | The single top-level member that marks a rule as an OAuth policy envelope. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L28) |
|
|
5363
|
+
| `RECIPIENT_SUITE` | RFC 9180 suite accepted for client-sealed decryption contributions. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/recipient.ts#L12) |
|
|
4067
5364
|
| `REGO_POLICY_REFUSED` | The refusal text a holder sees when an envelope's policy denies. Deliberately generic: rule contents are confidential to the operator set, so a refusal never names a claim or clause. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L37) |
|
|
4068
5365
|
| `REGO_WASM_SHA256` | SHA-256 of the vendored `keykeeper_rego_wasm_bg.wasm`, as recorded in its PINS.json. `scripts/check-rego-pins.mjs` asserts the two agree, so this constant cannot drift from the pinned build. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L44) |
|
|
5366
|
+
| `RETRY_AFTER_ONLY_STATUSES` | HTTP statuses retried only when the service explicitly sends `Retry-After`. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L47) |
|
|
5367
|
+
| `RETRY_STATUSES` | HTTP statuses that mean "not now" and are retried even without a header. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/retry.ts#L45) |
|