@shuttle.technology/authorization 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +708 -2
  2. package/dist/aesGcmSiv.d.ts +14 -0
  3. package/dist/aesGcmSiv.js +160 -0
  4. package/dist/auth.d.ts +68 -0
  5. package/dist/auth.js +215 -0
  6. package/dist/balances.d.ts +31 -0
  7. package/dist/balances.js +44 -0
  8. package/dist/canonicalize.d.ts +19 -0
  9. package/dist/canonicalize.js +107 -0
  10. package/dist/client.d.ts +264 -0
  11. package/dist/client.js +754 -0
  12. package/dist/deviceKey.d.ts +13 -0
  13. package/dist/deviceKey.js +28 -0
  14. package/dist/deviceShare.d.ts +9 -0
  15. package/dist/deviceShare.js +24 -0
  16. package/dist/deviceShareEnvelope.d.ts +13 -0
  17. package/dist/deviceShareEnvelope.js +139 -0
  18. package/dist/linkedChecks.d.ts +17 -0
  19. package/dist/linkedChecks.js +31 -0
  20. package/dist/linkedSendDisplay.d.ts +73 -0
  21. package/dist/linkedSendDisplay.js +84 -0
  22. package/dist/linkedWalletSignals.d.ts +22 -0
  23. package/dist/linkedWalletSignals.js +101 -0
  24. package/dist/linkedWallets.d.ts +373 -0
  25. package/dist/linkedWallets.js +471 -0
  26. package/dist/mediatedOperation.d.ts +27 -0
  27. package/dist/mediatedOperation.js +68 -0
  28. package/dist/modeC.d.ts +131 -0
  29. package/dist/modeC.js +248 -0
  30. package/dist/modeCLinked.d.ts +207 -0
  31. package/dist/modeCLinked.js +270 -0
  32. package/dist/pages.d.ts +22 -0
  33. package/dist/pages.js +45 -0
  34. package/dist/poll.d.ts +15 -0
  35. package/dist/poll.js +76 -0
  36. package/dist/requestGrant.d.ts +169 -0
  37. package/dist/requestGrant.js +243 -0
  38. package/dist/sends.d.ts +89 -0
  39. package/dist/sends.js +127 -0
  40. package/dist/slice4.d.ts +173 -0
  41. package/dist/slice4.js +285 -0
  42. package/dist/streams.d.ts +212 -0
  43. package/dist/streams.js +282 -0
  44. package/dist/trackedWallets.d.ts +53 -0
  45. package/dist/trackedWallets.js +104 -0
  46. package/dist/transferStatus.d.ts +45 -0
  47. package/dist/transferStatus.js +43 -0
  48. package/dist/walletDisplayParts.d.ts +15 -0
  49. package/dist/walletDisplayParts.js +43 -0
  50. package/dist/walletEvents.d.ts +43 -0
  51. package/dist/walletEvents.js +97 -0
  52. package/dist/walletLimits.d.ts +65 -0
  53. package/dist/walletLimits.js +102 -0
  54. package/dist/walletOperations.d.ts +192 -0
  55. package/dist/walletOperations.js +308 -0
  56. package/package.json +64 -4
@@ -0,0 +1,308 @@
1
+ // Mode B user wallet operations (AUTH-009-A03, source §1.3). Closed types,
2
+ // client-side validation of the five wallet payloads, and strict parsers for
3
+ // the safe status projection and the protected wallet result. These helpers
4
+ // compose the same /v1 operation routes as the local operations; they add no
5
+ // authority. Local faults raise ClientFlowError; server denials stay
6
+ // AuthorizationError and are produced by the caller's transport.
7
+ import { ClientFlowError, canonicalDecimal, deadlineAfter, isNextAction, opaqueId, record, rfc3339UTC, } from "./auth.js";
8
+ import { bindingRevision, displayCommon, lowerUUID, rawQuantity, summaryOf, walletRecipient } from "./walletDisplayParts.js";
9
+ import { parseLinkedSendDisplay } from "./linkedSendDisplay.js";
10
+ import { parseMediatedOperation } from "./mediatedOperation.js";
11
+ export { LinkedSendAssets, MaxTransferCommentBytes, ReplaceActions, linkedSendAsset, replaceAction, transferComment } from "./linkedSendDisplay.js";
12
+ /** walletMaterialPurged separates the purged display from every material display. */
13
+ export function walletMaterialPurged(display) {
14
+ return "materialPurged" in display;
15
+ }
16
+ /** MaxWalletMessageBytes is the decoded wallet.sign payload bound of source §2.8. */
17
+ export const MaxWalletMessageBytes = 4096;
18
+ const maxWalletGeneration = (1n << 64n) - 1n;
19
+ const compressedP256Key = /^(02|03)[0-9a-f]{64}$/;
20
+ const walletNetwork = /^[A-Za-z0-9_.-]{1,64}$/;
21
+ const base64urlValue = /^[A-Za-z0-9_-]+$/;
22
+ /**
23
+ * validateUserWalletCreate rejects every locally detectable fault before any
24
+ * request leaves the client: a foreign owner, a wallet ID present or absent
25
+ * against its kind, a non-compressed recipient key, a noncanonical or
26
+ * out-of-range quantity, a non-native asset, and a sign message outside
27
+ * 1..4096 decoded bytes. It returns the exact value it was given so the
28
+ * caller sends the same closed body it validated.
29
+ */
30
+ export function validateUserWalletCreate(value, expectedOwnerId) {
31
+ const common = record(value, ["kind", "owner_type", "owner_id", "payload"], ["wallet_id", "result_recipient"]);
32
+ if (common.owner_type !== "account" || !opaqueId(common.owner_id) || common.owner_id !== expectedOwnerId) {
33
+ throw new ClientFlowError("invalid_operation_create");
34
+ }
35
+ if (common.result_recipient !== undefined) {
36
+ const recipient = record(common.result_recipient, ["type", "id"]);
37
+ if ((recipient.type !== "account" && recipient.type !== "service") || !opaqueId(recipient.id))
38
+ throw new ClientFlowError("invalid_operation_create");
39
+ }
40
+ const walletRequired = common.kind !== "wallet.create";
41
+ if (walletRequired !== opaqueId(common.wallet_id))
42
+ throw new ClientFlowError("invalid_operation_create");
43
+ switch (common.kind) {
44
+ case "wallet.create": {
45
+ const payload = record(common.payload, ["network", "recipient_public_key"]);
46
+ if (!network(payload.network) || !recipientPublicKey(payload.recipient_public_key))
47
+ throw new ClientFlowError("invalid_operation_create");
48
+ break;
49
+ }
50
+ case "wallet.sign": {
51
+ const payload = record(common.payload, ["network", "message_base64url"]);
52
+ if (!network(payload.network) || !boundedMessage(payload.message_base64url))
53
+ throw new ClientFlowError("invalid_operation_create");
54
+ break;
55
+ }
56
+ case "wallet.send": {
57
+ const payload = record(common.payload, ["network", "asset", "recipient", "amount_raw", "max_fee_raw"]);
58
+ if (!network(payload.network) || payload.asset !== "native" || typeof payload.recipient !== "string" || !walletRecipient.test(payload.recipient) ||
59
+ !rawQuantity(payload.amount_raw, true) || !rawQuantity(payload.max_fee_raw, false)) {
60
+ throw new ClientFlowError("invalid_operation_create");
61
+ }
62
+ break;
63
+ }
64
+ case "wallet.export": {
65
+ const payload = record(common.payload, ["recipient_public_key"]);
66
+ if (!recipientPublicKey(payload.recipient_public_key))
67
+ throw new ClientFlowError("invalid_operation_create");
68
+ break;
69
+ }
70
+ case "wallet.recover": {
71
+ const payload = record(common.payload, ["expected_generation", "recipient_public_key"]);
72
+ if (!recipientPublicKey(payload.recipient_public_key) || !walletGeneration(payload.expected_generation))
73
+ throw new ClientFlowError("invalid_operation_create");
74
+ break;
75
+ }
76
+ default:
77
+ throw new ClientFlowError("invalid_operation_create");
78
+ }
79
+ return value;
80
+ }
81
+ export function parseUserWalletOperationEnvelope(payload) {
82
+ const root = record(payload, ["request_id", "operation"]);
83
+ if (!opaqueId(root.request_id))
84
+ throw new ClientFlowError("invalid_server_response");
85
+ return { requestId: root.request_id, operation: parseUserWalletOperation(root.operation) };
86
+ }
87
+ export function parseUserWalletOperation(payload) {
88
+ // A Mode C send is read in the mediated projection the provider serves for it.
89
+ if (payload !== null && typeof payload === "object" && payload.authorization_basis === "user_request_signed")
90
+ return parseMediatedOperation(payload);
91
+ const root = record(payload, [
92
+ "id", "version", "kind", "state", "effect_state", "authorization_basis", "owner_type", "owner_id", "requester_id",
93
+ "request_fingerprint", "operation_fingerprint", "display", "created_at", "expires_at", "next_action",
94
+ ], ["wallet_id", "confirmation_location", "result_kind", "binding_source", "connection_id", "linked_wallet_id", "binding_revision"]);
95
+ if (!opaqueId(root.id) || !canonicalDecimal(root.version) || !userWalletKind(root.kind) || !userWalletState(root.state) ||
96
+ !userWalletEffectState(root.effect_state) || !userWalletBasis(root.authorization_basis) ||
97
+ root.owner_type !== "account" || !opaqueId(root.owner_id) || !opaqueId(root.requester_id) ||
98
+ (root.wallet_id !== undefined && !opaqueId(root.wallet_id)) || !lowerHexDigest(root.request_fingerprint) ||
99
+ !lowerHexDigest(root.operation_fingerprint) || !rfc3339UTC(root.created_at) || !rfc3339UTC(root.expires_at) ||
100
+ !deadlineAfter(root.created_at, root.expires_at) || (root.confirmation_location !== undefined && !httpsURL(root.confirmation_location)) ||
101
+ (root.result_kind !== undefined && !walletResultKind(root.result_kind)) || !isNextAction(root.next_action)) {
102
+ throw new ClientFlowError("invalid_server_response");
103
+ }
104
+ // A linked wallet is named by all three of its members, only for a send,
105
+ // and never beside an own wallet.
106
+ const linked = root.binding_source !== undefined;
107
+ if (linked && (root.binding_source !== "linked_wallet" || root.kind !== "wallet.send" || root.wallet_id !== undefined ||
108
+ !lowerUUID(root.connection_id) || !lowerUUID(root.linked_wallet_id) || !bindingRevision(root.binding_revision))) {
109
+ throw new ClientFlowError("invalid_server_response");
110
+ }
111
+ if (!linked && (root.connection_id !== undefined || root.linked_wallet_id !== undefined || root.binding_revision !== undefined || root.authorization_basis === "session_authorized")) {
112
+ throw new ClientFlowError("invalid_server_response");
113
+ }
114
+ const display = linked && !purgedDisplay(root.display) ? parseLinkedSendDisplay(root.display) : parseUserWalletDisplay(root.display, root.kind);
115
+ if (display.ownerId !== root.owner_id || display.requesterId !== root.requester_id || display.walletId !== root.wallet_id) {
116
+ throw new ClientFlowError("invalid_server_response");
117
+ }
118
+ if ("linkedWalletId" in display && (display.linkedWalletId !== root.linked_wallet_id || display.connectionId !== root.connection_id || display.bindingRevision !== root.binding_revision)) {
119
+ throw new ClientFlowError("invalid_server_response");
120
+ }
121
+ const operation = {
122
+ id: root.id,
123
+ version: root.version,
124
+ kind: root.kind,
125
+ state: root.state,
126
+ effectState: root.effect_state,
127
+ authorizationBasis: root.authorization_basis,
128
+ ownerType: root.owner_type,
129
+ ownerId: root.owner_id,
130
+ requesterId: root.requester_id,
131
+ requestFingerprint: root.request_fingerprint,
132
+ operationFingerprint: root.operation_fingerprint,
133
+ display,
134
+ createdAt: root.created_at,
135
+ expiresAt: root.expires_at,
136
+ nextAction: root.next_action,
137
+ };
138
+ if (root.wallet_id !== undefined)
139
+ operation.walletId = root.wallet_id;
140
+ if (linked)
141
+ operation.linkedWallet = { connectionId: root.connection_id, linkedWalletId: root.linked_wallet_id, bindingRevision: root.binding_revision };
142
+ if (root.confirmation_location !== undefined)
143
+ operation.confirmationLocation = root.confirmation_location;
144
+ if (root.result_kind !== undefined)
145
+ operation.resultKind = root.result_kind;
146
+ return operation;
147
+ }
148
+ /**
149
+ * parseWalletResult accepts the protected wallet output of source §2.2:
150
+ * output_base64url is present for a signature and forbidden for a transfer
151
+ * receipt. A wallet_created result is its own closed shape: the created
152
+ * wallet and its sealed device share, with no output member.
153
+ */
154
+ export function parseWalletResult(payload, expectedOperationId) {
155
+ const root = record(payload, ["request_id", "result"]);
156
+ if (root.result !== null && typeof root.result === "object" && root.result.kind === "wallet_created") {
157
+ return parseCreatedWalletResult(root.request_id, root.result, expectedOperationId);
158
+ }
159
+ const result = record(root.result, ["operation_id", "kind", "receipt_id"], ["output_base64url"]);
160
+ if (!opaqueId(root.request_id) || !opaqueId(result.operation_id) || result.operation_id !== expectedOperationId ||
161
+ !walletResultKind(result.kind) || result.kind === "wallet_created" || !opaqueId(result.receipt_id)) {
162
+ throw new ClientFlowError("invalid_server_response");
163
+ }
164
+ if (result.kind === "signature") {
165
+ if (typeof result.output_base64url !== "string" || !base64urlValue.test(result.output_base64url))
166
+ throw new ClientFlowError("invalid_server_response");
167
+ return { requestId: root.request_id, result: { operationId: result.operation_id, kind: result.kind, receiptId: result.receipt_id, outputBase64url: result.output_base64url } };
168
+ }
169
+ if (result.output_base64url !== undefined)
170
+ throw new ClientFlowError("invalid_server_response");
171
+ return { requestId: root.request_id, result: { operationId: result.operation_id, kind: result.kind, receiptId: result.receipt_id } };
172
+ }
173
+ function parseCreatedWalletResult(requestId, value, expectedOperationId) {
174
+ const result = record(value, ["operation_id", "kind", "receipt_id", "wallet", "device_share"]);
175
+ const wallet = record(result.wallet, ["wallet_id", "key_id", "network", "address", "algorithm", "public_key"]);
176
+ const share = record(result.device_share, ["ciphertext", "nonce", "ephemeral_public_key", "encryption_algorithm", "encryption_context"]);
177
+ // The receipt of a creation is the created wallet ID; a result naming two
178
+ // different wallets is not one creation.
179
+ if (!opaqueId(requestId) || result.operation_id !== expectedOperationId || !lowerUUID(wallet.wallet_id) || result.receipt_id !== wallet.wallet_id ||
180
+ !lowerUUID(wallet.key_id) || typeof wallet.network !== "string" || !/^[a-z0-9_.-]{1,64}$/.test(wallet.network) ||
181
+ typeof wallet.address !== "string" || !walletRecipient.test(wallet.address) || !algorithmName(wallet.algorithm) || !lowerHexBytes(wallet.public_key) ||
182
+ !lowerHexBytes(share.ciphertext) || !lowerHexBytes(share.nonce) || !lowerHexBytes(share.ephemeral_public_key) ||
183
+ !algorithmName(share.encryption_algorithm) || !lowerHexBytes(share.encryption_context)) {
184
+ throw new ClientFlowError("invalid_server_response");
185
+ }
186
+ return {
187
+ requestId,
188
+ result: {
189
+ operationId: expectedOperationId, kind: "wallet_created", receiptId: wallet.wallet_id,
190
+ wallet: { walletId: wallet.wallet_id, keyId: wallet.key_id, network: wallet.network, address: wallet.address, algorithm: wallet.algorithm, publicKey: wallet.public_key },
191
+ deviceShare: { ciphertext: share.ciphertext, nonce: share.nonce, ephemeralPublicKey: share.ephemeral_public_key, encryptionAlgorithm: share.encryption_algorithm, encryptionContext: share.encryption_context },
192
+ },
193
+ };
194
+ }
195
+ function purgedDisplay(value) {
196
+ return value !== null && typeof value === "object" && Object.prototype.hasOwnProperty.call(value, "material_purged");
197
+ }
198
+ function parseUserWalletDisplay(value, kind) {
199
+ if (value === null || typeof value !== "object" || Array.isArray(value))
200
+ throw new ClientFlowError("invalid_server_response");
201
+ if (Object.prototype.hasOwnProperty.call(value, "material_purged")) {
202
+ const purged = record(value, ["kind", "owner_id", "requester_id", "result_recipient", "material_purged"], ["wallet_id"]);
203
+ if (purged.kind !== kind || purged.material_purged !== true)
204
+ throw new ClientFlowError("invalid_server_response");
205
+ return { ...displayCommon(purged), kind, materialPurged: true };
206
+ }
207
+ switch (kind) {
208
+ case "wallet.create": {
209
+ const display = record(value, ["kind", "owner_id", "requester_id", "result_recipient", "network", "recipient_public_key"], ["wallet_id", "prepared_summary"]);
210
+ if (display.kind !== kind || !network(display.network) || !recipientPublicKey(display.recipient_public_key))
211
+ throw new ClientFlowError("invalid_server_response");
212
+ return { ...displayCommon(display), kind, network: display.network, recipientPublicKey: display.recipient_public_key, ...summaryOf(display.prepared_summary) };
213
+ }
214
+ case "wallet.sign": {
215
+ const display = record(value, ["kind", "owner_id", "requester_id", "result_recipient", "network", "message_base64url"], ["wallet_id", "prepared_summary"]);
216
+ if (display.kind !== kind || !network(display.network) || !boundedMessage(display.message_base64url))
217
+ throw new ClientFlowError("invalid_server_response");
218
+ return { ...displayCommon(display), kind, network: display.network, messageBase64url: display.message_base64url, ...summaryOf(display.prepared_summary) };
219
+ }
220
+ case "wallet.send": {
221
+ const display = record(value, ["kind", "owner_id", "requester_id", "result_recipient", "network", "asset", "recipient", "amount_raw", "max_fee_raw"], ["wallet_id", "prepared_summary"]);
222
+ if (display.kind !== kind || !network(display.network) || display.asset !== "native" || typeof display.recipient !== "string" ||
223
+ !walletRecipient.test(display.recipient) || !rawQuantity(display.amount_raw, true) || !rawQuantity(display.max_fee_raw, false)) {
224
+ throw new ClientFlowError("invalid_server_response");
225
+ }
226
+ return {
227
+ ...displayCommon(display), kind, network: display.network, asset: display.asset, recipient: display.recipient,
228
+ amountRaw: display.amount_raw, maxFeeRaw: display.max_fee_raw, ...summaryOf(display.prepared_summary),
229
+ };
230
+ }
231
+ case "wallet.export": {
232
+ const display = record(value, ["kind", "owner_id", "requester_id", "result_recipient", "recipient_public_key"], ["wallet_id", "prepared_summary"]);
233
+ if (display.kind !== kind || !recipientPublicKey(display.recipient_public_key))
234
+ throw new ClientFlowError("invalid_server_response");
235
+ return { ...displayCommon(display), kind, recipientPublicKey: display.recipient_public_key, ...summaryOf(display.prepared_summary) };
236
+ }
237
+ default: {
238
+ const display = record(value, ["kind", "owner_id", "requester_id", "result_recipient", "recipient_public_key", "expected_generation"], ["wallet_id", "prepared_summary"]);
239
+ if (display.kind !== "wallet.recover" || !recipientPublicKey(display.recipient_public_key) || !walletGeneration(display.expected_generation)) {
240
+ throw new ClientFlowError("invalid_server_response");
241
+ }
242
+ return {
243
+ ...displayCommon(display), kind: "wallet.recover", recipientPublicKey: display.recipient_public_key,
244
+ expectedGeneration: display.expected_generation, ...summaryOf(display.prepared_summary),
245
+ };
246
+ }
247
+ }
248
+ }
249
+ function network(value) {
250
+ return typeof value === "string" && walletNetwork.test(value);
251
+ }
252
+ function recipientPublicKey(value) {
253
+ return typeof value === "string" && compressedP256Key.test(value);
254
+ }
255
+ /**
256
+ * boundedMessage accepts unpadded base64url whose decoded length is 1..4096
257
+ * bytes. A base64url group of exactly one residual character encodes no byte,
258
+ * so that length is rejected outright.
259
+ */
260
+ function boundedMessage(value) {
261
+ if (typeof value !== "string" || !base64urlValue.test(value) || value.length % 4 === 1)
262
+ return false;
263
+ const decoded = Math.floor((value.length * 3) / 4);
264
+ return decoded >= 1 && decoded <= MaxWalletMessageBytes;
265
+ }
266
+ function walletGeneration(value) {
267
+ if (!canonicalDecimal(value))
268
+ return false;
269
+ const generation = BigInt(value);
270
+ return generation > 0n && generation <= maxWalletGeneration;
271
+ }
272
+ function userWalletKind(value) {
273
+ return value === "wallet.create" || value === "wallet.sign" || value === "wallet.send" || value === "wallet.export" || value === "wallet.recover";
274
+ }
275
+ function walletResultKind(value) {
276
+ return value === "signature" || value === "transfer_receipt" || value === "wallet_created";
277
+ }
278
+ /** lowerHexBytes accepts 1..1024 bytes of lowercase hexadecimal. */
279
+ function lowerHexBytes(value) {
280
+ return typeof value === "string" && value.length >= 2 && value.length <= 2048 && value.length % 2 === 0 && /^[0-9a-f]+$/.test(value);
281
+ }
282
+ function algorithmName(value) {
283
+ return typeof value === "string" && /^[a-z0-9_-]{1,128}$/.test(value);
284
+ }
285
+ function userWalletState(value) {
286
+ return value === "awaiting_confirmation" || value === "authorized" || value === "dispatching" || value === "outcome_unknown" ||
287
+ value === "succeeded" || value === "failed" || value === "denied" || value === "canceled" || value === "expired";
288
+ }
289
+ function userWalletEffectState(value) {
290
+ return value === "no_effect" || value === "possible" || value === "known";
291
+ }
292
+ function userWalletBasis(value) {
293
+ return value === "" || value === "user_confirmed" || value === "session_authorized";
294
+ }
295
+ function lowerHexDigest(value) {
296
+ return typeof value === "string" && /^[0-9a-f]{64}$/.test(value);
297
+ }
298
+ function httpsURL(value) {
299
+ if (typeof value !== "string")
300
+ return false;
301
+ try {
302
+ const parsed = new URL(value);
303
+ return parsed.protocol === "https:" && parsed.username === "" && parsed.password === "";
304
+ }
305
+ catch {
306
+ return false;
307
+ }
308
+ }
package/package.json CHANGED
@@ -1,6 +1,66 @@
1
1
  {
2
2
  "name": "@shuttle.technology/authorization",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "TypeScript SDK for Streams Authorization and authorized wallet operations.",
5
+ "homepage": "https://www.npmjs.com/package/@shuttle.technology/authorization",
6
+ "packageManager": "pnpm@11.19.0",
7
+ "type": "module",
8
+ "files": [
9
+ "dist/**/*.js",
10
+ "dist/**/*.d.ts",
11
+ "README.md"
12
+ ],
13
+ "main": "./dist/client.js",
14
+ "types": "./dist/client.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/client.d.ts",
18
+ "import": "./dist/client.js"
19
+ },
20
+ "./mode-c": {
21
+ "types": "./dist/modeC.d.ts",
22
+ "import": "./dist/modeC.js"
23
+ },
24
+ "./mode-c-linked": {
25
+ "types": "./dist/modeCLinked.d.ts",
26
+ "import": "./dist/modeCLinked.js"
27
+ },
28
+ "./streams": {
29
+ "types": "./dist/streams.d.ts",
30
+ "import": "./dist/streams.js"
31
+ },
32
+ "./linked-wallets": {
33
+ "types": "./dist/linkedWallets.d.ts",
34
+ "import": "./dist/linkedWallets.js"
35
+ },
36
+ "./device-key": {
37
+ "types": "./dist/deviceKey.d.ts",
38
+ "import": "./dist/deviceKey.js"
39
+ },
40
+ "./device-share": {
41
+ "types": "./dist/deviceShare.d.ts",
42
+ "import": "./dist/deviceShare.js"
43
+ }
44
+ },
45
+ "publishConfig": {
46
+ "access": "public",
47
+ "registry": "https://registry.npmjs.org/"
48
+ },
49
+ "scripts": {
50
+ "check": "node --experimental-strip-types --check src/auth.ts && node --experimental-strip-types --check src/balances.ts && node --experimental-strip-types --check src/canonicalize.ts && node --experimental-strip-types --check src/client.ts && node --experimental-strip-types --check src/aesGcmSiv.ts && node --experimental-strip-types --check src/deviceKey.ts && node --experimental-strip-types --check src/deviceShare.ts && node --experimental-strip-types --check src/deviceShareEnvelope.ts && node --experimental-strip-types --check src/linkedSendDisplay.ts && node --experimental-strip-types --check src/linkedChecks.ts && node --experimental-strip-types --check src/linkedWallets.ts && node --experimental-strip-types --check src/linkedWalletSignals.ts && node --experimental-strip-types --check src/mediatedOperation.ts && node --experimental-strip-types --check src/pages.ts && node --experimental-strip-types --check src/modeC.ts && node --experimental-strip-types --check src/modeCLinked.ts && node --experimental-strip-types --check src/poll.ts && node --experimental-strip-types --check src/requestGrant.ts && node --experimental-strip-types --check src/sends.ts && node --experimental-strip-types --check src/slice4.ts && node --experimental-strip-types --check src/streams.ts && node --experimental-strip-types --check src/trackedWallets.ts && node --experimental-strip-types --check src/transferStatus.ts && node --experimental-strip-types --check src/walletDisplayParts.ts && node --experimental-strip-types --check src/walletEvents.ts && node --experimental-strip-types --check src/walletLimits.ts && node --experimental-strip-types --check src/walletOperations.ts && node --check test/http-integration.mjs && node --check test/http-integration-slice4.mjs && node --check test/http-integration-slice6.mjs && node --check test/http-integration-slice7.mjs && node --check test/http-integration-contract.mjs && node --check test/http-integration-linked-send.mjs && node --check test/http-integration-limits.mjs && node --check test/http-integration-modec-linked.mjs && node --check test/http-integration-mode-a.mjs && node --check test/http-integration-demo.mjs",
51
+ "typecheck": "tsc --noEmit",
52
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
53
+ "prepack": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
54
+ "package:smoke": "node test/package-smoke.mjs",
55
+ "test": "node --experimental-strip-types --test test/*.test.ts",
56
+ "integration:http": "node test/http-integration.mjs",
57
+ "verify": "pnpm run check && pnpm run typecheck && pnpm run build && pnpm run test"
58
+ },
59
+ "engines": {
60
+ "node": "24.19.0"
61
+ },
62
+ "devDependencies": {
63
+ "@types/node": "24.13.3",
64
+ "typescript": "7.0.2"
65
+ }
66
+ }