@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,36 +1,36 @@
1
1
  import {
2
+ bytesToHex2,
3
+ hexToBytes2,
4
+ without0x2,
5
+ utf8ToBytes2,
6
+ asciiToBytes2,
7
+ bytesToAscii2,
8
+ concatBytes2,
9
+ intToBigInt2,
10
+ intToBytes2,
11
+ intToHex2,
12
+ writeUInt32BE2,
13
+ writeUInt16BE2,
14
+ writeUInt82,
15
+ c32addressDecode2
16
+ } from "./stacks-esm-7a0ehykf.js";
17
+ import {
18
+ serializeCVBytes2,
2
19
  BytesReader,
3
20
  readAddress,
4
- readCV,
5
21
  readLPString,
6
- serializeCVBytes
7
- } from "./stacks-69nq48jp.js";
8
- import {
9
- parseContractId
10
- } from "./stacks-4d7c3x27.js";
22
+ readCV
23
+ } from "./stacks-esm-hkw1kvd4.js";
11
24
  import {
12
- asciiToBytes,
13
- bytesToAscii,
14
- bytesToHex,
15
- c32addressDecode,
16
- concatBytes,
17
- hexToBytes,
18
- intToBigInt,
19
- intToBytes,
20
- intToHex,
21
- utf8ToBytes,
22
- without0x,
23
- writeUInt16BE,
24
- writeUInt32BE,
25
- writeUInt8
26
- } from "./stacks-qs5fzts5.js";
25
+ parseContractId2
26
+ } from "./stacks-esm-kbz5s6v8.js";
27
27
 
28
28
  // src/transactions/types.ts
29
- var AuthType = {
29
+ var AuthType2 = {
30
30
  Standard: 4,
31
31
  Sponsored: 5
32
32
  };
33
- var PayloadType = {
33
+ var PayloadType2 = {
34
34
  TokenTransfer: 0,
35
35
  SmartContract: 1,
36
36
  ContractCall: 2,
@@ -41,7 +41,7 @@ var PayloadType = {
41
41
  TenureChange: 7,
42
42
  NakamotoCoinbase: 8
43
43
  };
44
- var ClarityVersion = {
44
+ var ClarityVersion2 = {
45
45
  Clarity1: 1,
46
46
  Clarity2: 2,
47
47
  Clarity3: 3,
@@ -49,17 +49,17 @@ var ClarityVersion = {
49
49
  Clarity5: 5,
50
50
  Clarity6: 6
51
51
  };
52
- var AnchorMode = {
52
+ var AnchorMode2 = {
53
53
  OnChainOnly: 1,
54
54
  OffChainOnly: 2,
55
55
  Any: 3
56
56
  };
57
- var PostConditionModeWire = {
57
+ var PostConditionModeWire2 = {
58
58
  Allow: 1,
59
59
  Deny: 2,
60
60
  Originator: 3
61
61
  };
62
- var AddressHashMode = {
62
+ var AddressHashMode2 = {
63
63
  P2PKH: 0,
64
64
  P2SH: 1,
65
65
  P2WPKH: 2,
@@ -67,52 +67,52 @@ var AddressHashMode = {
67
67
  P2SH_NonSequential: 5,
68
68
  P2WSH_P2SH_NonSequential: 7
69
69
  };
70
- var PubKeyEncoding = {
70
+ var PubKeyEncoding2 = {
71
71
  Compressed: 0,
72
72
  Uncompressed: 1
73
73
  };
74
- var FungibleConditionCode = {
74
+ var FungibleConditionCode2 = {
75
75
  Equal: 1,
76
76
  Greater: 2,
77
77
  GreaterEqual: 3,
78
78
  Less: 4,
79
79
  LessEqual: 5
80
80
  };
81
- var NonFungibleConditionCode = {
81
+ var NonFungibleConditionCode2 = {
82
82
  Sends: 16,
83
83
  DoesNotSend: 17,
84
84
  MaybeSent: 18
85
85
  };
86
- var PoxConditionCode = {
86
+ var PoxConditionCode2 = {
87
87
  WillNotPerform: 48,
88
88
  MayPerform: 49,
89
89
  WillPerform: 50
90
90
  };
91
- var PostConditionPrincipalId = {
91
+ var PostConditionPrincipalId2 = {
92
92
  Origin: 1,
93
93
  Standard: 2,
94
94
  Contract: 3
95
95
  };
96
- var AssetType = {
96
+ var AssetType2 = {
97
97
  STX: 0,
98
98
  Fungible: 1,
99
99
  NonFungible: 2,
100
100
  Staking: 3,
101
101
  Pox: 4
102
102
  };
103
- var AuthFieldType = {
103
+ var AuthFieldType2 = {
104
104
  PublicKeyCompressed: 0,
105
105
  PublicKeyUncompressed: 1,
106
106
  SignatureCompressed: 2,
107
107
  SignatureUncompressed: 3
108
108
  };
109
- var RECOVERABLE_ECDSA_SIG_LENGTH_BYTES = 65;
110
- var MEMO_MAX_LENGTH_BYTES = 34;
111
- var MAX_STRING_LENGTH_BYTES = 128;
112
- var COINBASE_BYTES_LENGTH = 32;
113
- var VRF_PROOF_BYTES_LENGTH = 80;
114
- var MICROBLOCK_HEADER_BYTES_LENGTH = 132;
115
- var TenureChangeCause = {
109
+ var RECOVERABLE_ECDSA_SIG_LENGTH_BYTES2 = 65;
110
+ var MEMO_MAX_LENGTH_BYTES2 = 34;
111
+ var MAX_STRING_LENGTH_BYTES2 = 128;
112
+ var COINBASE_BYTES_LENGTH2 = 32;
113
+ var VRF_PROOF_BYTES_LENGTH2 = 80;
114
+ var MICROBLOCK_HEADER_BYTES_LENGTH2 = 132;
115
+ var TenureChangeCause2 = {
116
116
  BlockFound: 0,
117
117
  Extended: 1,
118
118
  ExtendedRuntime: 2,
@@ -124,207 +124,207 @@ var TenureChangeCause = {
124
124
 
125
125
  // src/transactions/wire/serialize.ts
126
126
  function serializeAddress(c32Address) {
127
- const [version, hash160] = c32addressDecode(c32Address);
128
- return concatBytes(new Uint8Array([version]), hexToBytes(hash160));
127
+ const [version, hash160] = c32addressDecode2(c32Address);
128
+ return concatBytes2(new Uint8Array([version]), hexToBytes2(hash160));
129
129
  }
130
130
  function serializeLPString(str, prefixBytes = 1) {
131
- const content = utf8ToBytes(str);
132
- const prefix = hexToBytes(intToHex(content.byteLength, prefixBytes));
133
- return concatBytes(prefix, content);
131
+ const content = utf8ToBytes2(str);
132
+ const prefix = hexToBytes2(intToHex2(content.byteLength, prefixBytes));
133
+ return concatBytes2(prefix, content);
134
134
  }
135
135
  function serializeLPStringLong(str) {
136
136
  return serializeLPString(str, 4);
137
137
  }
138
138
  function serializeMemo(memo) {
139
- const content = asciiToBytes(memo);
140
- const padded = new Uint8Array(MEMO_MAX_LENGTH_BYTES);
141
- padded.set(content.slice(0, MEMO_MAX_LENGTH_BYTES));
139
+ const content = asciiToBytes2(memo);
140
+ const padded = new Uint8Array(MEMO_MAX_LENGTH_BYTES2);
141
+ padded.set(content.slice(0, MEMO_MAX_LENGTH_BYTES2));
142
142
  return padded;
143
143
  }
144
144
  function serializeSpendingCondition(condition) {
145
145
  const parts = [
146
- writeUInt8(condition.hashMode),
147
- hexToBytes(condition.signer),
148
- intToBytes(condition.nonce, 8),
149
- intToBytes(condition.fee, 8)
146
+ writeUInt82(condition.hashMode),
147
+ hexToBytes2(condition.signer),
148
+ intToBytes2(condition.nonce, 8),
149
+ intToBytes2(condition.fee, 8)
150
150
  ];
151
151
  if ("signature" in condition) {
152
152
  const sc = condition;
153
- parts.push(writeUInt8(sc.keyEncoding));
154
- parts.push(hexToBytes(sc.signature));
153
+ parts.push(writeUInt82(sc.keyEncoding));
154
+ parts.push(hexToBytes2(sc.signature));
155
155
  } else {
156
156
  const mc = condition;
157
- parts.push(writeUInt32BE(mc.fields.length));
157
+ parts.push(writeUInt32BE2(mc.fields.length));
158
158
  for (const field of mc.fields) {
159
159
  parts.push(serializeAuthField(field));
160
160
  }
161
- parts.push(writeUInt16BE(mc.signaturesRequired));
161
+ parts.push(writeUInt16BE2(mc.signaturesRequired));
162
162
  }
163
- return concatBytes(...parts);
163
+ return concatBytes2(...parts);
164
164
  }
165
165
  function serializeAuthField(field) {
166
166
  if (field.type === "publicKey") {
167
- const typeId2 = field.pubKeyEncoding === 0 ? 0 : 1;
168
- return concatBytes(writeUInt8(typeId2), hexToBytes(field.data));
167
+ const typeId = field.pubKeyEncoding === 0 ? 0 : 1;
168
+ return concatBytes2(writeUInt82(typeId), hexToBytes2(field.data));
169
169
  }
170
170
  const typeId = field.pubKeyEncoding === 0 ? 2 : 3;
171
- return concatBytes(writeUInt8(typeId), hexToBytes(field.data));
171
+ return concatBytes2(writeUInt82(typeId), hexToBytes2(field.data));
172
172
  }
173
173
  function serializeAuthorization(auth) {
174
- const parts = [writeUInt8(auth.authType)];
174
+ const parts = [writeUInt82(auth.authType)];
175
175
  parts.push(serializeSpendingCondition(auth.spendingCondition));
176
- if (auth.authType === AuthType.Sponsored) {
176
+ if (auth.authType === AuthType2.Sponsored) {
177
177
  parts.push(serializeSpendingCondition(auth.sponsorSpendingCondition));
178
178
  }
179
- return concatBytes(...parts);
179
+ return concatBytes2(...parts);
180
180
  }
181
181
  function serializePrincipal(principal) {
182
182
  switch (principal.type) {
183
183
  case "origin":
184
- return writeUInt8(PostConditionPrincipalId.Origin);
184
+ return writeUInt82(PostConditionPrincipalId2.Origin);
185
185
  case "standard":
186
- return concatBytes(writeUInt8(PostConditionPrincipalId.Standard), serializeAddress(principal.address));
186
+ return concatBytes2(writeUInt82(PostConditionPrincipalId2.Standard), serializeAddress(principal.address));
187
187
  case "contract":
188
- return concatBytes(writeUInt8(PostConditionPrincipalId.Contract), serializeAddress(principal.address), serializeLPString(principal.contractName));
188
+ return concatBytes2(writeUInt82(PostConditionPrincipalId2.Contract), serializeAddress(principal.address), serializeLPString(principal.contractName));
189
189
  }
190
190
  }
191
191
  function serializeAssetInfo(asset) {
192
- return concatBytes(serializeAddress(asset.address), serializeLPString(asset.contractName), serializeLPString(asset.assetName));
192
+ return concatBytes2(serializeAddress(asset.address), serializeLPString(asset.contractName), serializeLPString(asset.assetName));
193
193
  }
194
- function serializePostConditionWire(pc) {
194
+ function serializePostConditionWire2(pc) {
195
195
  const parts = [];
196
196
  switch (pc.type) {
197
197
  case "stx":
198
- parts.push(writeUInt8(AssetType.STX));
198
+ parts.push(writeUInt82(AssetType2.STX));
199
199
  parts.push(serializePrincipal(pc.principal));
200
- parts.push(writeUInt8(pc.conditionCode));
201
- parts.push(intToBytes(pc.amount, 8));
200
+ parts.push(writeUInt82(pc.conditionCode));
201
+ parts.push(intToBytes2(pc.amount, 8));
202
202
  break;
203
203
  case "ft":
204
- parts.push(writeUInt8(AssetType.Fungible));
204
+ parts.push(writeUInt82(AssetType2.Fungible));
205
205
  parts.push(serializePrincipal(pc.principal));
206
206
  parts.push(serializeAssetInfo(pc.asset));
207
- parts.push(writeUInt8(pc.conditionCode));
208
- parts.push(intToBytes(pc.amount, 8));
207
+ parts.push(writeUInt82(pc.conditionCode));
208
+ parts.push(intToBytes2(pc.amount, 8));
209
209
  break;
210
210
  case "nft":
211
- parts.push(writeUInt8(AssetType.NonFungible));
211
+ parts.push(writeUInt82(AssetType2.NonFungible));
212
212
  parts.push(serializePrincipal(pc.principal));
213
213
  parts.push(serializeAssetInfo(pc.asset));
214
- parts.push(serializeCVBytes(pc.assetId));
215
- parts.push(writeUInt8(pc.conditionCode));
214
+ parts.push(serializeCVBytes2(pc.assetId));
215
+ parts.push(writeUInt82(pc.conditionCode));
216
216
  break;
217
217
  case "staking":
218
- parts.push(writeUInt8(AssetType.Staking));
218
+ parts.push(writeUInt82(AssetType2.Staking));
219
219
  parts.push(serializePrincipal(pc.principal));
220
- parts.push(writeUInt8(pc.conditionCode));
221
- parts.push(intToBytes(pc.amount, 8));
220
+ parts.push(writeUInt82(pc.conditionCode));
221
+ parts.push(intToBytes2(pc.amount, 8));
222
222
  break;
223
223
  case "pox":
224
- parts.push(writeUInt8(AssetType.Pox));
224
+ parts.push(writeUInt82(AssetType2.Pox));
225
225
  parts.push(serializePrincipal(pc.principal));
226
- parts.push(writeUInt8(pc.conditionCode));
226
+ parts.push(writeUInt82(pc.conditionCode));
227
227
  break;
228
228
  }
229
- return concatBytes(...parts);
229
+ return concatBytes2(...parts);
230
230
  }
231
231
  function serializePostConditions(pcs) {
232
- const parts = [writeUInt32BE(pcs.length)];
232
+ const parts = [writeUInt32BE2(pcs.length)];
233
233
  for (const pc of pcs)
234
- parts.push(serializePostConditionWire(pc));
235
- return concatBytes(...parts);
234
+ parts.push(serializePostConditionWire2(pc));
235
+ return concatBytes2(...parts);
236
236
  }
237
237
  function serializePayload(payload) {
238
- const parts = [writeUInt8(payload.payloadType)];
238
+ const parts = [writeUInt82(payload.payloadType)];
239
239
  switch (payload.payloadType) {
240
- case PayloadType.TokenTransfer:
241
- parts.push(serializeCVBytes(payload.recipient));
242
- parts.push(intToBytes(payload.amount, 8));
240
+ case PayloadType2.TokenTransfer:
241
+ parts.push(serializeCVBytes2(payload.recipient));
242
+ parts.push(intToBytes2(payload.amount, 8));
243
243
  parts.push(serializeMemo(payload.memo));
244
244
  break;
245
- case PayloadType.ContractCall:
245
+ case PayloadType2.ContractCall:
246
246
  parts.push(serializeAddress(payload.contractAddress));
247
247
  parts.push(serializeLPString(payload.contractName));
248
248
  parts.push(serializeLPString(payload.functionName));
249
- parts.push(writeUInt32BE(payload.functionArgs.length));
249
+ parts.push(writeUInt32BE2(payload.functionArgs.length));
250
250
  for (const arg of payload.functionArgs) {
251
- parts.push(serializeCVBytes(arg));
251
+ parts.push(serializeCVBytes2(arg));
252
252
  }
253
253
  break;
254
- case PayloadType.SmartContract:
254
+ case PayloadType2.SmartContract:
255
255
  parts.push(serializeLPString(payload.contractName));
256
256
  parts.push(serializeLPStringLong(payload.codeBody));
257
257
  break;
258
- case PayloadType.VersionedSmartContract:
259
- parts.push(writeUInt8(payload.clarityVersion ?? 2));
258
+ case PayloadType2.VersionedSmartContract:
259
+ parts.push(writeUInt82(payload.clarityVersion ?? 2));
260
260
  parts.push(serializeLPString(payload.contractName));
261
261
  parts.push(serializeLPStringLong(payload.codeBody));
262
262
  break;
263
- case PayloadType.Coinbase:
264
- parts.push(hexToBytes(payload.coinbaseBuffer));
263
+ case PayloadType2.Coinbase:
264
+ parts.push(hexToBytes2(payload.coinbaseBuffer));
265
265
  break;
266
- case PayloadType.CoinbaseToAltRecipient: {
266
+ case PayloadType2.CoinbaseToAltRecipient: {
267
267
  const cbAlt = payload;
268
- parts.push(hexToBytes(cbAlt.coinbaseBuffer));
269
- parts.push(serializeCVBytes(cbAlt.recipient));
268
+ parts.push(hexToBytes2(cbAlt.coinbaseBuffer));
269
+ parts.push(serializeCVBytes2(cbAlt.recipient));
270
270
  break;
271
271
  }
272
- case PayloadType.PoisonMicroblock: {
272
+ case PayloadType2.PoisonMicroblock: {
273
273
  const pm = payload;
274
- parts.push(hexToBytes(pm.header1));
275
- parts.push(hexToBytes(pm.header2));
274
+ parts.push(hexToBytes2(pm.header1));
275
+ parts.push(hexToBytes2(pm.header2));
276
276
  break;
277
277
  }
278
- case PayloadType.TenureChange: {
278
+ case PayloadType2.TenureChange: {
279
279
  const tc = payload;
280
- parts.push(hexToBytes(tc.tenureConsensusHash));
281
- parts.push(hexToBytes(tc.prevTenureConsensusHash));
282
- parts.push(hexToBytes(tc.burnViewConsensusHash));
283
- parts.push(hexToBytes(tc.previousTenureEnd));
284
- parts.push(writeUInt32BE(tc.previousTenureBlocks));
285
- parts.push(writeUInt8(tc.cause));
286
- parts.push(hexToBytes(tc.pubkeyHash));
280
+ parts.push(hexToBytes2(tc.tenureConsensusHash));
281
+ parts.push(hexToBytes2(tc.prevTenureConsensusHash));
282
+ parts.push(hexToBytes2(tc.burnViewConsensusHash));
283
+ parts.push(hexToBytes2(tc.previousTenureEnd));
284
+ parts.push(writeUInt32BE2(tc.previousTenureBlocks));
285
+ parts.push(writeUInt82(tc.cause));
286
+ parts.push(hexToBytes2(tc.pubkeyHash));
287
287
  break;
288
288
  }
289
- case PayloadType.NakamotoCoinbase: {
289
+ case PayloadType2.NakamotoCoinbase: {
290
290
  const nc = payload;
291
- parts.push(hexToBytes(nc.coinbaseBuffer));
291
+ parts.push(hexToBytes2(nc.coinbaseBuffer));
292
292
  if (nc.recipient) {
293
- parts.push(serializeCVBytes({ type: "some", value: nc.recipient }));
293
+ parts.push(serializeCVBytes2({ type: "some", value: nc.recipient }));
294
294
  } else {
295
- parts.push(serializeCVBytes({ type: "none" }));
295
+ parts.push(serializeCVBytes2({ type: "none" }));
296
296
  }
297
- parts.push(hexToBytes(nc.vrfProof));
297
+ parts.push(hexToBytes2(nc.vrfProof));
298
298
  break;
299
299
  }
300
300
  }
301
- return concatBytes(...parts);
301
+ return concatBytes2(...parts);
302
302
  }
303
303
  var _txCache = new WeakMap;
304
304
  function clearTxCache(tx) {
305
305
  _txCache.delete(tx);
306
306
  }
307
- function serializeTransaction(tx) {
307
+ function serializeTransaction2(tx) {
308
308
  const cached = _txCache.get(tx);
309
309
  if (cached)
310
310
  return cached;
311
- const bytes = concatBytes(writeUInt8(tx.version), writeUInt32BE(tx.chainId), serializeAuthorization(tx.auth), writeUInt8(tx.anchorMode), writeUInt8(tx.postConditionMode), serializePostConditions(tx.postConditions), serializePayload(tx.payload));
311
+ const bytes = concatBytes2(writeUInt82(tx.version), writeUInt32BE2(tx.chainId), serializeAuthorization(tx.auth), writeUInt82(tx.anchorMode), writeUInt82(tx.postConditionMode), serializePostConditions(tx.postConditions), serializePayload(tx.payload));
312
312
  _txCache.set(tx, bytes);
313
313
  return bytes;
314
314
  }
315
- function serializeTransactionHex(tx) {
316
- return bytesToHex(serializeTransaction(tx));
315
+ function serializeTransactionHex2(tx) {
316
+ return bytesToHex2(serializeTransaction2(tx));
317
317
  }
318
318
 
319
319
  // src/transactions/wire/deserialize.ts
320
320
  function readSpendingCondition(r) {
321
321
  const hashMode = r.readUInt8();
322
- const signer = bytesToHex(r.readBytes(20));
322
+ const signer = bytesToHex2(r.readBytes(20));
323
323
  const nonce = r.readBigUInt64BE();
324
324
  const fee = r.readBigUInt64BE();
325
- if (hashMode === AddressHashMode.P2PKH || hashMode === AddressHashMode.P2WPKH) {
325
+ if (hashMode === AddressHashMode2.P2PKH || hashMode === AddressHashMode2.P2WPKH) {
326
326
  const keyEncoding = r.readUInt8();
327
- const signature = bytesToHex(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES));
327
+ const signature = bytesToHex2(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES2));
328
328
  return {
329
329
  hashMode,
330
330
  signer,
@@ -343,13 +343,13 @@ function readSpendingCondition(r) {
343
343
  fields.push({
344
344
  type: "publicKey",
345
345
  pubKeyEncoding: fieldType,
346
- data: bytesToHex(r.readBytes(keyLen))
346
+ data: bytesToHex2(r.readBytes(keyLen))
347
347
  });
348
348
  } else {
349
349
  fields.push({
350
350
  type: "signature",
351
351
  pubKeyEncoding: fieldType === 2 ? 0 : 1,
352
- data: bytesToHex(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES))
352
+ data: bytesToHex2(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES2))
353
353
  });
354
354
  }
355
355
  }
@@ -366,12 +366,12 @@ function readSpendingCondition(r) {
366
366
  function readAuthorization(r) {
367
367
  const authType = r.readUInt8();
368
368
  const spendingCondition = readSpendingCondition(r);
369
- if (authType === AuthType.Standard) {
370
- return { authType: AuthType.Standard, spendingCondition };
369
+ if (authType === AuthType2.Standard) {
370
+ return { authType: AuthType2.Standard, spendingCondition };
371
371
  }
372
372
  const sponsorSpendingCondition = readSpendingCondition(r);
373
373
  return {
374
- authType: AuthType.Sponsored,
374
+ authType: AuthType2.Sponsored,
375
375
  spendingCondition,
376
376
  sponsorSpendingCondition
377
377
  };
@@ -386,11 +386,11 @@ function readAssetInfo(r) {
386
386
  function readPostConditionPrincipal(r) {
387
387
  const type = r.readUInt8();
388
388
  switch (type) {
389
- case PostConditionPrincipalId.Origin:
389
+ case PostConditionPrincipalId2.Origin:
390
390
  return { type: "origin" };
391
- case PostConditionPrincipalId.Standard:
391
+ case PostConditionPrincipalId2.Standard:
392
392
  return { type: "standard", address: readAddress(r) };
393
- case PostConditionPrincipalId.Contract:
393
+ case PostConditionPrincipalId2.Contract:
394
394
  return {
395
395
  type: "contract",
396
396
  address: readAddress(r),
@@ -404,14 +404,14 @@ function readPostCondition(r) {
404
404
  const assetType = r.readUInt8();
405
405
  const principal = readPostConditionPrincipal(r);
406
406
  switch (assetType) {
407
- case AssetType.STX:
407
+ case AssetType2.STX:
408
408
  return {
409
409
  type: "stx",
410
410
  principal,
411
411
  conditionCode: r.readUInt8(),
412
412
  amount: r.readBigUInt64BE()
413
413
  };
414
- case AssetType.Fungible:
414
+ case AssetType2.Fungible:
415
415
  return {
416
416
  type: "ft",
417
417
  principal,
@@ -419,7 +419,7 @@ function readPostCondition(r) {
419
419
  conditionCode: r.readUInt8(),
420
420
  amount: r.readBigUInt64BE()
421
421
  };
422
- case AssetType.NonFungible:
422
+ case AssetType2.NonFungible:
423
423
  return {
424
424
  type: "nft",
425
425
  principal,
@@ -427,14 +427,14 @@ function readPostCondition(r) {
427
427
  assetId: readCV(r),
428
428
  conditionCode: r.readUInt8()
429
429
  };
430
- case AssetType.Staking:
430
+ case AssetType2.Staking:
431
431
  return {
432
432
  type: "staking",
433
433
  principal,
434
434
  conditionCode: r.readUInt8(),
435
435
  amount: r.readBigUInt64BE()
436
436
  };
437
- case AssetType.Pox:
437
+ case AssetType2.Pox:
438
438
  return {
439
439
  type: "pox",
440
440
  principal,
@@ -462,19 +462,19 @@ function readPostConditions(r) {
462
462
  function readPayload(r) {
463
463
  const payloadType = r.readUInt8();
464
464
  switch (payloadType) {
465
- case PayloadType.TokenTransfer: {
465
+ case PayloadType2.TokenTransfer: {
466
466
  const recipient = readCV(r);
467
467
  const amount = r.readBigUInt64BE();
468
- const memoBytes = r.readBytes(MEMO_MAX_LENGTH_BYTES);
469
- const memo = bytesToAscii(memoBytes).replace(/\0+$/, "");
468
+ const memoBytes = r.readBytes(MEMO_MAX_LENGTH_BYTES2);
469
+ const memo = bytesToAscii2(memoBytes).replace(/\0+$/, "");
470
470
  return {
471
- payloadType: PayloadType.TokenTransfer,
471
+ payloadType: PayloadType2.TokenTransfer,
472
472
  recipient,
473
473
  amount,
474
474
  memo
475
475
  };
476
476
  }
477
- case PayloadType.ContractCall: {
477
+ case PayloadType2.ContractCall: {
478
478
  const contractAddress = readAddress(r);
479
479
  const contractName = readLPString(r);
480
480
  const functionName = readLPString(r);
@@ -483,57 +483,57 @@ function readPayload(r) {
483
483
  for (let i = 0;i < numArgs; i++)
484
484
  functionArgs.push(readCV(r));
485
485
  return {
486
- payloadType: PayloadType.ContractCall,
486
+ payloadType: PayloadType2.ContractCall,
487
487
  contractAddress,
488
488
  contractName,
489
489
  functionName,
490
490
  functionArgs
491
491
  };
492
492
  }
493
- case PayloadType.SmartContract: {
493
+ case PayloadType2.SmartContract: {
494
494
  const contractName = readLPString(r);
495
495
  const codeBody = readLPString(r, 4);
496
- return { payloadType: PayloadType.SmartContract, contractName, codeBody };
496
+ return { payloadType: PayloadType2.SmartContract, contractName, codeBody };
497
497
  }
498
- case PayloadType.VersionedSmartContract: {
498
+ case PayloadType2.VersionedSmartContract: {
499
499
  const clarityVersion = r.readUInt8();
500
500
  const contractName = readLPString(r);
501
501
  const codeBody = readLPString(r, 4);
502
502
  return {
503
- payloadType: PayloadType.VersionedSmartContract,
503
+ payloadType: PayloadType2.VersionedSmartContract,
504
504
  clarityVersion,
505
505
  contractName,
506
506
  codeBody
507
507
  };
508
508
  }
509
- case PayloadType.Coinbase: {
510
- const coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));
511
- return { payloadType: PayloadType.Coinbase, coinbaseBuffer };
509
+ case PayloadType2.Coinbase: {
510
+ const coinbaseBuffer = bytesToHex2(r.readBytes(COINBASE_BYTES_LENGTH2));
511
+ return { payloadType: PayloadType2.Coinbase, coinbaseBuffer };
512
512
  }
513
- case PayloadType.CoinbaseToAltRecipient: {
514
- const coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));
513
+ case PayloadType2.CoinbaseToAltRecipient: {
514
+ const coinbaseBuffer = bytesToHex2(r.readBytes(COINBASE_BYTES_LENGTH2));
515
515
  const recipient = readCV(r);
516
516
  return {
517
- payloadType: PayloadType.CoinbaseToAltRecipient,
517
+ payloadType: PayloadType2.CoinbaseToAltRecipient,
518
518
  coinbaseBuffer,
519
519
  recipient
520
520
  };
521
521
  }
522
- case PayloadType.PoisonMicroblock: {
523
- const header1 = bytesToHex(r.readBytes(MICROBLOCK_HEADER_BYTES_LENGTH));
524
- const header2 = bytesToHex(r.readBytes(MICROBLOCK_HEADER_BYTES_LENGTH));
525
- return { payloadType: PayloadType.PoisonMicroblock, header1, header2 };
522
+ case PayloadType2.PoisonMicroblock: {
523
+ const header1 = bytesToHex2(r.readBytes(MICROBLOCK_HEADER_BYTES_LENGTH2));
524
+ const header2 = bytesToHex2(r.readBytes(MICROBLOCK_HEADER_BYTES_LENGTH2));
525
+ return { payloadType: PayloadType2.PoisonMicroblock, header1, header2 };
526
526
  }
527
- case PayloadType.TenureChange: {
528
- const tenureConsensusHash = bytesToHex(r.readBytes(20));
529
- const prevTenureConsensusHash = bytesToHex(r.readBytes(20));
530
- const burnViewConsensusHash = bytesToHex(r.readBytes(20));
531
- const previousTenureEnd = bytesToHex(r.readBytes(32));
527
+ case PayloadType2.TenureChange: {
528
+ const tenureConsensusHash = bytesToHex2(r.readBytes(20));
529
+ const prevTenureConsensusHash = bytesToHex2(r.readBytes(20));
530
+ const burnViewConsensusHash = bytesToHex2(r.readBytes(20));
531
+ const previousTenureEnd = bytesToHex2(r.readBytes(32));
532
532
  const previousTenureBlocks = r.readUInt32BE();
533
533
  const cause = r.readUInt8();
534
- const pubkeyHash = bytesToHex(r.readBytes(20));
534
+ const pubkeyHash = bytesToHex2(r.readBytes(20));
535
535
  return {
536
- payloadType: PayloadType.TenureChange,
536
+ payloadType: PayloadType2.TenureChange,
537
537
  tenureConsensusHash,
538
538
  prevTenureConsensusHash,
539
539
  burnViewConsensusHash,
@@ -543,13 +543,13 @@ function readPayload(r) {
543
543
  pubkeyHash
544
544
  };
545
545
  }
546
- case PayloadType.NakamotoCoinbase: {
547
- const coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));
546
+ case PayloadType2.NakamotoCoinbase: {
547
+ const coinbaseBuffer = bytesToHex2(r.readBytes(COINBASE_BYTES_LENGTH2));
548
548
  const optionalCV = readCV(r);
549
549
  const recipient = optionalCV.type === "none" ? null : optionalCV.type === "some" ? optionalCV.value : optionalCV;
550
- const vrfProof = bytesToHex(r.readBytes(VRF_PROOF_BYTES_LENGTH));
550
+ const vrfProof = bytesToHex2(r.readBytes(VRF_PROOF_BYTES_LENGTH2));
551
551
  return {
552
- payloadType: PayloadType.NakamotoCoinbase,
552
+ payloadType: PayloadType2.NakamotoCoinbase,
553
553
  coinbaseBuffer,
554
554
  recipient,
555
555
  vrfProof
@@ -559,12 +559,12 @@ function readPayload(r) {
559
559
  throw new Error(`Unknown payload type: ${payloadType}`);
560
560
  }
561
561
  }
562
- function deserializePostConditionWire(input) {
563
- const bytes = typeof input === "string" ? hexToBytes(without0x(input)) : input;
562
+ function deserializePostConditionWire2(input) {
563
+ const bytes = typeof input === "string" ? hexToBytes2(without0x2(input)) : input;
564
564
  return readPostCondition(new BytesReader(bytes));
565
565
  }
566
- function deserializeTransaction(input, meta) {
567
- const bytes = typeof input === "string" ? hexToBytes(without0x(input)) : input;
566
+ function deserializeTransaction2(input, meta) {
567
+ const bytes = typeof input === "string" ? hexToBytes2(without0x2(input)) : input;
568
568
  const r = new BytesReader(bytes);
569
569
  const tx = {
570
570
  version: r.readUInt8(),
@@ -583,46 +583,46 @@ function deserializeTransaction(input, meta) {
583
583
 
584
584
  // src/postconditions/convert.ts
585
585
  var MAX_U64 = 18446744073709551615n;
586
- function parsePostConditionAmount(amount) {
587
- const value = intToBigInt(amount);
586
+ function parsePostConditionAmount2(amount) {
587
+ const value = intToBigInt2(amount);
588
588
  if (value < 0n || value > MAX_U64) {
589
589
  throw new RangeError(`Post-condition amount must be between 0 and ${MAX_U64} (u64 max), received: ${value}`);
590
590
  }
591
591
  return value;
592
592
  }
593
593
  var FUNGIBLE_CODE_MAP = {
594
- eq: FungibleConditionCode.Equal,
595
- gt: FungibleConditionCode.Greater,
596
- gte: FungibleConditionCode.GreaterEqual,
597
- lt: FungibleConditionCode.Less,
598
- lte: FungibleConditionCode.LessEqual
594
+ eq: FungibleConditionCode2.Equal,
595
+ gt: FungibleConditionCode2.Greater,
596
+ gte: FungibleConditionCode2.GreaterEqual,
597
+ lt: FungibleConditionCode2.Less,
598
+ lte: FungibleConditionCode2.LessEqual
599
599
  };
600
600
  var FUNGIBLE_CODE_REVERSE = {
601
- [FungibleConditionCode.Equal]: "eq",
602
- [FungibleConditionCode.Greater]: "gt",
603
- [FungibleConditionCode.GreaterEqual]: "gte",
604
- [FungibleConditionCode.Less]: "lt",
605
- [FungibleConditionCode.LessEqual]: "lte"
601
+ [FungibleConditionCode2.Equal]: "eq",
602
+ [FungibleConditionCode2.Greater]: "gt",
603
+ [FungibleConditionCode2.GreaterEqual]: "gte",
604
+ [FungibleConditionCode2.Less]: "lt",
605
+ [FungibleConditionCode2.LessEqual]: "lte"
606
606
  };
607
607
  var NFT_CODE_MAP = {
608
- sent: NonFungibleConditionCode.Sends,
609
- "not-sent": NonFungibleConditionCode.DoesNotSend,
610
- "maybe-sent": NonFungibleConditionCode.MaybeSent
608
+ sent: NonFungibleConditionCode2.Sends,
609
+ "not-sent": NonFungibleConditionCode2.DoesNotSend,
610
+ "maybe-sent": NonFungibleConditionCode2.MaybeSent
611
611
  };
612
612
  var NFT_CODE_REVERSE = {
613
- [NonFungibleConditionCode.Sends]: "sent",
614
- [NonFungibleConditionCode.DoesNotSend]: "not-sent",
615
- [NonFungibleConditionCode.MaybeSent]: "maybe-sent"
613
+ [NonFungibleConditionCode2.Sends]: "sent",
614
+ [NonFungibleConditionCode2.DoesNotSend]: "not-sent",
615
+ [NonFungibleConditionCode2.MaybeSent]: "maybe-sent"
616
616
  };
617
617
  var POX_CODE_MAP = {
618
- "will-not-perform": PoxConditionCode.WillNotPerform,
619
- "may-perform": PoxConditionCode.MayPerform,
620
- "will-perform": PoxConditionCode.WillPerform
618
+ "will-not-perform": PoxConditionCode2.WillNotPerform,
619
+ "may-perform": PoxConditionCode2.MayPerform,
620
+ "will-perform": PoxConditionCode2.WillPerform
621
621
  };
622
622
  var POX_CODE_REVERSE = {
623
- [PoxConditionCode.WillNotPerform]: "will-not-perform",
624
- [PoxConditionCode.MayPerform]: "may-perform",
625
- [PoxConditionCode.WillPerform]: "will-perform"
623
+ [PoxConditionCode2.WillNotPerform]: "will-not-perform",
624
+ [PoxConditionCode2.MayPerform]: "may-perform",
625
+ [PoxConditionCode2.WillPerform]: "will-perform"
626
626
  };
627
627
  function resolvePrincipal(address) {
628
628
  if (address === "origin")
@@ -646,7 +646,7 @@ function assetToString(asset) {
646
646
  }
647
647
  function parseAsset(asset) {
648
648
  const [contractId, tokenName] = asset.split("::");
649
- const [addr, name] = parseContractId(contractId);
649
+ const [addr, name] = parseContractId2(contractId);
650
650
  return { address: addr, contractName: name, assetName: tokenName };
651
651
  }
652
652
  function convertPostCondition(pc) {
@@ -656,7 +656,7 @@ function convertPostCondition(pc) {
656
656
  type: "stx",
657
657
  principal: resolvePrincipal(pc.address),
658
658
  conditionCode: FUNGIBLE_CODE_MAP[pc.condition],
659
- amount: parsePostConditionAmount(pc.amount)
659
+ amount: parsePostConditionAmount2(pc.amount)
660
660
  };
661
661
  case "ft-postcondition":
662
662
  return {
@@ -664,7 +664,7 @@ function convertPostCondition(pc) {
664
664
  principal: resolvePrincipal(pc.address),
665
665
  asset: parseAsset(pc.asset),
666
666
  conditionCode: FUNGIBLE_CODE_MAP[pc.condition],
667
- amount: parsePostConditionAmount(pc.amount)
667
+ amount: parsePostConditionAmount2(pc.amount)
668
668
  };
669
669
  case "nft-postcondition":
670
670
  return {
@@ -679,7 +679,7 @@ function convertPostCondition(pc) {
679
679
  type: "staking",
680
680
  principal: resolvePrincipal(pc.address),
681
681
  conditionCode: FUNGIBLE_CODE_MAP[pc.condition],
682
- amount: parsePostConditionAmount(pc.amount)
682
+ amount: parsePostConditionAmount2(pc.amount)
683
683
  };
684
684
  case "pox-postcondition":
685
685
  return {
@@ -689,7 +689,7 @@ function convertPostCondition(pc) {
689
689
  };
690
690
  }
691
691
  }
692
- function wireToPostCondition(wire) {
692
+ function wireToPostCondition2(wire) {
693
693
  switch (wire.type) {
694
694
  case "stx":
695
695
  return {
@@ -747,14 +747,14 @@ function poxName(code) {
747
747
  throw new Error(`Unknown pox post-condition code: ${code}`);
748
748
  return name;
749
749
  }
750
- function fromHex(hex) {
751
- return wireToPostCondition(deserializePostConditionWire(hex));
750
+ function fromHex2(hex) {
751
+ return wireToPostCondition2(deserializePostConditionWire2(hex));
752
752
  }
753
- function postConditionToHex(pc) {
754
- return bytesToHex(serializePostConditionWire(convertPostCondition(pc)));
753
+ function postConditionToHex2(pc) {
754
+ return bytesToHex2(serializePostConditionWire2(convertPostCondition(pc)));
755
755
  }
756
756
 
757
- export { AuthType, PayloadType, ClarityVersion, AnchorMode, PostConditionModeWire, AddressHashMode, PubKeyEncoding, FungibleConditionCode, NonFungibleConditionCode, PoxConditionCode, PostConditionPrincipalId, AssetType, AuthFieldType, RECOVERABLE_ECDSA_SIG_LENGTH_BYTES, MEMO_MAX_LENGTH_BYTES, MAX_STRING_LENGTH_BYTES, COINBASE_BYTES_LENGTH, VRF_PROOF_BYTES_LENGTH, MICROBLOCK_HEADER_BYTES_LENGTH, TenureChangeCause, serializePostConditionWire, serializePayload, clearTxCache, serializeTransaction, serializeTransactionHex, deserializePostConditionWire, deserializeTransaction, parsePostConditionAmount, convertPostCondition, wireToPostCondition, fromHex, postConditionToHex };
757
+ export { AuthType2, PayloadType2, ClarityVersion2, AnchorMode2, PostConditionModeWire2, AddressHashMode2, PubKeyEncoding2, FungibleConditionCode2, NonFungibleConditionCode2, PoxConditionCode2, PostConditionPrincipalId2, AssetType2, AuthFieldType2, RECOVERABLE_ECDSA_SIG_LENGTH_BYTES2, MEMO_MAX_LENGTH_BYTES2, MAX_STRING_LENGTH_BYTES2, COINBASE_BYTES_LENGTH2, VRF_PROOF_BYTES_LENGTH2, MICROBLOCK_HEADER_BYTES_LENGTH2, TenureChangeCause2, serializePostConditionWire2, serializePayload, clearTxCache, serializeTransaction2, serializeTransactionHex2, deserializePostConditionWire2, deserializeTransaction2, parsePostConditionAmount2, convertPostCondition, wireToPostCondition2, fromHex2, postConditionToHex2 };
758
758
 
759
- //# debugId=0727B877F1BE3A9864756E2164756E21
760
- //# sourceMappingURL=stacks-51ybf135.js.map
759
+ //# debugId=4AE8108BDE2F69E064756E2164756E21
760
+ //# sourceMappingURL=stacks-esm-phgy8yqf.js.map