@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,43 +1,43 @@
1
1
  import {
2
- MalformedResponseError
3
- } from "./stacks-esm-743jfh10.js";
2
+ bytesToHex2,
3
+ with0x2,
4
+ intToBigInt2
5
+ } from "./stacks-esm-7a0ehykf.js";
4
6
  import {
5
- buildContractCall,
6
- getTransactionId,
7
- signTransactionWithAccount
8
- } from "./stacks-esm-r9q4wnyw.js";
7
+ serializeCVBytes2,
8
+ BroadcastError2,
9
+ TransactionAbortedError2,
10
+ TransactionDroppedError2,
11
+ WaitForTransactionTimeoutError2,
12
+ deserializeCVBytes2
13
+ } from "./stacks-esm-hkw1kvd4.js";
9
14
  import {
10
- clearTxCache,
11
15
  serializePayload,
12
- serializeTransaction
13
- } from "./stacks-esm-skmcf5n2.js";
16
+ clearTxCache,
17
+ serializeTransaction2
18
+ } from "./stacks-esm-phgy8yqf.js";
14
19
  import {
15
- BroadcastError,
16
- TransactionAbortedError,
17
- TransactionDroppedError,
18
- WaitForTransactionTimeoutError,
19
- deserializeCVBytes,
20
- serializeCVBytes
21
- } from "./stacks-esm-fcfdn2zx.js";
20
+ parseContractId2
21
+ } from "./stacks-esm-kbz5s6v8.js";
22
22
  import {
23
- BaseError
24
- } from "./stacks-esm-1jae0a3r.js";
23
+ buildContractCall2,
24
+ signTransactionWithAccount2,
25
+ getTransactionId2
26
+ } from "./stacks-esm-cmtj5vky.js";
25
27
  import {
26
- parseContractId
27
- } from "./stacks-esm-2mc7ebrm.js";
28
+ MalformedResponseError2
29
+ } from "./stacks-esm-0pc6tmf0.js";
28
30
  import {
29
- bytesToHex,
30
- intToBigInt,
31
- with0x
32
- } from "./stacks-esm-cvhazvhd.js";
31
+ BaseError2
32
+ } from "./stacks-esm-7v18h5dk.js";
33
33
 
34
34
  // src/actions/public/estimateFee.ts
35
35
  function isValidEstimation(e) {
36
36
  return typeof e === "object" && e !== null && "fee_rate" in e && "fee" in e && (typeof e.fee_rate === "number" || typeof e.fee_rate === "string") && (typeof e.fee === "number" || typeof e.fee === "string");
37
37
  }
38
- async function estimateFee(client, params) {
39
- const payloadHex = bytesToHex(serializePayload(params.transaction.payload));
40
- const txHex = bytesToHex(serializeTransaction(params.transaction));
38
+ async function estimateFee2(client, params) {
39
+ const payloadHex = bytesToHex2(serializePayload(params.transaction.payload));
40
+ const txHex = bytesToHex2(serializeTransaction2(params.transaction));
41
41
  const data = await client.request("/v2/fees/transaction", {
42
42
  method: "POST",
43
43
  body: {
@@ -48,7 +48,7 @@ async function estimateFee(client, params) {
48
48
  const raw = data?.estimations ?? [];
49
49
  return raw.map((e) => {
50
50
  if (!isValidEstimation(e)) {
51
- throw new MalformedResponseError("estimateFee: node response contains invalid fee estimation entry");
51
+ throw new MalformedResponseError2("estimateFee: node response contains invalid fee estimation entry");
52
52
  }
53
53
  return {
54
54
  feeRate: Number(e.fee_rate),
@@ -58,16 +58,16 @@ async function estimateFee(client, params) {
58
58
  }
59
59
 
60
60
  // src/actions/public/getBlockHeight.ts
61
- async function getBlockHeight(client) {
61
+ async function getBlockHeight2(client) {
62
62
  const data = await client.request("/v2/info", { method: "GET" });
63
63
  if (typeof data?.stacks_tip_height !== "number") {
64
- throw new MalformedResponseError('getBlockHeight: /v2/info response is missing "stacks_tip_height"');
64
+ throw new MalformedResponseError2('getBlockHeight: /v2/info response is missing "stacks_tip_height"');
65
65
  }
66
66
  return data.stacks_tip_height;
67
67
  }
68
68
 
69
69
  // src/errors/http.ts
70
- class HttpRequestError extends BaseError {
70
+ class HttpRequestError2 extends BaseError2 {
71
71
  name = "HttpRequestError";
72
72
  status;
73
73
  url;
@@ -82,31 +82,31 @@ class HttpRequestError extends BaseError {
82
82
  }
83
83
 
84
84
  // src/actions/public/getMapEntry.ts
85
- async function getMapEntry(client, params) {
86
- const [address, name] = parseContractId(params.contract);
87
- const serializedKey = with0x(bytesToHex(serializeCVBytes(params.key)));
85
+ async function getMapEntry2(client, params) {
86
+ const [address, name] = parseContractId2(params.contract);
87
+ const serializedKey = with0x2(bytesToHex2(serializeCVBytes2(params.key)));
88
88
  const data = await client.request(`/v2/map_entry/${address}/${name}/${params.mapName}`, {
89
89
  method: "POST",
90
90
  body: serializedKey
91
91
  });
92
92
  if (typeof data?.data !== "string") {
93
- throw new MalformedResponseError(`getMapEntry: /v2/map_entry/${address}/${name}/${params.mapName} response is missing "data"`);
93
+ throw new MalformedResponseError2(`getMapEntry: /v2/map_entry/${address}/${name}/${params.mapName} response is missing "data"`);
94
94
  }
95
- return deserializeCVBytes(data.data);
95
+ return deserializeCVBytes2(data.data);
96
96
  }
97
97
 
98
98
  // src/actions/public/getNonce.ts
99
- async function getNonce(client, params) {
99
+ async function getNonce2(client, params) {
100
100
  const data = await client.request(`/v2/accounts/${encodeURIComponent(params.address)}`, { method: "GET" });
101
101
  const nonce = data?.nonce;
102
102
  if (typeof nonce !== "number" && typeof nonce !== "string") {
103
- throw new MalformedResponseError(`getNonce: /v2/accounts/${params.address} response is missing "nonce"`);
103
+ throw new MalformedResponseError2(`getNonce: /v2/accounts/${params.address} response is missing "nonce"`);
104
104
  }
105
105
  return BigInt(nonce);
106
106
  }
107
107
 
108
108
  // src/errors/transport.ts
109
- class TimeoutError extends BaseError {
109
+ class TimeoutError2 extends BaseError2 {
110
110
  name = "TimeoutError";
111
111
  method;
112
112
  url;
@@ -187,7 +187,7 @@ async function fetchWithRetry(url, options, retryCount, retryDelay, timeout, ext
187
187
  let timedOut = false;
188
188
  const timeoutId = setTimeout(() => {
189
189
  timedOut = true;
190
- controller.abort(new TimeoutError({ method, url, timeout, attempt }));
190
+ controller.abort(new TimeoutError2({ method, url, timeout, attempt }));
191
191
  }, timeout);
192
192
  const onCallerAbort = () => controller.abort(abortReason(signal));
193
193
  signal?.addEventListener("abort", onCallerAbort, { once: true });
@@ -206,7 +206,7 @@ async function fetchWithRetry(url, options, retryCount, retryDelay, timeout, ext
206
206
  } catch (error) {
207
207
  if (signal?.aborted)
208
208
  throw abortReason(signal);
209
- lastError = timedOut ? new TimeoutError({ method, url, timeout, attempt }) : error instanceof Error ? error : new Error(String(error));
209
+ lastError = timedOut ? new TimeoutError2({ method, url, timeout, attempt }) : error instanceof Error ? error : new Error(String(error));
210
210
  if (attempt < retryCount) {
211
211
  clearTimeout(timeoutId);
212
212
  await sleep(retryDelay * (attempt + 1), signal);
@@ -223,7 +223,7 @@ async function fetchWithRetry(url, options, retryCount, retryDelay, timeout, ext
223
223
  throw abortReason(signal);
224
224
  if (!timedOut)
225
225
  throw error;
226
- lastError = new TimeoutError({ method, url, timeout, attempt });
226
+ lastError = new TimeoutError2({ method, url, timeout, attempt });
227
227
  if (attempt < retryCount) {
228
228
  clearTimeout(timeoutId);
229
229
  await sleep(retryDelay * (attempt + 1), signal);
@@ -242,13 +242,13 @@ async function fetchWithRetry(url, options, retryCount, retryDelay, timeout, ext
242
242
  return;
243
243
  })
244
244
  ]);
245
- throw new HttpRequestError(response.status, {
245
+ throw new HttpRequestError2(response.status, {
246
246
  details: capDetails(body),
247
247
  url,
248
248
  method
249
249
  });
250
250
  }
251
- lastError = new HttpRequestError(response.status, { url, method });
251
+ lastError = new HttpRequestError2(response.status, { url, method });
252
252
  const delay = retryAfterMs(response) ?? retryDelay * (attempt + 1);
253
253
  response.body?.cancel().catch(() => {});
254
254
  clearTimeout(timeoutId);
@@ -298,7 +298,7 @@ function buildRequestFn(baseUrl, config) {
298
298
  }
299
299
 
300
300
  // src/actions/public/txSources.ts
301
- class IndexSourceConfigError extends Error {
301
+ class IndexSourceConfigError2 extends Error {
302
302
  name = "IndexSourceConfigError";
303
303
  }
304
304
  function isHiroHost(url, client) {
@@ -323,10 +323,10 @@ function indexRequestFn(client, baseUrl, sourceName) {
323
323
  const transportUrl = client.transport.config.url?.replace(/\/$/, "");
324
324
  if (baseUrl === undefined) {
325
325
  if (!transportUrl) {
326
- throw new IndexSourceConfigError(`${sourceName} needs the URL of your Secondlayer instance: pass baseUrl, or use an http() transport pointed at the instance`);
326
+ throw new IndexSourceConfigError2(`${sourceName} needs the URL of your Secondlayer instance: pass baseUrl, or use an http() transport pointed at the instance`);
327
327
  }
328
328
  if (isHiroHost(transportUrl, client)) {
329
- throw new IndexSourceConfigError(`${sourceName} reads /v1/index on a Secondlayer instance, and ${transportUrl} is a Hiro host: pass baseUrl with the URL of your instance`);
329
+ throw new IndexSourceConfigError2(`${sourceName} reads /v1/index on a Secondlayer instance, and ${transportUrl} is a Hiro host: pass baseUrl with the URL of your instance`);
330
330
  }
331
331
  return client.request;
332
332
  }
@@ -337,7 +337,7 @@ function indexRequestFn(client, baseUrl, sourceName) {
337
337
  return buildRequestFn(target, { timeout, retryCount, retryDelay });
338
338
  }
339
339
  function indexNotFound(error, sourceName) {
340
- if (!(error instanceof HttpRequestError) || error.status !== 404) {
340
+ if (!(error instanceof HttpRequestError2) || error.status !== 404) {
341
341
  return false;
342
342
  }
343
343
  const body = error.details;
@@ -345,7 +345,7 @@ function indexNotFound(error, sourceName) {
345
345
  try {
346
346
  JSON.parse(body);
347
347
  } catch {
348
- throw new IndexSourceConfigError(`${sourceName} got a non-JSON 404 from ${error.url ?? "the transport host"}: it does not serve /v1/index, pass baseUrl with the URL of your Secondlayer instance`, { cause: error });
348
+ throw new IndexSourceConfigError2(`${sourceName} got a non-JSON 404 from ${error.url ?? "the transport host"}: it does not serve /v1/index, pass baseUrl with the URL of your Secondlayer instance`, { cause: error });
349
349
  }
350
350
  }
351
351
  return true;
@@ -357,7 +357,7 @@ function decodeResultHex(hex) {
357
357
  if (!hex)
358
358
  return {};
359
359
  try {
360
- return { result: deserializeCVBytes(hex), resultHex: hex };
360
+ return { result: deserializeCVBytes2(hex), resultHex: hex };
361
361
  } catch {
362
362
  return { resultHex: hex };
363
363
  }
@@ -373,14 +373,14 @@ function normalizeStatus(txStatus) {
373
373
  return txStatus.startsWith("dropped") ? "dropped" : undefined;
374
374
  }
375
375
  }
376
- function extendedApiSource() {
376
+ function extendedApiSource2() {
377
377
  return {
378
378
  async get({ client, txid }) {
379
379
  let data;
380
380
  try {
381
381
  data = await client.request(`/extended/v1/tx/${encodeURIComponent(normalizeTxid(txid))}`, { method: "GET" });
382
382
  } catch (error) {
383
- if (error instanceof HttpRequestError && error.status === 404) {
383
+ if (error instanceof HttpRequestError2 && error.status === 404) {
384
384
  return { receipt: null };
385
385
  }
386
386
  throw error;
@@ -405,7 +405,7 @@ function extendedApiSource() {
405
405
  }
406
406
  };
407
407
  }
408
- function indexTxSource(params = {}) {
408
+ function indexTxSource2(params = {}) {
409
409
  const headers = params.apiKey ? { authorization: `Bearer ${params.apiKey}` } : undefined;
410
410
  return {
411
411
  canonicalOnly: true,
@@ -443,22 +443,22 @@ function indexTxSource(params = {}) {
443
443
  }
444
444
 
445
445
  // src/actions/public/getTransaction.ts
446
- async function getTransaction(client, params) {
447
- const source = params.source ?? extendedApiSource();
446
+ async function getTransaction2(client, params) {
447
+ const source = params.source ?? extendedApiSource2();
448
448
  const { receipt } = await source.get({ client, txid: params.txid });
449
449
  return receipt;
450
450
  }
451
451
 
452
452
  // src/actions/public/waitForTransactionReceipt.ts
453
453
  var sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
454
- async function waitForTransactionReceipt(client, params) {
454
+ async function waitForTransactionReceipt2(client, params) {
455
455
  const {
456
456
  txid,
457
457
  confirmations = 1,
458
458
  timeout = 180000,
459
459
  pollingInterval = 3000
460
460
  } = params;
461
- const source = params.source ?? extendedApiSource();
461
+ const source = params.source ?? extendedApiSource2();
462
462
  const droppedGracePeriod = params.droppedGracePeriod ?? (source.canonicalOnly ? timeout : 30000);
463
463
  const startedAt = Date.now();
464
464
  let unknownSince = null;
@@ -469,16 +469,16 @@ async function waitForTransactionReceipt(client, params) {
469
469
  if (receipt === null) {
470
470
  unknownSince ??= Date.now();
471
471
  if (Date.now() - unknownSince >= droppedGracePeriod) {
472
- throw new TransactionDroppedError(everPending ? `Transaction ${txid} left the mempool without being mined` : `Transaction ${txid} was never observed by the status source`, { txid });
472
+ throw new TransactionDroppedError2(everPending ? `Transaction ${txid} left the mempool without being mined` : `Transaction ${txid} was never observed by the status source`, { txid });
473
473
  }
474
474
  } else {
475
475
  unknownSince = null;
476
476
  switch (receipt.status) {
477
477
  case "dropped":
478
- throw new TransactionDroppedError(`Transaction ${txid} was dropped from the mempool`, { txid });
478
+ throw new TransactionDroppedError2(`Transaction ${txid} was dropped from the mempool`, { txid });
479
479
  case "abort_by_response":
480
480
  case "abort_by_post_condition":
481
- throw new TransactionAbortedError(`Transaction ${txid} aborted (${receipt.status})`, { receipt });
481
+ throw new TransactionAbortedError2(`Transaction ${txid} aborted (${receipt.status})`, { receipt });
482
482
  case "pending":
483
483
  everPending = true;
484
484
  break;
@@ -486,7 +486,7 @@ async function waitForTransactionReceipt(client, params) {
486
486
  if (confirmations <= 1)
487
487
  return receipt;
488
488
  if (receipt.blockHeight !== undefined) {
489
- const tip = snapshot.tip ?? await getBlockHeight(client);
489
+ const tip = snapshot.tip ?? await getBlockHeight2(client);
490
490
  if (tip - receipt.blockHeight + 1 >= confirmations)
491
491
  return receipt;
492
492
  }
@@ -495,18 +495,18 @@ async function waitForTransactionReceipt(client, params) {
495
495
  }
496
496
  }
497
497
  if (Date.now() - startedAt >= timeout) {
498
- throw new WaitForTransactionTimeoutError(`Timed out after ${timeout}ms waiting for transaction ${txid}`, { txid });
498
+ throw new WaitForTransactionTimeoutError2(`Timed out after ${timeout}ms waiting for transaction ${txid}`, { txid });
499
499
  }
500
500
  await sleep2(pollingInterval);
501
501
  }
502
502
  }
503
503
 
504
504
  // src/actions/wallet/sendTransaction.ts
505
- async function sendTransaction(client, params) {
506
- const hex = bytesToHex(serializeTransaction(params.transaction));
505
+ async function sendTransaction2(client, params) {
506
+ const hex = bytesToHex2(serializeTransaction2(params.transaction));
507
507
  const body = { tx: hex };
508
508
  if (params.attachment) {
509
- body.attachment = typeof params.attachment === "string" ? params.attachment : bytesToHex(params.attachment);
509
+ body.attachment = typeof params.attachment === "string" ? params.attachment : bytesToHex2(params.attachment);
510
510
  }
511
511
  let data;
512
512
  try {
@@ -516,33 +516,33 @@ async function sendTransaction(client, params) {
516
516
  retryCount: 0
517
517
  });
518
518
  } catch (error) {
519
- if (error instanceof HttpRequestError && error.details) {
519
+ if (error instanceof HttpRequestError2 && error.details) {
520
520
  try {
521
521
  data = JSON.parse(error.details);
522
522
  } catch {
523
523
  throw error;
524
524
  }
525
- } else if (error instanceof TimeoutError) {
526
- const txid2 = getTransactionId(params.transaction);
527
- const receipt = await getTransaction(client, { txid: txid2 }).catch(() => null);
525
+ } else if (error instanceof TimeoutError2) {
526
+ const txid = getTransactionId2(params.transaction);
527
+ const receipt = await getTransaction2(client, { txid }).catch(() => null);
528
528
  if (receipt === null)
529
529
  throw error;
530
- data = { txid: txid2 };
530
+ data = { txid };
531
531
  } else {
532
532
  throw error;
533
533
  }
534
534
  }
535
535
  if (data.error) {
536
- throw new BroadcastError(data.reason ?? data.error, {
536
+ throw new BroadcastError2(data.reason ?? data.error, {
537
537
  reason: data.reason,
538
538
  reasonData: data.reason_data,
539
- txid: data.txid ?? getTransactionId(params.transaction)
539
+ txid: data.txid ?? getTransactionId2(params.transaction)
540
540
  });
541
541
  }
542
- const txid = typeof data === "string" ? data.replace(/"/g, "") : data.txid ?? getTransactionId(params.transaction);
542
+ const txid = typeof data === "string" ? data.replace(/"/g, "") : data.txid ?? getTransactionId2(params.transaction);
543
543
  if (params.wait) {
544
544
  const confirmations = params.wait === true ? 1 : params.wait;
545
- const receipt = await waitForTransactionReceipt(client, {
545
+ const receipt = await waitForTransactionReceipt2(client, {
546
546
  txid,
547
547
  confirmations
548
548
  });
@@ -552,12 +552,12 @@ async function sendTransaction(client, params) {
552
552
  }
553
553
 
554
554
  // src/actions/wallet/nonceManager.ts
555
- function jsonRpcSource() {
555
+ function jsonRpcSource2() {
556
556
  return {
557
- get: ({ client, address }) => getNonce(client, { address })
557
+ get: ({ client, address }) => getNonce2(client, { address })
558
558
  };
559
559
  }
560
- function memoryStore() {
560
+ function memoryStore2() {
561
561
  const next = new Map;
562
562
  const locks = new Map;
563
563
  function withLock(key, fn) {
@@ -593,9 +593,9 @@ function memoryStore() {
593
593
  function nonceKey(client, address) {
594
594
  return `${client.chain?.id ?? "stacks"}:${address}`;
595
595
  }
596
- function createNonceManager(params = {}) {
597
- const source = params.source ?? jsonRpcSource();
598
- const store = params.store ?? memoryStore();
596
+ function createNonceManager2(params = {}) {
597
+ const source = params.source ?? jsonRpcSource2();
598
+ const store = params.store ?? memoryStore2();
599
599
  return {
600
600
  consume({ client, address }) {
601
601
  return store.reserve(nonceKey(client, address), () => source.get({ client, address }));
@@ -611,10 +611,10 @@ function createNonceManager(params = {}) {
611
611
  }
612
612
  };
613
613
  }
614
- async function resolveNonce(client, address) {
614
+ async function resolveNonce2(client, address) {
615
615
  if (client.nonceManager)
616
616
  return client.nonceManager.consume({ client, address });
617
- return getNonce(client, { address });
617
+ return getNonce2(client, { address });
618
618
  }
619
619
  async function releaseNonce(client, address, nonce) {
620
620
  if (!client.nonceManager)
@@ -623,7 +623,7 @@ async function releaseNonce(client, address, nonce) {
623
623
  await client.nonceManager.release({ client, address, nonce });
624
624
  } catch {}
625
625
  }
626
- async function reconcileNonce(manager, params) {
626
+ async function reconcileNonce2(manager, params) {
627
627
  const { client, address, source } = params;
628
628
  const downward = params.downward ?? true;
629
629
  const authoritative = await source.get({ client, address });
@@ -637,7 +637,7 @@ async function reconcileNonce(manager, params) {
637
637
  await manager.reset({ client, address });
638
638
  return { reset: true, authoritative, tracked };
639
639
  }
640
- function startNonceReconciler(manager, params) {
640
+ function startNonceReconciler2(manager, params) {
641
641
  const { client, addresses, source, clock } = params;
642
642
  const intervalMs = params.intervalMs ?? 60000;
643
643
  let running = true;
@@ -646,7 +646,7 @@ function startNonceReconciler(manager, params) {
646
646
  return;
647
647
  for (const address of addresses) {
648
648
  try {
649
- const result = await reconcileNonce(manager, {
649
+ const result = await reconcileNonce2(manager, {
650
650
  client,
651
651
  address,
652
652
  source,
@@ -678,8 +678,8 @@ function startNonceReconciler(manager, params) {
678
678
  stop: () => clearInterval(timer)
679
679
  };
680
680
  }
681
- function isNonceConflictError(error) {
682
- if (!(error instanceof BroadcastError))
681
+ function isNonceConflictError2(error) {
682
+ if (!(error instanceof BroadcastError2))
683
683
  return false;
684
684
  if (error.reason === "ConflictingNonceInMempool" || error.reason === "BadNonce") {
685
685
  return true;
@@ -688,14 +688,14 @@ function isNonceConflictError(error) {
688
688
  return false;
689
689
  return error.message.toLowerCase().includes("nonce");
690
690
  }
691
- async function broadcastWithNonceReset(client, params) {
691
+ async function broadcastWithNonceReset2(client, params) {
692
692
  try {
693
- const result = await sendTransaction(client, {
693
+ const result = await sendTransaction2(client, {
694
694
  transaction: params.transaction
695
695
  });
696
696
  return result.txid;
697
697
  } catch (error) {
698
- if (client.nonceManager && isNonceConflictError(error)) {
698
+ if (client.nonceManager && isNonceConflictError2(error)) {
699
699
  await client.nonceManager.reset({ client, address: params.address });
700
700
  }
701
701
  throw error;
@@ -703,56 +703,56 @@ async function broadcastWithNonceReset(client, params) {
703
703
  }
704
704
 
705
705
  // src/actions/wallet/utils.ts
706
- function isProviderAccount(account) {
706
+ function isProviderAccount2(account) {
707
707
  return account.type === "provider";
708
708
  }
709
709
  var FEE_TIERS = ["min", "low", "mid", "high"];
710
710
  var TIER_INDEX = { low: 0, mid: 1, high: 2 };
711
- function isFeeTier(fee) {
711
+ function isFeeTier2(fee) {
712
712
  return typeof fee === "string" && FEE_TIERS.includes(fee);
713
713
  }
714
- function minimumFee(transaction) {
715
- return BigInt(serializeTransaction(transaction).length);
714
+ function minimumFee2(transaction) {
715
+ return BigInt(serializeTransaction2(transaction).length);
716
716
  }
717
- function isNoEstimateAvailable(error) {
718
- return error instanceof HttpRequestError && error.status === 400 && (error.details?.includes("NoEstimateAvailable") ?? false);
717
+ function isNoEstimateAvailable2(error) {
718
+ return error instanceof HttpRequestError2 && error.status === 400 && (error.details?.includes("NoEstimateAvailable") ?? false);
719
719
  }
720
- async function resolveFee(client, transaction, fee) {
721
- if (fee !== undefined && !isFeeTier(fee))
722
- return { fee: intToBigInt(fee) };
720
+ async function resolveFee2(client, transaction, fee) {
721
+ if (fee !== undefined && !isFeeTier2(fee))
722
+ return { fee: intToBigInt2(fee) };
723
723
  const tier = fee ?? "mid";
724
724
  if (tier === "min")
725
- return { fee: minimumFee(transaction), tier };
725
+ return { fee: minimumFee2(transaction), tier };
726
726
  let estimates;
727
727
  try {
728
- estimates = await estimateFee(client, { transaction });
728
+ estimates = await estimateFee2(client, { transaction });
729
729
  } catch (error) {
730
- if (!isNoEstimateAvailable(error))
730
+ if (!isNoEstimateAvailable2(error))
731
731
  throw error;
732
- return { fee: minimumFee(transaction), tier: "min" };
732
+ return { fee: minimumFee2(transaction), tier: "min" };
733
733
  }
734
734
  const pick = estimates[TIER_INDEX[tier]] ?? estimates[estimates.length - 1];
735
735
  if (pick)
736
736
  return { fee: BigInt(pick.fee), tier };
737
- return { fee: minimumFee(transaction), tier: "min" };
737
+ return { fee: minimumFee2(transaction), tier: "min" };
738
738
  }
739
739
  function setUnsignedFee(transaction, fee) {
740
740
  transaction.auth.spendingCondition.fee = fee;
741
741
  clearTxCache(transaction);
742
742
  }
743
743
  function assertNoFeeTierForProvider(fee) {
744
- if (isFeeTier(fee)) {
744
+ if (isFeeTier2(fee)) {
745
745
  throw new Error(`Fee tier '${fee}' requires local signing; provider (wallet) accounts set their own fee`);
746
746
  }
747
747
  }
748
748
 
749
749
  // src/actions/wallet/callContract.ts
750
- async function callContract(client, params) {
750
+ async function callContract2(client, params) {
751
751
  const account = client.account;
752
752
  if (!account)
753
753
  throw new Error("Account required");
754
- const [contractAddress, contractName] = parseContractId(params.contract);
755
- if (isProviderAccount(account)) {
754
+ const [contractAddress, contractName] = parseContractId2(params.contract);
755
+ if (isProviderAccount2(account)) {
756
756
  assertNoFeeTierForProvider(params.fee);
757
757
  const result = await account.provider.request("stx_callContract", {
758
758
  contract: params.contract,
@@ -762,10 +762,10 @@ async function callContract(client, params) {
762
762
  return result.txid;
763
763
  }
764
764
  const managed = params.nonce === undefined && client.nonceManager !== undefined;
765
- const nonce = params.nonce ?? await resolveNonce(client, account.address);
765
+ const nonce = params.nonce ?? await resolveNonce2(client, account.address);
766
766
  try {
767
- const needsFeeResolution = params.fee === undefined || isFeeTier(params.fee);
768
- const unsigned = buildContractCall({
767
+ const needsFeeResolution = params.fee === undefined || isFeeTier2(params.fee);
768
+ const unsigned = buildContractCall2({
769
769
  contractAddress,
770
770
  contractName,
771
771
  functionName: params.functionName,
@@ -778,11 +778,11 @@ async function callContract(client, params) {
778
778
  postConditions: params.postConditions
779
779
  });
780
780
  if (needsFeeResolution) {
781
- const { fee } = await resolveFee(client, unsigned, params.fee);
781
+ const { fee } = await resolveFee2(client, unsigned, params.fee);
782
782
  setUnsignedFee(unsigned, fee);
783
783
  }
784
- const signed = await signTransactionWithAccount(unsigned, account);
785
- return await broadcastWithNonceReset(client, {
784
+ const signed = await signTransactionWithAccount2(unsigned, account);
785
+ return await broadcastWithNonceReset2(client, {
786
786
  transaction: signed,
787
787
  address: account.address
788
788
  });
@@ -793,7 +793,7 @@ async function callContract(client, params) {
793
793
  }
794
794
  }
795
795
 
796
- export { estimateFee, getBlockHeight, HttpRequestError, getMapEntry, getNonce, TimeoutError, createTransport, buildRequestFn, IndexSourceConfigError, indexRequestFn, indexNotFound, extendedApiSource, indexTxSource, getTransaction, waitForTransactionReceipt, sendTransaction, jsonRpcSource, memoryStore, createNonceManager, resolveNonce, releaseNonce, reconcileNonce, startNonceReconciler, isNonceConflictError, broadcastWithNonceReset, isProviderAccount, isFeeTier, minimumFee, isNoEstimateAvailable, resolveFee, setUnsignedFee, assertNoFeeTierForProvider, callContract };
796
+ export { estimateFee2, getBlockHeight2, HttpRequestError2, getMapEntry2, getNonce2, TimeoutError2, createTransport, buildRequestFn, IndexSourceConfigError2, indexRequestFn, indexNotFound, extendedApiSource2, indexTxSource2, getTransaction2, waitForTransactionReceipt2, sendTransaction2, jsonRpcSource2, memoryStore2, createNonceManager2, resolveNonce2, releaseNonce, reconcileNonce2, startNonceReconciler2, isNonceConflictError2, broadcastWithNonceReset2, isProviderAccount2, isFeeTier2, minimumFee2, isNoEstimateAvailable2, resolveFee2, setUnsignedFee, assertNoFeeTierForProvider, callContract2 };
797
797
 
798
- //# debugId=D0127FA0D8988A0264756E2164756E21
799
- //# sourceMappingURL=stacks-esm-qk0p9fr6.js.map
798
+ //# debugId=863F4AC28F71513464756E2164756E21
799
+ //# sourceMappingURL=stacks-esm-ea4m4bk7.js.map