@dvmkit/sdk 0.3.4-rc.10 → 0.5.0-rc.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 (56) hide show
  1. package/dist/{chunk-2KGG5ORW.js → chunk-7ZUKL4IV.js} +3 -3
  2. package/dist/{chunk-KXZUCCEY.js → chunk-A4YFWZ7R.js} +4 -55
  3. package/dist/{chunk-C2AGARLM.js → chunk-B2IROPQF.js} +450 -83
  4. package/dist/{chunk-MKI6OVW4.js → chunk-CZULM42S.js} +0 -51
  5. package/dist/{chunk-UZC4A4DM.js → chunk-EYTHFFFU.js} +2489 -213
  6. package/dist/{chunk-M4QDXD2A.js → chunk-FYRR2UEZ.js} +1 -1
  7. package/dist/{chunk-4UZN2GP5.js → chunk-GAOAYHZA.js} +209 -33
  8. package/dist/{chunk-YYQG4R7T.js → chunk-GFY5FRX3.js} +6 -4
  9. package/dist/{chunk-Z4BNLUZF.js → chunk-IWQHUSMO.js} +3 -105
  10. package/dist/{chunk-4J32DTLT.js → chunk-IXR5RFK7.js} +82 -4
  11. package/dist/{chunk-2SD2W2BG.js → chunk-JH3SX3LY.js} +252 -26
  12. package/dist/chunk-KA6VN5FK.js +245 -0
  13. package/dist/{chunk-YRDA7EWN.js → chunk-LE74UEV7.js} +61 -16
  14. package/dist/chunk-LIRAHP7B.js +53 -0
  15. package/dist/{chunk-MG67KXU7.js → chunk-MZRJR2CW.js} +4 -2
  16. package/dist/chunk-OFVV37XC.js +57 -0
  17. package/dist/{chunk-A4CM2BD3.js → chunk-PAIM66YA.js} +91 -2
  18. package/dist/{chunk-JDFLRNAZ.js → chunk-PB4FYZET.js} +67 -7
  19. package/dist/{chunk-BQ2NMWKE.js → chunk-PLG4XER6.js} +1 -1
  20. package/dist/chunk-RLTSCKRI.js +109 -0
  21. package/dist/{chunk-VAMSJRJT.js → chunk-TUA7PYH7.js} +27 -105
  22. package/dist/{chunk-O3QDFPKM.js → chunk-TZ2WKCDD.js} +1 -1
  23. package/dist/{chunk-Z3EHBW2G.js → chunk-UOCZXO2Z.js} +7 -5
  24. package/dist/{chunk-EAMZZ2B4.js → chunk-X7EZ5CLI.js} +59 -0
  25. package/dist/{chunk-CE7XEHYC.js → chunk-Z4KLECAC.js} +1 -1
  26. package/dist/{chunk-7X6UDVCQ.js → chunk-Z4ZT5LNT.js} +66 -2
  27. package/dist/{credit-ledger-A35WH2TI.js → credit-ledger-MI2H7NEC.js} +3 -1
  28. package/dist/{credit-menu-0-UtJ3hh.d.ts → credit-menu-CAfqe8IY.d.ts} +133 -7
  29. package/dist/{fx-DhyT1Cjh.d.ts → fx-D9nsN3n4.d.ts} +1 -1
  30. package/dist/index.d.ts +6 -6
  31. package/dist/index.js +4 -3
  32. package/dist/internal/caller.d.ts +80 -13
  33. package/dist/internal/caller.js +56 -54
  34. package/dist/internal/index.js +1 -1
  35. package/dist/internal/server.d.ts +11 -85
  36. package/dist/internal/server.js +21 -18
  37. package/dist/{job-store-D3CcZp_g.d.ts → job-store-Bx-VFRjg.d.ts} +1 -1
  38. package/dist/{lightning-backend-BhsyrBLa.d.ts → lightning-backend-BAx2Y8pP.d.ts} +1 -1
  39. package/dist/{memory-credit-ledger-2LBZVMKJ.js → memory-credit-ledger-W2BAUYJP.js} +4 -2
  40. package/dist/{mpp-setup-7CGBKNUP.js → mpp-setup-RF5FXGGV.js} +5 -1
  41. package/dist/{payout-reporter-ZMOA37GN.js → payout-reporter-3Y2U55ZX.js} +1 -1
  42. package/dist/{postgres-job-store-MSD2HZOI.js → postgres-job-store-VLXLWXUQ.js} +1 -1
  43. package/dist/{revenue-reporter-EKJOGQYR.js → revenue-reporter-MAERPYGK.js} +1 -1
  44. package/dist/server/index.d.ts +14 -10
  45. package/dist/server/index.js +57 -19
  46. package/dist/{step-cache-v2yhyhSZ.d.ts → step-cache-QG_h5-3G.d.ts} +1769 -1549
  47. package/dist/{tempo-charge-store-4WX7FPOV.js → tempo-charge-store-Q3D7KYMH.js} +1 -1
  48. package/dist/tempo-lifecycle-ZBBLFBMH.js +15 -0
  49. package/dist/{tempo-session-store-LCSDHB7G.js → tempo-session-store-ZRNCOX7P.js} +1 -1
  50. package/dist/{tempo-wallet-RCGBBAJH.js → tempo-wallet-B5XXV3YH.js} +4 -3
  51. package/dist/testing/index.d.ts +3 -3
  52. package/dist/{usd-Cu9G6xv2.d.ts → usd-EwRqCPF-.d.ts} +1 -1
  53. package/dist/{x402-S47Q77UE.js → x402-R6HPBY5D.js} +18 -14
  54. package/package.json +1 -1
  55. package/dist/chunk-YHN3WMMF.js +0 -122
  56. package/dist/tempo-lifecycle-TJ62A7UX.js +0 -13
@@ -2,16 +2,16 @@ import {
2
2
  createX402FacilitatorAuthHeaders,
3
3
  settleWithFacilitator,
4
4
  verifyWithFacilitator
5
- } from "./chunk-BQ2NMWKE.js";
5
+ } from "./chunk-PLG4XER6.js";
6
6
  import {
7
7
  buildPaymentRequirements,
8
8
  decodePayment,
9
9
  encodeSettleResponseHeader,
10
10
  exactEvmAuthorization
11
- } from "./chunk-Z4BNLUZF.js";
11
+ } from "./chunk-IWQHUSMO.js";
12
12
  import {
13
13
  usdcToMsats
14
- } from "./chunk-A4CM2BD3.js";
14
+ } from "./chunk-PAIM66YA.js";
15
15
  import {
16
16
  callerLoggers
17
17
  } from "./chunk-66HGCPBU.js";
@@ -1,3 +1,7 @@
1
+ import {
2
+ canonicaliseForSigning
3
+ } from "./chunk-OFVV37XC.js";
4
+
1
5
  // src/sdk/types.ts
2
6
  function isZodSchema(value) {
3
7
  return typeof value === "object" && value !== null && "_zod" in value && "parse" in value && "safeParse" in value;
@@ -12,58 +16,6 @@ var DEFAULT_CREDIT_MAX = "$5.00";
12
16
  var DEFAULT_CREDIT_TTL_SECONDS = 30 * 24 * 60 * 60;
13
17
  var DEFAULT_JOB_RETENTION_DAYS = 90;
14
18
 
15
- // src/lib/cast-auth/canonical-json.ts
16
- function canonicalize(value) {
17
- return JSON.stringify(sortDeep(value));
18
- }
19
- function canonicaliseForSigning(value) {
20
- return new TextEncoder().encode(canonicalize(value));
21
- }
22
- function sortDeep(value) {
23
- if (value === null) return null;
24
- if (typeof value === "string" || typeof value === "boolean") return value;
25
- if (typeof value === "number") {
26
- if (!Number.isFinite(value)) {
27
- throw new TypeError(`canonicalize: non-finite number is not JSON-serialisable`);
28
- }
29
- return value;
30
- }
31
- if (Array.isArray(value)) return value.map(sortDeep);
32
- if (typeof value === "object") {
33
- const sorted = {};
34
- for (const key of Object.keys(value).sort()) {
35
- const v = value[key];
36
- if (v === void 0) continue;
37
- sorted[key] = sortDeep(v);
38
- }
39
- return sorted;
40
- }
41
- throw new TypeError(`canonicalize: unsupported value of type ${typeof value}`);
42
- }
43
-
44
- // src/lib/cast-auth/verify.ts
45
- import { schnorr } from "@noble/curves/secp256k1.js";
46
- function verifyCanonicalSignedRequest(payload, signatureHex, pubkeyHex) {
47
- if (!/^[0-9a-f]{64}$/i.test(pubkeyHex) || !/^[0-9a-f]{128}$/i.test(signatureHex)) {
48
- return false;
49
- }
50
- const data = canonicaliseForSigning(payload);
51
- const signature = hexToBytes(signatureHex);
52
- const pubkey = hexToBytes(pubkeyHex);
53
- try {
54
- return schnorr.verify(signature, data, pubkey);
55
- } catch {
56
- return false;
57
- }
58
- }
59
- function hexToBytes(hex) {
60
- const out = new Uint8Array(hex.length / 2);
61
- for (let i = 0; i < out.length; i++) {
62
- out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
63
- }
64
- return out;
65
- }
66
-
67
19
  // src/lib/signed-request-statement.ts
68
20
  var SIGNED_REQUEST_AUTH_ID = "secp256k1-schnorr-v2";
69
21
  var SIGNED_REQUEST_STATEMENT_VERSION = 2;
@@ -129,9 +81,6 @@ export {
129
81
  DEFAULT_CREDIT_MAX,
130
82
  DEFAULT_CREDIT_TTL_SECONDS,
131
83
  DEFAULT_JOB_RETENTION_DAYS,
132
- canonicalize,
133
- canonicaliseForSigning,
134
- verifyCanonicalSignedRequest,
135
84
  SIGNED_REQUEST_AUTH_ID,
136
85
  SIGNED_REQUEST_STATEMENT_VERSION,
137
86
  signedRequestStatementHeader,