@secondlayer/stacks 6.1.0 → 6.1.2

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 (166) hide show
  1. package/dist/shared/stacks-esm-0pc6tmf0.js +50 -0
  2. package/dist/shared/{stacks-esm-743jfh10.js.map → stacks-esm-0pc6tmf0.js.map} +2 -2
  3. package/dist/shared/{stacks-esm-0rdxcta7.js → stacks-esm-16d82wyc.js} +10 -10
  4. package/dist/shared/{stacks-esm-0rdxcta7.js.map → stacks-esm-16d82wyc.js.map} +2 -2
  5. package/dist/shared/{stacks-esm-cvhazvhd.js → stacks-esm-7a0ehykf.js} +43 -43
  6. package/dist/shared/{stacks-esm-cvhazvhd.js.map → stacks-esm-7a0ehykf.js.map} +2 -2
  7. package/dist/shared/{stacks-esm-1jae0a3r.js → stacks-esm-7v18h5dk.js} +4 -4
  8. package/dist/shared/{stacks-esm-1jae0a3r.js.map → stacks-esm-7v18h5dk.js.map} +2 -2
  9. package/dist/shared/{stacks-esm-9rnx0zxr.js → stacks-esm-8f5catbf.js} +126 -126
  10. package/dist/shared/{stacks-esm-9rnx0zxr.js.map → stacks-esm-8f5catbf.js.map} +2 -2
  11. package/dist/shared/{stacks-esm-7fpqgtyx.js → stacks-esm-8jt6k8p3.js} +13 -13
  12. package/dist/shared/{stacks-esm-7fpqgtyx.js.map → stacks-esm-8jt6k8p3.js.map} +2 -2
  13. package/dist/shared/{stacks-esm-hr7fpxtj.js → stacks-esm-a20wyky3.js} +92 -92
  14. package/dist/shared/{stacks-esm-hr7fpxtj.js.map → stacks-esm-a20wyky3.js.map} +2 -2
  15. package/dist/shared/{stacks-esm-3pv5avgr.js → stacks-esm-b54n1jdx.js} +54 -54
  16. package/dist/shared/{stacks-esm-3pv5avgr.js.map → stacks-esm-b54n1jdx.js.map} +2 -2
  17. package/dist/shared/{stacks-esm-r9q4wnyw.js → stacks-esm-cmtj5vky.js} +162 -162
  18. package/dist/shared/{stacks-esm-r9q4wnyw.js.map → stacks-esm-cmtj5vky.js.map} +2 -2
  19. package/dist/shared/{stacks-esm-wv67m4g6.js → stacks-esm-e2qhfgke.js} +36 -36
  20. package/dist/shared/{stacks-esm-wv67m4g6.js.map → stacks-esm-e2qhfgke.js.map} +2 -2
  21. package/dist/shared/{stacks-esm-qk0p9fr6.js → stacks-esm-ea4m4bk7.js} +117 -117
  22. package/dist/shared/{stacks-esm-qk0p9fr6.js.map → stacks-esm-ea4m4bk7.js.map} +2 -2
  23. package/dist/shared/{stacks-esm-fcfdn2zx.js → stacks-esm-hkw1kvd4.js} +140 -140
  24. package/dist/shared/{stacks-esm-fcfdn2zx.js.map → stacks-esm-hkw1kvd4.js.map} +2 -2
  25. package/dist/shared/{stacks-esm-qkj67g80.js → stacks-esm-k108pemv.js} +4 -4
  26. package/dist/shared/{stacks-esm-qkj67g80.js.map → stacks-esm-k108pemv.js.map} +2 -2
  27. package/dist/shared/stacks-esm-kbz5s6v8.js +84 -0
  28. package/dist/shared/{stacks-esm-2mc7ebrm.js.map → stacks-esm-kbz5s6v8.js.map} +2 -2
  29. package/dist/shared/{stacks-esm-n53kvwmt.js → stacks-esm-mt1thm7k.js} +9 -9
  30. package/dist/shared/{stacks-esm-n53kvwmt.js.map → stacks-esm-mt1thm7k.js.map} +2 -2
  31. package/dist/shared/{stacks-esm-v45990hx.js → stacks-esm-n1mekwnb.js} +9 -9
  32. package/dist/shared/{stacks-esm-v45990hx.js.map → stacks-esm-n1mekwnb.js.map} +2 -2
  33. package/dist/shared/{stacks-esm-r6dejrgr.js → stacks-esm-nt5hf8ht.js} +34 -34
  34. package/dist/shared/{stacks-esm-r6dejrgr.js.map → stacks-esm-nt5hf8ht.js.map} +2 -2
  35. package/dist/shared/{stacks-esm-skmcf5n2.js → stacks-esm-phgy8yqf.js} +210 -210
  36. package/dist/shared/{stacks-esm-skmcf5n2.js.map → stacks-esm-phgy8yqf.js.map} +2 -2
  37. package/dist/shared/{stacks-esm-kds4n82p.js → stacks-esm-pxv6ny92.js} +116 -116
  38. package/dist/shared/{stacks-esm-kds4n82p.js.map → stacks-esm-pxv6ny92.js.map} +2 -2
  39. package/dist/shared/{stacks-esm-3g33bqsm.js → stacks-esm-qfzxhdqz.js} +19 -19
  40. package/dist/shared/{stacks-esm-3g33bqsm.js.map → stacks-esm-qfzxhdqz.js.map} +2 -2
  41. package/dist/shared/{stacks-esm-aw2mj3sj.js → stacks-esm-snj9s2q8.js} +43 -43
  42. package/dist/shared/{stacks-esm-aw2mj3sj.js.map → stacks-esm-snj9s2q8.js.map} +2 -2
  43. package/dist/shared/{stacks-esm-q19a17fd.js → stacks-esm-ss9ap75h.js} +28 -28
  44. package/dist/shared/{stacks-esm-q19a17fd.js.map → stacks-esm-ss9ap75h.js.map} +2 -2
  45. package/dist/shared/{stacks-esm-x1r01353.js → stacks-esm-t88hc019.js} +18 -18
  46. package/dist/shared/{stacks-esm-x1r01353.js.map → stacks-esm-t88hc019.js.map} +2 -2
  47. package/dist/shared/stacks-esm-tdrdye4y.js +48 -0
  48. package/dist/shared/{stacks-esm-pxhfqfff.js.map → stacks-esm-tdrdye4y.js.map} +2 -2
  49. package/dist/src/accounts/index.cjs +15 -13
  50. package/dist/src/accounts/index.cjs.map +2 -2
  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 +83 -81
  56. package/dist/src/actions/index.cjs.map +2 -2
  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 +2035 -2036
  62. package/dist/src/bitcoin/index.cjs.map +8 -8
  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 +3313 -3310
  68. package/dist/src/bns/index.cjs.map +13 -13
  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 +14 -12
  74. package/dist/src/chains/index.cjs.map +2 -2
  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 +98 -96
  80. package/dist/src/clarity/index.cjs.map +2 -2
  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 +27 -20
  86. package/dist/src/connect/index.cjs.map +3 -3
  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 +27 -20
  90. package/dist/src/connect/index.js.map +3 -3
  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 +22 -20
  98. package/dist/src/filters/index.cjs.map +2 -2
  99. package/dist/src/filters/index.d.cts +1 -1
  100. package/dist/src/filters/index.d.ts +1 -1
  101. package/dist/src/filters/index.js +30 -30
  102. package/dist/src/filters/index.js.map +1 -1
  103. package/dist/src/index.cjs +1411 -1410
  104. package/dist/src/index.cjs.map +11 -11
  105. package/dist/src/index.d.cts +724 -724
  106. package/dist/src/index.d.ts +724 -724
  107. package/dist/src/index.js +219 -219
  108. package/dist/src/index.js.map +2 -2
  109. package/dist/src/postconditions/index.cjs +26 -24
  110. package/dist/src/postconditions/index.cjs.map +2 -2
  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 +722 -721
  116. package/dist/src/pox/index.cjs.map +9 -9
  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 +141 -137
  122. package/dist/src/pox5/index.cjs.map +3 -3
  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 +71 -69
  128. package/dist/src/sbtc/index.cjs.map +2 -2
  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 +716 -715
  140. package/dist/src/stackingdao/index.cjs.map +9 -9
  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 +15 -13
  146. package/dist/src/subscriptions/index.cjs.map +2 -2
  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 +79 -77
  152. package/dist/src/transactions/index.cjs.map +2 -2
  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 +76 -74
  158. package/dist/src/utils/index.cjs.map +2 -2
  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-esm-2mc7ebrm.js +0 -84
  165. package/dist/shared/stacks-esm-743jfh10.js +0 -50
  166. package/dist/shared/stacks-esm-pxhfqfff.js +0 -48
@@ -1,94 +1,3 @@
1
- type IntCV = {
2
- readonly type: "int"
3
- readonly value: bigint
4
- };
5
- type UIntCV = {
6
- readonly type: "uint"
7
- readonly value: bigint
8
- };
9
- type BooleanCV = TrueCV | FalseCV;
10
- type TrueCV = {
11
- readonly type: "true"
12
- };
13
- type FalseCV = {
14
- readonly type: "false"
15
- };
16
- type BufferCV = {
17
- readonly type: "buffer"
18
- readonly value: string
19
- };
20
- type NoneCV = {
21
- readonly type: "none"
22
- };
23
- type SomeCV = {
24
- readonly type: "some"
25
- readonly value: ClarityValue
26
- };
27
- type ResponseOkCV = {
28
- readonly type: "ok"
29
- readonly value: ClarityValue
30
- };
31
- type ResponseErrorCV = {
32
- readonly type: "err"
33
- readonly value: ClarityValue
34
- };
35
- type StandardPrincipalCV = {
36
- readonly type: "address"
37
- readonly value: string
38
- };
39
- type ContractPrincipalCV = {
40
- readonly type: "contract"
41
- readonly value: string
42
- };
43
- type ListCV = {
44
- type: "list"
45
- value: ClarityValue[]
46
- };
47
- type TupleData = {
48
- [key: string]: ClarityValue
49
- };
50
- type TupleCV = {
51
- type: "tuple"
52
- value: TupleData
53
- };
54
- type StringAsciiCV = {
55
- readonly type: "ascii"
56
- readonly value: string
57
- };
58
- type StringUtf8CV = {
59
- readonly type: "utf8"
60
- readonly value: string
61
- };
62
- type ClarityValue = IntCV | UIntCV | BooleanCV | BufferCV | NoneCV | SomeCV | ResponseOkCV | ResponseErrorCV | StandardPrincipalCV | ContractPrincipalCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV;
63
- /** Account derived from a local private key (mnemonic or raw key). */
64
- type LocalAccount = {
65
- type: "local"
66
- address: string
67
- /** Compressed public key (hex) */
68
- publicKey: string
69
- /** Raw ECDSA sign over a hash */
70
- sign(hash: Uint8Array): Uint8Array
71
- /** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
72
- signMessage(message: string | Uint8Array): string
73
- };
74
- /** Account with a user-provided signing function (sync or async). */
75
- type CustomAccount = {
76
- type: "custom"
77
- address: string
78
- publicKey: string
79
- sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
80
- };
81
- /** Browser wallet provider interface (e.g. Leather, Xverse). */
82
- type StacksProvider = {
83
- request(method: string, params?: any): Promise<any>
84
- };
85
- /** Account backed by a browser wallet {@link StacksProvider}. */
86
- type ProviderAccount = {
87
- type: "provider"
88
- address: string
89
- publicKey: string
90
- provider: StacksProvider
91
- };
92
1
  /**
93
2
  * Bitcoin double-SHA256: `sha256(sha256(bytes))`. This is the hash Bitcoin uses
94
3
  * for txids, block headers, and merkle nodes — NOT the same as the Stacks
@@ -303,6 +212,97 @@ interface EsploraConfig {
303
212
  * works. Use as the hosted fallback behind `bitcoinRpcSource`.
304
213
  */
305
214
  declare function esploraSource(config: EsploraConfig): ProofSource;
215
+ type IntCV = {
216
+ readonly type: "int"
217
+ readonly value: bigint
218
+ };
219
+ type UIntCV = {
220
+ readonly type: "uint"
221
+ readonly value: bigint
222
+ };
223
+ type BooleanCV = TrueCV | FalseCV;
224
+ type TrueCV = {
225
+ readonly type: "true"
226
+ };
227
+ type FalseCV = {
228
+ readonly type: "false"
229
+ };
230
+ type BufferCV = {
231
+ readonly type: "buffer"
232
+ readonly value: string
233
+ };
234
+ type NoneCV = {
235
+ readonly type: "none"
236
+ };
237
+ type SomeCV = {
238
+ readonly type: "some"
239
+ readonly value: ClarityValue
240
+ };
241
+ type ResponseOkCV = {
242
+ readonly type: "ok"
243
+ readonly value: ClarityValue
244
+ };
245
+ type ResponseErrorCV = {
246
+ readonly type: "err"
247
+ readonly value: ClarityValue
248
+ };
249
+ type StandardPrincipalCV = {
250
+ readonly type: "address"
251
+ readonly value: string
252
+ };
253
+ type ContractPrincipalCV = {
254
+ readonly type: "contract"
255
+ readonly value: string
256
+ };
257
+ type ListCV = {
258
+ type: "list"
259
+ value: ClarityValue[]
260
+ };
261
+ type TupleData = {
262
+ [key: string]: ClarityValue
263
+ };
264
+ type TupleCV = {
265
+ type: "tuple"
266
+ value: TupleData
267
+ };
268
+ type StringAsciiCV = {
269
+ readonly type: "ascii"
270
+ readonly value: string
271
+ };
272
+ type StringUtf8CV = {
273
+ readonly type: "utf8"
274
+ readonly value: string
275
+ };
276
+ type ClarityValue = IntCV | UIntCV | BooleanCV | BufferCV | NoneCV | SomeCV | ResponseOkCV | ResponseErrorCV | StandardPrincipalCV | ContractPrincipalCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV;
277
+ /** Account derived from a local private key (mnemonic or raw key). */
278
+ type LocalAccount = {
279
+ type: "local"
280
+ address: string
281
+ /** Compressed public key (hex) */
282
+ publicKey: string
283
+ /** Raw ECDSA sign over a hash */
284
+ sign(hash: Uint8Array): Uint8Array
285
+ /** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
286
+ signMessage(message: string | Uint8Array): string
287
+ };
288
+ /** Account with a user-provided signing function (sync or async). */
289
+ type CustomAccount = {
290
+ type: "custom"
291
+ address: string
292
+ publicKey: string
293
+ sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
294
+ };
295
+ /** Browser wallet provider interface (e.g. Leather, Xverse). */
296
+ type StacksProvider = {
297
+ request(method: string, params?: any): Promise<any>
298
+ };
299
+ /** Account backed by a browser wallet {@link StacksProvider}. */
300
+ type ProviderAccount = {
301
+ type: "provider"
302
+ address: string
303
+ publicKey: string
304
+ provider: StacksProvider
305
+ };
306
306
  /**
307
307
  * Encode the argument vector for the SIP-044 native built-in
308
308
  * `(verify-merkle-proof leaf-hash root-hash tx-index tx-count sibling-hashes)`.
@@ -827,4 +827,4 @@ type VerifyBitcoinPaymentParams = ({
827
827
  * leaf), so its bytes are committed.
828
828
  */
829
829
  declare function verifyBitcoinPayment(client: Client, params: VerifyBitcoinPaymentParams): Promise<VerifyBitcoinPaymentResult>;
830
- export { verifyBitcoinPayment, taprootTweakPubkey, stripWitness, spvAdapterPrincipal, rootFromProof, reverseBytes, publicKeyToP2wpkhAddress, publicKeyToP2trAddress, parseOutputScript, parseBlockHeader, parseBitcoinTx, merkleRoot2 as merkleRoot, isClarity6Active, getSpvAdapter, getBurnBlockHeight, formatBitcoinAddress, fallbackProofSource, esploraSource, encodeMerkleProofArgs, doubleSha256, decodeTxOutput, buildTxProof, buildMerkleProof, blockHash, bitcoinVerifier, bitcoinTxid, bitcoinRpcSource, VerifyBitcoinPaymentResult, VerifyBitcoinPaymentParams, SpvProof, SpvAdapterRef, SPV_ADAPTER_CONTRACTS, SPV_ADAPTER_ABI, ProofSource, ParsedOutputScript, ParsedBitcoinTx, OutputScriptType, MerkleProof, EsploraConfig, EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET, DecodedTxOutput, Clarity6Gate, BtcReader, BlockHeader, BlockForTx, BitcoinVerifierConfig, BitcoinVerifier, BitcoinTxOutput, BitcoinTxInput, BitcoinRpcConfig, BitcoinPaymentOutput, BitcoinNetwork };
830
+ export { BitcoinNetwork, BitcoinPaymentOutput, BitcoinRpcConfig, BitcoinTxInput, BitcoinTxOutput, BitcoinVerifier, BitcoinVerifierConfig, BlockForTx, BlockHeader, BtcReader, Clarity6Gate, DecodedTxOutput, EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET, EsploraConfig, MerkleProof, OutputScriptType, ParsedBitcoinTx, ParsedOutputScript, ProofSource, SPV_ADAPTER_ABI, SPV_ADAPTER_CONTRACTS, SpvAdapterRef, SpvProof, VerifyBitcoinPaymentParams, VerifyBitcoinPaymentResult, bitcoinRpcSource, bitcoinTxid, bitcoinVerifier, blockHash, buildMerkleProof, buildTxProof, decodeTxOutput, doubleSha256, encodeMerkleProofArgs, esploraSource, fallbackProofSource, formatBitcoinAddress, getBurnBlockHeight, getSpvAdapter, isClarity6Active, merkleRoot2 as merkleRoot, parseBitcoinTx, parseBlockHeader, parseOutputScript, publicKeyToP2trAddress, publicKeyToP2wpkhAddress, reverseBytes, rootFromProof, spvAdapterPrincipal, stripWitness, taprootTweakPubkey, verifyBitcoinPayment };
@@ -1,94 +1,3 @@
1
- type IntCV = {
2
- readonly type: "int"
3
- readonly value: bigint
4
- };
5
- type UIntCV = {
6
- readonly type: "uint"
7
- readonly value: bigint
8
- };
9
- type BooleanCV = TrueCV | FalseCV;
10
- type TrueCV = {
11
- readonly type: "true"
12
- };
13
- type FalseCV = {
14
- readonly type: "false"
15
- };
16
- type BufferCV = {
17
- readonly type: "buffer"
18
- readonly value: string
19
- };
20
- type NoneCV = {
21
- readonly type: "none"
22
- };
23
- type SomeCV = {
24
- readonly type: "some"
25
- readonly value: ClarityValue
26
- };
27
- type ResponseOkCV = {
28
- readonly type: "ok"
29
- readonly value: ClarityValue
30
- };
31
- type ResponseErrorCV = {
32
- readonly type: "err"
33
- readonly value: ClarityValue
34
- };
35
- type StandardPrincipalCV = {
36
- readonly type: "address"
37
- readonly value: string
38
- };
39
- type ContractPrincipalCV = {
40
- readonly type: "contract"
41
- readonly value: string
42
- };
43
- type ListCV = {
44
- type: "list"
45
- value: ClarityValue[]
46
- };
47
- type TupleData = {
48
- [key: string]: ClarityValue
49
- };
50
- type TupleCV = {
51
- type: "tuple"
52
- value: TupleData
53
- };
54
- type StringAsciiCV = {
55
- readonly type: "ascii"
56
- readonly value: string
57
- };
58
- type StringUtf8CV = {
59
- readonly type: "utf8"
60
- readonly value: string
61
- };
62
- type ClarityValue = IntCV | UIntCV | BooleanCV | BufferCV | NoneCV | SomeCV | ResponseOkCV | ResponseErrorCV | StandardPrincipalCV | ContractPrincipalCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV;
63
- /** Account derived from a local private key (mnemonic or raw key). */
64
- type LocalAccount = {
65
- type: "local"
66
- address: string
67
- /** Compressed public key (hex) */
68
- publicKey: string
69
- /** Raw ECDSA sign over a hash */
70
- sign(hash: Uint8Array): Uint8Array
71
- /** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
72
- signMessage(message: string | Uint8Array): string
73
- };
74
- /** Account with a user-provided signing function (sync or async). */
75
- type CustomAccount = {
76
- type: "custom"
77
- address: string
78
- publicKey: string
79
- sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
80
- };
81
- /** Browser wallet provider interface (e.g. Leather, Xverse). */
82
- type StacksProvider = {
83
- request(method: string, params?: any): Promise<any>
84
- };
85
- /** Account backed by a browser wallet {@link StacksProvider}. */
86
- type ProviderAccount = {
87
- type: "provider"
88
- address: string
89
- publicKey: string
90
- provider: StacksProvider
91
- };
92
1
  /**
93
2
  * Bitcoin double-SHA256: `sha256(sha256(bytes))`. This is the hash Bitcoin uses
94
3
  * for txids, block headers, and merkle nodes — NOT the same as the Stacks
@@ -303,6 +212,97 @@ interface EsploraConfig {
303
212
  * works. Use as the hosted fallback behind `bitcoinRpcSource`.
304
213
  */
305
214
  declare function esploraSource(config: EsploraConfig): ProofSource;
215
+ type IntCV = {
216
+ readonly type: "int"
217
+ readonly value: bigint
218
+ };
219
+ type UIntCV = {
220
+ readonly type: "uint"
221
+ readonly value: bigint
222
+ };
223
+ type BooleanCV = TrueCV | FalseCV;
224
+ type TrueCV = {
225
+ readonly type: "true"
226
+ };
227
+ type FalseCV = {
228
+ readonly type: "false"
229
+ };
230
+ type BufferCV = {
231
+ readonly type: "buffer"
232
+ readonly value: string
233
+ };
234
+ type NoneCV = {
235
+ readonly type: "none"
236
+ };
237
+ type SomeCV = {
238
+ readonly type: "some"
239
+ readonly value: ClarityValue
240
+ };
241
+ type ResponseOkCV = {
242
+ readonly type: "ok"
243
+ readonly value: ClarityValue
244
+ };
245
+ type ResponseErrorCV = {
246
+ readonly type: "err"
247
+ readonly value: ClarityValue
248
+ };
249
+ type StandardPrincipalCV = {
250
+ readonly type: "address"
251
+ readonly value: string
252
+ };
253
+ type ContractPrincipalCV = {
254
+ readonly type: "contract"
255
+ readonly value: string
256
+ };
257
+ type ListCV = {
258
+ type: "list"
259
+ value: ClarityValue[]
260
+ };
261
+ type TupleData = {
262
+ [key: string]: ClarityValue
263
+ };
264
+ type TupleCV = {
265
+ type: "tuple"
266
+ value: TupleData
267
+ };
268
+ type StringAsciiCV = {
269
+ readonly type: "ascii"
270
+ readonly value: string
271
+ };
272
+ type StringUtf8CV = {
273
+ readonly type: "utf8"
274
+ readonly value: string
275
+ };
276
+ type ClarityValue = IntCV | UIntCV | BooleanCV | BufferCV | NoneCV | SomeCV | ResponseOkCV | ResponseErrorCV | StandardPrincipalCV | ContractPrincipalCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV;
277
+ /** Account derived from a local private key (mnemonic or raw key). */
278
+ type LocalAccount = {
279
+ type: "local"
280
+ address: string
281
+ /** Compressed public key (hex) */
282
+ publicKey: string
283
+ /** Raw ECDSA sign over a hash */
284
+ sign(hash: Uint8Array): Uint8Array
285
+ /** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
286
+ signMessage(message: string | Uint8Array): string
287
+ };
288
+ /** Account with a user-provided signing function (sync or async). */
289
+ type CustomAccount = {
290
+ type: "custom"
291
+ address: string
292
+ publicKey: string
293
+ sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
294
+ };
295
+ /** Browser wallet provider interface (e.g. Leather, Xverse). */
296
+ type StacksProvider = {
297
+ request(method: string, params?: any): Promise<any>
298
+ };
299
+ /** Account backed by a browser wallet {@link StacksProvider}. */
300
+ type ProviderAccount = {
301
+ type: "provider"
302
+ address: string
303
+ publicKey: string
304
+ provider: StacksProvider
305
+ };
306
306
  /**
307
307
  * Encode the argument vector for the SIP-044 native built-in
308
308
  * `(verify-merkle-proof leaf-hash root-hash tx-index tx-count sibling-hashes)`.
@@ -827,4 +827,4 @@ type VerifyBitcoinPaymentParams = ({
827
827
  * leaf), so its bytes are committed.
828
828
  */
829
829
  declare function verifyBitcoinPayment(client: Client, params: VerifyBitcoinPaymentParams): Promise<VerifyBitcoinPaymentResult>;
830
- export { verifyBitcoinPayment, taprootTweakPubkey, stripWitness, spvAdapterPrincipal, rootFromProof, reverseBytes, publicKeyToP2wpkhAddress, publicKeyToP2trAddress, parseOutputScript, parseBlockHeader, parseBitcoinTx, merkleRoot2 as merkleRoot, isClarity6Active, getSpvAdapter, getBurnBlockHeight, formatBitcoinAddress, fallbackProofSource, esploraSource, encodeMerkleProofArgs, doubleSha256, decodeTxOutput, buildTxProof, buildMerkleProof, blockHash, bitcoinVerifier, bitcoinTxid, bitcoinRpcSource, VerifyBitcoinPaymentResult, VerifyBitcoinPaymentParams, SpvProof, SpvAdapterRef, SPV_ADAPTER_CONTRACTS, SPV_ADAPTER_ABI, ProofSource, ParsedOutputScript, ParsedBitcoinTx, OutputScriptType, MerkleProof, EsploraConfig, EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET, DecodedTxOutput, Clarity6Gate, BtcReader, BlockHeader, BlockForTx, BitcoinVerifierConfig, BitcoinVerifier, BitcoinTxOutput, BitcoinTxInput, BitcoinRpcConfig, BitcoinPaymentOutput, BitcoinNetwork };
830
+ export { BitcoinNetwork, BitcoinPaymentOutput, BitcoinRpcConfig, BitcoinTxInput, BitcoinTxOutput, BitcoinVerifier, BitcoinVerifierConfig, BlockForTx, BlockHeader, BtcReader, Clarity6Gate, DecodedTxOutput, EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET, EsploraConfig, MerkleProof, OutputScriptType, ParsedBitcoinTx, ParsedOutputScript, ProofSource, SPV_ADAPTER_ABI, SPV_ADAPTER_CONTRACTS, SpvAdapterRef, SpvProof, VerifyBitcoinPaymentParams, VerifyBitcoinPaymentResult, bitcoinRpcSource, bitcoinTxid, bitcoinVerifier, blockHash, buildMerkleProof, buildTxProof, decodeTxOutput, doubleSha256, encodeMerkleProofArgs, esploraSource, fallbackProofSource, formatBitcoinAddress, getBurnBlockHeight, getSpvAdapter, isClarity6Active, merkleRoot2 as merkleRoot, parseBitcoinTx, parseBlockHeader, parseOutputScript, publicKeyToP2trAddress, publicKeyToP2wpkhAddress, reverseBytes, rootFromProof, spvAdapterPrincipal, stripWitness, taprootTweakPubkey, verifyBitcoinPayment };
@@ -1,45 +1,43 @@
1
1
  import {
2
- EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET,
3
- bitcoinRpcSource,
4
- buildMerkleProof,
5
- buildTxProof,
6
- esploraSource,
7
- fallbackProofSource,
8
- merkleRoot,
9
- rootFromProof
10
- } from "../../shared/stacks-esm-r6dejrgr.js";
2
+ hexToBytes2
3
+ } from "../../shared/stacks-esm-7a0ehykf.js";
11
4
  import {
12
- BtcReader,
13
- bitcoinTxid,
14
- blockHash,
15
- doubleSha256,
16
- formatBitcoinAddress,
17
- parseBitcoinTx,
18
- parseBlockHeader,
19
- publicKeyToP2trAddress,
20
- publicKeyToP2wpkhAddress,
21
- reverseBytes,
22
- stripWitness,
23
- taprootTweakPubkey
24
- } from "../../shared/stacks-esm-wv67m4g6.js";
25
- import"../../shared/stacks-esm-9rnx0zxr.js";
26
- import"../../shared/stacks-esm-n53kvwmt.js";
5
+ uintCV2,
6
+ bufferCV2,
7
+ listCV2
8
+ } from "../../shared/stacks-esm-hkw1kvd4.js";
9
+ import"../../shared/stacks-esm-kbz5s6v8.js";
10
+ import"../../shared/stacks-esm-tdrdye4y.js";
11
+ import"../../shared/stacks-esm-8f5catbf.js";
12
+ import"../../shared/stacks-esm-a20wyky3.js";
27
13
  import {
28
- MalformedResponseError,
29
- readContract
30
- } from "../../shared/stacks-esm-743jfh10.js";
31
- import"../../shared/stacks-esm-hr7fpxtj.js";
32
- import"../../shared/stacks-esm-pxhfqfff.js";
14
+ doubleSha2562,
15
+ reverseBytes2,
16
+ BtcReader2,
17
+ parseBitcoinTx2,
18
+ stripWitness2,
19
+ bitcoinTxid2,
20
+ parseBlockHeader2,
21
+ blockHash2,
22
+ formatBitcoinAddress2,
23
+ taprootTweakPubkey2,
24
+ publicKeyToP2wpkhAddress2,
25
+ publicKeyToP2trAddress2
26
+ } from "../../shared/stacks-esm-e2qhfgke.js";
33
27
  import {
34
- bufferCV,
35
- listCV,
36
- uintCV
37
- } from "../../shared/stacks-esm-fcfdn2zx.js";
38
- import"../../shared/stacks-esm-1jae0a3r.js";
39
- import"../../shared/stacks-esm-2mc7ebrm.js";
28
+ merkleRoot2,
29
+ buildMerkleProof2,
30
+ rootFromProof2,
31
+ buildTxProof2,
32
+ fallbackProofSource2,
33
+ bitcoinRpcSource2,
34
+ esploraSource2,
35
+ EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET2
36
+ } from "../../shared/stacks-esm-nt5hf8ht.js";
40
37
  import {
41
- hexToBytes
42
- } from "../../shared/stacks-esm-cvhazvhd.js";
38
+ MalformedResponseError2,
39
+ readContract2
40
+ } from "../../shared/stacks-esm-0pc6tmf0.js";
43
41
  // src/bitcoin/codec.ts
44
42
  function merkleDepth(txCount) {
45
43
  let depth = 0;
@@ -74,18 +72,18 @@ function encodeMerkleProofArgs(params) {
74
72
  assertHash32(sibling, `sibling ${i}`);
75
73
  }
76
74
  return [
77
- bufferCV(leaf),
78
- bufferCV(root),
79
- uintCV(proof.txIndex),
80
- uintCV(proof.txCount),
81
- listCV(proof.siblings.map((s) => bufferCV(s)))
75
+ bufferCV2(leaf),
76
+ bufferCV2(root),
77
+ uintCV2(proof.txIndex),
78
+ uintCV2(proof.txCount),
79
+ listCV2(proof.siblings.map((s) => bufferCV2(s)))
82
80
  ];
83
81
  }
84
82
  function expectBuffer(cv, label) {
85
83
  if (cv?.type !== "buffer") {
86
84
  throw new Error(`expected ${label} to be a buffer, got ${cv?.type}`);
87
85
  }
88
- return hexToBytes(cv.value);
86
+ return hexToBytes2(cv.value);
89
87
  }
90
88
  function decodeTxOutput(cv) {
91
89
  const tuple = cv.type === "ok" ? cv.value : cv;
@@ -212,12 +210,12 @@ var SPV_ADAPTER_ABI = {
212
210
  async function getBurnBlockHeight(client) {
213
211
  const info = await client.request("/v2/info");
214
212
  if (typeof info?.burn_block_height !== "number") {
215
- throw new MalformedResponseError('getBurnBlockHeight: /v2/info response is missing "burn_block_height"');
213
+ throw new MalformedResponseError2('getBurnBlockHeight: /v2/info response is missing "burn_block_height"');
216
214
  }
217
215
  return info.burn_block_height;
218
216
  }
219
217
  async function isClarity6Active(client, gate = {}) {
220
- const activation = gate.activationBurnHeight ?? (client.chain?.network === "mainnet" ? EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET : undefined);
218
+ const activation = gate.activationBurnHeight ?? (client.chain?.network === "mainnet" ? EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET2 : undefined);
221
219
  if (activation == null) {
222
220
  throw new Error(`Clarity 6 (SIP-044 / Epoch 4.0) has no fixed activation height on ${client.chain?.network ?? "this network"} — pass { activationBurnHeight }`);
223
221
  }
@@ -237,7 +235,7 @@ function bitcoinVerifier(client, config) {
237
235
  const { contract, sender } = config;
238
236
  async function verifyMerkleProof(input) {
239
237
  const args = encodeMerkleProofArgs(input);
240
- const result = await readContract(client, {
238
+ const result = await readContract2(client, {
241
239
  contract,
242
240
  functionName: "verify-merkle",
243
241
  args,
@@ -248,7 +246,7 @@ function bitcoinVerifier(client, config) {
248
246
  return {
249
247
  verifyMerkleProof,
250
248
  verifySpvProof(proof) {
251
- const root = parseBlockHeader(proof.header).merkleRoot;
249
+ const root = parseBlockHeader2(proof.header).merkleRoot;
252
250
  return verifyMerkleProof({
253
251
  leaf: proof.txidInternal,
254
252
  root,
@@ -256,16 +254,16 @@ function bitcoinVerifier(client, config) {
256
254
  });
257
255
  },
258
256
  async wasTxMined(proof) {
259
- const result = await readContract(client, {
257
+ const result = await readContract2(client, {
260
258
  contract,
261
259
  functionName: "was-tx-mined",
262
260
  args: [
263
- bufferCV(proof.header),
264
- uintCV(proof.height),
265
- bufferCV(proof.txidInternal),
266
- uintCV(proof.merkle.txIndex),
267
- uintCV(proof.merkle.txCount),
268
- listCV(proof.merkle.siblings.map((s) => bufferCV(s)))
261
+ bufferCV2(proof.header),
262
+ uintCV2(proof.height),
263
+ bufferCV2(proof.txidInternal),
264
+ uintCV2(proof.merkle.txIndex),
265
+ uintCV2(proof.merkle.txCount),
266
+ listCV2(proof.merkle.siblings.map((s) => bufferCV2(s)))
269
267
  ],
270
268
  sender
271
269
  });
@@ -274,10 +272,10 @@ function bitcoinVerifier(client, config) {
274
272
  return clarityToBool(result);
275
273
  },
276
274
  async getTxOutput(rawTx, vout) {
277
- const result = await readContract(client, {
275
+ const result = await readContract2(client, {
278
276
  contract,
279
277
  functionName: "get-tx-output",
280
- args: [bufferCV(rawTx), uintCV(vout)],
278
+ args: [bufferCV2(rawTx), uintCV2(vout)],
281
279
  sender
282
280
  });
283
281
  if (result.type === "err") {
@@ -302,19 +300,19 @@ async function verifyBitcoinPayment(client, params) {
302
300
  if (!resolvedContract) {
303
301
  throw new Error(`No spv-adapter deployed for ${network} — pass an explicit \`contract\`. Only mainnet has a published reference adapter; the SIP-044 built-ins require Clarity 6 / Epoch 4.0 (deploy recipe: contracts/README.md).`);
304
302
  }
305
- const proof = "proof" in params ? params.proof : await buildTxProof(params.source, { txid: params.txid, vout });
303
+ const proof = "proof" in params ? params.proof : await buildTxProof2(params.source, { txid: params.txid, vout });
306
304
  const verifier = bitcoinVerifier(client, {
307
305
  contract: resolvedContract,
308
306
  sender
309
307
  });
310
308
  const mined = authenticateHeader ? await verifier.wasTxMined(proof) : await verifier.verifySpvProof(proof);
311
- const parsedTx = parseBitcoinTx(proof.rawTx);
309
+ const parsedTx = parseBitcoinTx2(proof.rawTx);
312
310
  const out = parsedTx.outputs[vout];
313
311
  if (!out) {
314
312
  throw new Error(`vout ${vout} out of range (tx has ${parsedTx.outputs.length} outputs)`);
315
313
  }
316
314
  const parsedScript = parseOutputScript(out.scriptPubKey);
317
- const address = formatBitcoinAddress(parsedScript, network);
315
+ const address = formatBitcoinAddress2(parsedScript, network);
318
316
  const output = {
319
317
  vout,
320
318
  script: out.scriptPubKey,
@@ -328,38 +326,38 @@ async function verifyBitcoinPayment(client, params) {
328
326
  return { verified, mined, output, proof };
329
327
  }
330
328
  export {
331
- verifyBitcoinPayment,
332
- taprootTweakPubkey,
333
- stripWitness,
334
- spvAdapterPrincipal,
335
- rootFromProof,
336
- reverseBytes,
337
- publicKeyToP2wpkhAddress,
338
- publicKeyToP2trAddress,
339
- parseOutputScript,
340
- parseBlockHeader,
341
- parseBitcoinTx,
342
- merkleRoot,
343
- isClarity6Active,
344
- getSpvAdapter,
345
- getBurnBlockHeight,
346
- formatBitcoinAddress,
347
- fallbackProofSource,
348
- esploraSource,
349
- encodeMerkleProofArgs,
350
- doubleSha256,
351
- decodeTxOutput,
352
- buildTxProof,
353
- buildMerkleProof,
354
- blockHash,
355
- bitcoinVerifier,
356
- bitcoinTxid,
357
- bitcoinRpcSource,
358
- SPV_ADAPTER_CONTRACTS,
329
+ BtcReader2 as BtcReader,
330
+ EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET2 as EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET,
359
331
  SPV_ADAPTER_ABI,
360
- EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET,
361
- BtcReader
332
+ SPV_ADAPTER_CONTRACTS,
333
+ bitcoinRpcSource2 as bitcoinRpcSource,
334
+ bitcoinTxid2 as bitcoinTxid,
335
+ bitcoinVerifier,
336
+ blockHash2 as blockHash,
337
+ buildMerkleProof2 as buildMerkleProof,
338
+ buildTxProof2 as buildTxProof,
339
+ decodeTxOutput,
340
+ doubleSha2562 as doubleSha256,
341
+ encodeMerkleProofArgs,
342
+ esploraSource2 as esploraSource,
343
+ fallbackProofSource2 as fallbackProofSource,
344
+ formatBitcoinAddress2 as formatBitcoinAddress,
345
+ getBurnBlockHeight,
346
+ getSpvAdapter,
347
+ isClarity6Active,
348
+ merkleRoot2 as merkleRoot,
349
+ parseBitcoinTx2 as parseBitcoinTx,
350
+ parseBlockHeader2 as parseBlockHeader,
351
+ parseOutputScript,
352
+ publicKeyToP2trAddress2 as publicKeyToP2trAddress,
353
+ publicKeyToP2wpkhAddress2 as publicKeyToP2wpkhAddress,
354
+ reverseBytes2 as reverseBytes,
355
+ rootFromProof2 as rootFromProof,
356
+ spvAdapterPrincipal,
357
+ stripWitness2 as stripWitness,
358
+ taprootTweakPubkey2 as taprootTweakPubkey,
359
+ verifyBitcoinPayment
362
360
  };
363
361
 
364
- //# debugId=D4B662C386BB76C964756E2164756E21
362
+ //# debugId=748999E5FC58202E64756E2164756E21
365
363
  //# sourceMappingURL=index.js.map