@secondlayer/stacks 0.2.1 → 0.3.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 (171) hide show
  1. package/dist/shared/stacks-02actsrx.cjs.map +2 -2
  2. package/dist/shared/{stacks-vyb9rx8q.js → stacks-09wa7ewe.js} +125 -115
  3. package/dist/shared/stacks-09wa7ewe.js.map +15 -0
  4. package/dist/shared/{stacks-ky14tdf6.cjs → stacks-0nfexv24.cjs} +20 -8
  5. package/dist/shared/stacks-0nfexv24.cjs.map +14 -0
  6. package/dist/shared/{stacks-an5k8n4t.cjs → stacks-14pgpkrr.cjs} +82 -73
  7. package/dist/shared/stacks-14pgpkrr.cjs.map +23 -0
  8. package/dist/shared/{stacks-vbke9mqw.cjs → stacks-17sdtaxg.cjs} +120 -106
  9. package/dist/shared/stacks-17sdtaxg.cjs.map +15 -0
  10. package/dist/shared/{stacks-wrb1es85.js → stacks-1s5w4ncf.js} +46 -34
  11. package/dist/shared/stacks-1s5w4ncf.js.map +17 -0
  12. package/dist/shared/stacks-24h5k94q.cjs.map +3 -3
  13. package/dist/shared/{stacks-evnzth1q.cjs → stacks-4vzmhw3q.cjs} +3 -3
  14. package/dist/shared/stacks-4vzmhw3q.cjs.map +10 -0
  15. package/dist/shared/{stacks-vd9jcp0b.js → stacks-4x2bcc2k.js} +89 -80
  16. package/dist/shared/stacks-4x2bcc2k.js.map +23 -0
  17. package/dist/shared/stacks-5tprhns9.cjs.map +3 -3
  18. package/dist/shared/stacks-709tra19.js.map +2 -2
  19. package/dist/shared/{stacks-qcx67vqa.js → stacks-70p84bgg.js} +3 -3
  20. package/dist/shared/stacks-70p84bgg.js.map +10 -0
  21. package/dist/shared/{stacks-k2p5tv6x.js → stacks-913a2rx7.js} +3 -3
  22. package/dist/shared/stacks-913a2rx7.js.map +10 -0
  23. package/dist/shared/{stacks-qyt8m5v0.js → stacks-96d6m1zy.js} +16 -7
  24. package/dist/shared/stacks-96d6m1zy.js.map +11 -0
  25. package/dist/shared/stacks-9g0jhab3.cjs.map +2 -2
  26. package/dist/shared/stacks-dr5en54r.cjs.map +2 -2
  27. package/dist/shared/stacks-fcaefc5b.cjs.map +2 -2
  28. package/dist/shared/stacks-gck1sq7h.cjs.map +2 -2
  29. package/dist/shared/{stacks-yfveb68e.js → stacks-je937aas.js} +3 -3
  30. package/dist/shared/stacks-je937aas.js.map +10 -0
  31. package/dist/shared/{stacks-k58k970n.js → stacks-kg1npstf.js} +5 -3
  32. package/dist/shared/stacks-kg1npstf.js.map +10 -0
  33. package/dist/shared/{stacks-qvg7c24g.cjs → stacks-n98w7g57.cjs} +5 -3
  34. package/dist/shared/stacks-n98w7g57.cjs.map +10 -0
  35. package/dist/shared/{stacks-9mdk86wp.js → stacks-nqae5amn.cjs} +77 -159
  36. package/dist/shared/stacks-nqae5amn.cjs.map +10 -0
  37. package/dist/shared/stacks-qcae5852.js.map +2 -2
  38. package/dist/shared/stacks-qt8ehebn.js.map +3 -3
  39. package/dist/shared/{stacks-r1t6g3c3.cjs → stacks-ra02bpny.cjs} +8 -3
  40. package/dist/shared/stacks-ra02bpny.cjs.map +11 -0
  41. package/dist/shared/{stacks-bycy6t9k.js → stacks-rwfgts3s.js} +2 -2
  42. package/dist/shared/{stacks-bycy6t9k.js.map → stacks-rwfgts3s.js.map} +2 -2
  43. package/dist/shared/{stacks-gjvbq6w7.js → stacks-s10yb9gz.js} +2 -2
  44. package/dist/shared/stacks-s10yb9gz.js.map +10 -0
  45. package/dist/shared/{stacks-v3zy6zds.cjs → stacks-s30kkvm8.js} +104 -117
  46. package/dist/shared/stacks-s30kkvm8.js.map +10 -0
  47. package/dist/shared/{stacks-nqytwfcc.js → stacks-s7z5q8be.js} +8 -3
  48. package/dist/shared/stacks-s7z5q8be.js.map +11 -0
  49. package/dist/shared/stacks-v9jqcpd4.js.map +2 -2
  50. package/dist/shared/stacks-vdfag81a.cjs.map +2 -2
  51. package/dist/shared/{stacks-fedzr2ka.js → stacks-wjem3xw9.js} +23 -11
  52. package/dist/shared/stacks-wjem3xw9.js.map +14 -0
  53. package/dist/shared/{stacks-k08tgzyp.cjs → stacks-wyxj879g.cjs} +3 -3
  54. package/dist/shared/stacks-wyxj879g.cjs.map +13 -0
  55. package/dist/shared/stacks-y3dh7hv1.js.map +3 -3
  56. package/dist/shared/{stacks-2ar4prfz.cjs → stacks-y5262j0z.cjs} +14 -5
  57. package/dist/shared/stacks-y5262j0z.cjs.map +11 -0
  58. package/dist/shared/stacks-ya3x01yd.cjs.map +2 -2
  59. package/dist/shared/{stacks-9avax1yf.js → stacks-zf7rbpzp.js} +5 -5
  60. package/dist/shared/stacks-zf7rbpzp.js.map +13 -0
  61. package/dist/shared/{stacks-61rvzkz1.cjs → stacks-znrb59ce.cjs} +41 -29
  62. package/dist/shared/stacks-znrb59ce.cjs.map +17 -0
  63. package/dist/src/accounts/index.cjs +2 -2
  64. package/dist/src/accounts/index.cjs.map +5 -5
  65. package/dist/src/accounts/index.js +4 -8
  66. package/dist/src/accounts/index.js.map +5 -5
  67. package/dist/src/actions/index.d.cts +36 -29
  68. package/dist/src/actions/index.d.ts +36 -29
  69. package/dist/src/actions/index.js +10 -10
  70. package/dist/src/bns/index.cjs +55 -43
  71. package/dist/src/bns/index.cjs.map +9 -9
  72. package/dist/src/bns/index.d.cts +29 -29
  73. package/dist/src/bns/index.d.ts +29 -29
  74. package/dist/src/bns/index.js +66 -54
  75. package/dist/src/bns/index.js.map +9 -9
  76. package/dist/src/clarity/index.js +6 -6
  77. package/dist/src/connect/index.cjs +114 -112
  78. package/dist/src/connect/index.cjs.map +13 -13
  79. package/dist/src/connect/index.js +114 -112
  80. package/dist/src/connect/index.js.map +13 -13
  81. package/dist/src/connect/walletconnect/index.cjs +3 -3
  82. package/dist/src/connect/walletconnect/index.cjs.map +10 -10
  83. package/dist/src/connect/walletconnect/index.js +3 -3
  84. package/dist/src/connect/walletconnect/index.js.map +10 -10
  85. package/dist/src/index.cjs +108 -2
  86. package/dist/src/index.cjs.map +19 -15
  87. package/dist/src/index.d.cts +298 -112
  88. package/dist/src/index.d.ts +298 -112
  89. package/dist/src/index.js +125 -12
  90. package/dist/src/index.js.map +19 -15
  91. package/dist/src/postconditions/index.js +3 -3
  92. package/dist/src/pox/index.cjs.map +6 -6
  93. package/dist/src/pox/index.d.cts +29 -29
  94. package/dist/src/pox/index.d.ts +29 -29
  95. package/dist/src/pox/index.js +9 -9
  96. package/dist/src/pox/index.js.map +6 -6
  97. package/dist/src/stackingdao/index.cjs +31 -6
  98. package/dist/src/stackingdao/index.cjs.map +6 -6
  99. package/dist/src/stackingdao/index.d.cts +29 -29
  100. package/dist/src/stackingdao/index.d.ts +29 -29
  101. package/dist/src/stackingdao/index.js +41 -16
  102. package/dist/src/stackingdao/index.js.map +6 -6
  103. package/dist/src/subscriptions/index.d.cts +29 -29
  104. package/dist/src/subscriptions/index.d.ts +29 -29
  105. package/dist/src/tools/btc/index.cjs +130 -0
  106. package/dist/src/tools/btc/index.cjs.map +10 -0
  107. package/dist/src/tools/btc/index.d.cts +8 -0
  108. package/dist/src/tools/btc/index.d.ts +8 -0
  109. package/dist/src/tools/btc/index.js +89 -0
  110. package/dist/src/tools/btc/index.js.map +10 -0
  111. package/dist/src/tools/index.cjs +2470 -0
  112. package/dist/src/tools/index.cjs.map +61 -0
  113. package/dist/src/tools/index.d.cts +144 -0
  114. package/dist/src/tools/index.d.ts +144 -0
  115. package/dist/src/tools/index.js +2435 -0
  116. package/dist/src/tools/index.js.map +61 -0
  117. package/dist/src/transactions/index.d.cts +7 -0
  118. package/dist/src/transactions/index.d.ts +7 -0
  119. package/dist/src/transactions/index.js +6 -6
  120. package/dist/src/triggers/index.cjs +66 -0
  121. package/dist/src/triggers/index.cjs.map +10 -0
  122. package/dist/src/triggers/index.d.cts +116 -0
  123. package/dist/src/triggers/index.d.ts +116 -0
  124. package/dist/src/triggers/index.js +25 -0
  125. package/dist/src/triggers/index.js.map +10 -0
  126. package/dist/src/tx/index.cjs +65 -0
  127. package/dist/src/tx/index.cjs.map +10 -0
  128. package/dist/src/tx/index.d.cts +42 -0
  129. package/dist/src/tx/index.d.ts +42 -0
  130. package/dist/src/tx/index.js +22 -0
  131. package/dist/src/tx/index.js.map +10 -0
  132. package/dist/src/ui/index.cjs +431 -0
  133. package/dist/src/ui/index.cjs.map +27 -0
  134. package/dist/src/ui/index.d.cts +107 -0
  135. package/dist/src/ui/index.d.ts +107 -0
  136. package/dist/src/ui/index.js +391 -0
  137. package/dist/src/ui/index.js.map +27 -0
  138. package/dist/src/ui/schemas.cjs +134 -0
  139. package/dist/src/ui/schemas.cjs.map +18 -0
  140. package/dist/src/ui/schemas.d.cts +83 -0
  141. package/dist/src/ui/schemas.d.ts +83 -0
  142. package/dist/src/ui/schemas.js +91 -0
  143. package/dist/src/ui/schemas.js.map +18 -0
  144. package/dist/src/utils/index.cjs +3 -3
  145. package/dist/src/utils/index.cjs.map +4 -4
  146. package/dist/src/utils/index.js +7 -7
  147. package/dist/src/utils/index.js.map +4 -4
  148. package/package.json +157 -105
  149. package/dist/shared/stacks-2ar4prfz.cjs.map +0 -11
  150. package/dist/shared/stacks-61rvzkz1.cjs.map +0 -17
  151. package/dist/shared/stacks-9avax1yf.js.map +0 -13
  152. package/dist/shared/stacks-9mdk86wp.js.map +0 -10
  153. package/dist/shared/stacks-an5k8n4t.cjs.map +0 -23
  154. package/dist/shared/stacks-evnzth1q.cjs.map +0 -10
  155. package/dist/shared/stacks-fedzr2ka.js.map +0 -13
  156. package/dist/shared/stacks-gjvbq6w7.js.map +0 -10
  157. package/dist/shared/stacks-k08tgzyp.cjs.map +0 -13
  158. package/dist/shared/stacks-k2p5tv6x.js.map +0 -10
  159. package/dist/shared/stacks-k58k970n.js.map +0 -10
  160. package/dist/shared/stacks-ky14tdf6.cjs.map +0 -13
  161. package/dist/shared/stacks-nqytwfcc.js.map +0 -11
  162. package/dist/shared/stacks-qcx67vqa.js.map +0 -10
  163. package/dist/shared/stacks-qvg7c24g.cjs.map +0 -10
  164. package/dist/shared/stacks-qyt8m5v0.js.map +0 -11
  165. package/dist/shared/stacks-r1t6g3c3.cjs.map +0 -11
  166. package/dist/shared/stacks-v3zy6zds.cjs.map +0 -10
  167. package/dist/shared/stacks-vbke9mqw.cjs.map +0 -15
  168. package/dist/shared/stacks-vd9jcp0b.js.map +0 -23
  169. package/dist/shared/stacks-vyb9rx8q.js.map +0 -15
  170. package/dist/shared/stacks-wrb1es85.js.map +0 -17
  171. package/dist/shared/stacks-yfveb68e.js.map +0 -10
@@ -0,0 +1,134 @@
1
+ var import_node_module = require("node:module");
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toCommonJS = (from) => {
10
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
+ if (entry)
12
+ return entry;
13
+ entry = __defProp({}, "__esModule", { value: true });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (var key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(entry, key))
17
+ __defProp(entry, key, {
18
+ get: __accessProp.bind(from, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ __moduleCache.set(from, entry);
23
+ return entry;
24
+ };
25
+ var __moduleCache;
26
+ var __returnValue = (v) => v;
27
+ function __exportSetter(name, newValue) {
28
+ this[name] = __returnValue.bind(null, newValue);
29
+ }
30
+ var __export = (target, all) => {
31
+ for (var name in all)
32
+ __defProp(target, name, {
33
+ get: all[name],
34
+ enumerable: true,
35
+ configurable: true,
36
+ set: __exportSetter.bind(all, name)
37
+ });
38
+ };
39
+
40
+ // src/ui/schemas.ts
41
+ var exports_schemas = {};
42
+ __export(exports_schemas, {
43
+ defineCatalog: () => defineCatalog,
44
+ atomSchemas: () => atomSchemas,
45
+ TxStatusProps: () => TxStatusProps,
46
+ TokenProps: () => TokenProps,
47
+ PrincipalProps: () => PrincipalProps,
48
+ NftAssetProps: () => NftAssetProps,
49
+ BnsNameProps: () => BnsNameProps,
50
+ BlockHeightProps: () => BlockHeightProps,
51
+ AmountProps: () => AmountProps,
52
+ AddressProps: () => AddressProps
53
+ });
54
+ module.exports = __toCommonJS(exports_schemas);
55
+
56
+ // src/ui/atoms/address.schema.ts
57
+ var import_zod = require("zod");
58
+ var AddressProps = import_zod.z.object({
59
+ value: import_zod.z.string().describe("Stacks principal (SP…/SM…/ST…)"),
60
+ bns: import_zod.z.string().nullable().optional().describe("Optional BNS override"),
61
+ truncate: import_zod.z.boolean().optional().default(true)
62
+ });
63
+ // src/ui/atoms/amount.schema.ts
64
+ var import_zod2 = require("zod");
65
+ var AmountProps = import_zod2.z.object({
66
+ microUnits: import_zod2.z.string().describe("Amount in micro-units (as string to preserve bigint precision)"),
67
+ decimals: import_zod2.z.number().int().min(0).max(18).default(6).describe("Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)"),
68
+ symbol: import_zod2.z.string().default("STX"),
69
+ usdValue: import_zod2.z.number().nullable().optional()
70
+ });
71
+ // src/ui/atoms/blockHeight.schema.ts
72
+ var import_zod3 = require("zod");
73
+ var BlockHeightProps = import_zod3.z.object({
74
+ height: import_zod3.z.number().int().nonnegative(),
75
+ timestamp: import_zod3.z.string().nullable().optional().describe("ISO-8601 block timestamp")
76
+ });
77
+ // src/ui/atoms/bnsName.schema.ts
78
+ var import_zod4 = require("zod");
79
+ var BnsNameProps = import_zod4.z.object({
80
+ name: import_zod4.z.string(),
81
+ namespace: import_zod4.z.string(),
82
+ expiresAt: import_zod4.z.string().nullable().optional().describe("ISO-8601 timestamp")
83
+ });
84
+ // src/ui/atoms/nftAsset.schema.ts
85
+ var import_zod5 = require("zod");
86
+ var NftAssetProps = import_zod5.z.object({
87
+ assetIdentifier: import_zod5.z.string().describe("Full asset identifier (e.g. SP123.contract::asset-name)"),
88
+ tokenId: import_zod5.z.string().describe("Token id (as string to preserve bigint precision)"),
89
+ name: import_zod5.z.string().nullable().optional(),
90
+ imageUrl: import_zod5.z.string().url().nullable().optional()
91
+ });
92
+ // src/ui/atoms/principal.schema.ts
93
+ var import_zod6 = require("zod");
94
+ var PrincipalProps = import_zod6.z.object({
95
+ value: import_zod6.z.string().describe("Standard or contract principal"),
96
+ bns: import_zod6.z.string().nullable().optional(),
97
+ kind: import_zod6.z.enum(["standard", "contract"]).optional()
98
+ });
99
+ // src/ui/atoms/token.schema.ts
100
+ var import_zod7 = require("zod");
101
+ var TokenProps = import_zod7.z.object({
102
+ symbol: import_zod7.z.string(),
103
+ contract: import_zod7.z.string().nullable().optional().describe("SIP-010 contract id (for non-STX tokens)"),
104
+ decimals: import_zod7.z.number().int().min(0).max(18).default(6)
105
+ });
106
+ // src/ui/atoms/txStatus.schema.ts
107
+ var import_zod8 = require("zod");
108
+ var TxStatusProps = import_zod8.z.object({
109
+ status: import_zod8.z.enum([
110
+ "pending",
111
+ "success",
112
+ "failed",
113
+ "abort_by_post_condition",
114
+ "abort_by_response"
115
+ ]),
116
+ txId: import_zod8.z.string().nullable().optional()
117
+ });
118
+ // src/ui/schemas.ts
119
+ var atomSchemas = {
120
+ Address: { props: AddressProps },
121
+ Amount: { props: AmountProps },
122
+ BlockHeight: { props: BlockHeightProps },
123
+ BnsName: { props: BnsNameProps },
124
+ NftAsset: { props: NftAssetProps },
125
+ Principal: { props: PrincipalProps },
126
+ Token: { props: TokenProps },
127
+ TxStatus: { props: TxStatusProps }
128
+ };
129
+ function defineCatalog(def) {
130
+ return def;
131
+ }
132
+
133
+ //# debugId=A453CD9C19FDB34F64756E2164756E21
134
+ //# sourceMappingURL=schemas.cjs.map
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ui/atoms/address.schema.ts", "../../../src/ui/atoms/amount.schema.ts", "../../../src/ui/atoms/blockHeight.schema.ts", "../../../src/ui/atoms/bnsName.schema.ts", "../../../src/ui/atoms/nftAsset.schema.ts", "../../../src/ui/atoms/principal.schema.ts", "../../../src/ui/atoms/token.schema.ts", "../../../src/ui/atoms/txStatus.schema.ts", "../../../src/ui/schemas.ts"],
4
+ "sourcesContent": [
5
+ "import { z } from \"zod\";\n\nexport interface AddressPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\ttruncate?: boolean;\n}\n\nexport const AddressProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Stacks principal (SP…/SM…/ST…)\"),\n\tbns: z.string().nullable().optional().describe(\"Optional BNS override\"),\n\ttruncate: z.boolean().optional().default(true),\n});\n",
6
+ "import { z } from \"zod\";\n\nexport interface AmountPropsType {\n\tmicroUnits: string;\n\tdecimals?: number;\n\tsymbol?: string;\n\tusdValue?: number | null | undefined;\n}\n\nexport const AmountProps: z.ZodTypeAny = z.object({\n\tmicroUnits: z\n\t\t.string()\n\t\t.describe(\"Amount in micro-units (as string to preserve bigint precision)\"),\n\tdecimals: z\n\t\t.number()\n\t\t.int()\n\t\t.min(0)\n\t\t.max(18)\n\t\t.default(6)\n\t\t.describe(\n\t\t\t\"Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)\",\n\t\t),\n\tsymbol: z.string().default(\"STX\"),\n\tusdValue: z.number().nullable().optional(),\n});\n",
7
+ "import { z } from \"zod\";\n\nexport interface BlockHeightPropsType {\n\theight: number;\n\ttimestamp?: string | null | undefined;\n}\n\nexport const BlockHeightProps: z.ZodTypeAny = z.object({\n\theight: z.number().int().nonnegative(),\n\ttimestamp: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"ISO-8601 block timestamp\"),\n});\n",
8
+ "import { z } from \"zod\";\n\nexport interface BnsNamePropsType {\n\tname: string;\n\tnamespace: string;\n\texpiresAt?: string | null | undefined;\n}\n\nexport const BnsNameProps: z.ZodTypeAny = z.object({\n\tname: z.string(),\n\tnamespace: z.string(),\n\texpiresAt: z.string().nullable().optional().describe(\"ISO-8601 timestamp\"),\n});\n",
9
+ "import { z } from \"zod\";\n\nexport interface NftAssetPropsType {\n\tassetIdentifier: string;\n\ttokenId: string;\n\tname?: string | null | undefined;\n\timageUrl?: string | null | undefined;\n}\n\nexport const NftAssetProps: z.ZodTypeAny = z.object({\n\tassetIdentifier: z\n\t\t.string()\n\t\t.describe(\"Full asset identifier (e.g. SP123.contract::asset-name)\"),\n\ttokenId: z\n\t\t.string()\n\t\t.describe(\"Token id (as string to preserve bigint precision)\"),\n\tname: z.string().nullable().optional(),\n\timageUrl: z.string().url().nullable().optional(),\n});\n",
10
+ "import { z } from \"zod\";\n\nexport interface PrincipalPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\tkind?: \"standard\" | \"contract\" | undefined;\n}\n\nexport const PrincipalProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Standard or contract principal\"),\n\tbns: z.string().nullable().optional(),\n\tkind: z.enum([\"standard\", \"contract\"]).optional(),\n});\n",
11
+ "import { z } from \"zod\";\n\nexport interface TokenPropsType {\n\tsymbol: string;\n\tcontract?: string | null | undefined;\n\tdecimals?: number;\n}\n\nexport const TokenProps: z.ZodTypeAny = z.object({\n\tsymbol: z.string(),\n\tcontract: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"SIP-010 contract id (for non-STX tokens)\"),\n\tdecimals: z.number().int().min(0).max(18).default(6),\n});\n",
12
+ "import { z } from \"zod\";\n\nexport interface TxStatusPropsType {\n\tstatus:\n\t\t| \"pending\"\n\t\t| \"success\"\n\t\t| \"failed\"\n\t\t| \"abort_by_post_condition\"\n\t\t| \"abort_by_response\";\n\ttxId?: string | null | undefined;\n}\n\nexport const TxStatusProps: z.ZodTypeAny = z.object({\n\tstatus: z.enum([\n\t\t\"pending\",\n\t\t\"success\",\n\t\t\"failed\",\n\t\t\"abort_by_post_condition\",\n\t\t\"abort_by_response\",\n\t]),\n\ttxId: z.string().nullable().optional(),\n});\n",
13
+ "/**\n * React-free Zod schemas for Stacks UI atoms, plus a pass-through\n * `defineCatalog` helper.\n *\n * Import from this module when writing a workflow handler that uses\n * `step.render` — you avoid pulling React and `@json-render/*` into the\n * bundled handler (which would duplicate Zod and break esbuild's util\n * scoping). The runner wraps the raw definition into a real json-render\n * `Catalog` at render time using its own `@json-render/*` install.\n *\n * @example\n *\n * import { defineCatalog, AddressProps, AmountProps } from \"@secondlayer/stacks/ui/schemas\"\n * import { z } from \"zod\"\n *\n * const whaleUI = defineCatalog({\n * components: {\n * Address: { props: AddressProps },\n * Amount: { props: AmountProps },\n * WhaleCard: {\n * props: z.object({ from: z.string(), amount: z.string() }),\n * },\n * },\n * actions: {},\n * })\n *\n * // ...inside a workflow handler:\n * await step.render(\"card\", whaleUI, { model, prompt, context })\n */\n\nexport {\n\tAddressProps,\n\ttype AddressPropsType,\n} from \"./atoms/address.schema.ts\";\nexport { AmountProps, type AmountPropsType } from \"./atoms/amount.schema.ts\";\nexport {\n\tBlockHeightProps,\n\ttype BlockHeightPropsType,\n} from \"./atoms/blockHeight.schema.ts\";\nexport { BnsNameProps, type BnsNamePropsType } from \"./atoms/bnsName.schema.ts\";\nexport {\n\tNftAssetProps,\n\ttype NftAssetPropsType,\n} from \"./atoms/nftAsset.schema.ts\";\nexport {\n\tPrincipalProps,\n\ttype PrincipalPropsType,\n} from \"./atoms/principal.schema.ts\";\nexport { TokenProps, type TokenPropsType } from \"./atoms/token.schema.ts\";\nexport {\n\tTxStatusProps,\n\ttype TxStatusPropsType,\n} from \"./atoms/txStatus.schema.ts\";\n\nimport type { z } from \"zod\";\nimport { AddressProps } from \"./atoms/address.schema.ts\";\nimport { AmountProps } from \"./atoms/amount.schema.ts\";\nimport { BlockHeightProps } from \"./atoms/blockHeight.schema.ts\";\nimport { BnsNameProps } from \"./atoms/bnsName.schema.ts\";\nimport { NftAssetProps } from \"./atoms/nftAsset.schema.ts\";\nimport { PrincipalProps } from \"./atoms/principal.schema.ts\";\nimport { TokenProps } from \"./atoms/token.schema.ts\";\nimport { TxStatusProps } from \"./atoms/txStatus.schema.ts\";\n\n/**\n * Atom-schema registry — ready to drop into a catalog's `components` field.\n */\nexport const atomSchemas: Record<string, { props: z.ZodTypeAny }> = {\n\tAddress: { props: AddressProps },\n\tAmount: { props: AmountProps },\n\tBlockHeight: { props: BlockHeightProps },\n\tBnsName: { props: BnsNameProps },\n\tNftAsset: { props: NftAssetProps },\n\tPrincipal: { props: PrincipalProps },\n\tToken: { props: TokenProps },\n\tTxStatus: { props: TxStatusProps },\n};\n\n// --- Raw catalog definition shape (wrapped into a Catalog at render time) ---\n\n/**\n * Raw catalog definition — a plain object mapping component names to their\n * prop schemas. The workflow runner wraps this into a `@json-render/core`\n * `Catalog` via its own install, keeping json-render out of the user bundle.\n */\nexport interface RawCatalogDefinition {\n\tcomponents: Record<string, { props: unknown }>;\n\tactions?: Record<string, { params?: unknown }>;\n}\n\n/**\n * Identity helper — exists so authors get IDE autocomplete and so the\n * migration story to a real catalog constructor stays open. Does not import\n * `@json-render/*`, so nothing React-flavored bundles into the handler.\n */\nexport function defineCatalog<T extends RawCatalogDefinition>(def: T): T {\n\treturn def;\n}\n"
14
+ ],
15
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAkB,IAAlB;AAQO,IAAM,eAA6B,aAAE,OAAO;AAAA,EAClD,OAAO,aAAE,OAAO,EAAE,SAAS,gCAA+B;AAAA,EAC1D,KAAK,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,uBAAuB;AAAA,EACtE,UAAU,aAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,IAAI;AAC9C,CAAC;;ACZiB,IAAlB;AASO,IAAM,cAA4B,cAAE,OAAO;AAAA,EACjD,YAAY,cACV,OAAO,EACP,SAAS,gEAAgE;AAAA,EAC3E,UAAU,cACR,OAAO,EACP,IAAI,EACJ,IAA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,cAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC;AACpD,CAAC;;AChBiB,IAAlB;AAYO,IAAM,gBAA8B,cAAE,OAAO;AAAA,EACnD,QAAQ,cAAE,KAAK;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAAA,EACD,MAAM,cAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AACtC,CAAC;;AC8CM,IAAM,cAAuD;AAAA,EACnE,SAAS,EAAE,OAAO,aAAa;AAAA,EAC/B,QAAQ,EAAE,OAAO,YAAY;AAAA,EAC7B,aAAa,EAAE,OAAO,iBAAiB;AAAA,EACvC,SAAS,EAAE,OAAO,aAAa;AAAA,EAC/B,UAAU,EAAE,OAAO,cAAc;AAAA,EACjC,WAAW,EAAE,OAAO,eAAe;AAAA,EACnC,OAAO,EAAE,OAAO,WAAW;AAAA,EAC3B,UAAU,EAAE,OAAO,cAAc;AAClC;AAmBO,SAAS,aAA6C,CAAC,KAAW;AAAA,EACxE,OAAO;AAAA;",
16
+ "debugId": "A453CD9C19FDB34F64756E2164756E21",
17
+ "names": []
18
+ }
@@ -0,0 +1,83 @@
1
+ import { z } from "zod";
2
+ interface AddressPropsType {
3
+ value: string;
4
+ bns?: string | null | undefined;
5
+ truncate?: boolean;
6
+ }
7
+ declare const AddressProps: z.ZodTypeAny;
8
+ import { z as z2 } from "zod";
9
+ interface AmountPropsType {
10
+ microUnits: string;
11
+ decimals?: number;
12
+ symbol?: string;
13
+ usdValue?: number | null | undefined;
14
+ }
15
+ declare const AmountProps: z2.ZodTypeAny;
16
+ import { z as z3 } from "zod";
17
+ interface BlockHeightPropsType {
18
+ height: number;
19
+ timestamp?: string | null | undefined;
20
+ }
21
+ declare const BlockHeightProps: z3.ZodTypeAny;
22
+ import { z as z4 } from "zod";
23
+ interface BnsNamePropsType {
24
+ name: string;
25
+ namespace: string;
26
+ expiresAt?: string | null | undefined;
27
+ }
28
+ declare const BnsNameProps: z4.ZodTypeAny;
29
+ import { z as z5 } from "zod";
30
+ interface NftAssetPropsType {
31
+ assetIdentifier: string;
32
+ tokenId: string;
33
+ name?: string | null | undefined;
34
+ imageUrl?: string | null | undefined;
35
+ }
36
+ declare const NftAssetProps: z5.ZodTypeAny;
37
+ import { z as z6 } from "zod";
38
+ interface PrincipalPropsType {
39
+ value: string;
40
+ bns?: string | null | undefined;
41
+ kind?: "standard" | "contract" | undefined;
42
+ }
43
+ declare const PrincipalProps: z6.ZodTypeAny;
44
+ import { z as z7 } from "zod";
45
+ interface TokenPropsType {
46
+ symbol: string;
47
+ contract?: string | null | undefined;
48
+ decimals?: number;
49
+ }
50
+ declare const TokenProps: z7.ZodTypeAny;
51
+ import { z as z8 } from "zod";
52
+ interface TxStatusPropsType {
53
+ status: "pending" | "success" | "failed" | "abort_by_post_condition" | "abort_by_response";
54
+ txId?: string | null | undefined;
55
+ }
56
+ declare const TxStatusProps: z8.ZodTypeAny;
57
+ import { z as z9 } from "zod";
58
+ /**
59
+ * Atom-schema registry — ready to drop into a catalog's `components` field.
60
+ */
61
+ declare const atomSchemas: Record<string, {
62
+ props: z9.ZodTypeAny
63
+ }>;
64
+ /**
65
+ * Raw catalog definition — a plain object mapping component names to their
66
+ * prop schemas. The workflow runner wraps this into a `@json-render/core`
67
+ * `Catalog` via its own install, keeping json-render out of the user bundle.
68
+ */
69
+ interface RawCatalogDefinition {
70
+ components: Record<string, {
71
+ props: unknown
72
+ }>;
73
+ actions?: Record<string, {
74
+ params?: unknown
75
+ }>;
76
+ }
77
+ /**
78
+ * Identity helper — exists so authors get IDE autocomplete and so the
79
+ * migration story to a real catalog constructor stays open. Does not import
80
+ * `@json-render/*`, so nothing React-flavored bundles into the handler.
81
+ */
82
+ declare function defineCatalog<T extends RawCatalogDefinition>(def: T): T;
83
+ export { defineCatalog, atomSchemas, TxStatusPropsType, TxStatusProps, TokenPropsType, TokenProps, RawCatalogDefinition, PrincipalPropsType, PrincipalProps, NftAssetPropsType, NftAssetProps, BnsNamePropsType, BnsNameProps, BlockHeightPropsType, BlockHeightProps, AmountPropsType, AmountProps, AddressPropsType, AddressProps };
@@ -0,0 +1,83 @@
1
+ import { z } from "zod";
2
+ interface AddressPropsType {
3
+ value: string;
4
+ bns?: string | null | undefined;
5
+ truncate?: boolean;
6
+ }
7
+ declare const AddressProps: z.ZodTypeAny;
8
+ import { z as z2 } from "zod";
9
+ interface AmountPropsType {
10
+ microUnits: string;
11
+ decimals?: number;
12
+ symbol?: string;
13
+ usdValue?: number | null | undefined;
14
+ }
15
+ declare const AmountProps: z2.ZodTypeAny;
16
+ import { z as z3 } from "zod";
17
+ interface BlockHeightPropsType {
18
+ height: number;
19
+ timestamp?: string | null | undefined;
20
+ }
21
+ declare const BlockHeightProps: z3.ZodTypeAny;
22
+ import { z as z4 } from "zod";
23
+ interface BnsNamePropsType {
24
+ name: string;
25
+ namespace: string;
26
+ expiresAt?: string | null | undefined;
27
+ }
28
+ declare const BnsNameProps: z4.ZodTypeAny;
29
+ import { z as z5 } from "zod";
30
+ interface NftAssetPropsType {
31
+ assetIdentifier: string;
32
+ tokenId: string;
33
+ name?: string | null | undefined;
34
+ imageUrl?: string | null | undefined;
35
+ }
36
+ declare const NftAssetProps: z5.ZodTypeAny;
37
+ import { z as z6 } from "zod";
38
+ interface PrincipalPropsType {
39
+ value: string;
40
+ bns?: string | null | undefined;
41
+ kind?: "standard" | "contract" | undefined;
42
+ }
43
+ declare const PrincipalProps: z6.ZodTypeAny;
44
+ import { z as z7 } from "zod";
45
+ interface TokenPropsType {
46
+ symbol: string;
47
+ contract?: string | null | undefined;
48
+ decimals?: number;
49
+ }
50
+ declare const TokenProps: z7.ZodTypeAny;
51
+ import { z as z8 } from "zod";
52
+ interface TxStatusPropsType {
53
+ status: "pending" | "success" | "failed" | "abort_by_post_condition" | "abort_by_response";
54
+ txId?: string | null | undefined;
55
+ }
56
+ declare const TxStatusProps: z8.ZodTypeAny;
57
+ import { z as z9 } from "zod";
58
+ /**
59
+ * Atom-schema registry — ready to drop into a catalog's `components` field.
60
+ */
61
+ declare const atomSchemas: Record<string, {
62
+ props: z9.ZodTypeAny
63
+ }>;
64
+ /**
65
+ * Raw catalog definition — a plain object mapping component names to their
66
+ * prop schemas. The workflow runner wraps this into a `@json-render/core`
67
+ * `Catalog` via its own install, keeping json-render out of the user bundle.
68
+ */
69
+ interface RawCatalogDefinition {
70
+ components: Record<string, {
71
+ props: unknown
72
+ }>;
73
+ actions?: Record<string, {
74
+ params?: unknown
75
+ }>;
76
+ }
77
+ /**
78
+ * Identity helper — exists so authors get IDE autocomplete and so the
79
+ * migration story to a real catalog constructor stays open. Does not import
80
+ * `@json-render/*`, so nothing React-flavored bundles into the handler.
81
+ */
82
+ declare function defineCatalog<T extends RawCatalogDefinition>(def: T): T;
83
+ export { defineCatalog, atomSchemas, TxStatusPropsType, TxStatusProps, TokenPropsType, TokenProps, RawCatalogDefinition, PrincipalPropsType, PrincipalProps, NftAssetPropsType, NftAssetProps, BnsNamePropsType, BnsNameProps, BlockHeightPropsType, BlockHeightProps, AmountPropsType, AmountProps, AddressPropsType, AddressProps };
@@ -0,0 +1,91 @@
1
+ // src/ui/atoms/address.schema.ts
2
+ import { z } from "zod";
3
+ var AddressProps = z.object({
4
+ value: z.string().describe("Stacks principal (SP…/SM…/ST…)"),
5
+ bns: z.string().nullable().optional().describe("Optional BNS override"),
6
+ truncate: z.boolean().optional().default(true)
7
+ });
8
+ // src/ui/atoms/amount.schema.ts
9
+ import { z as z2 } from "zod";
10
+ var AmountProps = z2.object({
11
+ microUnits: z2.string().describe("Amount in micro-units (as string to preserve bigint precision)"),
12
+ decimals: z2.number().int().min(0).max(18).default(6).describe("Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)"),
13
+ symbol: z2.string().default("STX"),
14
+ usdValue: z2.number().nullable().optional()
15
+ });
16
+ // src/ui/atoms/blockHeight.schema.ts
17
+ import { z as z3 } from "zod";
18
+ var BlockHeightProps = z3.object({
19
+ height: z3.number().int().nonnegative(),
20
+ timestamp: z3.string().nullable().optional().describe("ISO-8601 block timestamp")
21
+ });
22
+ // src/ui/atoms/bnsName.schema.ts
23
+ import { z as z4 } from "zod";
24
+ var BnsNameProps = z4.object({
25
+ name: z4.string(),
26
+ namespace: z4.string(),
27
+ expiresAt: z4.string().nullable().optional().describe("ISO-8601 timestamp")
28
+ });
29
+ // src/ui/atoms/nftAsset.schema.ts
30
+ import { z as z5 } from "zod";
31
+ var NftAssetProps = z5.object({
32
+ assetIdentifier: z5.string().describe("Full asset identifier (e.g. SP123.contract::asset-name)"),
33
+ tokenId: z5.string().describe("Token id (as string to preserve bigint precision)"),
34
+ name: z5.string().nullable().optional(),
35
+ imageUrl: z5.string().url().nullable().optional()
36
+ });
37
+ // src/ui/atoms/principal.schema.ts
38
+ import { z as z6 } from "zod";
39
+ var PrincipalProps = z6.object({
40
+ value: z6.string().describe("Standard or contract principal"),
41
+ bns: z6.string().nullable().optional(),
42
+ kind: z6.enum(["standard", "contract"]).optional()
43
+ });
44
+ // src/ui/atoms/token.schema.ts
45
+ import { z as z7 } from "zod";
46
+ var TokenProps = z7.object({
47
+ symbol: z7.string(),
48
+ contract: z7.string().nullable().optional().describe("SIP-010 contract id (for non-STX tokens)"),
49
+ decimals: z7.number().int().min(0).max(18).default(6)
50
+ });
51
+ // src/ui/atoms/txStatus.schema.ts
52
+ import { z as z8 } from "zod";
53
+ var TxStatusProps = z8.object({
54
+ status: z8.enum([
55
+ "pending",
56
+ "success",
57
+ "failed",
58
+ "abort_by_post_condition",
59
+ "abort_by_response"
60
+ ]),
61
+ txId: z8.string().nullable().optional()
62
+ });
63
+ // src/ui/schemas.ts
64
+ var atomSchemas = {
65
+ Address: { props: AddressProps },
66
+ Amount: { props: AmountProps },
67
+ BlockHeight: { props: BlockHeightProps },
68
+ BnsName: { props: BnsNameProps },
69
+ NftAsset: { props: NftAssetProps },
70
+ Principal: { props: PrincipalProps },
71
+ Token: { props: TokenProps },
72
+ TxStatus: { props: TxStatusProps }
73
+ };
74
+ function defineCatalog(def) {
75
+ return def;
76
+ }
77
+ export {
78
+ defineCatalog,
79
+ atomSchemas,
80
+ TxStatusProps,
81
+ TokenProps,
82
+ PrincipalProps,
83
+ NftAssetProps,
84
+ BnsNameProps,
85
+ BlockHeightProps,
86
+ AmountProps,
87
+ AddressProps
88
+ };
89
+
90
+ //# debugId=C344789B3957A10364756E2164756E21
91
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ui/atoms/address.schema.ts", "../../../src/ui/atoms/amount.schema.ts", "../../../src/ui/atoms/blockHeight.schema.ts", "../../../src/ui/atoms/bnsName.schema.ts", "../../../src/ui/atoms/nftAsset.schema.ts", "../../../src/ui/atoms/principal.schema.ts", "../../../src/ui/atoms/token.schema.ts", "../../../src/ui/atoms/txStatus.schema.ts", "../../../src/ui/schemas.ts"],
4
+ "sourcesContent": [
5
+ "import { z } from \"zod\";\n\nexport interface AddressPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\ttruncate?: boolean;\n}\n\nexport const AddressProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Stacks principal (SP…/SM…/ST…)\"),\n\tbns: z.string().nullable().optional().describe(\"Optional BNS override\"),\n\ttruncate: z.boolean().optional().default(true),\n});\n",
6
+ "import { z } from \"zod\";\n\nexport interface AmountPropsType {\n\tmicroUnits: string;\n\tdecimals?: number;\n\tsymbol?: string;\n\tusdValue?: number | null | undefined;\n}\n\nexport const AmountProps: z.ZodTypeAny = z.object({\n\tmicroUnits: z\n\t\t.string()\n\t\t.describe(\"Amount in micro-units (as string to preserve bigint precision)\"),\n\tdecimals: z\n\t\t.number()\n\t\t.int()\n\t\t.min(0)\n\t\t.max(18)\n\t\t.default(6)\n\t\t.describe(\n\t\t\t\"Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)\",\n\t\t),\n\tsymbol: z.string().default(\"STX\"),\n\tusdValue: z.number().nullable().optional(),\n});\n",
7
+ "import { z } from \"zod\";\n\nexport interface BlockHeightPropsType {\n\theight: number;\n\ttimestamp?: string | null | undefined;\n}\n\nexport const BlockHeightProps: z.ZodTypeAny = z.object({\n\theight: z.number().int().nonnegative(),\n\ttimestamp: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"ISO-8601 block timestamp\"),\n});\n",
8
+ "import { z } from \"zod\";\n\nexport interface BnsNamePropsType {\n\tname: string;\n\tnamespace: string;\n\texpiresAt?: string | null | undefined;\n}\n\nexport const BnsNameProps: z.ZodTypeAny = z.object({\n\tname: z.string(),\n\tnamespace: z.string(),\n\texpiresAt: z.string().nullable().optional().describe(\"ISO-8601 timestamp\"),\n});\n",
9
+ "import { z } from \"zod\";\n\nexport interface NftAssetPropsType {\n\tassetIdentifier: string;\n\ttokenId: string;\n\tname?: string | null | undefined;\n\timageUrl?: string | null | undefined;\n}\n\nexport const NftAssetProps: z.ZodTypeAny = z.object({\n\tassetIdentifier: z\n\t\t.string()\n\t\t.describe(\"Full asset identifier (e.g. SP123.contract::asset-name)\"),\n\ttokenId: z\n\t\t.string()\n\t\t.describe(\"Token id (as string to preserve bigint precision)\"),\n\tname: z.string().nullable().optional(),\n\timageUrl: z.string().url().nullable().optional(),\n});\n",
10
+ "import { z } from \"zod\";\n\nexport interface PrincipalPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\tkind?: \"standard\" | \"contract\" | undefined;\n}\n\nexport const PrincipalProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Standard or contract principal\"),\n\tbns: z.string().nullable().optional(),\n\tkind: z.enum([\"standard\", \"contract\"]).optional(),\n});\n",
11
+ "import { z } from \"zod\";\n\nexport interface TokenPropsType {\n\tsymbol: string;\n\tcontract?: string | null | undefined;\n\tdecimals?: number;\n}\n\nexport const TokenProps: z.ZodTypeAny = z.object({\n\tsymbol: z.string(),\n\tcontract: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"SIP-010 contract id (for non-STX tokens)\"),\n\tdecimals: z.number().int().min(0).max(18).default(6),\n});\n",
12
+ "import { z } from \"zod\";\n\nexport interface TxStatusPropsType {\n\tstatus:\n\t\t| \"pending\"\n\t\t| \"success\"\n\t\t| \"failed\"\n\t\t| \"abort_by_post_condition\"\n\t\t| \"abort_by_response\";\n\ttxId?: string | null | undefined;\n}\n\nexport const TxStatusProps: z.ZodTypeAny = z.object({\n\tstatus: z.enum([\n\t\t\"pending\",\n\t\t\"success\",\n\t\t\"failed\",\n\t\t\"abort_by_post_condition\",\n\t\t\"abort_by_response\",\n\t]),\n\ttxId: z.string().nullable().optional(),\n});\n",
13
+ "/**\n * React-free Zod schemas for Stacks UI atoms, plus a pass-through\n * `defineCatalog` helper.\n *\n * Import from this module when writing a workflow handler that uses\n * `step.render` — you avoid pulling React and `@json-render/*` into the\n * bundled handler (which would duplicate Zod and break esbuild's util\n * scoping). The runner wraps the raw definition into a real json-render\n * `Catalog` at render time using its own `@json-render/*` install.\n *\n * @example\n *\n * import { defineCatalog, AddressProps, AmountProps } from \"@secondlayer/stacks/ui/schemas\"\n * import { z } from \"zod\"\n *\n * const whaleUI = defineCatalog({\n * components: {\n * Address: { props: AddressProps },\n * Amount: { props: AmountProps },\n * WhaleCard: {\n * props: z.object({ from: z.string(), amount: z.string() }),\n * },\n * },\n * actions: {},\n * })\n *\n * // ...inside a workflow handler:\n * await step.render(\"card\", whaleUI, { model, prompt, context })\n */\n\nexport {\n\tAddressProps,\n\ttype AddressPropsType,\n} from \"./atoms/address.schema.ts\";\nexport { AmountProps, type AmountPropsType } from \"./atoms/amount.schema.ts\";\nexport {\n\tBlockHeightProps,\n\ttype BlockHeightPropsType,\n} from \"./atoms/blockHeight.schema.ts\";\nexport { BnsNameProps, type BnsNamePropsType } from \"./atoms/bnsName.schema.ts\";\nexport {\n\tNftAssetProps,\n\ttype NftAssetPropsType,\n} from \"./atoms/nftAsset.schema.ts\";\nexport {\n\tPrincipalProps,\n\ttype PrincipalPropsType,\n} from \"./atoms/principal.schema.ts\";\nexport { TokenProps, type TokenPropsType } from \"./atoms/token.schema.ts\";\nexport {\n\tTxStatusProps,\n\ttype TxStatusPropsType,\n} from \"./atoms/txStatus.schema.ts\";\n\nimport type { z } from \"zod\";\nimport { AddressProps } from \"./atoms/address.schema.ts\";\nimport { AmountProps } from \"./atoms/amount.schema.ts\";\nimport { BlockHeightProps } from \"./atoms/blockHeight.schema.ts\";\nimport { BnsNameProps } from \"./atoms/bnsName.schema.ts\";\nimport { NftAssetProps } from \"./atoms/nftAsset.schema.ts\";\nimport { PrincipalProps } from \"./atoms/principal.schema.ts\";\nimport { TokenProps } from \"./atoms/token.schema.ts\";\nimport { TxStatusProps } from \"./atoms/txStatus.schema.ts\";\n\n/**\n * Atom-schema registry — ready to drop into a catalog's `components` field.\n */\nexport const atomSchemas: Record<string, { props: z.ZodTypeAny }> = {\n\tAddress: { props: AddressProps },\n\tAmount: { props: AmountProps },\n\tBlockHeight: { props: BlockHeightProps },\n\tBnsName: { props: BnsNameProps },\n\tNftAsset: { props: NftAssetProps },\n\tPrincipal: { props: PrincipalProps },\n\tToken: { props: TokenProps },\n\tTxStatus: { props: TxStatusProps },\n};\n\n// --- Raw catalog definition shape (wrapped into a Catalog at render time) ---\n\n/**\n * Raw catalog definition — a plain object mapping component names to their\n * prop schemas. The workflow runner wraps this into a `@json-render/core`\n * `Catalog` via its own install, keeping json-render out of the user bundle.\n */\nexport interface RawCatalogDefinition {\n\tcomponents: Record<string, { props: unknown }>;\n\tactions?: Record<string, { params?: unknown }>;\n}\n\n/**\n * Identity helper — exists so authors get IDE autocomplete and so the\n * migration story to a real catalog constructor stays open. Does not import\n * `@json-render/*`, so nothing React-flavored bundles into the handler.\n */\nexport function defineCatalog<T extends RawCatalogDefinition>(def: T): T {\n\treturn def;\n}\n"
14
+ ],
15
+ "mappings": ";AAAA;AAQO,IAA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,OAAO;AAAA,EACpD,OAAO,GAAE,OAAO,EAAE,SAAS,gCAAgC;AAAA,EAC3D,KAAK,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACpC,MAAM,GAAE,KAAK,CAAC,YAAY,UAAU,CAAC,EAAE,SAAS;AACjD,CAAC;;ACZD,cAAS;AAQF,IAAM,aAA2B,GAAE,OAAO;AAAA,EAChD,QAAQ,GAAE,OAAO;AAAA,EACjB,UAAU,GACR,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,0CAA0C;AAAA,EACrD,UAAU,GAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC;AACpD,CAAC;;AChBD,cAAS;AAYF,IAAM,gBAA8B,GAAE,OAAO;AAAA,EACnD,QAAQ,GAAE,KAAK;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAAA,EACD,MAAM,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AACtC,CAAC;;AC8CM,IAAM,cAAuD;AAAA,EACnE,SAAS,EAAE,OAAO,aAAa;AAAA,EAC/B,QAAQ,EAAE,OAAO,YAAY;AAAA,EAC7B,aAAa,EAAE,OAAO,iBAAiB;AAAA,EACvC,SAAS,EAAE,OAAO,aAAa;AAAA,EAC/B,UAAU,EAAE,OAAO,cAAc;AAAA,EACjC,WAAW,EAAE,OAAO,eAAe;AAAA,EACnC,OAAO,EAAE,OAAO,WAAW;AAAA,EAC3B,UAAU,EAAE,OAAO,cAAc;AAClC;AAmBO,SAAS,aAA6C,CAAC,KAAW;AAAA,EACxE,OAAO;AAAA;",
16
+ "debugId": "C344789B3957A10364756E2164756E21",
17
+ "names": []
18
+ }
@@ -64,15 +64,15 @@ __export(exports_utils, {
64
64
  module.exports = __toCommonJS(exports_utils);
65
65
 
66
66
  // src/utils/signature.ts
67
- var import_secp256k1 = require("@noble/secp256k1");
68
67
  var import_sha23 = require("@noble/hashes/sha2.js");
68
+ var import_secp256k1 = require("@noble/secp256k1");
69
69
  function parseSignature(hex) {
70
70
  const clean = hex.startsWith("0x") ? hex.slice(2) : hex;
71
71
  if (clean.length !== 130) {
72
72
  throw new Error(`Invalid signature length: expected 130 hex chars, got ${clean.length}`);
73
73
  }
74
74
  return {
75
- recovery: parseInt(clean.slice(0, 2), 16),
75
+ recovery: Number.parseInt(clean.slice(0, 2), 16),
76
76
  r: clean.slice(2, 66),
77
77
  s: clean.slice(66, 130)
78
78
  };
@@ -164,5 +164,5 @@ function randomBytes(length) {
164
164
  return import_secp256k12.etc.randomBytes(length ?? 32);
165
165
  }
166
166
 
167
- //# debugId=F1D67D47267AF34764756E2164756E21
167
+ //# debugId=72C814DCE343721064756E2164756E21
168
168
  //# sourceMappingURL=index.cjs.map
@@ -2,10 +2,10 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/utils/signature.ts", "../src/utils/keys.ts"],
4
4
  "sourcesContent": [
5
- "import { Signature as NobleSignature, verify } from \"@noble/secp256k1\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { hexToBytes, concatBytes, utf8ToBytes } from \"./encoding.ts\";\nimport { hashP2PKH } from \"./hash.ts\";\nimport { c32address } from \"./address.ts\";\nimport { AddressVersion } from \"./constants.ts\";\n\nexport interface RecoverableSignature {\n /** Recovery id (0–3) */\n recovery: number;\n /** 32-byte r value as hex */\n r: string;\n /** 32-byte s value as hex */\n s: string;\n}\n\n// --- Format conversion ---\n\n/**\n * Parse a 65-byte VRS hex signature into components.\n * VRS format: recovery (1 byte) + r (32 bytes) + s (32 bytes)\n */\nexport function parseSignature(hex: string): RecoverableSignature {\n const clean = hex.startsWith(\"0x\") ? hex.slice(2) : hex;\n if (clean.length !== 130) {\n throw new Error(`Invalid signature length: expected 130 hex chars, got ${clean.length}`);\n }\n return {\n recovery: parseInt(clean.slice(0, 2), 16),\n r: clean.slice(2, 66),\n s: clean.slice(66, 130),\n };\n}\n\n/**\n * Serialize a recoverable signature to 65-byte VRS hex (130 chars).\n */\nexport function serializeSignature(sig: RecoverableSignature): string {\n const v = sig.recovery.toString(16).padStart(2, \"0\");\n return v + sig.r + sig.s;\n}\n\n/** Convert VRS hex to RSV hex: r+s (128 chars) + recovery (2 chars). */\nexport function signatureVrsToRsv(vrs: string): string {\n const clean = vrs.startsWith(\"0x\") ? vrs.slice(2) : vrs;\n return clean.slice(2) + clean.slice(0, 2);\n}\n\n/** Convert RSV hex to VRS hex: recovery (2 chars) + r+s (128 chars). */\nexport function signatureRsvToVrs(rsv: string): string {\n const clean = rsv.startsWith(\"0x\") ? rsv.slice(2) : rsv;\n return clean.slice(-2) + clean.slice(0, -2);\n}\n\n// --- Recovery ---\n\n/**\n * Recover a public key from a message hash and VRS signature.\n * @returns hex-encoded public key (33 bytes compressed, or 65 bytes uncompressed)\n */\nexport function recoverPublicKey(\n hash: Uint8Array | string,\n signature: string,\n compressed = true\n): string {\n const parsed = parseSignature(signature);\n const rs = parsed.r + parsed.s;\n const sig = NobleSignature.fromCompact(rs).addRecoveryBit(parsed.recovery);\n const msgHash = typeof hash === \"string\" ? hexToBytes(hash) : hash;\n const point = sig.recoverPublicKey(msgHash);\n return point.toHex(compressed);\n}\n\n/**\n * Recover a Stacks address from a message hash and VRS signature.\n * @param addressVersion defaults to MainnetSingleSig (22)\n */\nexport function recoverAddress(\n hash: Uint8Array | string,\n signature: string,\n addressVersion: number = AddressVersion.MainnetSingleSig\n): string {\n const pubkey = recoverPublicKey(hash, signature, true);\n const pubkeyHash = hashP2PKH(hexToBytes(pubkey));\n return c32address(addressVersion, pubkeyHash);\n}\n\n// --- Verification ---\n\n/**\n * Verify an ECDSA signature against a message hash and public key.\n * Accepts compact (64-byte) signature as hex or Uint8Array.\n */\nexport function verifySignature(\n hash: Uint8Array | string,\n signature: string | Uint8Array,\n publicKey: string | Uint8Array\n): boolean {\n return verify(signature, hash, publicKey, { lowS: false });\n}\n\n/** Bitcoin-style varint encoding for message length prefix. */\nfunction encodeVarint(n: number): Uint8Array {\n if (n < 0xfd) return new Uint8Array([n]);\n if (n <= 0xffff) {\n const buf = new Uint8Array(3);\n buf[0] = 0xfd;\n buf[1] = n & 0xff;\n buf[2] = (n >> 8) & 0xff;\n return buf;\n }\n const buf = new Uint8Array(5);\n buf[0] = 0xfe;\n buf[1] = n & 0xff;\n buf[2] = (n >> 8) & 0xff;\n buf[3] = (n >> 16) & 0xff;\n buf[4] = (n >> 24) & 0xff;\n return buf;\n}\n\nconst STACKS_MESSAGE_PREFIX = \"\\x17Stacks Signed Message:\\n\";\nconst LEGACY_MESSAGE_PREFIX = \"\\x18Stacks Message Signing:\\n\";\n\n/** Hash a message with the Stacks structured message prefix. */\nfunction hashMessage(message: string | Uint8Array, prefix: string): Uint8Array {\n const messageBytes = typeof message === \"string\" ? utf8ToBytes(message) : message;\n const prefixBytes = utf8ToBytes(prefix);\n const lengthBytes = encodeVarint(messageBytes.length);\n return sha256(concatBytes(prefixBytes, lengthBytes, messageBytes));\n}\n\n/**\n * Verify a signed Stacks message.\n * Parses a VRS signature, extracts r+s for verification.\n * Falls back to legacy prefix if standard prefix fails.\n */\nexport function verifyMessageSignature(\n message: string | Uint8Array,\n signature: string,\n publicKey: string\n): boolean {\n const parsed = parseSignature(signature);\n const compactSig = parsed.r + parsed.s;\n\n const msgHash = hashMessage(message, STACKS_MESSAGE_PREFIX);\n if (verify(compactSig, msgHash, publicKey, { lowS: false })) return true;\n\n // Fallback to legacy prefix\n if (typeof message === \"string\") {\n const legacyHash = hashMessage(message, LEGACY_MESSAGE_PREFIX);\n if (verify(compactSig, legacyHash, publicKey, { lowS: false })) return true;\n }\n\n return false;\n}\n",
6
- "import { Point, etc } from \"@noble/secp256k1\";\nimport { bytesToHex, hexToBytes } from \"./encoding.ts\";\n\n/** Compress a public key to 33 bytes (hex). */\nexport function compressPublicKey(publicKey: string | Uint8Array): string {\n const hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n return Point.fromHex(hex).toHex(true);\n}\n\n/** Uncompress a public key to 65 bytes (hex). */\nexport function uncompressPublicKey(publicKey: string | Uint8Array): string {\n const hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n return Point.fromHex(hex).toHex(false);\n}\n\n/** Check if a public key is in compressed format (starts with 0x02 or 0x03). */\nexport function isCompressedPublicKey(publicKey: string | Uint8Array): boolean {\n const bytes = typeof publicKey === \"string\" ? hexToBytes(publicKey) : publicKey;\n return bytes.length === 33 && (bytes[0] === 0x02 || bytes[0] === 0x03);\n}\n\n/** Generate cryptographically secure random bytes. Defaults to 32 bytes. */\nexport function randomBytes(length?: number): Uint8Array {\n return etc.randomBytes(length ?? 32);\n}\n"
5
+ "import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { Signature as NobleSignature, verify } from \"@noble/secp256k1\";\nimport { c32address } from \"./address.ts\";\nimport { AddressVersion } from \"./constants.ts\";\nimport { concatBytes, hexToBytes, utf8ToBytes } from \"./encoding.ts\";\nimport { hashP2PKH } from \"./hash.ts\";\n\nexport interface RecoverableSignature {\n\t/** Recovery id (0–3) */\n\trecovery: number;\n\t/** 32-byte r value as hex */\n\tr: string;\n\t/** 32-byte s value as hex */\n\ts: string;\n}\n\n// --- Format conversion ---\n\n/**\n * Parse a 65-byte VRS hex signature into components.\n * VRS format: recovery (1 byte) + r (32 bytes) + s (32 bytes)\n */\nexport function parseSignature(hex: string): RecoverableSignature {\n\tconst clean = hex.startsWith(\"0x\") ? hex.slice(2) : hex;\n\tif (clean.length !== 130) {\n\t\tthrow new Error(\n\t\t\t`Invalid signature length: expected 130 hex chars, got ${clean.length}`,\n\t\t);\n\t}\n\treturn {\n\t\trecovery: Number.parseInt(clean.slice(0, 2), 16),\n\t\tr: clean.slice(2, 66),\n\t\ts: clean.slice(66, 130),\n\t};\n}\n\n/**\n * Serialize a recoverable signature to 65-byte VRS hex (130 chars).\n */\nexport function serializeSignature(sig: RecoverableSignature): string {\n\tconst v = sig.recovery.toString(16).padStart(2, \"0\");\n\treturn v + sig.r + sig.s;\n}\n\n/** Convert VRS hex to RSV hex: r+s (128 chars) + recovery (2 chars). */\nexport function signatureVrsToRsv(vrs: string): string {\n\tconst clean = vrs.startsWith(\"0x\") ? vrs.slice(2) : vrs;\n\treturn clean.slice(2) + clean.slice(0, 2);\n}\n\n/** Convert RSV hex to VRS hex: recovery (2 chars) + r+s (128 chars). */\nexport function signatureRsvToVrs(rsv: string): string {\n\tconst clean = rsv.startsWith(\"0x\") ? rsv.slice(2) : rsv;\n\treturn clean.slice(-2) + clean.slice(0, -2);\n}\n\n// --- Recovery ---\n\n/**\n * Recover a public key from a message hash and VRS signature.\n * @returns hex-encoded public key (33 bytes compressed, or 65 bytes uncompressed)\n */\nexport function recoverPublicKey(\n\thash: Uint8Array | string,\n\tsignature: string,\n\tcompressed = true,\n): string {\n\tconst parsed = parseSignature(signature);\n\tconst rs = parsed.r + parsed.s;\n\tconst sig = NobleSignature.fromCompact(rs).addRecoveryBit(parsed.recovery);\n\tconst msgHash = typeof hash === \"string\" ? hexToBytes(hash) : hash;\n\tconst point = sig.recoverPublicKey(msgHash);\n\treturn point.toHex(compressed);\n}\n\n/**\n * Recover a Stacks address from a message hash and VRS signature.\n * @param addressVersion defaults to MainnetSingleSig (22)\n */\nexport function recoverAddress(\n\thash: Uint8Array | string,\n\tsignature: string,\n\taddressVersion: number = AddressVersion.MainnetSingleSig,\n): string {\n\tconst pubkey = recoverPublicKey(hash, signature, true);\n\tconst pubkeyHash = hashP2PKH(hexToBytes(pubkey));\n\treturn c32address(addressVersion, pubkeyHash);\n}\n\n// --- Verification ---\n\n/**\n * Verify an ECDSA signature against a message hash and public key.\n * Accepts compact (64-byte) signature as hex or Uint8Array.\n */\nexport function verifySignature(\n\thash: Uint8Array | string,\n\tsignature: string | Uint8Array,\n\tpublicKey: string | Uint8Array,\n): boolean {\n\treturn verify(signature, hash, publicKey, { lowS: false });\n}\n\n/** Bitcoin-style varint encoding for message length prefix. */\nfunction encodeVarint(n: number): Uint8Array {\n\tif (n < 0xfd) return new Uint8Array([n]);\n\tif (n <= 0xffff) {\n\t\tconst buf = new Uint8Array(3);\n\t\tbuf[0] = 0xfd;\n\t\tbuf[1] = n & 0xff;\n\t\tbuf[2] = (n >> 8) & 0xff;\n\t\treturn buf;\n\t}\n\tconst buf = new Uint8Array(5);\n\tbuf[0] = 0xfe;\n\tbuf[1] = n & 0xff;\n\tbuf[2] = (n >> 8) & 0xff;\n\tbuf[3] = (n >> 16) & 0xff;\n\tbuf[4] = (n >> 24) & 0xff;\n\treturn buf;\n}\n\nconst STACKS_MESSAGE_PREFIX = \"\\x17Stacks Signed Message:\\n\";\nconst LEGACY_MESSAGE_PREFIX = \"\\x18Stacks Message Signing:\\n\";\n\n/** Hash a message with the Stacks structured message prefix. */\nfunction hashMessage(message: string | Uint8Array, prefix: string): Uint8Array {\n\tconst messageBytes =\n\t\ttypeof message === \"string\" ? utf8ToBytes(message) : message;\n\tconst prefixBytes = utf8ToBytes(prefix);\n\tconst lengthBytes = encodeVarint(messageBytes.length);\n\treturn sha256(concatBytes(prefixBytes, lengthBytes, messageBytes));\n}\n\n/**\n * Verify a signed Stacks message.\n * Parses a VRS signature, extracts r+s for verification.\n * Falls back to legacy prefix if standard prefix fails.\n */\nexport function verifyMessageSignature(\n\tmessage: string | Uint8Array,\n\tsignature: string,\n\tpublicKey: string,\n): boolean {\n\tconst parsed = parseSignature(signature);\n\tconst compactSig = parsed.r + parsed.s;\n\n\tconst msgHash = hashMessage(message, STACKS_MESSAGE_PREFIX);\n\tif (verify(compactSig, msgHash, publicKey, { lowS: false })) return true;\n\n\t// Fallback to legacy prefix\n\tif (typeof message === \"string\") {\n\t\tconst legacyHash = hashMessage(message, LEGACY_MESSAGE_PREFIX);\n\t\tif (verify(compactSig, legacyHash, publicKey, { lowS: false })) return true;\n\t}\n\n\treturn false;\n}\n",
6
+ "import { Point, etc } from \"@noble/secp256k1\";\nimport { bytesToHex, hexToBytes } from \"./encoding.ts\";\n\n/** Compress a public key to 33 bytes (hex). */\nexport function compressPublicKey(publicKey: string | Uint8Array): string {\n\tconst hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n\treturn Point.fromHex(hex).toHex(true);\n}\n\n/** Uncompress a public key to 65 bytes (hex). */\nexport function uncompressPublicKey(publicKey: string | Uint8Array): string {\n\tconst hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n\treturn Point.fromHex(hex).toHex(false);\n}\n\n/** Check if a public key is in compressed format (starts with 0x02 or 0x03). */\nexport function isCompressedPublicKey(publicKey: string | Uint8Array): boolean {\n\tconst bytes =\n\t\ttypeof publicKey === \"string\" ? hexToBytes(publicKey) : publicKey;\n\treturn bytes.length === 33 && (bytes[0] === 0x02 || bytes[0] === 0x03);\n}\n\n/** Generate cryptographically secure random bytes. Defaults to 32 bytes. */\nexport function randomBytes(length?: number): Uint8Array {\n\treturn etc.randomBytes(length ?? 32);\n}\n"
7
7
  ],
8
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAoD,IAApD;AACuB,IAAvB;AAqBO,SAAS,cAAc,CAAC,KAAmC;AAAA,EAChE,MAAM,QAAQ,IAAI,WAAW,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI;AAAA,EACpD,IAAI,MAAM,WAAW,KAAK;AAAA,IACxB,MAAM,IAAI,MAAM,yDAAyD,MAAM,QAAQ;AAAA,EACzF;AAAA,EACA,OAAO;AAAA,IACL,UAAU,SAAS,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE;AAAA,IACxC,GAAG,MAAM,MAAM,GAAG,EAAE;AAAA,IACpB,GAAG,MAAM,MAAM,IAAI,GAAG;AAAA,EACxB;AAAA;AAMK,SAAS,kBAAkB,CAAC,KAAmC;AAAA,EACpE,MAAM,IAAI,IAAI,SAAS,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAAA,EACnD,OAAO,IAAI,IAAI,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AAAA,EAC5E,OAAO,wBAAM,QAAQ,GAAG,EAAE,MAAM,KAAK;AAAA;AAI/B,SAAS,qBAAqB,CAAC,WAAyC;AAAA,EAC9E,MAAM,QACL,OAAO,cAAc,WAAW,WAAW,SAAS,IAAI;AAAA,EACzD,OAAO,MAAM,WAAW,OAAO,MAAM,OAAO,KAAQ,MAAM,OAAO;AAAA;AAI3D,SAAS,WAAW,CAAC,QAA6B;AAAA,EACxD,OAAO,sBAAI,YAAY,UAAU,EAAE;AAAA;",
9
+ "debugId": "72C814DCE343721064756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -3,7 +3,7 @@ import {
3
3
  formatUnits,
4
4
  parseStx,
5
5
  parseUnits
6
- } from "../../shared/stacks-k2p5tv6x.js";
6
+ } from "../../shared/stacks-913a2rx7.js";
7
7
  import {
8
8
  AddressVersion,
9
9
  MAX_I128,
@@ -20,7 +20,7 @@ import {
20
20
  sha256,
21
21
  sha512_256,
22
22
  txidFromBytes
23
- } from "../../shared/stacks-bycy6t9k.js";
23
+ } from "../../shared/stacks-rwfgts3s.js";
24
24
  import {
25
25
  addressToVersion,
26
26
  getContractAddress,
@@ -29,7 +29,7 @@ import {
29
29
  isValidAddress,
30
30
  parseContractId,
31
31
  validateStacksAddress
32
- } from "../../shared/stacks-gjvbq6w7.js";
32
+ } from "../../shared/stacks-s10yb9gz.js";
33
33
  import {
34
34
  asciiToBytes,
35
35
  bigIntToBytes,
@@ -54,17 +54,17 @@ import {
54
54
  writeUInt16BE,
55
55
  writeUInt32BE,
56
56
  writeUInt8
57
- } from "../../shared/stacks-nqytwfcc.js";
57
+ } from "../../shared/stacks-s7z5q8be.js";
58
58
  // src/utils/signature.ts
59
- import { Signature as NobleSignature, verify } from "@noble/secp256k1";
60
59
  import { sha256 as sha2562 } from "@noble/hashes/sha2.js";
60
+ import { Signature as NobleSignature, verify } from "@noble/secp256k1";
61
61
  function parseSignature(hex) {
62
62
  const clean = hex.startsWith("0x") ? hex.slice(2) : hex;
63
63
  if (clean.length !== 130) {
64
64
  throw new Error(`Invalid signature length: expected 130 hex chars, got ${clean.length}`);
65
65
  }
66
66
  return {
67
- recovery: parseInt(clean.slice(0, 2), 16),
67
+ recovery: Number.parseInt(clean.slice(0, 2), 16),
68
68
  r: clean.slice(2, 66),
69
69
  s: clean.slice(66, 130)
70
70
  };
@@ -217,5 +217,5 @@ export {
217
217
  AddressVersion
218
218
  };
219
219
 
220
- //# debugId=9AA6CFA890CEF05564756E2164756E21
220
+ //# debugId=BEE4F6837A334EA064756E2164756E21
221
221
  //# sourceMappingURL=index.js.map