@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
@@ -19,13 +19,15 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  return cached;
20
20
  }
21
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
22
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
23
- for (let key of __getOwnPropNames(mod))
24
- if (!__hasOwnProp.call(to, key))
25
- __defProp(to, key, {
26
- get: __accessProp.bind(mod, key),
27
- enumerable: true
28
- });
22
+ const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
23
+ if (mod && typeof mod === "object" || typeof mod === "function") {
24
+ for (let key of __getOwnPropNames(mod))
25
+ if (!__hasOwnProp.call(to, key))
26
+ __defProp(to, key, {
27
+ get: __accessProp.bind(mod, key),
28
+ enumerable: true
29
+ });
30
+ }
29
31
  if (canCache)
30
32
  cache.set(mod, to);
31
33
  return to;
@@ -64,22 +66,22 @@ var __export = (target, all) => {
64
66
  // src/sbtc/index.ts
65
67
  var exports_sbtc = {};
66
68
  __export(exports_sbtc, {
67
- validateBitcoinTxid: () => validateBitcoinTxid,
68
- sbtcToSats: () => sbtcToSats,
69
- sbtcContractId: () => sbtcContractId,
70
- sbtc: () => sbtc,
71
- satsToSbtc: () => satsToSbtc,
72
- formatBtcAddress: () => formatBtcAddress,
73
- bitcoinTxidToHex: () => bitcoinTxidToHex,
74
- bitcoinTxidFromHex: () => bitcoinTxidFromHex,
75
- SBTC_UNIT_NAME: () => SBTC_UNIT_NAME,
76
- SBTC_TOKEN_ABI: () => SBTC_TOKEN_ABI,
77
- SBTC_EVENT_TOPICS: () => SBTC_EVENT_TOPICS,
78
- SBTC_DECIMALS: () => SBTC_DECIMALS,
79
- SBTC_CONTRACTS: () => SBTC_CONTRACTS,
80
- SBTC_BTC_ADDRESS_VERSION: () => SBTC_BTC_ADDRESS_VERSION,
69
+ SBTC_ASSET_IDENTIFIER_MAINNET: () => SBTC_ASSET_IDENTIFIER_MAINNET,
81
70
  SBTC_ASSET_IDENTIFIER_TESTNET: () => SBTC_ASSET_IDENTIFIER_TESTNET,
82
- SBTC_ASSET_IDENTIFIER_MAINNET: () => SBTC_ASSET_IDENTIFIER_MAINNET
71
+ SBTC_BTC_ADDRESS_VERSION: () => SBTC_BTC_ADDRESS_VERSION,
72
+ SBTC_CONTRACTS: () => SBTC_CONTRACTS,
73
+ SBTC_DECIMALS: () => SBTC_DECIMALS,
74
+ SBTC_EVENT_TOPICS: () => SBTC_EVENT_TOPICS,
75
+ SBTC_TOKEN_ABI: () => SBTC_TOKEN_ABI,
76
+ SBTC_UNIT_NAME: () => SBTC_UNIT_NAME,
77
+ bitcoinTxidFromHex: () => bitcoinTxidFromHex,
78
+ bitcoinTxidToHex: () => bitcoinTxidToHex,
79
+ formatBtcAddress: () => formatBtcAddress,
80
+ satsToSbtc: () => satsToSbtc,
81
+ sbtc: () => sbtc,
82
+ sbtcContractId: () => sbtcContractId,
83
+ sbtcToSats: () => sbtcToSats,
84
+ validateBitcoinTxid: () => validateBitcoinTxid
83
85
  });
84
86
  module.exports = __toCommonJS(exports_sbtc);
85
87
 
@@ -665,8 +667,8 @@ function clarityTypeFromByte(byte) {
665
667
  // src/clarity/deserialize.ts
666
668
  function readAddress(reader) {
667
669
  const version = reader.readUInt8();
668
- const hash1602 = bytesToHex(reader.readBytes(20));
669
- return c32address(version, hash1602);
670
+ const hash160 = bytesToHex(reader.readBytes(20));
671
+ return c32address(version, hash160);
670
672
  }
671
673
  function readLPString(reader, prefixBytes = 1) {
672
674
  let length = 0;
@@ -766,8 +768,8 @@ function withTypeId(type, bytes) {
766
768
  return concatBytes(new Uint8Array([typeIdByte(type)]), bytes);
767
769
  }
768
770
  function serializeAddress(c32Address) {
769
- const [version, hash1602] = c32addressDecode(c32Address);
770
- return concatBytes(new Uint8Array([version]), hexToBytes(hash1602));
771
+ const [version, hash160] = c32addressDecode(c32Address);
772
+ return concatBytes(new Uint8Array([version]), hexToBytes(hash160));
771
773
  }
772
774
  function serializeLPString(str, prefixBytes = 1) {
773
775
  const content = utf8ToBytes(str);
@@ -874,13 +876,13 @@ function bufferCV(buffer) {
874
876
  return { type: "buffer", value: bytesToHex(buffer) };
875
877
  }
876
878
  function standardPrincipalCV(address) {
877
- const [version, hash1602] = c32addressDecode(address);
878
- const normalized = c32address(version, hash1602);
879
+ const [version, hash160] = c32addressDecode(address);
880
+ const normalized = c32address(version, hash160);
879
881
  return { type: "address", value: normalized };
880
882
  }
881
883
  function contractPrincipalCV(address, contractName) {
882
- const [version, hash1602] = c32addressDecode(address);
883
- const normalized = c32address(version, hash1602);
884
+ const [version, hash160] = c32addressDecode(address);
885
+ const normalized = c32address(version, hash160);
884
886
  if (utf8ToBytes(contractName).byteLength >= 128) {
885
887
  throw new Error("Contract name must be less than 128 bytes");
886
888
  }
@@ -1491,8 +1493,8 @@ function deserializeTransaction(input, meta) {
1491
1493
 
1492
1494
  // src/transactions/wire/serialize.ts
1493
1495
  function serializeAddress2(c32Address) {
1494
- const [version, hash1602] = c32addressDecode(c32Address);
1495
- return concatBytes(new Uint8Array([version]), hexToBytes(hash1602));
1496
+ const [version, hash160] = c32addressDecode(c32Address);
1497
+ return concatBytes(new Uint8Array([version]), hexToBytes(hash160));
1496
1498
  }
1497
1499
  function serializeLPString2(str, prefixBytes = 1) {
1498
1500
  const content = utf8ToBytes(str);
@@ -1531,8 +1533,8 @@ function serializeSpendingCondition(condition) {
1531
1533
  }
1532
1534
  function serializeAuthField(field) {
1533
1535
  if (field.type === "publicKey") {
1534
- const typeId2 = field.pubKeyEncoding === 0 ? 0 : 1;
1535
- return concatBytes(writeUInt8(typeId2), hexToBytes(field.data));
1536
+ const typeId = field.pubKeyEncoding === 0 ? 0 : 1;
1537
+ return concatBytes(writeUInt8(typeId), hexToBytes(field.data));
1536
1538
  }
1537
1539
  const typeId = field.pubKeyEncoding === 0 ? 2 : 3;
1538
1540
  return concatBytes(writeUInt8(typeId), hexToBytes(field.data));
@@ -2002,11 +2004,11 @@ function replayMultiSigSigHash(tx) {
2002
2004
  const condition = tx.auth.spendingCondition;
2003
2005
  if (isNonSequential(condition.hashMode)) {
2004
2006
  const preSign = nonSequentialPreSignHash(tx);
2005
- let curSigHash2 = preSign;
2007
+ let curSigHash = preSign;
2006
2008
  for (const field of condition.fields) {
2007
- curSigHash2 = sigHashPostSign(curSigHash2, field.pubKeyEncoding, field.data);
2009
+ curSigHash = sigHashPostSign(curSigHash, field.pubKeyEncoding, field.data);
2008
2010
  }
2009
- return curSigHash2;
2011
+ return curSigHash;
2010
2012
  }
2011
2013
  let curSigHash = initialSigHash(tx);
2012
2014
  for (const field of condition.fields) {
@@ -2127,8 +2129,8 @@ async function signSequentialWithAccount(tx, condition, account, publicKeys, sig
2127
2129
  const fields = [...condition.fields];
2128
2130
  let curSigHash = initialSigHash(tx);
2129
2131
  for (const field of fields) {
2130
- const preSign2 = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
2131
- curSigHash = sigHashPostSign(preSign2, field.pubKeyEncoding, field.data);
2132
+ const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
2133
+ curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);
2132
2134
  }
2133
2135
  for (let i = fields.length;i < signerIndex; i++) {
2134
2136
  const pubKeyField = {
@@ -2137,8 +2139,8 @@ async function signSequentialWithAccount(tx, condition, account, publicKeys, sig
2137
2139
  data: publicKeys[i]
2138
2140
  };
2139
2141
  fields.push(pubKeyField);
2140
- const preSign2 = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
2141
- curSigHash = sigHashPostSign(preSign2, pubKeyField.pubKeyEncoding, pubKeyField.data);
2142
+ const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
2143
+ curSigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);
2142
2144
  }
2143
2145
  const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
2144
2146
  const sigBytes = await account.sign(hexToBytes(preSign));
@@ -2432,9 +2434,9 @@ function getOriginSigHash(tx) {
2432
2434
  if ("fields" in condition) {
2433
2435
  return replayMultiSigSigHash(tx);
2434
2436
  }
2435
- const initialSigHash2 = signBegin(tx);
2437
+ const initialSigHash = signBegin(tx);
2436
2438
  const sc = condition;
2437
- const preSign = sigHashPreSign(initialSigHash2, AuthType.Standard, sc.fee, sc.nonce);
2439
+ const preSign = sigHashPreSign(initialSigHash, AuthType.Standard, sc.fee, sc.nonce);
2438
2440
  return sigHashPostSign(preSign, sc.keyEncoding, sc.signature);
2439
2441
  }
2440
2442
  function signSponsor(tx, privateKey) {
@@ -2738,8 +2740,8 @@ function indexNotFound(error, sourceName) {
2738
2740
  }
2739
2741
  return true;
2740
2742
  }
2741
- function normalizeTxid(txid2) {
2742
- return txid2.startsWith("0x") ? txid2 : `0x${txid2}`;
2743
+ function normalizeTxid(txid) {
2744
+ return txid.startsWith("0x") ? txid : `0x${txid}`;
2743
2745
  }
2744
2746
  function decodeResultHex(hex) {
2745
2747
  if (!hex)
@@ -2763,10 +2765,10 @@ function normalizeStatus(txStatus) {
2763
2765
  }
2764
2766
  function extendedApiSource() {
2765
2767
  return {
2766
- async get({ client, txid: txid2 }) {
2768
+ async get({ client, txid }) {
2767
2769
  let data;
2768
2770
  try {
2769
- data = await client.request(`/extended/v1/tx/${encodeURIComponent(normalizeTxid(txid2))}`, { method: "GET" });
2771
+ data = await client.request(`/extended/v1/tx/${encodeURIComponent(normalizeTxid(txid))}`, { method: "GET" });
2770
2772
  } catch (error) {
2771
2773
  if (error instanceof HttpRequestError && error.status === 404) {
2772
2774
  return { receipt: null };
@@ -2781,7 +2783,7 @@ function extendedApiSource() {
2781
2783
  return { receipt: null };
2782
2784
  return {
2783
2785
  receipt: {
2784
- txid: normalizeTxid(txid2),
2786
+ txid: normalizeTxid(txid),
2785
2787
  status,
2786
2788
  blockHeight: typeof data.block_height === "number" && data.block_height > 0 ? data.block_height : undefined,
2787
2789
  blockHash: data.block_hash ?? undefined,
@@ -2797,11 +2799,11 @@ function indexTxSource(params = {}) {
2797
2799
  const headers = params.apiKey ? { authorization: `Bearer ${params.apiKey}` } : undefined;
2798
2800
  return {
2799
2801
  canonicalOnly: true,
2800
- async get({ client, txid: txid2 }) {
2802
+ async get({ client, txid }) {
2801
2803
  const request = indexRequestFn(client, params.baseUrl, "indexTxSource");
2802
2804
  let data;
2803
2805
  try {
2804
- data = await request(`/v1/index/transactions/${normalizeTxid(txid2)}`, {
2806
+ data = await request(`/v1/index/transactions/${normalizeTxid(txid)}`, {
2805
2807
  method: "GET",
2806
2808
  headers
2807
2809
  });
@@ -2850,7 +2852,7 @@ async function getBlockHeight(client) {
2850
2852
  var sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
2851
2853
  async function waitForTransactionReceipt(client, params) {
2852
2854
  const {
2853
- txid: txid2,
2855
+ txid,
2854
2856
  confirmations = 1,
2855
2857
  timeout = 180000,
2856
2858
  pollingInterval = 3000
@@ -2861,21 +2863,21 @@ async function waitForTransactionReceipt(client, params) {
2861
2863
  let unknownSince = null;
2862
2864
  let everPending = false;
2863
2865
  while (true) {
2864
- const snapshot = await source.get({ client, txid: txid2 });
2866
+ const snapshot = await source.get({ client, txid });
2865
2867
  const receipt = snapshot.receipt;
2866
2868
  if (receipt === null) {
2867
2869
  unknownSince ??= Date.now();
2868
2870
  if (Date.now() - unknownSince >= droppedGracePeriod) {
2869
- throw new TransactionDroppedError(everPending ? `Transaction ${txid2} left the mempool without being mined` : `Transaction ${txid2} was never observed by the status source`, { txid: txid2 });
2871
+ throw new TransactionDroppedError(everPending ? `Transaction ${txid} left the mempool without being mined` : `Transaction ${txid} was never observed by the status source`, { txid });
2870
2872
  }
2871
2873
  } else {
2872
2874
  unknownSince = null;
2873
2875
  switch (receipt.status) {
2874
2876
  case "dropped":
2875
- throw new TransactionDroppedError(`Transaction ${txid2} was dropped from the mempool`, { txid: txid2 });
2877
+ throw new TransactionDroppedError(`Transaction ${txid} was dropped from the mempool`, { txid });
2876
2878
  case "abort_by_response":
2877
2879
  case "abort_by_post_condition":
2878
- throw new TransactionAbortedError(`Transaction ${txid2} aborted (${receipt.status})`, { receipt });
2880
+ throw new TransactionAbortedError(`Transaction ${txid} aborted (${receipt.status})`, { receipt });
2879
2881
  case "pending":
2880
2882
  everPending = true;
2881
2883
  break;
@@ -2892,7 +2894,7 @@ async function waitForTransactionReceipt(client, params) {
2892
2894
  }
2893
2895
  }
2894
2896
  if (Date.now() - startedAt >= timeout) {
2895
- throw new WaitForTransactionTimeoutError(`Timed out after ${timeout}ms waiting for transaction ${txid2}`, { txid: txid2 });
2897
+ throw new WaitForTransactionTimeoutError(`Timed out after ${timeout}ms waiting for transaction ${txid}`, { txid });
2896
2898
  }
2897
2899
  await sleep2(pollingInterval);
2898
2900
  }
@@ -2920,11 +2922,11 @@ async function sendTransaction(client, params) {
2920
2922
  throw error;
2921
2923
  }
2922
2924
  } else if (error instanceof TimeoutError) {
2923
- const txid3 = getTransactionId(params.transaction);
2924
- const receipt = await getTransaction(client, { txid: txid3 }).catch(() => null);
2925
+ const txid = getTransactionId(params.transaction);
2926
+ const receipt = await getTransaction(client, { txid }).catch(() => null);
2925
2927
  if (receipt === null)
2926
2928
  throw error;
2927
- data = { txid: txid3 };
2929
+ data = { txid };
2928
2930
  } else {
2929
2931
  throw error;
2930
2932
  }
@@ -2936,16 +2938,16 @@ async function sendTransaction(client, params) {
2936
2938
  txid: data.txid ?? getTransactionId(params.transaction)
2937
2939
  });
2938
2940
  }
2939
- const txid2 = typeof data === "string" ? data.replace(/"/g, "") : data.txid ?? getTransactionId(params.transaction);
2941
+ const txid = typeof data === "string" ? data.replace(/"/g, "") : data.txid ?? getTransactionId(params.transaction);
2940
2942
  if (params.wait) {
2941
2943
  const confirmations = params.wait === true ? 1 : params.wait;
2942
2944
  const receipt = await waitForTransactionReceipt(client, {
2943
- txid: txid2,
2945
+ txid,
2944
2946
  confirmations
2945
2947
  });
2946
- return { txid: txid2, receipt };
2948
+ return { txid, receipt };
2947
2949
  }
2948
- return { txid: txid2 };
2950
+ return { txid };
2949
2951
  }
2950
2952
 
2951
2953
  // src/actions/wallet/nonceManager.ts
@@ -3507,8 +3509,8 @@ function stripWitness(rawTx) {
3507
3509
  return scanTx(rawTx).legacy;
3508
3510
  }
3509
3511
  function bitcoinTxid(rawTx, { display = false } = {}) {
3510
- const txid2 = doubleSha256(scanTx(rawTx).legacy);
3511
- return display ? reverseBytes(txid2) : txid2;
3512
+ const txid = doubleSha256(scanTx(rawTx).legacy);
3513
+ return display ? reverseBytes(txid) : txid;
3512
3514
  }
3513
3515
  function parseBlockHeader(header) {
3514
3516
  if (header.length !== 80) {
@@ -3905,14 +3907,14 @@ function bitcoinTxidFromHex(hex) {
3905
3907
  return buf;
3906
3908
  }
3907
3909
  function satsToSbtc(sats) {
3908
- const sign2 = sats < 0n ? "-" : "";
3910
+ const sign = sats < 0n ? "-" : "";
3909
3911
  const abs = sats < 0n ? -sats : sats;
3910
3912
  const whole = abs / 100000000n;
3911
3913
  const frac = abs % 100000000n;
3912
3914
  if (frac === 0n)
3913
- return `${sign2}${whole}`;
3915
+ return `${sign}${whole}`;
3914
3916
  const fracStr = frac.toString().padStart(8, "0").replace(/0+$/, "");
3915
- return `${sign2}${whole}.${fracStr}`;
3917
+ return `${sign}${whole}.${fracStr}`;
3916
3918
  }
3917
3919
  function sbtcToSats(amount) {
3918
3920
  const trimmed = amount.trim();
@@ -3948,5 +3950,5 @@ function sbtc() {
3948
3950
  });
3949
3951
  }
3950
3952
 
3951
- //# debugId=3F13DBE5A9B1BAE464756E2164756E21
3953
+ //# debugId=8C7FC92EE1E7816764756E2164756E21
3952
3954
  //# sourceMappingURL=index.cjs.map