@t3foundry/tasra-sdk 0.0.0-stage → 0.3.1-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +94 -0
  4. package/README.md +137 -2
  5. package/SECURITY.md +115 -0
  6. package/dist/app/approvals.d.ts +50 -0
  7. package/dist/app/approvals.js +90 -0
  8. package/dist/app/authorization.d.ts +19 -0
  9. package/dist/app/authorization.js +20 -0
  10. package/dist/app/client.d.ts +231 -0
  11. package/dist/app/client.js +272 -0
  12. package/dist/app/creation.d.ts +73 -0
  13. package/dist/app/creation.js +77 -0
  14. package/dist/app/deployment.d.ts +36 -0
  15. package/dist/app/deployment.js +18 -0
  16. package/dist/app/identity.d.ts +211 -0
  17. package/dist/app/identity.js +287 -0
  18. package/dist/app/index.d.ts +22 -0
  19. package/dist/app/index.js +12 -0
  20. package/dist/app/manifest.d.ts +74 -0
  21. package/dist/app/manifest.js +120 -0
  22. package/dist/app/node.d.ts +30 -0
  23. package/dist/app/node.js +159 -0
  24. package/dist/app/ready-slot.d.ts +157 -0
  25. package/dist/app/ready-slot.js +199 -0
  26. package/dist/app/tasra-client.d.ts +125 -0
  27. package/dist/app/tasra-client.js +79 -0
  28. package/dist/app/viem.d.ts +10 -0
  29. package/dist/app/viem.js +32 -0
  30. package/dist/app/wallet.d.ts +126 -0
  31. package/dist/app/wallet.js +137 -0
  32. package/dist/auth/dpop.d.ts +86 -0
  33. package/dist/auth/dpop.js +142 -0
  34. package/dist/auth/holderProof.d.ts +102 -0
  35. package/dist/auth/holderProof.js +161 -0
  36. package/dist/auth/identityScope.d.ts +19 -0
  37. package/dist/auth/identityScope.js +82 -0
  38. package/dist/auth/index.d.ts +11 -0
  39. package/dist/auth/index.js +13 -0
  40. package/dist/auth/oid4vp.d.ts +230 -0
  41. package/dist/auth/oid4vp.js +780 -0
  42. package/dist/auth/rego/wasm/PINS.json +11 -0
  43. package/dist/auth/rego/wasm/keykeeper_rego_wasm.d.ts +76 -0
  44. package/dist/auth/rego/wasm/keykeeper_rego_wasm.js +379 -0
  45. package/dist/auth/rego/wasm/keykeeper_rego_wasm_bg.wasm +0 -0
  46. package/dist/auth/rego.d.ts +192 -0
  47. package/dist/auth/rego.js +492 -0
  48. package/dist/auth/verifier.d.ts +166 -0
  49. package/dist/auth/verifier.js +211 -0
  50. package/dist/chain/abis/accountantSetRegistry.d.ts +441 -0
  51. package/dist/chain/abis/accountantSetRegistry.js +574 -0
  52. package/dist/chain/abis/accountantSlashing.d.ts +2071 -0
  53. package/dist/chain/abis/accountantSlashing.js +2670 -0
  54. package/dist/chain/abis/bondingCurve.d.ts +398 -0
  55. package/dist/chain/abis/bondingCurve.js +521 -0
  56. package/dist/chain/abis/equivocationSlasher.d.ts +292 -0
  57. package/dist/chain/abis/equivocationSlasher.js +379 -0
  58. package/dist/chain/abis/fixedTasraPriceOracle.d.ts +52 -0
  59. package/dist/chain/abis/fixedTasraPriceOracle.js +72 -0
  60. package/dist/chain/abis/index.d.ts +12801 -0
  61. package/dist/chain/abis/index.js +64 -0
  62. package/dist/chain/abis/keeperShareRegistry.d.ts +519 -0
  63. package/dist/chain/abis/keeperShareRegistry.js +675 -0
  64. package/dist/chain/abis/keyRegistry.d.ts +2421 -0
  65. package/dist/chain/abis/keyRegistry.js +3114 -0
  66. package/dist/chain/abis/livenessRegistry.d.ts +402 -0
  67. package/dist/chain/abis/livenessRegistry.js +524 -0
  68. package/dist/chain/abis/mockEurc.d.ts +210 -0
  69. package/dist/chain/abis/mockEurc.js +276 -0
  70. package/dist/chain/abis/nodeRegistry.d.ts +1630 -0
  71. package/dist/chain/abis/nodeRegistry.js +2113 -0
  72. package/dist/chain/abis/platformExecutor.d.ts +328 -0
  73. package/dist/chain/abis/platformExecutor.js +429 -0
  74. package/dist/chain/abis/prevrandaoSaltBeacon.d.ts +16 -0
  75. package/dist/chain/abis/prevrandaoSaltBeacon.js +24 -0
  76. package/dist/chain/abis/serviceRegistry.d.ts +556 -0
  77. package/dist/chain/abis/serviceRegistry.js +719 -0
  78. package/dist/chain/abis/settlement.d.ts +1624 -0
  79. package/dist/chain/abis/settlement.js +2096 -0
  80. package/dist/chain/abis/tasraSwapRouter.d.ts +92 -0
  81. package/dist/chain/abis/tasraSwapRouter.js +122 -0
  82. package/dist/chain/abis/tasraToken.d.ts +455 -0
  83. package/dist/chain/abis/tasraToken.js +599 -0
  84. package/dist/chain/abis/tasraVestingVault.d.ts +165 -0
  85. package/dist/chain/abis/tasraVestingVault.js +215 -0
  86. package/dist/chain/abis/thresholdRandomBeacon.d.ts +378 -0
  87. package/dist/chain/abis/thresholdRandomBeacon.js +494 -0
  88. package/dist/chain/abis/treasury.d.ts +301 -0
  89. package/dist/chain/abis/treasury.js +390 -0
  90. package/dist/chain/abis/verifierSetRegistry.d.ts +445 -0
  91. package/dist/chain/abis/verifierSetRegistry.js +579 -0
  92. package/dist/chain/client.d.ts +212 -0
  93. package/dist/chain/client.js +576 -0
  94. package/dist/chain/commitmentRecovery.d.ts +21 -0
  95. package/dist/chain/commitmentRecovery.js +44 -0
  96. package/dist/chain/committeeClient.d.ts +102 -0
  97. package/dist/chain/committeeClient.js +137 -0
  98. package/dist/chain/deployments.d.ts +56 -0
  99. package/dist/chain/deployments.js +269 -0
  100. package/dist/chain/discovery.d.ts +49 -0
  101. package/dist/chain/discovery.js +107 -0
  102. package/dist/chain/events.d.ts +58 -0
  103. package/dist/chain/events.js +125 -0
  104. package/dist/chain/format.d.ts +25 -0
  105. package/dist/chain/format.js +51 -0
  106. package/dist/chain/index.d.ts +41 -0
  107. package/dist/chain/index.js +56 -0
  108. package/dist/chain/manifest.d.ts +165 -0
  109. package/dist/chain/manifest.js +132 -0
  110. package/dist/chain/network-profiles.json +75 -0
  111. package/dist/chain/networks.d.ts +73 -0
  112. package/dist/chain/networks.js +62 -0
  113. package/dist/chain/node.d.ts +44 -0
  114. package/dist/chain/node.js +176 -0
  115. package/dist/chain/offchain.d.ts +149 -0
  116. package/dist/chain/offchain.js +73 -0
  117. package/dist/chain/provisionRule.d.ts +164 -0
  118. package/dist/chain/provisionRule.js +212 -0
  119. package/dist/chain/registeredAgent.d.ts +64 -0
  120. package/dist/chain/registeredAgent.js +140 -0
  121. package/dist/chain/registeredOperation.d.ts +49 -0
  122. package/dist/chain/registeredOperation.js +136 -0
  123. package/dist/chain/registeredRelay.d.ts +206 -0
  124. package/dist/chain/registeredRelay.js +312 -0
  125. package/dist/chain/revertReason.d.ts +14 -0
  126. package/dist/chain/revertReason.js +62 -0
  127. package/dist/chain/ruleAmendment.d.ts +80 -0
  128. package/dist/chain/ruleAmendment.js +195 -0
  129. package/dist/chain/ruleAmendmentCore.d.ts +129 -0
  130. package/dist/chain/ruleAmendmentCore.js +152 -0
  131. package/dist/chain/ruleInput.d.ts +10 -0
  132. package/dist/chain/ruleInput.js +13 -0
  133. package/dist/chain/serviceIdentity.d.ts +176 -0
  134. package/dist/chain/serviceIdentity.js +237 -0
  135. package/dist/chain/serviceProfiles.d.ts +39 -0
  136. package/dist/chain/serviceProfiles.js +74 -0
  137. package/dist/chain/services.d.ts +141 -0
  138. package/dist/chain/services.js +79 -0
  139. package/dist/chain/slotClient.d.ts +55 -0
  140. package/dist/chain/slotClient.js +62 -0
  141. package/dist/chain/slotSeed.d.ts +31 -0
  142. package/dist/chain/slotSeed.js +98 -0
  143. package/dist/chain/write.d.ts +431 -0
  144. package/dist/chain/write.js +958 -0
  145. package/dist/client/client.d.ts +112 -0
  146. package/dist/client/client.js +111 -0
  147. package/dist/client/index.d.ts +3 -0
  148. package/dist/client/index.js +2 -0
  149. package/dist/client/session.d.ts +67 -0
  150. package/dist/client/session.js +238 -0
  151. package/dist/committee/client.d.ts +284 -0
  152. package/dist/committee/client.js +351 -0
  153. package/dist/committee/dual-sign.d.ts +110 -0
  154. package/dist/committee/dual-sign.js +202 -0
  155. package/dist/committee/ecdsa.d.ts +36 -0
  156. package/dist/committee/ecdsa.js +45 -0
  157. package/dist/committee/extraction.d.ts +82 -0
  158. package/dist/committee/extraction.js +96 -0
  159. package/dist/committee/index.d.ts +19 -0
  160. package/dist/committee/index.js +13 -0
  161. package/dist/committee/oauth.d.ts +51 -0
  162. package/dist/committee/oauth.js +90 -0
  163. package/dist/committee/receipts.d.ts +51 -0
  164. package/dist/committee/receipts.js +59 -0
  165. package/dist/committee/request.d.ts +264 -0
  166. package/dist/committee/request.js +305 -0
  167. package/dist/committee/token.d.ts +274 -0
  168. package/dist/committee/token.js +418 -0
  169. package/dist/crypto/constants.d.ts +10 -0
  170. package/dist/crypto/constants.js +32 -0
  171. package/dist/crypto/detect.d.ts +20 -0
  172. package/dist/crypto/detect.js +44 -0
  173. package/dist/crypto/envelope.d.ts +60 -0
  174. package/dist/crypto/envelope.js +243 -0
  175. package/dist/crypto/frost.d.ts +49 -0
  176. package/dist/crypto/frost.js +152 -0
  177. package/dist/crypto/hex.d.ts +7 -0
  178. package/dist/crypto/hex.js +24 -0
  179. package/dist/crypto/ibe-blob.d.ts +114 -0
  180. package/dist/crypto/ibe-blob.js +208 -0
  181. package/dist/crypto/ibe.d.ts +88 -0
  182. package/dist/crypto/ibe.js +262 -0
  183. package/dist/crypto/index.d.ts +12 -0
  184. package/dist/crypto/index.js +12 -0
  185. package/dist/crypto/kem.d.ts +55 -0
  186. package/dist/crypto/kem.js +241 -0
  187. package/dist/decryption/client.d.ts +64 -0
  188. package/dist/decryption/client.js +82 -0
  189. package/dist/decryption/index.d.ts +2 -0
  190. package/dist/decryption/index.js +2 -0
  191. package/dist/errors.d.ts +124 -0
  192. package/dist/errors.js +167 -0
  193. package/dist/index.d.ts +43 -0
  194. package/dist/index.js +98 -0
  195. package/dist/keys/index.d.ts +1 -0
  196. package/dist/keys/index.js +4 -0
  197. package/dist/keys/node-client.d.ts +27 -0
  198. package/dist/keys/node-client.js +97 -0
  199. package/dist/oid4vp/binding.d.ts +76 -0
  200. package/dist/oid4vp/binding.js +118 -0
  201. package/dist/oid4vp/did-web.d.ts +49 -0
  202. package/dist/oid4vp/did-web.js +57 -0
  203. package/dist/oid4vp/index.d.ts +9 -0
  204. package/dist/oid4vp/index.js +10 -0
  205. package/dist/oid4vp/jose.d.ts +166 -0
  206. package/dist/oid4vp/jose.js +242 -0
  207. package/dist/oid4vp/jwe.d.ts +30 -0
  208. package/dist/oid4vp/jwe.js +93 -0
  209. package/dist/oid4vp/oid4vci.d.ts +84 -0
  210. package/dist/oid4vp/oid4vci.js +85 -0
  211. package/dist/oid4vp/request-object.d.ts +109 -0
  212. package/dist/oid4vp/request-object.js +96 -0
  213. package/dist/oid4vp/sd-jwt.d.ts +177 -0
  214. package/dist/oid4vp/sd-jwt.js +208 -0
  215. package/dist/oid4vp/verifier-agent.d.ts +161 -0
  216. package/dist/oid4vp/verifier-agent.js +132 -0
  217. package/dist/oid4vp/wallet.d.ts +116 -0
  218. package/dist/oid4vp/wallet.js +108 -0
  219. package/dist/recipient/store.d.ts +67 -0
  220. package/dist/recipient/store.js +98 -0
  221. package/dist/signing/ecdsa.d.ts +49 -0
  222. package/dist/signing/ecdsa.js +79 -0
  223. package/dist/signing/frost.d.ts +88 -0
  224. package/dist/signing/frost.js +145 -0
  225. package/dist/signing/index.d.ts +4 -0
  226. package/dist/signing/index.js +3 -0
  227. package/dist/slots/faucet.d.ts +23 -0
  228. package/dist/slots/faucet.js +35 -0
  229. package/dist/slots/index.d.ts +2 -0
  230. package/dist/slots/index.js +4 -0
  231. package/dist/verifier-agent/index.d.ts +241 -0
  232. package/dist/verifier-agent/index.js +411 -0
  233. package/docs/DEVELOPER-EXPERIENCE.md +62 -0
  234. package/docs/README.md +33 -0
  235. package/docs/access-control.md +76 -0
  236. package/docs/ai-development.md +292 -0
  237. package/docs/api.md +338 -0
  238. package/docs/application-api.md +335 -0
  239. package/docs/architecture.md +65 -0
  240. package/docs/basics.md +48 -0
  241. package/docs/capabilities.md +86 -0
  242. package/docs/chain.md +153 -0
  243. package/docs/compatibility.md +36 -0
  244. package/docs/consumer-migrations.md +80 -0
  245. package/docs/create-slot.md +104 -0
  246. package/docs/document-signing.md +243 -0
  247. package/docs/encrypted-notes.md +129 -0
  248. package/docs/encryption.md +100 -0
  249. package/docs/errors.md +76 -0
  250. package/docs/flows.md +289 -0
  251. package/docs/fuji.md +127 -0
  252. package/docs/funding.md +126 -0
  253. package/docs/getting-started.md +94 -0
  254. package/docs/glossary.md +44 -0
  255. package/docs/installation.md +132 -0
  256. package/docs/manage-slot.md +95 -0
  257. package/docs/native-approvals.md +124 -0
  258. package/docs/prerequisites.md +137 -0
  259. package/docs/read-slot.md +41 -0
  260. package/docs/reference/README.md +30 -0
  261. package/docs/reference/app-node.md +102 -0
  262. package/docs/reference/app.md +1737 -0
  263. package/docs/reference/chain-node.md +159 -0
  264. package/docs/reference/chain.md +3609 -0
  265. package/docs/reference/committee.md +2176 -0
  266. package/docs/reference/main.md +4068 -0
  267. package/docs/reference/oid4vp.md +2547 -0
  268. package/docs/reference/verifier-agent.md +498 -0
  269. package/docs/shared-account.md +168 -0
  270. package/docs/signing-and-encryption.md +52 -0
  271. package/docs/signing.md +172 -0
  272. package/examples/committee-slot.ts +16 -0
  273. package/examples/connect-fuji.ts +41 -0
  274. package/examples/connect-network.ts +14 -0
  275. package/examples/credential-approvals.ts +46 -0
  276. package/examples/document-signing/README.md +59 -0
  277. package/examples/document-signing/backend.ts +132 -0
  278. package/examples/document-signing/build.mjs +19 -0
  279. package/examples/document-signing/config.ts +34 -0
  280. package/examples/document-signing/gitignore.template +9 -0
  281. package/examples/document-signing/model.ts +140 -0
  282. package/examples/document-signing/network.ts +58 -0
  283. package/examples/document-signing/package.json +25 -0
  284. package/examples/document-signing/public/index.html +27 -0
  285. package/examples/document-signing/public/sample.pdf +31 -0
  286. package/examples/document-signing/public/styles.css +531 -0
  287. package/examples/document-signing/server.ts +358 -0
  288. package/examples/document-signing/setup.ts +111 -0
  289. package/examples/document-signing/store.ts +105 -0
  290. package/examples/document-signing/tsconfig.json +24 -0
  291. package/examples/document-signing/verify.ts +24 -0
  292. package/examples/document-signing/web/app.ts +312 -0
  293. package/examples/document-signing/web/preview.ts +67 -0
  294. package/examples/document-signing/web/wallet.ts +146 -0
  295. package/examples/document-signing/workflow.test.ts +228 -0
  296. package/examples/document-signing/workflow.ts +241 -0
  297. package/examples/document-signing.ts +96 -0
  298. package/examples/encrypted-notes.ts +86 -0
  299. package/examples/ethers-signer.ts +204 -0
  300. package/examples/fund-slot.ts +73 -0
  301. package/examples/getting-started.ts +25 -0
  302. package/examples/learning-authorize.ts +23 -0
  303. package/examples/learning-cancel-slot.ts +11 -0
  304. package/examples/learning-context.ts +28 -0
  305. package/examples/learning-create-slot.ts +25 -0
  306. package/examples/learning-read-slot.ts +8 -0
  307. package/examples/learning-renew-slot.ts +12 -0
  308. package/examples/learning-sign.ts +8 -0
  309. package/examples/live-config.ts +71 -0
  310. package/examples/minimal.ts +6 -0
  311. package/examples/native-approvals.ts +57 -0
  312. package/examples/network.ts +58 -0
  313. package/examples/offline.ts +16 -0
  314. package/examples/personal-vault.ts +20 -0
  315. package/examples/provision-slot.ts +47 -0
  316. package/examples/shared-account.ts +46 -0
  317. package/examples/slot-address.ts +13 -0
  318. package/examples/slot-creation.ts +9 -0
  319. package/examples/tutorial-negative.ts +26 -0
  320. package/examples/tutorial-support.ts +76 -0
  321. package/examples/viem-account.ts +203 -0
  322. package/package.json +303 -4
@@ -0,0 +1,125 @@
1
+ import type { Hex } from 'viem';
2
+ import { type TasraApplication, type TasraApplicationConfig, type AuthorizedOperationOptions } from './client.js';
3
+ import { type ApplicationManifest, type ResolveApplicationManifestOptions, type LoadApplicationManifestOptions } from './manifest.js';
4
+ import { type ApplicationStore, type CreateApplicationSlot, type SlotCreationProgress } from './ready-slot.js';
5
+ import { createLocalWallet, connectWallet, createSlotWallet } from './wallet.js';
6
+ import { createIdentity, issueCredential, verifyCredential, credentialPolicy, credentialAuthorization, presentCredentials } from './identity.js';
7
+ /**
8
+ * Network manifest and optional wallet, storage and transport adapters for an application.
9
+ */
10
+ export interface TasraClientOptions extends ResolveApplicationManifestOptions {
11
+ /**
12
+ * Network manifest downloaded from tasra-releases, or approved application settings.
13
+ */
14
+ manifest: ApplicationManifest;
15
+ /**
16
+ * Private durable store required when creating slots.
17
+ */
18
+ store?: ApplicationStore;
19
+ /** Creator wallet; connect a browser wallet or explicitly generate a local one. */
20
+ wallet?: Pick<ReturnType<typeof createLocalWallet>, 'wallet' | 'signer'>;
21
+ /**
22
+ * Optional existing read client; deployment consistency is checked.
23
+ */
24
+ chain?: TasraApplicationConfig['chain'];
25
+ /**
26
+ * Explicit mapping from registered keeper endpoints to reachable endpoints.
27
+ */
28
+ keeperUrl?: TasraApplicationConfig['keeperUrl'];
29
+ /**
30
+ * HTTP implementation for manifest and keeper requests.
31
+ */
32
+ fetchImpl?: typeof fetch;
33
+ /**
34
+ * Explicit verifier-agent endpoint override.
35
+ */
36
+ verifierAgentUrl?: string;
37
+ }
38
+ /**
39
+ * Per-operation overrides for the creator wallet, durable store and cancellation deadline.
40
+ */
41
+ export interface CreateSlotOptions {
42
+ /**
43
+ * Creator wallet override for this creation request.
44
+ */
45
+ wallet?: TasraClientOptions['wallet'];
46
+ /**
47
+ * Durable store override for the named slot intent.
48
+ */
49
+ store?: ApplicationStore;
50
+ /**
51
+ * Cancel pending creation work; submitted transactions remain on-chain.
52
+ */
53
+ signal?: AbortSignal;
54
+ /**
55
+ * Cooperative creation deadline in milliseconds. In-flight RPC requests and wallet prompts may outlast it; resumed receipt polling has its own wait.
56
+ */
57
+ timeoutMs?: number;
58
+ /** Receive safe creation milestones. Callback failures do not interrupt creation. */
59
+ onProgress?: (progress: SlotCreationProgress) => void | Promise<void>;
60
+ }
61
+ type CreatedSlot<M extends CreateApplicationSlot['mode']> = Awaited<ReturnType<TasraApplication['slots'][M]>>;
62
+ /** Manifest-first application API. Construction validates configuration without network I/O. */
63
+ export declare class TasraClient {
64
+ /**
65
+ * Validated public deployment configuration.
66
+ */
67
+ readonly deployment: TasraApplication['deployment'];
68
+ /**
69
+ * Read-only chain client used for discovery and verification.
70
+ */
71
+ readonly chain: TasraApplication['chain'];
72
+ /**
73
+ * Verifier-agent endpoint selected from configuration or the manifest.
74
+ */
75
+ readonly verifierAgentUrl?: string;
76
+ /**
77
+ * Open existing slot handles or create a durable named slot.
78
+ */
79
+ readonly slots: TasraApplication['slots'] & {
80
+ create: <M extends CreateApplicationSlot['mode']>(input: CreateApplicationSlot & {
81
+ mode: M;
82
+ }, options?: CreateSlotOptions) => Promise<CreatedSlot<M>>;
83
+ };
84
+ /**
85
+ * Create and restore holder or issuer DID identities.
86
+ */
87
+ readonly identities: {
88
+ create: typeof createIdentity;
89
+ };
90
+ /**
91
+ * Issue, verify, present and authorize using holder-bound credentials.
92
+ */
93
+ readonly credentials: {
94
+ issue: typeof issueCredential;
95
+ verify: typeof verifyCredential;
96
+ policy: typeof credentialPolicy;
97
+ authorize: typeof credentialAuthorization;
98
+ present: typeof presentCredentials;
99
+ };
100
+ /**
101
+ * Create a key-backed wallet, connect an external wallet or adapt an ECDSA slot.
102
+ */
103
+ readonly wallets: {
104
+ create: (options?: Parameters<typeof createLocalWallet>[1]) => ReturnType<typeof createLocalWallet>;
105
+ connect: (provider: Parameters<typeof connectWallet>[1]) => ReturnType<typeof connectWallet>;
106
+ fromSlot: (slotId: Hex, options: AuthorizedOperationOptions) => ReturnType<typeof createSlotWallet>;
107
+ };
108
+ /**
109
+ * Check the RPC chain ID and required registry bytecode.
110
+ */
111
+ readonly check: TasraApplication['check'];
112
+ /**
113
+ * Validate manifest configuration and prepare the application adapters without network I/O.
114
+ * @param options Manifest and explicitly chosen storage, wallet and transport settings.
115
+ */
116
+ constructor(options: TasraClientOptions);
117
+ /**
118
+ * Download a network manifest from tasra-releases and construct the application client. An optional independently trusted digest is checked before parsing.
119
+ * @param source Manifest download URL.
120
+ * @param options Digest pin, deployment choices and application adapters.
121
+ * @returns Client configured from the validated manifest.
122
+ */
123
+ static fromManifest(source: string | URL, options?: Omit<TasraClientOptions, 'manifest'> & LoadApplicationManifestOptions): Promise<TasraClient>;
124
+ }
125
+ export {};
@@ -0,0 +1,79 @@
1
+ import { createTasra } from './client.js';
2
+ import { resolveApplicationManifest, loadApplicationManifest } from './manifest.js';
3
+ import { createApplicationSlot } from './ready-slot.js';
4
+ import { createLocalWallet, connectWallet, createSlotWallet } from './wallet.js';
5
+ import { createIdentity, issueCredential, verifyCredential, credentialPolicy, credentialAuthorization, presentCredentials } from './identity.js';
6
+ /** Manifest-first application API. Construction validates configuration without network I/O. */
7
+ export class TasraClient {
8
+ /**
9
+ * Validated public deployment configuration.
10
+ */
11
+ deployment;
12
+ /**
13
+ * Read-only chain client used for discovery and verification.
14
+ */
15
+ chain;
16
+ /**
17
+ * Verifier-agent endpoint selected from configuration or the manifest.
18
+ */
19
+ verifierAgentUrl;
20
+ /**
21
+ * Open existing slot handles or create a durable named slot.
22
+ */
23
+ slots;
24
+ /**
25
+ * Create and restore holder or issuer DID identities.
26
+ */
27
+ identities = { create: createIdentity };
28
+ /**
29
+ * Issue, verify, present and authorize using holder-bound credentials.
30
+ */
31
+ credentials = { issue: issueCredential, verify: verifyCredential, policy: credentialPolicy, authorize: credentialAuthorization, present: presentCredentials };
32
+ /**
33
+ * Create a key-backed wallet, connect an external wallet or adapt an ECDSA slot.
34
+ */
35
+ wallets;
36
+ /**
37
+ * Check the RPC chain ID and required registry bytecode.
38
+ */
39
+ check;
40
+ /**
41
+ * Validate manifest configuration and prepare the application adapters without network I/O.
42
+ * @param options Manifest and explicitly chosen storage, wallet and transport settings.
43
+ */
44
+ constructor(options) {
45
+ options = { ...options };
46
+ const resolved = resolveApplicationManifest(options.manifest, options);
47
+ const keeperUrl = options.keeperUrl ?? resolved.keeperUrl;
48
+ const app = createTasra({ ...resolved, keeperUrl, chain: options.chain, fetchImpl: options.fetchImpl });
49
+ this.deployment = app.deployment;
50
+ this.chain = app.chain;
51
+ this.verifierAgentUrl = options.verifierAgentUrl ?? resolved.verifierAgentUrl;
52
+ this.check = app.check;
53
+ this.wallets = {
54
+ create: config => createLocalWallet(app.deployment, config),
55
+ connect: provider => connectWallet(app.deployment, provider),
56
+ fromSlot: (slotId, config) => createSlotWallet(app, slotId, config),
57
+ };
58
+ this.slots = { ...app.slots, create: async (input, config = {}) => {
59
+ const request = structuredClone(input);
60
+ const wallet = config.wallet ?? options.wallet, store = config.store ?? options.store;
61
+ if (!wallet || !store)
62
+ throw new Error('Creating slots requires a creator wallet and durable store');
63
+ const id = await createApplicationSlot(app, request, { ...wallet, store, keeperUrl, fetchImpl: options.fetchImpl, signal: config.signal, timeoutMs: config.timeoutMs, onProgress: config.onProgress });
64
+ return await app.slots[request.mode](id);
65
+ } };
66
+ }
67
+ /**
68
+ * Download a network manifest from tasra-releases and construct the application client. An optional independently trusted digest is checked before parsing.
69
+ * @param source Manifest download URL.
70
+ * @param options Digest pin, deployment choices and application adapters.
71
+ * @returns Client configured from the validated manifest.
72
+ */
73
+ static async fromManifest(source, options = {}) {
74
+ options = { ...options };
75
+ const resolved = await loadApplicationManifest(source, options);
76
+ return new TasraClient({ ...options, manifest: resolved.deployment, keeperUrl: options.keeperUrl ?? resolved.keeperUrl,
77
+ verifierAgentUrl: options.verifierAgentUrl ?? resolved.verifierAgentUrl });
78
+ }
79
+ }
@@ -0,0 +1,10 @@
1
+ import { type LocalAccount } from 'viem';
2
+ import type { AuthorizedOperationOptions, EcdsaSlot } from './client.js';
3
+ /**
4
+ * Use a Tasra slot as a viem account. Every signing call gets fresh authorization;
5
+ * this adapter never broadcasts a transaction. Pass it to viem's createWalletClient.
6
+ * @param slot Ready threshold ECDSA slot.
7
+ * @param options Fresh authorization callback and operation controls.
8
+ * @returns Viem account that verifies signatures before returning them.
9
+ */
10
+ export declare function toViemAccount(slot: EcdsaSlot, options: AuthorizedOperationOptions): Promise<LocalAccount>;
@@ -0,0 +1,32 @@
1
+ import { hashMessage, hashTypedData, keccak256, serializeSignature, serializeTransaction, hexToBytes, toHex, recoverAddress } from 'viem';
2
+ import { toAccount } from 'viem/accounts';
3
+ import { TasraApplicationError } from './client.js';
4
+ /**
5
+ * Use a Tasra slot as a viem account. Every signing call gets fresh authorization;
6
+ * this adapter never broadcasts a transaction. Pass it to viem's createWalletClient.
7
+ * @param slot Ready threshold ECDSA slot.
8
+ * @param options Fresh authorization callback and operation controls.
9
+ * @returns Viem account that verifies signatures before returning them.
10
+ */
11
+ export async function toViemAccount(slot, options) {
12
+ const address = await slot.getAddress();
13
+ const sign = async (hash) => {
14
+ if ((await slot.getAddress()).toLowerCase() !== address.toLowerCase())
15
+ throw new TasraApplicationError('SLOT_CHANGED', 'Slot account changed; construct a new viem account');
16
+ const result = await slot.signDigest(hexToBytes(hash), options);
17
+ const signature = { r: toHex(result.r), s: toHex(result.s), yParity: result.yParity };
18
+ if ((await recoverAddress({ hash, signature })).toLowerCase() !== address.toLowerCase())
19
+ throw new TasraApplicationError('SLOT_CHANGED', 'Signature belongs to a different account; construct a new viem account');
20
+ return signature;
21
+ };
22
+ return toAccount({ address,
23
+ async sign({ hash }) { return serializeSignature(await sign(hash)); },
24
+ async signMessage({ message }) { return serializeSignature(await sign(hashMessage(message))); },
25
+ async signTypedData(data) { return serializeSignature(await sign(hashTypedData(data))); },
26
+ async signTransaction(transaction, serializerOptions) {
27
+ const serialize = (serializerOptions?.serializer ?? serializeTransaction);
28
+ const tx = transaction;
29
+ return serialize(tx, await sign(keccak256(serialize(tx))));
30
+ },
31
+ });
32
+ }
@@ -0,0 +1,126 @@
1
+ import { type Account, type Address, type Chain, type EIP1193Provider, type Hex, type TransactionReceipt, type Transport, type WalletClient } from 'viem';
2
+ import type { TypedDataSigner } from '../oid4vp/verifier-agent.js';
3
+ import { type TasraDeployment } from './deployment.js';
4
+ import type { AuthorizedOperationOptions, TasraApplication } from './client.js';
5
+ import type { ApplicationStore } from './ready-slot.js';
6
+ /**
7
+ * Recipient, native-token value and optional calldata, gas limit and nonce.
8
+ */
9
+ export interface WalletTransactionInput {
10
+ /**
11
+ * Destination EVM address.
12
+ */
13
+ to: Address;
14
+ /**
15
+ * Native-token value in base units; defaults to zero.
16
+ */
17
+ value?: bigint;
18
+ /**
19
+ * Hex-encoded contract calldata; omitted for a plain transfer.
20
+ */
21
+ data?: Hex;
22
+ /**
23
+ * Optional transaction gas limit.
24
+ */
25
+ gas?: bigint;
26
+ /**
27
+ * Explicit transaction nonce when supplied.
28
+ */
29
+ nonce?: number;
30
+ }
31
+ /** Private durable evidence; signed bytes permit explicit recovery without creating a new transaction. */
32
+ export interface WalletTransactionJournal {
33
+ /**
34
+ * Wallet journal schema version.
35
+ */
36
+ schemaVersion: 1;
37
+ /**
38
+ * Chain to which the signed or submitted transaction is bound.
39
+ */
40
+ chainId: number;
41
+ /**
42
+ * Signing account address.
43
+ */
44
+ from: Address;
45
+ /**
46
+ * Original recipient, amount and transaction overrides.
47
+ */
48
+ request: WalletTransactionInput;
49
+ /**
50
+ * Last persisted transaction-submission or confirmation stage.
51
+ */
52
+ phase: 'signed' | 'submitting' | 'submitted' | 'confirmed';
53
+ /**
54
+ * Transaction hash, when known.
55
+ */
56
+ hash?: Hex;
57
+ /**
58
+ * Private signed bytes available for explicit transaction recovery.
59
+ */
60
+ signedTransaction?: Hex;
61
+ /**
62
+ * Observed chain receipt after confirmation.
63
+ */
64
+ receipt?: TransactionReceipt;
65
+ }
66
+ /**
67
+ * Chain-bound wallet adapter with durable transaction submission and receipt recovery.
68
+ */
69
+ export interface TasraWallet {
70
+ /**
71
+ * Selected EVM account address.
72
+ */
73
+ address: Address;
74
+ /**
75
+ * Bound viem wallet for advanced integrations.
76
+ */
77
+ wallet: WalletClient<Transport, Chain, Account>;
78
+ /**
79
+ * EIP-712 signer that rechecks account and chain consistency.
80
+ */
81
+ signer: TypedDataSigner;
82
+ /**
83
+ * Read this account native-token balance in base units.
84
+ */
85
+ getBalance(): Promise<bigint>;
86
+ /**
87
+ * Read the pending account nonce from the configured RPC.
88
+ */
89
+ getTransactionCount(): Promise<number>;
90
+ /** Persist and serialize a named transfer. Reusing its name only observes the saved transaction. */
91
+ transfer(name: string, input: WalletTransactionInput, store: ApplicationStore): Promise<WalletTransactionJournal>;
92
+ /** Serialize calls per account; persist must be durable before resolving. A failed send is never automatically retried. */
93
+ sendTransaction(input: WalletTransactionInput, options: {
94
+ persist: (journal: WalletTransactionJournal) => Promise<void>;
95
+ }): Promise<WalletTransactionJournal>;
96
+ /** Observes the saved hash only; never signs, replaces, or broadcasts. Unknown external-wallet outcomes require reconciliation. */
97
+ waitForTransaction(journal: WalletTransactionJournal, options?: {
98
+ timeoutMs?: number;
99
+ persist?: (journal: WalletTransactionJournal) => Promise<void>;
100
+ }): Promise<WalletTransactionJournal>;
101
+ }
102
+ /**
103
+ * Create or restore a local key. Explicitly export and save a generated key before funding it.
104
+ * @param deployment Approved network settings.
105
+ * @param options Optional existing private key; a fresh key is generated otherwise.
106
+ * @returns Chain-bound wallet with an explicit private-key export function.
107
+ */
108
+ export declare function createLocalWallet(deployment: TasraDeployment, options?: {
109
+ privateKey?: Hex;
110
+ }): TasraWallet & {
111
+ exportPrivateKey(): Hex;
112
+ };
113
+ /**
114
+ * Requests the user's wallet account. Chain switching remains an explicit wallet/user decision.
115
+ * @param deployment Approved network settings.
116
+ * @param provider User-selected EIP-1193 wallet provider.
117
+ * @returns Wallet bound to the authorized account and matching chain.
118
+ */
119
+ export declare function connectWallet(deployment: TasraDeployment, provider: EIP1193Provider): Promise<TasraWallet>;
120
+ /**
121
+ * Use a threshold ECDSA slot with fresh operation authorization on every signature.
122
+ * @param application Application client connected to the slot deployment.
123
+ * @param slotId Ready threshold ECDSA slot to expose as an Ethereum wallet.
124
+ * @param options Fresh authorization callback used for every signature.
125
+ */
126
+ export declare function createSlotWallet(application: TasraApplication, slotId: Hex, options: AuthorizedOperationOptions): Promise<TasraWallet>;
@@ -0,0 +1,137 @@
1
+ import { createPublicClient, createWalletClient, custom, defineChain, http, keccak256, toHex, parseTransaction, recoverTransactionAddress } from 'viem';
2
+ import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts';
3
+ import { TasraError } from '../errors.js';
4
+ import { defineDeployment } from './deployment.js';
5
+ import { toViemAccount } from './viem.js';
6
+ function chainFor(deployment) {
7
+ return defineChain({ id: deployment.chainId, name: deployment.name, nativeCurrency: { name: 'Native token', symbol: 'NATIVE', decimals: 18 }, rpcUrls: { default: { http: [deployment.rpcUrl] } } });
8
+ }
9
+ async function verifySignedTransaction(journal) {
10
+ if (!journal.signedTransaction)
11
+ return;
12
+ const transaction = parseTransaction(journal.signedTransaction);
13
+ const sender = await recoverTransactionAddress({ serializedTransaction: journal.signedTransaction });
14
+ const request = journal.request;
15
+ if (transaction.chainId !== journal.chainId || sender.toLowerCase() !== journal.from.toLowerCase() ||
16
+ transaction.to?.toLowerCase() !== request.to.toLowerCase() || (transaction.value ?? 0n) !== (request.value ?? 0n) ||
17
+ (transaction.data ?? '0x').toLowerCase() !== (request.data ?? '0x').toLowerCase() ||
18
+ request.gas !== undefined && transaction.gas !== request.gas || request.nonce !== undefined && transaction.nonce !== request.nonce) {
19
+ throw new TasraError('Signed transaction differs from its saved wallet, chain or request');
20
+ }
21
+ }
22
+ function wrap(deployment, wallet, local) {
23
+ const config = defineDeployment(deployment), address = wallet.account.address;
24
+ const pub = createPublicClient({ chain: chainFor(config), transport: http(config.rpcUrl, { retryCount: 0 }) });
25
+ async function assertChain() {
26
+ if (await pub.getChainId() !== config.chainId || await wallet.getChainId() !== config.chainId)
27
+ throw new TasraError('Wallet or RPC chain differs from the deployment');
28
+ if (!local && !(await wallet.getAddresses()).some(a => a.toLowerCase() === address.toLowerCase()))
29
+ throw new TasraError('Connected wallet account changed');
30
+ }
31
+ const result = { address, wallet,
32
+ signer: { address, async signTypedData(args) { const data = structuredClone(args); await assertChain(); return wallet.signTypedData(data); } },
33
+ async getBalance() { await assertChain(); return pub.getBalance({ address }); },
34
+ async getTransactionCount() { await assertChain(); return pub.getTransactionCount({ address, blockTag: 'pending' }); },
35
+ async transfer(name, input, store) {
36
+ if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,100}$/.test(name))
37
+ throw new TasraError('Invalid transaction name');
38
+ const request = structuredClone(input);
39
+ const key = `transfer-${keccak256(toHex(JSON.stringify([config.chainId, address.toLowerCase(), name]))).slice(2)}`;
40
+ return store.withLock(`wallet-${config.chainId}-${address}`, async () => {
41
+ const saved = await store.load(key);
42
+ if (saved && (saved.request.to.toLowerCase() !== request.to.toLowerCase() ||
43
+ (saved.request.value ?? 0n) !== (request.value ?? 0n) || (saved.request.data ?? '0x').toLowerCase() !== (request.data ?? '0x').toLowerCase() ||
44
+ saved.request.gas !== request.gas || saved.request.nonce !== request.nonce))
45
+ throw new TasraError('Transaction name already identifies a different request');
46
+ const persist = (journal) => store.save(key, journal);
47
+ const journal = saved ?? await result.sendTransaction(request, { persist });
48
+ return result.waitForTransaction(journal, { persist });
49
+ });
50
+ },
51
+ async sendTransaction(input, { persist }) {
52
+ const request = structuredClone(input);
53
+ await assertChain();
54
+ const journal = { schemaVersion: 1, chainId: config.chainId, from: address, request, phase: 'submitting' };
55
+ if (local) {
56
+ const prepared = await wallet.prepareTransactionRequest({ ...request, account: local, chain: wallet.chain });
57
+ const serialized = await wallet.signTransaction({ ...prepared, account: local, chain: wallet.chain });
58
+ journal.signedTransaction = serialized;
59
+ journal.hash = keccak256(serialized);
60
+ journal.phase = 'signed';
61
+ await verifySignedTransaction(journal);
62
+ // If this save fails, neither the transport nor the provider has seen a send request.
63
+ await persist(structuredClone(journal));
64
+ await assertChain();
65
+ const returned = await pub.sendRawTransaction({ serializedTransaction: serialized });
66
+ if (returned.toLowerCase() !== journal.hash.toLowerCase())
67
+ throw new TasraError('RPC returned a different transaction hash; reconcile the saved signed transaction');
68
+ }
69
+ else {
70
+ await persist(structuredClone(journal));
71
+ await assertChain();
72
+ journal.hash = await wallet.sendTransaction({ ...request, account: wallet.account, chain: wallet.chain });
73
+ }
74
+ journal.phase = 'submitted';
75
+ await persist(structuredClone(journal));
76
+ return journal;
77
+ },
78
+ async waitForTransaction(input, options = {}) {
79
+ const journal = structuredClone(input), { timeoutMs = 120_000, persist } = options;
80
+ if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1)
81
+ throw new TasraError('Invalid transaction receipt timeout');
82
+ if (journal.schemaVersion !== 1 || journal.chainId !== config.chainId || journal.from.toLowerCase() !== address.toLowerCase())
83
+ throw new TasraError('Saved transaction belongs to a different wallet or deployment');
84
+ if (!journal.hash || !/^0x[0-9a-fA-F]{64}$/.test(journal.hash))
85
+ throw new TasraError('Transaction outcome is unknown; reconcile its hash with the wallet before waiting');
86
+ if (journal.signedTransaction && keccak256(journal.signedTransaction) !== journal.hash)
87
+ throw new TasraError('Saved transaction hash differs from its signed bytes');
88
+ await verifySignedTransaction(journal);
89
+ await assertChain();
90
+ const receipt = await pub.waitForTransactionReceipt({ hash: journal.hash, timeout: timeoutMs, checkReplacement: false });
91
+ journal.phase = 'confirmed';
92
+ journal.receipt = receipt;
93
+ await persist?.(structuredClone(journal));
94
+ if (receipt.status !== 'success')
95
+ throw new TasraError(`Transaction reverted: ${journal.hash}`);
96
+ return journal;
97
+ }, };
98
+ return result;
99
+ }
100
+ /**
101
+ * Create or restore a local key. Explicitly export and save a generated key before funding it.
102
+ * @param deployment Approved network settings.
103
+ * @param options Optional existing private key; a fresh key is generated otherwise.
104
+ * @returns Chain-bound wallet with an explicit private-key export function.
105
+ */
106
+ export function createLocalWallet(deployment, options = {}) {
107
+ const config = defineDeployment(deployment), key = options.privateKey ?? generatePrivateKey(), account = privateKeyToAccount(key);
108
+ const wallet = createWalletClient({ account, chain: chainFor(config), transport: http(config.rpcUrl, { retryCount: 0 }) });
109
+ return { ...wrap(config, wallet, account), exportPrivateKey: () => key };
110
+ }
111
+ /**
112
+ * Requests the user's wallet account. Chain switching remains an explicit wallet/user decision.
113
+ * @param deployment Approved network settings.
114
+ * @param provider User-selected EIP-1193 wallet provider.
115
+ * @returns Wallet bound to the authorized account and matching chain.
116
+ */
117
+ export async function connectWallet(deployment, provider) {
118
+ const config = defineDeployment(deployment), transport = custom(provider, { retryCount: 0 }), chain = chainFor(config);
119
+ const connection = createWalletClient({ chain, transport });
120
+ if (await connection.getChainId() !== config.chainId)
121
+ throw new TasraError('Connected wallet chain differs from the deployment');
122
+ const [address] = await connection.requestAddresses();
123
+ if (!address)
124
+ throw new TasraError('Wallet did not authorize an account');
125
+ return wrap(config, createWalletClient({ account: address, chain, transport }));
126
+ }
127
+ /**
128
+ * Use a threshold ECDSA slot with fresh operation authorization on every signature.
129
+ * @param application Application client connected to the slot deployment.
130
+ * @param slotId Ready threshold ECDSA slot to expose as an Ethereum wallet.
131
+ * @param options Fresh authorization callback used for every signature.
132
+ */
133
+ export async function createSlotWallet(application, slotId, options) {
134
+ const account = await toViemAccount(await application.slots.ecdsa(slotId), options);
135
+ const config = application.deployment;
136
+ return wrap(config, createWalletClient({ account, chain: chainFor(config), transport: http(config.rpcUrl, { retryCount: 0 }) }), account);
137
+ }
@@ -0,0 +1,86 @@
1
+ /** Anything that can produce a DPoP proof for a given request. */
2
+ export interface DpopSigner {
3
+ /**
4
+ * Mint a proof over `(htm, htu)`, with `nonce` and `ath` (from `accessToken`) when given.
5
+ *
6
+ * RFC 9449 decides which claims a proof carries, and the two requests differ: a proof
7
+ * PRESENTING a token carries `ath` (and our agent always demands a `nonce`); a proof
8
+ * REQUESTING a token cannot carry `ath` — there is no token yet — and carries `nonce` only
9
+ * when the authorization server has challenged for one. An implementation omits each
10
+ * claim whose argument is absent, never sends it empty.
11
+ *
12
+ * An implementation MUST sign with the key the access token is bound to; a proof under
13
+ * any other key is refused by every drawn verifier with `DPoP proof jwk is not the key
14
+ * the access token is bound to`.
15
+ */
16
+ proof(args: {
17
+ htm: string;
18
+ htu: string;
19
+ nonce?: string;
20
+ accessToken?: string;
21
+ }): Promise<string>;
22
+ }
23
+ /**
24
+ * Compute the base64url SHA-256 access-token hash for the DPoP ath claim.
25
+ *
26
+ * @param accessToken - Exact access token string to bind into the DPoP proof.
27
+ */
28
+ export declare function accessTokenHash(accessToken: string): Promise<string>;
29
+ /** An ES256 key pair for DPoP, plus a {@link DpopSigner} over it. */
30
+ export interface DpopKey {
31
+ /** The public half, as the JWK that rides in every proof header. */
32
+ publicJwk: JsonWebKey;
33
+ /** RFC 7638 thumbprint - the value the IdP puts in the token's `cnf.jkt`. */
34
+ thumbprint(): Promise<string>;
35
+ /**
36
+ * The proof for a TOKEN REQUEST to the IdP (RFC 9449 §5): `htm`/`htu` of the token
37
+ * endpoint, the IdP's `DPoP-Nonce` only if it challenged for one, and never `ath`. The IdP
38
+ * binds the token it issues to this key (`cnf.jkt`).
39
+ */
40
+ tokenRequestProof(args: {
41
+ htm: string;
42
+ htu: string;
43
+ nonce?: string;
44
+ }): Promise<string>;
45
+ /** The proof for PRESENTING the token — pass it to `submitOauthResponse`. */
46
+ signer: DpopSigner;
47
+ }
48
+ /**
49
+ * Generate an ES256 DPoP key pair with a non-extractable private key.
50
+ * The returned signer can create proofs without exposing the private key bytes.
51
+ */
52
+ export declare function createDpopKey(): Promise<DpopKey>;
53
+ /**
54
+ * RFC 7638 JWK thumbprint of an EC P-256 public key.
55
+ *
56
+ * The member order is LEXICOGRAPHIC and the JSON has no whitespace - the RFC hashes an
57
+ * exactly specified string, so `JSON.stringify` over an object literal in a different order
58
+ * yields a different thumbprint and the token's `cnf.jkt` would never match.
59
+ *
60
+ * @param jwk - Public JSON Web Key whose required members form the thumbprint.
61
+ */
62
+ export declare function jwkThumbprint(jwk: JsonWebKey): Promise<string>;
63
+ /**
64
+ * Wrap `auth0-spa-js`'s own proof minter as a {@link DpopSigner}.
65
+ *
66
+ * The SDK holds the key, so this is the ONLY way an Auth0 app can produce a proof whose
67
+ * `jkt` matches its token's `cnf.jkt`.
68
+ *
69
+ * ```ts
70
+ * const signer = auth0DpopSigner((args) => auth0.generateDpopProof(args))
71
+ * ```
72
+ *
73
+ * @param generate - Callback that creates a DPoP proof using the identity provider client's bound key.
74
+ */
75
+ export declare function auth0DpopSigner(generate: (args: {
76
+ url: string;
77
+ method: string;
78
+ nonce?: string;
79
+ accessToken?: string;
80
+ }) => Promise<string>): DpopSigner;
81
+ /**
82
+ * Guard for a nonce that can ride in a header (the agent's challenge carries it back).
83
+ *
84
+ * @param nonce - Nonce text to check before using it as an HTTP header value.
85
+ */
86
+ export declare function isHeaderSafeNonce(nonce: string): boolean;