@secondlayer/stacks 6.0.0 → 6.1.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 (217) hide show
  1. package/dist/shared/stacks-esm-0pc6tmf0.js +50 -0
  2. package/dist/shared/{stacks-qex691bh.js.map → stacks-esm-0pc6tmf0.js.map} +2 -2
  3. package/dist/shared/{stacks-qt8ehebn.js → stacks-esm-16d82wyc.js} +10 -10
  4. package/dist/shared/{stacks-qt8ehebn.js.map → stacks-esm-16d82wyc.js.map} +2 -2
  5. package/dist/shared/{stacks-qs5fzts5.js → stacks-esm-7a0ehykf.js} +43 -43
  6. package/dist/shared/{stacks-qs5fzts5.js.map → stacks-esm-7a0ehykf.js.map} +2 -2
  7. package/dist/shared/{stacks-4hs8r4q2.js → stacks-esm-7v18h5dk.js} +4 -4
  8. package/dist/shared/{stacks-xjkn3en1.cjs.map → stacks-esm-7v18h5dk.js.map} +2 -2
  9. package/dist/shared/{stacks-71k0vmct.js → stacks-esm-8f5catbf.js} +126 -126
  10. package/dist/shared/{stacks-71k0vmct.js.map → stacks-esm-8f5catbf.js.map} +2 -2
  11. package/dist/shared/{stacks-wxfd6r4b.js → stacks-esm-8jt6k8p3.js} +13 -13
  12. package/dist/shared/{stacks-wxfd6r4b.js.map → stacks-esm-8jt6k8p3.js.map} +2 -2
  13. package/dist/shared/{stacks-x0qqwrev.js → stacks-esm-a20wyky3.js} +92 -92
  14. package/dist/shared/{stacks-agk106zs.cjs.map → stacks-esm-a20wyky3.js.map} +2 -2
  15. package/dist/shared/{stacks-gjz26k6b.js → stacks-esm-b54n1jdx.js} +102 -58
  16. package/dist/shared/stacks-esm-b54n1jdx.js.map +12 -0
  17. package/dist/shared/{stacks-9c1yam8b.js → stacks-esm-cmtj5vky.js} +162 -162
  18. package/dist/shared/{stacks-9c1yam8b.js.map → stacks-esm-cmtj5vky.js.map} +2 -2
  19. package/dist/shared/{stacks-z90xdr1x.js → stacks-esm-e2qhfgke.js} +36 -36
  20. package/dist/shared/{stacks-z90xdr1x.js.map → stacks-esm-e2qhfgke.js.map} +2 -2
  21. package/dist/shared/{stacks-v03zef3g.js → stacks-esm-ea4m4bk7.js} +117 -117
  22. package/dist/shared/{stacks-v03zef3g.js.map → stacks-esm-ea4m4bk7.js.map} +2 -2
  23. package/dist/shared/{stacks-69nq48jp.js → stacks-esm-hkw1kvd4.js} +140 -140
  24. package/dist/shared/{stacks-69nq48jp.js.map → stacks-esm-hkw1kvd4.js.map} +2 -2
  25. package/dist/shared/{stacks-qcae5852.js → stacks-esm-k108pemv.js} +4 -4
  26. package/dist/shared/{stacks-qcae5852.js.map → stacks-esm-k108pemv.js.map} +2 -2
  27. package/dist/shared/stacks-esm-kbz5s6v8.js +84 -0
  28. package/dist/shared/{stacks-4d7c3x27.js.map → stacks-esm-kbz5s6v8.js.map} +2 -2
  29. package/dist/shared/{stacks-kg1npstf.js → stacks-esm-mt1thm7k.js} +9 -9
  30. package/dist/shared/{stacks-kg1npstf.js.map → stacks-esm-mt1thm7k.js.map} +2 -2
  31. package/dist/shared/{stacks-yvb7rvwk.js → stacks-esm-n1mekwnb.js} +9 -9
  32. package/dist/shared/{stacks-8vzxax5e.cjs.map → stacks-esm-n1mekwnb.js.map} +2 -2
  33. package/dist/shared/{stacks-mftyrc60.js → stacks-esm-nt5hf8ht.js} +34 -34
  34. package/dist/shared/{stacks-mftyrc60.js.map → stacks-esm-nt5hf8ht.js.map} +2 -2
  35. package/dist/shared/{stacks-51ybf135.js → stacks-esm-phgy8yqf.js} +210 -210
  36. package/dist/shared/{stacks-51ybf135.js.map → stacks-esm-phgy8yqf.js.map} +2 -2
  37. package/dist/shared/{stacks-mbt36bzt.js → stacks-esm-pxv6ny92.js} +116 -116
  38. package/dist/shared/{stacks-mbt36bzt.js.map → stacks-esm-pxv6ny92.js.map} +2 -2
  39. package/dist/shared/{stacks-8brgfvqx.js → stacks-esm-qfzxhdqz.js} +19 -19
  40. package/dist/shared/{stacks-8brgfvqx.js.map → stacks-esm-qfzxhdqz.js.map} +2 -2
  41. package/dist/shared/{stacks-fd4rx56e.js → stacks-esm-snj9s2q8.js} +43 -43
  42. package/dist/shared/{stacks-fd4rx56e.js.map → stacks-esm-snj9s2q8.js.map} +2 -2
  43. package/dist/shared/{stacks-yajyej2y.js → stacks-esm-ss9ap75h.js} +28 -28
  44. package/dist/shared/{stacks-yajyej2y.js.map → stacks-esm-ss9ap75h.js.map} +2 -2
  45. package/dist/shared/{stacks-1m3m1agc.js → stacks-esm-t88hc019.js} +18 -18
  46. package/dist/shared/{stacks-1m3m1agc.js.map → stacks-esm-t88hc019.js.map} +2 -2
  47. package/dist/shared/stacks-esm-tdrdye4y.js +48 -0
  48. package/dist/shared/{stacks-enpj9krt.cjs.map → stacks-esm-tdrdye4y.js.map} +2 -2
  49. package/dist/src/accounts/index.cjs +565 -9
  50. package/dist/src/accounts/index.cjs.map +10 -4
  51. package/dist/src/accounts/index.d.cts +1 -1
  52. package/dist/src/accounts/index.d.ts +1 -1
  53. package/dist/src/accounts/index.js +26 -26
  54. package/dist/src/accounts/index.js.map +2 -2
  55. package/dist/src/actions/index.cjs +3860 -44
  56. package/dist/src/actions/index.cjs.map +65 -3
  57. package/dist/src/actions/index.d.cts +1 -1
  58. package/dist/src/actions/index.d.ts +1 -1
  59. package/dist/src/actions/index.js +102 -103
  60. package/dist/src/actions/index.js.map +1 -1
  61. package/dist/src/bitcoin/index.cjs +2506 -31
  62. package/dist/src/bitcoin/index.cjs.map +31 -3
  63. package/dist/src/bitcoin/index.d.cts +92 -92
  64. package/dist/src/bitcoin/index.d.ts +92 -92
  65. package/dist/src/bitcoin/index.js +88 -90
  66. package/dist/src/bitcoin/index.js.map +2 -2
  67. package/dist/src/bns/index.cjs +4435 -10
  68. package/dist/src/bns/index.cjs.map +50 -3
  69. package/dist/src/bns/index.d.cts +1 -1
  70. package/dist/src/bns/index.d.ts +1 -1
  71. package/dist/src/bns/index.js +39 -41
  72. package/dist/src/bns/index.js.map +2 -2
  73. package/dist/src/chains/index.cjs +141 -5
  74. package/dist/src/chains/index.cjs.map +5 -3
  75. package/dist/src/chains/index.d.cts +1 -1
  76. package/dist/src/chains/index.d.ts +1 -1
  77. package/dist/src/chains/index.js +12 -12
  78. package/dist/src/chains/index.js.map +1 -1
  79. package/dist/src/clarity/index.cjs +2021 -1
  80. package/dist/src/clarity/index.cjs.map +24 -3
  81. package/dist/src/clarity/index.d.cts +1 -1
  82. package/dist/src/clarity/index.d.ts +1 -1
  83. package/dist/src/clarity/index.js +170 -171
  84. package/dist/src/clarity/index.js.map +1 -1
  85. package/dist/src/connect/index.cjs +19 -19
  86. package/dist/src/connect/index.cjs.map +2 -2
  87. package/dist/src/connect/index.d.cts +1 -1
  88. package/dist/src/connect/index.d.ts +1 -1
  89. package/dist/src/connect/index.js +19 -19
  90. package/dist/src/connect/index.js.map +2 -2
  91. package/dist/src/connect/walletconnect/index.cjs +6 -46
  92. package/dist/src/connect/walletconnect/index.cjs.map +3 -4
  93. package/dist/src/connect/walletconnect/index.d.cts +1 -1
  94. package/dist/src/connect/walletconnect/index.d.ts +1 -1
  95. package/dist/src/connect/walletconnect/index.js +6 -46
  96. package/dist/src/connect/walletconnect/index.js.map +3 -4
  97. package/dist/src/filters/index.cjs +727 -1
  98. package/dist/src/filters/index.cjs.map +11 -3
  99. package/dist/src/filters/index.d.cts +76 -13
  100. package/dist/src/filters/index.d.ts +76 -13
  101. package/dist/src/filters/index.js +30 -26
  102. package/dist/src/filters/index.js.map +1 -1
  103. package/dist/src/index.cjs +4000 -126
  104. package/dist/src/index.cjs.map +69 -4
  105. package/dist/src/index.d.cts +658 -607
  106. package/dist/src/index.d.ts +658 -607
  107. package/dist/src/index.js +219 -219
  108. package/dist/src/index.js.map +2 -2
  109. package/dist/src/postconditions/index.cjs +1728 -1
  110. package/dist/src/postconditions/index.cjs.map +20 -3
  111. package/dist/src/postconditions/index.d.cts +1 -1
  112. package/dist/src/postconditions/index.d.ts +1 -1
  113. package/dist/src/postconditions/index.js +16 -17
  114. package/dist/src/postconditions/index.js.map +1 -1
  115. package/dist/src/pox/index.cjs +3866 -11
  116. package/dist/src/pox/index.cjs.map +48 -3
  117. package/dist/src/pox/index.d.cts +1 -1
  118. package/dist/src/pox/index.d.ts +1 -1
  119. package/dist/src/pox/index.js +40 -41
  120. package/dist/src/pox/index.js.map +2 -2
  121. package/dist/src/pox5/index.cjs +4124 -95
  122. package/dist/src/pox5/index.cjs.map +55 -4
  123. package/dist/src/pox5/index.d.cts +9 -1
  124. package/dist/src/pox5/index.d.ts +9 -1
  125. package/dist/src/pox5/index.js +210 -209
  126. package/dist/src/pox5/index.js.map +3 -3
  127. package/dist/src/sbtc/index.cjs +3719 -16
  128. package/dist/src/sbtc/index.cjs.map +47 -3
  129. package/dist/src/sbtc/index.d.cts +1 -1
  130. package/dist/src/sbtc/index.d.ts +1 -1
  131. package/dist/src/sbtc/index.js +39 -40
  132. package/dist/src/sbtc/index.js.map +2 -2
  133. package/dist/src/simnet/index.cjs +16 -16
  134. package/dist/src/simnet/index.cjs.map +2 -2
  135. package/dist/src/simnet/index.d.cts +1 -1
  136. package/dist/src/simnet/index.d.ts +1 -1
  137. package/dist/src/simnet/index.js +16 -16
  138. package/dist/src/simnet/index.js.map +2 -2
  139. package/dist/src/stackingdao/index.cjs +3747 -3
  140. package/dist/src/stackingdao/index.cjs.map +45 -3
  141. package/dist/src/stackingdao/index.d.cts +1 -1
  142. package/dist/src/stackingdao/index.d.ts +1 -1
  143. package/dist/src/stackingdao/index.js +26 -27
  144. package/dist/src/stackingdao/index.js.map +2 -2
  145. package/dist/src/subscriptions/index.cjs +160 -6
  146. package/dist/src/subscriptions/index.cjs.map +6 -3
  147. package/dist/src/subscriptions/index.d.cts +1 -1
  148. package/dist/src/subscriptions/index.d.ts +1 -1
  149. package/dist/src/subscriptions/index.js +14 -15
  150. package/dist/src/subscriptions/index.js.map +1 -1
  151. package/dist/src/transactions/index.cjs +2189 -49
  152. package/dist/src/transactions/index.cjs.map +23 -3
  153. package/dist/src/transactions/index.d.cts +1 -1
  154. package/dist/src/transactions/index.d.ts +1 -1
  155. package/dist/src/transactions/index.js +104 -105
  156. package/dist/src/transactions/index.js.map +1 -1
  157. package/dist/src/utils/index.cjs +503 -69
  158. package/dist/src/utils/index.cjs.map +9 -3
  159. package/dist/src/utils/index.d.cts +1 -1
  160. package/dist/src/utils/index.d.ts +1 -1
  161. package/dist/src/utils/index.js +131 -131
  162. package/dist/src/utils/index.js.map +2 -2
  163. package/package.json +1 -1
  164. package/dist/shared/stacks-02actsrx.cjs +0 -17
  165. package/dist/shared/stacks-02actsrx.cjs.map +0 -10
  166. package/dist/shared/stacks-03vfm21t.cjs +0 -222
  167. package/dist/shared/stacks-03vfm21t.cjs.map +0 -12
  168. package/dist/shared/stacks-24h5k94q.cjs +0 -74
  169. package/dist/shared/stacks-24h5k94q.cjs.map +0 -11
  170. package/dist/shared/stacks-37kz5t9f.cjs +0 -764
  171. package/dist/shared/stacks-37kz5t9f.cjs.map +0 -23
  172. package/dist/shared/stacks-3mt2q2na.cjs +0 -65
  173. package/dist/shared/stacks-3mt2q2na.cjs.map +0 -9
  174. package/dist/shared/stacks-4d7c3x27.js +0 -84
  175. package/dist/shared/stacks-4hs8r4q2.js.map +0 -10
  176. package/dist/shared/stacks-8vzxax5e.cjs +0 -45
  177. package/dist/shared/stacks-agk106zs.cjs +0 -267
  178. package/dist/shared/stacks-bdgh9n83.cjs +0 -212
  179. package/dist/shared/stacks-bdgh9n83.cjs.map +0 -11
  180. package/dist/shared/stacks-dpxnxhqb.cjs +0 -51
  181. package/dist/shared/stacks-dpxnxhqb.cjs.map +0 -11
  182. package/dist/shared/stacks-ee53k9j2.cjs +0 -651
  183. package/dist/shared/stacks-ee53k9j2.cjs.map +0 -13
  184. package/dist/shared/stacks-enpj9krt.cjs +0 -38
  185. package/dist/shared/stacks-f35mnrmg.cjs +0 -164
  186. package/dist/shared/stacks-f35mnrmg.cjs.map +0 -10
  187. package/dist/shared/stacks-fhzwsn5d.cjs +0 -261
  188. package/dist/shared/stacks-fhzwsn5d.cjs.map +0 -12
  189. package/dist/shared/stacks-gjz26k6b.js.map +0 -12
  190. package/dist/shared/stacks-gza2n1zs.cjs +0 -73
  191. package/dist/shared/stacks-gza2n1zs.cjs.map +0 -11
  192. package/dist/shared/stacks-kem68d80.cjs +0 -156
  193. package/dist/shared/stacks-kem68d80.cjs.map +0 -10
  194. package/dist/shared/stacks-n98w7g57.cjs +0 -234
  195. package/dist/shared/stacks-n98w7g57.cjs.map +0 -10
  196. package/dist/shared/stacks-p337hp6m.cjs +0 -336
  197. package/dist/shared/stacks-p337hp6m.cjs.map +0 -25
  198. package/dist/shared/stacks-q34k4vnc.cjs +0 -286
  199. package/dist/shared/stacks-q34k4vnc.cjs.map +0 -12
  200. package/dist/shared/stacks-qex691bh.js +0 -50
  201. package/dist/shared/stacks-rryme9bv.cjs +0 -569
  202. package/dist/shared/stacks-rryme9bv.cjs.map +0 -13
  203. package/dist/shared/stacks-s5vej5z6.cjs +0 -410
  204. package/dist/shared/stacks-s5vej5z6.cjs.map +0 -15
  205. package/dist/shared/stacks-sdqkapct.cjs +0 -67
  206. package/dist/shared/stacks-sdqkapct.cjs.map +0 -12
  207. package/dist/shared/stacks-v2rfr46a.js +0 -48
  208. package/dist/shared/stacks-v2rfr46a.js.map +0 -10
  209. package/dist/shared/stacks-vea7nde7.cjs +0 -731
  210. package/dist/shared/stacks-vea7nde7.cjs.map +0 -13
  211. package/dist/shared/stacks-wk8yp13j.cjs +0 -33
  212. package/dist/shared/stacks-wk8yp13j.cjs.map +0 -11
  213. package/dist/shared/stacks-x0qqwrev.js.map +0 -12
  214. package/dist/shared/stacks-xjkn3en1.cjs +0 -42
  215. package/dist/shared/stacks-xnrywjf1.cjs +0 -131
  216. package/dist/shared/stacks-xnrywjf1.cjs.map +0 -11
  217. package/dist/shared/stacks-yvb7rvwk.js.map +0 -10
@@ -1,267 +0,0 @@
1
- // src/clarity/abi/guards.ts
2
- function isUint128(value) {
3
- return typeof value === "bigint" && value >= 0n && value <= MAX_U128;
4
- }
5
- function isInt128(value) {
6
- return typeof value === "bigint" && value >= MIN_I128 && value <= MAX_I128;
7
- }
8
- function isBool(value) {
9
- return typeof value === "boolean";
10
- }
11
- function isPrincipal(value) {
12
- return typeof value === "string" && parsePrincipal(value) !== null;
13
- }
14
- function isStandardPrincipal(value) {
15
- if (typeof value !== "string")
16
- return false;
17
- const parsed = parsePrincipal(value);
18
- return parsed !== null && parsed.contractName === undefined;
19
- }
20
- function isContractPrincipal(value) {
21
- if (typeof value !== "string")
22
- return false;
23
- const parsed = parsePrincipal(value);
24
- return parsed !== null && parsed.contractName !== undefined;
25
- }
26
- function isTraitReference(value) {
27
- return isContractPrincipal(value);
28
- }
29
- function isString(value) {
30
- return typeof value === "string";
31
- }
32
- function isUint8Array(value) {
33
- return value instanceof Uint8Array;
34
- }
35
- function isArray(value, itemGuard) {
36
- return Array.isArray(value) && value.every(itemGuard);
37
- }
38
- function isOptional(value, guard) {
39
- return value === null || guard(value);
40
- }
41
- function isOkResponse(response) {
42
- return "ok" in response && !("err" in response);
43
- }
44
- function isErrResponse(response) {
45
- return "err" in response && !("ok" in response);
46
- }
47
- function isResponse(value, okGuard, errGuard) {
48
- if (typeof value !== "object" || value === null)
49
- return false;
50
- const obj = value;
51
- if ("ok" in value && !("err" in value))
52
- return okGuard(obj.ok);
53
- if ("err" in value && !("ok" in value))
54
- return errGuard(obj.err);
55
- return false;
56
- }
57
- function isAbiList(type) {
58
- return typeof type === "object" && type !== null && "list" in type;
59
- }
60
- function isAbiTuple(type) {
61
- return typeof type === "object" && type !== null && "tuple" in type;
62
- }
63
- function isAbiOptional(type) {
64
- return typeof type === "object" && type !== null && "optional" in type;
65
- }
66
- function isAbiResponse(type) {
67
- return typeof type === "object" && type !== null && "response" in type;
68
- }
69
- function isAbiBuffer(type) {
70
- return typeof type === "object" && type !== null && "buff" in type;
71
- }
72
- function isAbiStringAscii(type) {
73
- return typeof type === "object" && type !== null && "string-ascii" in type;
74
- }
75
- function isAbiStringUtf8(type) {
76
- return typeof type === "object" && type !== null && "string-utf8" in type;
77
- }
78
- function isAbiTraitReference(type) {
79
- return type === "trait_reference";
80
- }
81
-
82
- // src/clarity/abi/utils.ts
83
- function toCamelCase(str) {
84
- return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()).replace(/-([A-Z])/g, (_, letter) => letter).replace(/-(\d)/g, (_, digit) => digit).replace(/-/g, "").replace(/^\d/, "_$&");
85
- }
86
-
87
- // src/clarity/bridge.ts
88
- var CV_TYPE_TAGS = new Set([
89
- "int",
90
- "uint",
91
- "true",
92
- "false",
93
- "address",
94
- "contract",
95
- "ascii",
96
- "utf8",
97
- "buffer",
98
- "list",
99
- "tuple",
100
- "none",
101
- "some",
102
- "ok",
103
- "err"
104
- ]);
105
- function isClarityValue(value) {
106
- if (typeof value !== "object" || value === null)
107
- return false;
108
- const type = value.type;
109
- if (typeof type !== "string" || !CV_TYPE_TAGS.has(type))
110
- return false;
111
- if (type === "true" || type === "false" || type === "none")
112
- return true;
113
- return "value" in value;
114
- }
115
- var HEX_PAIRS_REGEX = /^(?:[0-9a-fA-F]{2})+$/;
116
- function coerceBuffer(value) {
117
- if (value instanceof Uint8Array)
118
- return bufferCV(value);
119
- if (typeof value === "object" && value !== null && "type" in value) {
120
- const tagged = value;
121
- if (tagged.type === "buffer" && isClarityValue(value))
122
- return value;
123
- if (typeof tagged.value === "string") {
124
- if (tagged.type === "ascii")
125
- return Cl.bufferFromAscii(tagged.value);
126
- if (tagged.type === "utf8")
127
- return Cl.bufferFromUtf8(tagged.value);
128
- if (tagged.type === "hex")
129
- return Cl.bufferFromHex(tagged.value);
130
- }
131
- throw new Error(`Unsupported buffer input: ${JSON.stringify(value)}`);
132
- }
133
- if (typeof value === "string") {
134
- const hex = value.startsWith("0x") ? value.slice(2) : value;
135
- if (HEX_PAIRS_REGEX.test(hex))
136
- return Cl.bufferFromHex(hex);
137
- return Cl.bufferFromUtf8(value);
138
- }
139
- throw new Error("buffer arg expects Uint8Array, hex string, { type, value }, or BufferCV");
140
- }
141
- function jsToClarityValue(abiType, value) {
142
- if (isAbiBuffer(abiType))
143
- return coerceBuffer(value);
144
- if (isClarityValue(value))
145
- return value;
146
- if (abiType === "uint128")
147
- return uintCV(value);
148
- if (abiType === "int128")
149
- return intCV(value);
150
- if (abiType === "bool")
151
- return boolCV(value);
152
- if (abiType === "principal" || abiType === "trait_reference")
153
- return Cl.principal(value);
154
- if (isAbiStringAscii(abiType))
155
- return stringAsciiCV(value);
156
- if (isAbiStringUtf8(abiType))
157
- return stringUtf8CV(value);
158
- if (isAbiList(abiType)) {
159
- const arr = value;
160
- return listCV(arr.map((item) => jsToClarityValue(abiType.list.type, item)));
161
- }
162
- if (isAbiTuple(abiType)) {
163
- const obj = value;
164
- const data = {};
165
- for (const field of abiType.tuple) {
166
- const camelKey = toCamelCase(field.name);
167
- const hasOriginal = field.name in obj;
168
- const hasCamel = camelKey in obj;
169
- const fieldValue = hasOriginal ? obj[field.name] : hasCamel ? obj[camelKey] : undefined;
170
- if (fieldValue === undefined && !isAbiOptional(field.type)) {
171
- throw new Error(`Missing tuple field: ${field.name}`);
172
- }
173
- data[field.name] = jsToClarityValue(field.type, fieldValue);
174
- }
175
- return tupleCV(data);
176
- }
177
- if (isAbiOptional(abiType)) {
178
- if (value === null || value === undefined)
179
- return noneCV();
180
- return someCV(jsToClarityValue(abiType.optional, value));
181
- }
182
- if (isAbiResponse(abiType)) {
183
- const obj = value;
184
- if ("ok" in obj && !("err" in obj))
185
- return responseOkCV(jsToClarityValue(abiType.response.ok, obj.ok));
186
- if ("err" in obj && !("ok" in obj))
187
- return responseErrorCV(jsToClarityValue(abiType.response.error, obj.err));
188
- throw new Error("Response must have exactly 'ok' or 'err' property");
189
- }
190
- throw new Error(`Unknown ABI type: ${JSON.stringify(abiType)}`);
191
- }
192
- function clarityValueToJS(abiType, cv) {
193
- return clarityValueToJSInner(abiType, cv);
194
- }
195
- function clarityValueToJSUntyped(abiType, cv) {
196
- return clarityValueToJSInner(abiType, cv);
197
- }
198
- function clarityValueToJSInner(abiType, cv) {
199
- if (abiType === "uint128" || abiType === "int128") {
200
- if (cv.type !== "int" && cv.type !== "uint")
201
- throw new Error(`Expected int/uint CV, got ${cv.type}`);
202
- return cv.value;
203
- }
204
- if (abiType === "bool") {
205
- if (cv.type === "true")
206
- return true;
207
- if (cv.type === "false")
208
- return false;
209
- throw new Error(`Expected bool CV, got ${cv.type}`);
210
- }
211
- if (abiType === "principal" || abiType === "trait_reference") {
212
- if (cv.type !== "address" && cv.type !== "contract")
213
- throw new Error(`Expected principal CV, got ${cv.type}`);
214
- return cv.value;
215
- }
216
- if (isAbiStringAscii(abiType) || isAbiStringUtf8(abiType)) {
217
- if (cv.type !== "ascii" && cv.type !== "utf8")
218
- throw new Error(`Expected string CV, got ${cv.type}`);
219
- return cv.value;
220
- }
221
- if (isAbiBuffer(abiType)) {
222
- if (cv.type !== "buffer")
223
- throw new Error(`Expected buffer CV, got ${cv.type}`);
224
- const hex = cv.value;
225
- const bytes = new Uint8Array(hex.length / 2);
226
- for (let i = 0;i < bytes.length; i++) {
227
- bytes[i] = Number.parseInt(hex.substring(i * 2, i * 2 + 2), 16);
228
- }
229
- return bytes;
230
- }
231
- if (isAbiList(abiType)) {
232
- if (cv.type !== "list")
233
- throw new Error(`Expected list CV, got ${cv.type}`);
234
- return cv.value.map((item) => clarityValueToJSInner(abiType.list.type, item));
235
- }
236
- if (isAbiTuple(abiType)) {
237
- if (cv.type !== "tuple")
238
- throw new Error(`Expected tuple CV, got ${cv.type}`);
239
- const result = {};
240
- for (const field of abiType.tuple) {
241
- const fieldCV = cv.value[field.name];
242
- if (!fieldCV)
243
- throw new Error(`Missing tuple field in CV: ${field.name}`);
244
- const camelKey = toCamelCase(field.name);
245
- result[camelKey] = clarityValueToJSInner(field.type, fieldCV);
246
- }
247
- return result;
248
- }
249
- if (isAbiOptional(abiType)) {
250
- if (cv.type === "none")
251
- return null;
252
- if (cv.type === "some")
253
- return clarityValueToJSInner(abiType.optional, cv.value);
254
- throw new Error(`Expected optional CV, got ${cv.type}`);
255
- }
256
- if (isAbiResponse(abiType)) {
257
- if (cv.type === "ok")
258
- return { ok: clarityValueToJSInner(abiType.response.ok, cv.value) };
259
- if (cv.type === "err")
260
- return { err: clarityValueToJSInner(abiType.response.error, cv.value) };
261
- throw new Error(`Expected response CV, got ${cv.type}`);
262
- }
263
- throw new Error(`Unknown ABI type: ${JSON.stringify(abiType)}`);
264
- }
265
-
266
- //# debugId=C0E0912050C4217A64756E2164756E21
267
- //# sourceMappingURL=stacks-agk106zs.cjs.map
@@ -1,212 +0,0 @@
1
- // src/bitcoin/serialize.ts
2
- function doubleSha256(bytes) {
3
- return import_sha2.sha256(import_sha2.sha256(bytes));
4
- }
5
- function reverseBytes(bytes) {
6
- const out = new Uint8Array(bytes.length);
7
- for (let i = 0;i < bytes.length; i++) {
8
- out[i] = bytes[bytes.length - 1 - i];
9
- }
10
- return out;
11
- }
12
-
13
- class BtcReader {
14
- data;
15
- view;
16
- offset = 0;
17
- constructor(data) {
18
- this.data = data;
19
- this.view = new DataView(data.buffer, data.byteOffset, data.byteLength);
20
- }
21
- get length() {
22
- return this.data.length;
23
- }
24
- readUInt8() {
25
- const v = this.view.getUint8(this.offset);
26
- this.offset += 1;
27
- return v;
28
- }
29
- peekUInt8() {
30
- return this.view.getUint8(this.offset);
31
- }
32
- readUInt32LE() {
33
- const v = this.view.getUint32(this.offset, true);
34
- this.offset += 4;
35
- return v;
36
- }
37
- readUInt64LE() {
38
- const v = this.view.getBigUint64(this.offset, true);
39
- this.offset += 8;
40
- return v;
41
- }
42
- readBytes(n) {
43
- if (this.offset + n > this.data.length) {
44
- throw new Error(`Bitcoin tx underflow: need ${n} bytes at offset ${this.offset}, have ${this.data.length}`);
45
- }
46
- const slice = this.data.slice(this.offset, this.offset + n);
47
- this.offset += n;
48
- return slice;
49
- }
50
- readVarInt() {
51
- const first = this.readUInt8();
52
- if (first < 253)
53
- return first;
54
- if (first === 253) {
55
- const v = this.view.getUint16(this.offset, true);
56
- this.offset += 2;
57
- return v;
58
- }
59
- if (first === 254) {
60
- return this.readUInt32LE();
61
- }
62
- const big = this.readUInt64LE();
63
- if (big > BigInt(Number.MAX_SAFE_INTEGER)) {
64
- throw new Error("Bitcoin varint exceeds safe integer range");
65
- }
66
- return Number(big);
67
- }
68
- }
69
- function scanTx(rawTx) {
70
- const r = new BtcReader(rawTx);
71
- const version = r.readUInt32LE();
72
- let hasWitness = false;
73
- if (r.peekUInt8() === 0) {
74
- r.readUInt8();
75
- const flag = r.readUInt8();
76
- if (flag !== 1) {
77
- throw new Error(`Unexpected SegWit flag 0x${flag.toString(16)}`);
78
- }
79
- hasWitness = true;
80
- }
81
- const bodyStart = r.offset;
82
- const inputCount = r.readVarInt();
83
- const inputs = [];
84
- for (let i = 0;i < inputCount; i++) {
85
- const prevTxid = r.readBytes(32);
86
- const vout = r.readUInt32LE();
87
- const scriptSig = r.readBytes(r.readVarInt());
88
- const sequence = r.readUInt32LE();
89
- inputs.push({ prevTxid, vout, scriptSig, sequence });
90
- }
91
- const outputCount = r.readVarInt();
92
- const outputs = [];
93
- for (let i = 0;i < outputCount; i++) {
94
- const value = r.readUInt64LE();
95
- const scriptPubKey = r.readBytes(r.readVarInt());
96
- outputs.push({ value, scriptPubKey });
97
- }
98
- const bodyEnd = r.offset;
99
- if (hasWitness) {
100
- for (let i = 0;i < inputCount; i++) {
101
- const itemCount = r.readVarInt();
102
- for (let j = 0;j < itemCount; j++) {
103
- r.readBytes(r.readVarInt());
104
- }
105
- }
106
- }
107
- const locktime = r.readUInt32LE();
108
- const legacy = concatBytes(rawTx.slice(0, 4), rawTx.slice(bodyStart, bodyEnd), rawTx.slice(r.offset - 4, r.offset));
109
- return { version, hasWitness, inputs, outputs, locktime, legacy };
110
- }
111
- function parseBitcoinTx(rawTx) {
112
- const s = scanTx(rawTx);
113
- return {
114
- version: s.version,
115
- hasWitness: s.hasWitness,
116
- inputs: s.inputs,
117
- outputs: s.outputs,
118
- locktime: s.locktime,
119
- txidInternal: doubleSha256(s.legacy)
120
- };
121
- }
122
- function stripWitness(rawTx) {
123
- return scanTx(rawTx).legacy;
124
- }
125
- function bitcoinTxid(rawTx, { display = false } = {}) {
126
- const txid = doubleSha256(scanTx(rawTx).legacy);
127
- return display ? reverseBytes(txid) : txid;
128
- }
129
- function parseBlockHeader(header) {
130
- if (header.length !== 80) {
131
- throw new Error(`Bitcoin block header must be 80 bytes, got ${header.length}`);
132
- }
133
- const r = new BtcReader(header);
134
- const version = r.readUInt32LE();
135
- const prevBlock = r.readBytes(32);
136
- const merkleRoot = r.readBytes(32);
137
- const timestamp = r.readUInt32LE();
138
- const bits = r.readUInt32LE();
139
- const nonce = r.readUInt32LE();
140
- return { version, prevBlock, merkleRoot, timestamp, bits, nonce };
141
- }
142
- function blockHash(header, { display = false } = {}) {
143
- const hash = doubleSha256(header);
144
- return display ? reverseBytes(hash) : hash;
145
- }
146
-
147
- // src/bitcoin/address.ts
148
- var import_secp256k1 = require("@noble/curves/secp256k1.js");
149
- var import_base = require("@scure/base");
150
- var BITCOIN_NETWORK_PARAMS = {
151
- mainnet: { p2pkh: 0, p2sh: 5, hrp: "bc" },
152
- testnet: { p2pkh: 111, p2sh: 196, hrp: "tb" },
153
- regtest: { p2pkh: 111, p2sh: 196, hrp: "bcrt" }
154
- };
155
- var NETWORK_PARAMS = BITCOIN_NETWORK_PARAMS;
156
- function base58CheckEncode(version, payload) {
157
- const data = concatBytes(Uint8Array.of(version), payload);
158
- const checksum = doubleSha256(data).slice(0, 4);
159
- return import_base.base58.encode(concatBytes(data, checksum));
160
- }
161
- function formatBitcoinAddress(parsed, network = "mainnet") {
162
- const params = NETWORK_PARAMS[network];
163
- const hash = parsed.hash;
164
- if (!hash)
165
- return;
166
- switch (parsed.type) {
167
- case "p2pkh":
168
- return base58CheckEncode(params.p2pkh, hash);
169
- case "p2sh":
170
- return base58CheckEncode(params.p2sh, hash);
171
- case "p2wpkh":
172
- case "p2wsh":
173
- return import_base.bech32.encode(params.hrp, [0, ...import_base.bech32.toWords(hash)]);
174
- case "p2tr":
175
- return import_base.bech32m.encode(params.hrp, [1, ...import_base.bech32m.toWords(hash)]);
176
- default:
177
- return;
178
- }
179
- }
180
- function toPubkeyBytes(publicKey) {
181
- return typeof publicKey === "string" ? hexToBytes(publicKey) : publicKey;
182
- }
183
- function taprootTweakPubkey(xonly) {
184
- if (xonly.length !== 32)
185
- throw new Error(`Expected 32-byte x-only pubkey, got ${xonly.length}`);
186
- const tweak = import_secp256k1.schnorr.utils.taggedHash("TapTweak", xonly);
187
- const t = BigInt(`0x${Array.from(tweak, (b) => b.toString(16).padStart(2, "0")).join("")}`);
188
- if (t >= import_secp256k1.secp256k1.Point.Fn.ORDER)
189
- throw new Error("Invalid tap tweak (exceeds curve order)");
190
- const internal = import_secp256k1.secp256k1.Point.fromBytes(concatBytes(Uint8Array.of(2), xonly));
191
- const output = internal.add(import_secp256k1.secp256k1.Point.BASE.multiply(t));
192
- return output.toBytes(true).slice(1);
193
- }
194
- function publicKeyToP2wpkhAddress(publicKey, network = "mainnet") {
195
- const pubkey = toPubkeyBytes(publicKey);
196
- if (pubkey.length !== 33)
197
- throw new Error(`Expected 33-byte compressed pubkey, got ${pubkey.length}`);
198
- const params = NETWORK_PARAMS[network];
199
- return import_base.bech32.encode(params.hrp, [0, ...import_base.bech32.toWords(hash160(pubkey))]);
200
- }
201
- function publicKeyToP2trAddress(publicKey, network = "mainnet") {
202
- const pubkey = toPubkeyBytes(publicKey);
203
- const xonly = pubkey.length === 33 ? pubkey.slice(1) : pubkey.length === 32 ? pubkey : undefined;
204
- if (!xonly)
205
- throw new Error(`Expected 33-byte compressed or 32-byte x-only pubkey, got ${pubkey.length}`);
206
- const params = NETWORK_PARAMS[network];
207
- const outputKey = taprootTweakPubkey(xonly);
208
- return import_base.bech32m.encode(params.hrp, [1, ...import_base.bech32m.toWords(outputKey)]);
209
- }
210
-
211
- //# debugId=1DF872A8095B935464756E2164756E21
212
- //# sourceMappingURL=stacks-bdgh9n83.cjs.map
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/bitcoin/serialize.ts", "../src/bitcoin/address.ts"],
4
- "sourcesContent": [
5
- "import { concatBytes } from \"../utils/encoding.ts\";\nimport { sha256 } from \"../utils/hash.ts\";\n\n/**\n * Bitcoin double-SHA256: `sha256(sha256(bytes))`. This is the hash Bitcoin uses\n * for txids, block headers, and merkle nodes — NOT the same as the Stacks\n * `txidFromBytes` (which uses sha512_256), so it lives here, not in `utils/hash`.\n */\nexport function doubleSha256(bytes: Uint8Array): Uint8Array {\n\treturn sha256(sha256(bytes));\n}\n\n/**\n * Reverse a byte array. Bitcoin hashes are computed and stored in *internal*\n * (little-endian) order but *displayed* big-endian, so the two differ by a\n * reversal. The SIP-044 built-ins consume internal order; only reverse for\n * display / when matching an explorer value.\n */\nexport function reverseBytes(bytes: Uint8Array): Uint8Array {\n\tconst out = new Uint8Array(bytes.length);\n\tfor (let i = 0; i < bytes.length; i++) {\n\t\tout[i] = bytes[bytes.length - 1 - i] as number;\n\t}\n\treturn out;\n}\n\n/**\n * A little-endian, varint-aware byte reader for Bitcoin serialization. The\n * shared `utils/BytesReader` is big-endian only; Bitcoin tx fields are\n * little-endian with compact-size (varint) length prefixes.\n */\nexport class BtcReader {\n\tprivate readonly data: Uint8Array;\n\tprivate readonly view: DataView;\n\tpublic offset = 0;\n\n\tconstructor(data: Uint8Array) {\n\t\tthis.data = data;\n\t\tthis.view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n\t}\n\n\tget length(): number {\n\t\treturn this.data.length;\n\t}\n\n\treadUInt8(): number {\n\t\tconst v = this.view.getUint8(this.offset);\n\t\tthis.offset += 1;\n\t\treturn v;\n\t}\n\n\t/** Read the next byte without advancing. */\n\tpeekUInt8(): number {\n\t\treturn this.view.getUint8(this.offset);\n\t}\n\n\treadUInt32LE(): number {\n\t\tconst v = this.view.getUint32(this.offset, true);\n\t\tthis.offset += 4;\n\t\treturn v;\n\t}\n\n\treadUInt64LE(): bigint {\n\t\tconst v = this.view.getBigUint64(this.offset, true);\n\t\tthis.offset += 8;\n\t\treturn v;\n\t}\n\n\treadBytes(n: number): Uint8Array {\n\t\tif (this.offset + n > this.data.length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Bitcoin tx underflow: need ${n} bytes at offset ${this.offset}, have ${this.data.length}`,\n\t\t\t);\n\t\t}\n\t\tconst slice = this.data.slice(this.offset, this.offset + n);\n\t\tthis.offset += n;\n\t\treturn slice;\n\t}\n\n\t/** Read a Bitcoin compact-size unsigned integer (varint). */\n\treadVarInt(): number {\n\t\tconst first = this.readUInt8();\n\t\tif (first < 0xfd) return first;\n\t\tif (first === 0xfd) {\n\t\t\tconst v = this.view.getUint16(this.offset, true);\n\t\t\tthis.offset += 2;\n\t\t\treturn v;\n\t\t}\n\t\tif (first === 0xfe) {\n\t\t\treturn this.readUInt32LE();\n\t\t}\n\t\tconst big = this.readUInt64LE();\n\t\tif (big > BigInt(Number.MAX_SAFE_INTEGER)) {\n\t\t\tthrow new Error(\"Bitcoin varint exceeds safe integer range\");\n\t\t}\n\t\treturn Number(big);\n\t}\n}\n\nexport interface BitcoinTxInput {\n\t/** Previous output txid, in serialized (internal) byte order. */\n\tprevTxid: Uint8Array;\n\tvout: number;\n\tscriptSig: Uint8Array;\n\tsequence: number;\n}\n\nexport interface BitcoinTxOutput {\n\t/** Output value in satoshis. */\n\tvalue: bigint;\n\tscriptPubKey: Uint8Array;\n}\n\nexport interface ParsedBitcoinTx {\n\tversion: number;\n\thasWitness: boolean;\n\tinputs: BitcoinTxInput[];\n\toutputs: BitcoinTxOutput[];\n\tlocktime: number;\n\t/**\n\t * The legacy txid as the raw double-SHA256 in *internal* byte order — ready\n\t * to pass as the leaf to `verify-merkle-proof`. Witness data is excluded\n\t * (the txid is computed over the legacy serialization), so this is stable for\n\t * both legacy and SegWit txs. Use `reverseBytes` for the displayed form.\n\t */\n\ttxidInternal: Uint8Array;\n}\n\ninterface ScanResult {\n\tversion: number;\n\thasWitness: boolean;\n\tinputs: BitcoinTxInput[];\n\toutputs: BitcoinTxOutput[];\n\tlocktime: number;\n\t/** The legacy (witness-stripped) serialization — what the txid is hashed over. */\n\tlegacy: Uint8Array;\n}\n\n/**\n * Single-pass scan of a raw Bitcoin tx. Captures the inputs/outputs slice and\n * reassembles the legacy serialization so both `parseBitcoinTx` and\n * `stripWitness` share one parser (and one set of foot-guns).\n */\nfunction scanTx(rawTx: Uint8Array): ScanResult {\n\tconst r = new BtcReader(rawTx);\n\tconst version = r.readUInt32LE();\n\n\t// SegWit marker (0x00) + flag (0x01) sit immediately after the version. A\n\t// legacy tx can never have a zero input count, so 0x00 here is unambiguous.\n\tlet hasWitness = false;\n\tif (r.peekUInt8() === 0x00) {\n\t\tr.readUInt8(); // marker\n\t\tconst flag = r.readUInt8();\n\t\tif (flag !== 0x01) {\n\t\t\tthrow new Error(`Unexpected SegWit flag 0x${flag.toString(16)}`);\n\t\t}\n\t\thasWitness = true;\n\t}\n\n\tconst bodyStart = r.offset;\n\tconst inputCount = r.readVarInt();\n\tconst inputs: BitcoinTxInput[] = [];\n\tfor (let i = 0; i < inputCount; i++) {\n\t\tconst prevTxid = r.readBytes(32);\n\t\tconst vout = r.readUInt32LE();\n\t\tconst scriptSig = r.readBytes(r.readVarInt());\n\t\tconst sequence = r.readUInt32LE();\n\t\tinputs.push({ prevTxid, vout, scriptSig, sequence });\n\t}\n\n\tconst outputCount = r.readVarInt();\n\tconst outputs: BitcoinTxOutput[] = [];\n\tfor (let i = 0; i < outputCount; i++) {\n\t\tconst value = r.readUInt64LE();\n\t\tconst scriptPubKey = r.readBytes(r.readVarInt());\n\t\toutputs.push({ value, scriptPubKey });\n\t}\n\tconst bodyEnd = r.offset;\n\n\tif (hasWitness) {\n\t\tfor (let i = 0; i < inputCount; i++) {\n\t\t\tconst itemCount = r.readVarInt();\n\t\t\tfor (let j = 0; j < itemCount; j++) {\n\t\t\t\tr.readBytes(r.readVarInt());\n\t\t\t}\n\t\t}\n\t}\n\n\tconst locktime = r.readUInt32LE();\n\n\tconst legacy = concatBytes(\n\t\trawTx.slice(0, 4),\n\t\trawTx.slice(bodyStart, bodyEnd),\n\t\trawTx.slice(r.offset - 4, r.offset),\n\t);\n\n\treturn { version, hasWitness, inputs, outputs, locktime, legacy };\n}\n\n/** Parse a serialized Bitcoin tx (legacy or SegWit) into its fields + txid. */\nexport function parseBitcoinTx(rawTx: Uint8Array): ParsedBitcoinTx {\n\tconst s = scanTx(rawTx);\n\treturn {\n\t\tversion: s.version,\n\t\thasWitness: s.hasWitness,\n\t\tinputs: s.inputs,\n\t\toutputs: s.outputs,\n\t\tlocktime: s.locktime,\n\t\ttxidInternal: doubleSha256(s.legacy),\n\t};\n}\n\n/**\n * Return the legacy (witness-stripped) serialization of a tx. For a legacy tx\n * this is the input unchanged; for a SegWit tx the marker, flag, and witness\n * stack are removed. This is the byte string the txid is hashed over.\n */\nexport function stripWitness(rawTx: Uint8Array): Uint8Array {\n\treturn scanTx(rawTx).legacy;\n}\n\n/**\n * Compute a tx's id from its raw serialization. Internal byte order by default\n * (the merkle leaf / built-in input); pass `{ display: true }` for the\n * explorer-style big-endian form.\n */\nexport function bitcoinTxid(\n\trawTx: Uint8Array,\n\t{ display = false }: { display?: boolean } = {},\n): Uint8Array {\n\tconst txid = doubleSha256(scanTx(rawTx).legacy);\n\treturn display ? reverseBytes(txid) : txid;\n}\n\nexport interface BlockHeader {\n\tversion: number;\n\t/** Previous block hash, internal byte order. */\n\tprevBlock: Uint8Array;\n\t/** Merkle root, internal byte order — pairs with `verify-merkle-proof`. */\n\tmerkleRoot: Uint8Array;\n\ttimestamp: number;\n\tbits: number;\n\tnonce: number;\n}\n\n/** Parse an 80-byte Bitcoin block header into its fields (hashes internal order). */\nexport function parseBlockHeader(header: Uint8Array): BlockHeader {\n\tif (header.length !== 80) {\n\t\tthrow new Error(\n\t\t\t`Bitcoin block header must be 80 bytes, got ${header.length}`,\n\t\t);\n\t}\n\tconst r = new BtcReader(header);\n\tconst version = r.readUInt32LE();\n\tconst prevBlock = r.readBytes(32);\n\tconst merkleRoot = r.readBytes(32);\n\tconst timestamp = r.readUInt32LE();\n\tconst bits = r.readUInt32LE();\n\tconst nonce = r.readUInt32LE();\n\treturn { version, prevBlock, merkleRoot, timestamp, bits, nonce };\n}\n\n/**\n * Hash an 80-byte block header (double-SHA256). Internal byte order by default;\n * `{ display: true }` for the explorer-style block hash.\n */\nexport function blockHash(\n\theader: Uint8Array,\n\t{ display = false }: { display?: boolean } = {},\n): Uint8Array {\n\tconst hash = doubleSha256(header);\n\treturn display ? reverseBytes(hash) : hash;\n}\n",
6
- "import { schnorr, secp256k1 } from \"@noble/curves/secp256k1.js\";\nimport { base58, bech32, bech32m } from \"@scure/base\";\nimport { concatBytes, hexToBytes } from \"../utils/encoding.ts\";\nimport { hash160 } from \"../utils/hash.ts\";\nimport type { ParsedOutputScript } from \"./codec.ts\";\nimport type { BitcoinNetwork } from \"./constants.ts\";\nimport { doubleSha256 } from \"./serialize.ts\";\n\n/** Address-encoding parameters (base58 version bytes + bech32 hrp) per network. */\nexport const BITCOIN_NETWORK_PARAMS = {\n\tmainnet: { p2pkh: 0x00, p2sh: 0x05, hrp: \"bc\" },\n\ttestnet: { p2pkh: 0x6f, p2sh: 0xc4, hrp: \"tb\" },\n\tregtest: { p2pkh: 0x6f, p2sh: 0xc4, hrp: \"bcrt\" },\n} as const;\n\nconst NETWORK_PARAMS = BITCOIN_NETWORK_PARAMS;\n\n/** Base58Check-encode a versioned 20-byte payload (legacy P2PKH / P2SH).\n * The one encoder for the package; pox5 and sbtc address code import it. */\nexport function base58CheckEncode(\n\tversion: number,\n\tpayload: Uint8Array,\n): string {\n\tconst data = concatBytes(Uint8Array.of(version), payload);\n\tconst checksum = doubleSha256(data).slice(0, 4);\n\treturn base58.encode(concatBytes(data, checksum));\n}\n\n/**\n * Render a parsed output script as a Bitcoin address for the given network.\n * Returns `undefined` for scripts without a standard address (OP_RETURN, P2PK,\n * unknown). Address encoding is network-dependent, which is why this is separate\n * from the pure `parseOutputScript` decoder.\n */\nexport function formatBitcoinAddress(\n\tparsed: ParsedOutputScript,\n\tnetwork: BitcoinNetwork = \"mainnet\",\n): string | undefined {\n\tconst params = NETWORK_PARAMS[network];\n\tconst hash = parsed.hash;\n\tif (!hash) return undefined;\n\tswitch (parsed.type) {\n\t\tcase \"p2pkh\":\n\t\t\treturn base58CheckEncode(params.p2pkh, hash);\n\t\tcase \"p2sh\":\n\t\t\treturn base58CheckEncode(params.p2sh, hash);\n\t\tcase \"p2wpkh\":\n\t\tcase \"p2wsh\":\n\t\t\treturn bech32.encode(params.hrp, [0, ...bech32.toWords(hash)]);\n\t\tcase \"p2tr\":\n\t\t\treturn bech32m.encode(params.hrp, [1, ...bech32m.toWords(hash)]);\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nfunction toPubkeyBytes(publicKey: Uint8Array | string): Uint8Array {\n\treturn typeof publicKey === \"string\" ? hexToBytes(publicKey) : publicKey;\n}\n\n/**\n * BIP341 key-path tweak: lift the x-only internal key to a point, add\n * `tapTweakHash(P)·G` (no script tree), and return the x-only output key.\n */\nexport function taprootTweakPubkey(xonly: Uint8Array): Uint8Array {\n\tif (xonly.length !== 32)\n\t\tthrow new Error(`Expected 32-byte x-only pubkey, got ${xonly.length}`);\n\tconst tweak = schnorr.utils.taggedHash(\"TapTweak\", xonly);\n\tconst t = BigInt(\n\t\t`0x${Array.from(tweak, (b) => b.toString(16).padStart(2, \"0\")).join(\"\")}`,\n\t);\n\tif (t >= secp256k1.Point.Fn.ORDER)\n\t\tthrow new Error(\"Invalid tap tweak (exceeds curve order)\");\n\tconst internal = secp256k1.Point.fromBytes(\n\t\tconcatBytes(Uint8Array.of(0x02), xonly),\n\t);\n\tconst output = internal.add(secp256k1.Point.BASE.multiply(t));\n\treturn output.toBytes(true).slice(1);\n}\n\n/**\n * Derive the native-segwit (P2WPKH, bech32 v0) address for a compressed\n * public key.\n */\nexport function publicKeyToP2wpkhAddress(\n\tpublicKey: Uint8Array | string,\n\tnetwork: BitcoinNetwork = \"mainnet\",\n): string {\n\tconst pubkey = toPubkeyBytes(publicKey);\n\tif (pubkey.length !== 33)\n\t\tthrow new Error(`Expected 33-byte compressed pubkey, got ${pubkey.length}`);\n\tconst params = NETWORK_PARAMS[network];\n\treturn bech32.encode(params.hrp, [0, ...bech32.toWords(hash160(pubkey))]);\n}\n\n/**\n * Derive the taproot (P2TR, bech32m v1) address for a public key — BIP341\n * key-path spend, no script tree. Accepts a 33-byte compressed key (the\n * parity byte is dropped) or a 32-byte x-only key.\n */\nexport function publicKeyToP2trAddress(\n\tpublicKey: Uint8Array | string,\n\tnetwork: BitcoinNetwork = \"mainnet\",\n): string {\n\tconst pubkey = toPubkeyBytes(publicKey);\n\tconst xonly =\n\t\tpubkey.length === 33\n\t\t\t? pubkey.slice(1)\n\t\t\t: pubkey.length === 32\n\t\t\t\t? pubkey\n\t\t\t\t: undefined;\n\tif (!xonly)\n\t\tthrow new Error(\n\t\t\t`Expected 33-byte compressed or 32-byte x-only pubkey, got ${pubkey.length}`,\n\t\t);\n\tconst params = NETWORK_PARAMS[network];\n\tconst outputKey = taprootTweakPubkey(xonly);\n\treturn bech32m.encode(params.hrp, [1, ...bech32m.toWords(outputKey)]);\n}\n"
7
- ],
8
- "mappings": ";AAQO,SAAS,YAAY,CAAC,OAA+B;AAAA,EAC3D,OAAO,mBAAO,mBAAO,KAAK,CAAC;AAAA;AASrB,SAAS,YAAY,CAAC,OAA+B;AAAA,EAC3D,MAAM,MAAM,IAAI,WAAW,MAAM,MAAM;AAAA,EACvC,SAAS,IAAI,EAAG,IAAI,MAAM,QAAQ,KAAK;AAAA,IACtC,IAAI,KAAK,MAAM,MAAM,SAAS,IAAI;AAAA,EACnC;AAAA,EACA,OAAO;AAAA;AAAA;AA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Q,MAAM,CAAC,CAAC,CAAC;AAAA;AAQlE,SAAS,sBAAsB,CACrC,WACA,UAA0B,WACjB;AAAA,EACT,MAAM,SAAS,cAAc,SAAS;AAAA,EACtC,MAAM,QACL,OAAO,WAAW,KACf,OAAO,MAAM,CAAC,IACd,OAAO,WAAW,KACjB,SACA;AAAA,EACL,IAAI,CAAC;AAAA,IACJ,MAAM,IAAI,MACT,6DAA6D,OAAO,QACrE;AAAA,EACD,MAAM,SAAS,eAAe;AAAA,EAC9B,MAAM,YAAY,mBAAmB,KAAK;AAAA,EAC1C,OAAO,oBAAQ,OAAO,OAAO,KAAK,CAAC,GAAG,GAAG,oBAAQ,QAAQ,SAAS,CAAC,CAAC;AAAA;",
9
- "debugId": "1DF872A8095B935464756E2164756E21",
10
- "names": []
11
- }
@@ -1,51 +0,0 @@
1
- // src/errors/websocket.ts
2
- class WebSocketError extends BaseError {
3
- name = "WebSocketError";
4
- }
5
-
6
- // src/subscriptions/actions.ts
7
- function getWsTransport(client) {
8
- if (client.transport.type !== "webSocket") {
9
- throw new WebSocketError("Watch actions require a webSocket transport. Use `webSocket()` when creating your client.");
10
- }
11
- return client.transport;
12
- }
13
- async function watchBlocks(client, params) {
14
- const transport = getWsTransport(client);
15
- return transport.subscribe({ event: "block" }, params.onBlock);
16
- }
17
- async function watchMempool(client, params) {
18
- const transport = getWsTransport(client);
19
- return transport.subscribe({ event: "mempool" }, params.onTransaction);
20
- }
21
- async function watchTransaction(client, params) {
22
- const transport = getWsTransport(client);
23
- return transport.subscribe({ event: "tx_update", tx_id: params.txId }, params.onUpdate);
24
- }
25
- async function watchAddress(client, params) {
26
- const transport = getWsTransport(client);
27
- return transport.subscribe({ event: "address_tx_update", address: params.address }, params.onTransaction);
28
- }
29
- async function watchAddressBalance(client, params) {
30
- const transport = getWsTransport(client);
31
- return transport.subscribe({ event: "address_balance_update", address: params.address }, params.onBalance);
32
- }
33
- async function watchNftEvent(client, params) {
34
- const transport = getWsTransport(client);
35
- let event;
36
- if (params.assetIdentifier && params.value) {
37
- event = "nft_event";
38
- } else if (params.assetIdentifier) {
39
- event = "nft_collection_event";
40
- } else {
41
- event = "nft_event";
42
- }
43
- return transport.subscribe({
44
- event,
45
- asset_identifier: params.assetIdentifier,
46
- value: params.value
47
- }, params.onEvent);
48
- }
49
-
50
- //# debugId=5512A15F010E3B8E64756E2164756E21
51
- //# sourceMappingURL=stacks-dpxnxhqb.cjs.map
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/errors/websocket.ts", "../src/subscriptions/actions.ts"],
4
- "sourcesContent": [
5
- "import { BaseError } from \"./base.ts\";\n\nexport class WebSocketError extends BaseError {\n\toverride name = \"WebSocketError\";\n}\n",
6
- "import type { Client } from \"../clients/types.ts\";\nimport { WebSocketError } from \"../errors/websocket.ts\";\nimport type { WebSocketTransport } from \"../transports/webSocket.ts\";\nimport type {\n\tAddressBalanceNotification,\n\tAddressTxNotification,\n\tBlockNotification,\n\tMempoolNotification,\n\tNftEventNotification,\n\tSubscription,\n\tTxUpdateNotification,\n} from \"./types.ts\";\n\nfunction getWsTransport(client: Client): WebSocketTransport {\n\tif (client.transport.type !== \"webSocket\") {\n\t\tthrow new WebSocketError(\n\t\t\t\"Watch actions require a webSocket transport. Use `webSocket()` when creating your client.\",\n\t\t);\n\t}\n\treturn client.transport as WebSocketTransport;\n}\n\nexport type WatchBlocksParams = {\n\tonBlock: (block: BlockNotification) => void;\n};\n\nexport async function watchBlocks(\n\tclient: Client,\n\tparams: WatchBlocksParams,\n): Promise<Subscription> {\n\tconst transport = getWsTransport(client);\n\treturn transport.subscribe({ event: \"block\" }, params.onBlock);\n}\n\nexport type WatchMempoolParams = {\n\tonTransaction: (tx: MempoolNotification) => void;\n};\n\nexport async function watchMempool(\n\tclient: Client,\n\tparams: WatchMempoolParams,\n): Promise<Subscription> {\n\tconst transport = getWsTransport(client);\n\treturn transport.subscribe({ event: \"mempool\" }, params.onTransaction);\n}\n\nexport type WatchTransactionParams = {\n\ttxId: string;\n\tonUpdate: (update: TxUpdateNotification) => void;\n};\n\nexport async function watchTransaction(\n\tclient: Client,\n\tparams: WatchTransactionParams,\n): Promise<Subscription> {\n\tconst transport = getWsTransport(client);\n\treturn transport.subscribe(\n\t\t{ event: \"tx_update\", tx_id: params.txId },\n\t\tparams.onUpdate,\n\t);\n}\n\nexport type WatchAddressParams = {\n\taddress: string;\n\tonTransaction: (tx: AddressTxNotification) => void;\n};\n\nexport async function watchAddress(\n\tclient: Client,\n\tparams: WatchAddressParams,\n): Promise<Subscription> {\n\tconst transport = getWsTransport(client);\n\treturn transport.subscribe(\n\t\t{ event: \"address_tx_update\", address: params.address },\n\t\tparams.onTransaction,\n\t);\n}\n\nexport type WatchAddressBalanceParams = {\n\taddress: string;\n\tonBalance: (balance: AddressBalanceNotification) => void;\n};\n\nexport async function watchAddressBalance(\n\tclient: Client,\n\tparams: WatchAddressBalanceParams,\n): Promise<Subscription> {\n\tconst transport = getWsTransport(client);\n\treturn transport.subscribe(\n\t\t{ event: \"address_balance_update\", address: params.address },\n\t\tparams.onBalance,\n\t);\n}\n\nexport type WatchNftEventParams = {\n\tonEvent: (event: NftEventNotification) => void;\n\tassetIdentifier?: string;\n\tvalue?: string;\n};\n\nexport async function watchNftEvent(\n\tclient: Client,\n\tparams: WatchNftEventParams,\n): Promise<Subscription> {\n\tconst transport = getWsTransport(client);\n\n\tlet event: \"nft_event\" | \"nft_asset_event\" | \"nft_collection_event\";\n\tif (params.assetIdentifier && params.value) {\n\t\tevent = \"nft_event\";\n\t} else if (params.assetIdentifier) {\n\t\tevent = \"nft_collection_event\";\n\t} else {\n\t\tevent = \"nft_event\";\n\t}\n\n\treturn transport.subscribe(\n\t\t{\n\t\t\tevent,\n\t\t\tasset_identifier: params.assetIdentifier,\n\t\t\tvalue: params.value,\n\t\t},\n\t\tparams.onEvent,\n\t);\n}\n"
7
- ],
8
- "mappings": ";AAEO,MAAM,uBAAuB,UAAU;AAAA,EACpC,OAAO;AACj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