@secondlayer/stacks 4.3.2 → 5.0.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 (165) hide show
  1. package/README.md +27 -11
  2. package/dist/shared/{stacks-bfan7ex7.js → stacks-4d7c3x27.js} +5 -5
  3. package/dist/shared/{stacks-bfan7ex7.js.map → stacks-4d7c3x27.js.map} +3 -3
  4. package/dist/shared/{stacks-709tra19.js → stacks-4hs8r4q2.js} +16 -2
  5. package/dist/shared/stacks-4hs8r4q2.js.map +10 -0
  6. package/dist/shared/{stacks-w23294am.js → stacks-51ybf135.js} +3 -3
  7. package/dist/shared/{stacks-0jk7vd8r.cjs → stacks-69nq48jp.js} +120 -17
  8. package/dist/shared/stacks-69nq48jp.js.map +15 -0
  9. package/dist/shared/{stacks-8pfdscq6.js → stacks-6gavarmy.js} +37 -9
  10. package/dist/shared/stacks-6gavarmy.js.map +12 -0
  11. package/dist/shared/{stacks-gxq2pbky.js → stacks-71k0vmct.js} +65 -8
  12. package/dist/shared/stacks-71k0vmct.js.map +13 -0
  13. package/dist/shared/{stacks-7wkf2rph.js → stacks-7bqkf3b0.js} +86 -71
  14. package/dist/shared/{stacks-7wkf2rph.js.map → stacks-7bqkf3b0.js.map} +9 -10
  15. package/dist/shared/{stacks-zcpvzbr0.js → stacks-8brgfvqx.js} +3 -3
  16. package/dist/shared/{stacks-4vzmhw3q.cjs → stacks-8vzxax5e.cjs} +13 -3
  17. package/dist/shared/stacks-8vzxax5e.cjs.map +10 -0
  18. package/dist/shared/{stacks-hnqt5rz4.js → stacks-9c1yam8b.js} +3 -3
  19. package/dist/shared/{stacks-bnbdqznq.cjs → stacks-bdgh9n83.cjs} +11 -10
  20. package/dist/shared/{stacks-bnbdqznq.cjs.map → stacks-bdgh9n83.cjs.map} +3 -3
  21. package/dist/shared/{stacks-fb75yew8.js → stacks-db3kwavg.cjs} +346 -138
  22. package/dist/shared/stacks-db3kwavg.cjs.map +23 -0
  23. package/dist/shared/{stacks-jpt52csy.js → stacks-e3nwm1dz.js} +14 -17
  24. package/dist/shared/stacks-e3nwm1dz.js.map +10 -0
  25. package/dist/shared/{stacks-ta1gar0b.cjs → stacks-ee53k9j2.cjs} +62 -6
  26. package/dist/shared/stacks-ee53k9j2.cjs.map +13 -0
  27. package/dist/shared/{stacks-27fmgajb.js → stacks-ga026yxz.js} +9 -9
  28. package/dist/shared/{stacks-27fmgajb.js.map → stacks-ga026yxz.js.map} +3 -3
  29. package/dist/shared/{stacks-nyaw1z2a.cjs → stacks-ggdz96r1.cjs} +4 -4
  30. package/dist/shared/{stacks-nyaw1z2a.cjs.map → stacks-ggdz96r1.cjs.map} +3 -3
  31. package/dist/shared/{stacks-08y0y0t7.js → stacks-gjz26k6b.js} +2 -2
  32. package/dist/shared/{stacks-x5386y2y.cjs → stacks-gza2n1zs.cjs} +5 -5
  33. package/dist/shared/{stacks-x5386y2y.cjs.map → stacks-gza2n1zs.cjs.map} +3 -3
  34. package/dist/shared/{stacks-ztzygy90.js → stacks-mftyrc60.js} +2 -2
  35. package/dist/shared/stacks-n4d8j8q3.js +801 -0
  36. package/dist/shared/stacks-n4d8j8q3.js.map +23 -0
  37. package/dist/shared/{stacks-ycbq8pf7.cjs → stacks-p337hp6m.cjs} +74 -59
  38. package/dist/shared/{stacks-ycbq8pf7.cjs.map → stacks-p337hp6m.cjs.map} +9 -10
  39. package/dist/shared/{stacks-ttdk2g2f.js → stacks-s5vej5z6.cjs} +92 -41
  40. package/dist/shared/stacks-s5vej5z6.cjs.map +15 -0
  41. package/dist/shared/stacks-sdqkapct.cjs +67 -0
  42. package/dist/shared/stacks-sdqkapct.cjs.map +12 -0
  43. package/dist/shared/{stacks-1arrcd11.js → stacks-v2rfr46a.js} +2 -2
  44. package/dist/shared/{stacks-9mqveyjv.cjs → stacks-w9t61fra.cjs} +7 -10
  45. package/dist/shared/stacks-w9t61fra.cjs.map +10 -0
  46. package/dist/shared/{stacks-tjjnkt3r.js → stacks-wxfd6r4b.js} +2 -2
  47. package/dist/shared/{stacks-4z72akdf.js → stacks-x0qqwrev.js} +3 -3
  48. package/dist/shared/{stacks-gck1sq7h.cjs → stacks-xjkn3en1.cjs} +16 -2
  49. package/dist/shared/stacks-xjkn3en1.cjs.map +10 -0
  50. package/dist/shared/stacks-xnrywjf1.cjs +131 -0
  51. package/dist/shared/stacks-xnrywjf1.cjs.map +11 -0
  52. package/dist/shared/stacks-yajyej2y.js +139 -0
  53. package/dist/shared/stacks-yajyej2y.js.map +11 -0
  54. package/dist/shared/{stacks-913a2rx7.js → stacks-yvb7rvwk.js} +13 -3
  55. package/dist/shared/stacks-yvb7rvwk.js.map +10 -0
  56. package/dist/shared/{stacks-0cdm20eh.js → stacks-z90xdr1x.js} +7 -11
  57. package/dist/shared/{stacks-0cdm20eh.js.map → stacks-z90xdr1x.js.map} +3 -3
  58. package/dist/src/accounts/index.js +2 -3
  59. package/dist/src/accounts/index.js.map +2 -2
  60. package/dist/src/actions/index.cjs +2 -1
  61. package/dist/src/actions/index.cjs.map +1 -1
  62. package/dist/src/actions/index.d.cts +108 -20
  63. package/dist/src/actions/index.d.ts +108 -20
  64. package/dist/src/actions/index.js +17 -15
  65. package/dist/src/actions/index.js.map +1 -1
  66. package/dist/src/bitcoin/index.d.cts +27 -0
  67. package/dist/src/bitcoin/index.d.ts +27 -0
  68. package/dist/src/bitcoin/index.js +10 -11
  69. package/dist/src/bitcoin/index.js.map +2 -2
  70. package/dist/src/bns/index.d.cts +27 -0
  71. package/dist/src/bns/index.d.ts +27 -0
  72. package/dist/src/bns/index.js +13 -13
  73. package/dist/src/bns/index.js.map +1 -1
  74. package/dist/src/clarity/index.js +7 -6
  75. package/dist/src/clarity/index.js.map +1 -1
  76. package/dist/src/connect/index.cjs +44 -30
  77. package/dist/src/connect/index.cjs.map +7 -7
  78. package/dist/src/connect/index.d.cts +16 -1
  79. package/dist/src/connect/index.d.ts +16 -1
  80. package/dist/src/connect/index.js +44 -30
  81. package/dist/src/connect/index.js.map +7 -7
  82. package/dist/src/connect/walletconnect/index.cjs +49 -413
  83. package/dist/src/connect/walletconnect/index.cjs.map +4 -4
  84. package/dist/src/connect/walletconnect/index.js +47 -411
  85. package/dist/src/connect/walletconnect/index.js.map +4 -4
  86. package/dist/src/filters/index.js +2 -2
  87. package/dist/src/index.cjs +49 -124
  88. package/dist/src/index.cjs.map +6 -8
  89. package/dist/src/index.d.cts +163 -54
  90. package/dist/src/index.d.ts +163 -54
  91. package/dist/src/index.js +79 -147
  92. package/dist/src/index.js.map +6 -8
  93. package/dist/src/postconditions/index.js +6 -5
  94. package/dist/src/postconditions/index.js.map +1 -1
  95. package/dist/src/pox/index.cjs +7 -83
  96. package/dist/src/pox/index.cjs.map +3 -3
  97. package/dist/src/pox/index.d.cts +32 -1
  98. package/dist/src/pox/index.d.ts +32 -1
  99. package/dist/src/pox/index.js +22 -102
  100. package/dist/src/pox/index.js.map +3 -3
  101. package/dist/src/pox5/index.cjs +4 -112
  102. package/dist/src/pox5/index.cjs.map +3 -4
  103. package/dist/src/pox5/index.d.cts +27 -0
  104. package/dist/src/pox5/index.d.ts +27 -0
  105. package/dist/src/pox5/index.js +20 -131
  106. package/dist/src/pox5/index.js.map +3 -4
  107. package/dist/src/sbtc/index.cjs +2 -27
  108. package/dist/src/sbtc/index.cjs.map +3 -3
  109. package/dist/src/sbtc/index.d.cts +30 -2
  110. package/dist/src/sbtc/index.d.ts +30 -2
  111. package/dist/src/sbtc/index.js +15 -45
  112. package/dist/src/sbtc/index.js.map +3 -3
  113. package/dist/src/stackingdao/index.d.cts +27 -0
  114. package/dist/src/stackingdao/index.d.ts +27 -0
  115. package/dist/src/stackingdao/index.js +11 -11
  116. package/dist/src/stackingdao/index.js.map +1 -1
  117. package/dist/src/subscriptions/index.d.cts +27 -0
  118. package/dist/src/subscriptions/index.d.ts +27 -0
  119. package/dist/src/subscriptions/index.js +2 -2
  120. package/dist/src/tools/btc/index.cjs.map +2 -2
  121. package/dist/src/tools/btc/index.js.map +2 -2
  122. package/dist/src/tools/index.cjs +629 -392
  123. package/dist/src/tools/index.cjs.map +30 -28
  124. package/dist/src/tools/index.d.cts +44 -0
  125. package/dist/src/tools/index.d.ts +44 -0
  126. package/dist/src/tools/index.js +628 -391
  127. package/dist/src/tools/index.js.map +30 -28
  128. package/dist/src/transactions/index.js +6 -5
  129. package/dist/src/transactions/index.js.map +1 -1
  130. package/dist/src/utils/index.d.cts +2 -5
  131. package/dist/src/utils/index.d.ts +2 -5
  132. package/dist/src/utils/index.js +2 -2
  133. package/package.json +18 -7
  134. package/dist/shared/stacks-0eatsx6d.cjs +0 -25
  135. package/dist/shared/stacks-0eatsx6d.cjs.map +0 -10
  136. package/dist/shared/stacks-0jk7vd8r.cjs.map +0 -14
  137. package/dist/shared/stacks-4vzmhw3q.cjs.map +0 -10
  138. package/dist/shared/stacks-5nmz5ad9.js +0 -409
  139. package/dist/shared/stacks-5nmz5ad9.js.map +0 -10
  140. package/dist/shared/stacks-709tra19.js.map +0 -10
  141. package/dist/shared/stacks-8pfdscq6.js.map +0 -12
  142. package/dist/shared/stacks-913a2rx7.js.map +0 -10
  143. package/dist/shared/stacks-9mqveyjv.cjs.map +0 -10
  144. package/dist/shared/stacks-e4xn4m7j.js +0 -27
  145. package/dist/shared/stacks-e4xn4m7j.js.map +0 -10
  146. package/dist/shared/stacks-fb75yew8.js.map +0 -21
  147. package/dist/shared/stacks-gck1sq7h.cjs.map +0 -10
  148. package/dist/shared/stacks-gxq2pbky.js.map +0 -13
  149. package/dist/shared/stacks-jpt52csy.js.map +0 -10
  150. package/dist/shared/stacks-mnnhpex3.cjs +0 -407
  151. package/dist/shared/stacks-mnnhpex3.cjs.map +0 -10
  152. package/dist/shared/stacks-ta1gar0b.cjs.map +0 -13
  153. package/dist/shared/stacks-tdsp5gsb.cjs +0 -527
  154. package/dist/shared/stacks-tdsp5gsb.cjs.map +0 -21
  155. package/dist/shared/stacks-ttdk2g2f.js.map +0 -14
  156. package/dist/shared/stacks-wdp5yr8n.cjs +0 -39
  157. package/dist/shared/stacks-wdp5yr8n.cjs.map +0 -12
  158. /package/dist/shared/{stacks-w23294am.js.map → stacks-51ybf135.js.map} +0 -0
  159. /package/dist/shared/{stacks-zcpvzbr0.js.map → stacks-8brgfvqx.js.map} +0 -0
  160. /package/dist/shared/{stacks-hnqt5rz4.js.map → stacks-9c1yam8b.js.map} +0 -0
  161. /package/dist/shared/{stacks-08y0y0t7.js.map → stacks-gjz26k6b.js.map} +0 -0
  162. /package/dist/shared/{stacks-ztzygy90.js.map → stacks-mftyrc60.js.map} +0 -0
  163. /package/dist/shared/{stacks-1arrcd11.js.map → stacks-v2rfr46a.js.map} +0 -0
  164. /package/dist/shared/{stacks-tjjnkt3r.js.map → stacks-wxfd6r4b.js.map} +0 -0
  165. /package/dist/shared/{stacks-4z72akdf.js.map → stacks-x0qqwrev.js.map} +0 -0
@@ -38,6 +38,15 @@ type NonceManager = {
38
38
  client: Client
39
39
  address: string
40
40
  }): void | Promise<void>
41
+ /**
42
+ * Give back a nonce from {@link NonceManager.consume} whose transaction
43
+ * was never accepted by the node. No-op unless it is the latest issued.
44
+ */
45
+ release(params: {
46
+ client: Client
47
+ address: string
48
+ nonce: bigint
49
+ }): void | Promise<void>
41
50
  /** Next nonce that {@link NonceManager.consume} would return without consuming it, or `undefined` if untracked. */
42
51
  peek(params: {
43
52
  client: Client
@@ -93,14 +102,32 @@ type RequestOptions = {
93
102
  method?: "GET" | "POST" | "PUT" | "DELETE"
94
103
  body?: unknown
95
104
  headers?: Record<string, string>
105
+ /**
106
+ * Cancel the request from the caller's side. An aborted signal rejects
107
+ * with the signal's reason immediately and never retries; it is combined
108
+ * with the transport's own per-attempt timeout.
109
+ */
110
+ signal?: AbortSignal
111
+ /**
112
+ * Override the transport's retry budget for this one request. Broadcasts
113
+ * pass `0`: re-sending a transaction the node may already hold trades a
114
+ * transient failure for a confusing nonce conflict.
115
+ */
116
+ retryCount?: number
96
117
  };
97
118
  /** Shared configuration for all transport types. */
98
119
  type TransportConfig = {
99
120
  url?: string
121
+ /**
122
+ * Per-attempt deadline in ms covering headers AND body. A stalled body
123
+ * rejects with `TimeoutError` instead of hanging. Default 30_000.
124
+ */
100
125
  timeout?: number
101
126
  retryCount?: number
102
127
  retryDelay?: number
103
128
  fetchOptions?: RequestInit
129
+ /** Sent as `x-api-key`. Held in the request closure and stripped from
130
+ * `Transport.config` so it never prints with the client. */
104
131
  apiKey?: string
105
132
  };
106
133
  /** A resolved transport instance with a bound request function. */
@@ -146,17 +173,34 @@ interface StacksTools {
146
173
  getMempoolStats: LooseTool;
147
174
  getNftHoldings: LooseTool;
148
175
  }
176
+ /**
177
+ * Bind the tool set to an explicit client.
178
+ *
179
+ * @deprecated Use `@secondlayer/mcp` for agent access to Stacks reads.
180
+ */
149
181
  declare function createStacksTools(client: StacksReadClient): StacksTools;
182
+ /** @deprecated Use `@secondlayer/mcp`. */
150
183
  declare const getStxBalance: LooseTool;
184
+ /** @deprecated Use `@secondlayer/mcp`. */
151
185
  declare const getAccountInfo: LooseTool;
186
+ /** @deprecated Use `@secondlayer/mcp`. */
152
187
  declare const getBlock: LooseTool;
188
+ /** @deprecated Use `@secondlayer/mcp`. */
153
189
  declare const getBlockHeight: LooseTool;
190
+ /** @deprecated Use `@secondlayer/mcp`. */
154
191
  declare const readContract: LooseTool;
192
+ /** @deprecated Use `@secondlayer/mcp`. */
155
193
  declare const estimateFee: LooseTool;
194
+ /** @deprecated Use `@secondlayer/mcp`. */
156
195
  declare const bnsResolve: LooseTool;
196
+ /** @deprecated Use `@secondlayer/mcp`. */
157
197
  declare const bnsReverse: LooseTool;
198
+ /** @deprecated Use `@secondlayer/mcp`. */
158
199
  declare const getTransaction: LooseTool;
200
+ /** @deprecated Use `@secondlayer/mcp`. */
159
201
  declare const getAccountHistory: LooseTool;
202
+ /** @deprecated Use `@secondlayer/mcp`. */
160
203
  declare const getMempoolStats: LooseTool;
204
+ /** @deprecated Use `@secondlayer/mcp`. */
161
205
  declare const getNftHoldings: LooseTool;
162
206
  export { readContract, getTransaction, getStxBalance, getNftHoldings, getMempoolStats, getBlockHeight, getBlock, getAccountInfo, getAccountHistory, estimateFee, createStacksTools, bnsReverse, bnsResolve, StacksTools };
@@ -38,6 +38,15 @@ type NonceManager = {
38
38
  client: Client
39
39
  address: string
40
40
  }): void | Promise<void>
41
+ /**
42
+ * Give back a nonce from {@link NonceManager.consume} whose transaction
43
+ * was never accepted by the node. No-op unless it is the latest issued.
44
+ */
45
+ release(params: {
46
+ client: Client
47
+ address: string
48
+ nonce: bigint
49
+ }): void | Promise<void>
41
50
  /** Next nonce that {@link NonceManager.consume} would return without consuming it, or `undefined` if untracked. */
42
51
  peek(params: {
43
52
  client: Client
@@ -93,14 +102,32 @@ type RequestOptions = {
93
102
  method?: "GET" | "POST" | "PUT" | "DELETE"
94
103
  body?: unknown
95
104
  headers?: Record<string, string>
105
+ /**
106
+ * Cancel the request from the caller's side. An aborted signal rejects
107
+ * with the signal's reason immediately and never retries; it is combined
108
+ * with the transport's own per-attempt timeout.
109
+ */
110
+ signal?: AbortSignal
111
+ /**
112
+ * Override the transport's retry budget for this one request. Broadcasts
113
+ * pass `0`: re-sending a transaction the node may already hold trades a
114
+ * transient failure for a confusing nonce conflict.
115
+ */
116
+ retryCount?: number
96
117
  };
97
118
  /** Shared configuration for all transport types. */
98
119
  type TransportConfig = {
99
120
  url?: string
121
+ /**
122
+ * Per-attempt deadline in ms covering headers AND body. A stalled body
123
+ * rejects with `TimeoutError` instead of hanging. Default 30_000.
124
+ */
100
125
  timeout?: number
101
126
  retryCount?: number
102
127
  retryDelay?: number
103
128
  fetchOptions?: RequestInit
129
+ /** Sent as `x-api-key`. Held in the request closure and stripped from
130
+ * `Transport.config` so it never prints with the client. */
104
131
  apiKey?: string
105
132
  };
106
133
  /** A resolved transport instance with a bound request function. */
@@ -146,17 +173,34 @@ interface StacksTools {
146
173
  getMempoolStats: LooseTool;
147
174
  getNftHoldings: LooseTool;
148
175
  }
176
+ /**
177
+ * Bind the tool set to an explicit client.
178
+ *
179
+ * @deprecated Use `@secondlayer/mcp` for agent access to Stacks reads.
180
+ */
149
181
  declare function createStacksTools(client: StacksReadClient): StacksTools;
182
+ /** @deprecated Use `@secondlayer/mcp`. */
150
183
  declare const getStxBalance: LooseTool;
184
+ /** @deprecated Use `@secondlayer/mcp`. */
151
185
  declare const getAccountInfo: LooseTool;
186
+ /** @deprecated Use `@secondlayer/mcp`. */
152
187
  declare const getBlock: LooseTool;
188
+ /** @deprecated Use `@secondlayer/mcp`. */
153
189
  declare const getBlockHeight: LooseTool;
190
+ /** @deprecated Use `@secondlayer/mcp`. */
154
191
  declare const readContract: LooseTool;
192
+ /** @deprecated Use `@secondlayer/mcp`. */
155
193
  declare const estimateFee: LooseTool;
194
+ /** @deprecated Use `@secondlayer/mcp`. */
156
195
  declare const bnsResolve: LooseTool;
196
+ /** @deprecated Use `@secondlayer/mcp`. */
157
197
  declare const bnsReverse: LooseTool;
198
+ /** @deprecated Use `@secondlayer/mcp`. */
158
199
  declare const getTransaction: LooseTool;
200
+ /** @deprecated Use `@secondlayer/mcp`. */
159
201
  declare const getAccountHistory: LooseTool;
202
+ /** @deprecated Use `@secondlayer/mcp`. */
160
203
  declare const getMempoolStats: LooseTool;
204
+ /** @deprecated Use `@secondlayer/mcp`. */
161
205
  declare const getNftHoldings: LooseTool;
162
206
  export { readContract, getTransaction, getStxBalance, getNftHoldings, getMempoolStats, getBlockHeight, getBlock, getAccountInfo, getAccountHistory, estimateFee, createStacksTools, bnsReverse, bnsResolve, StacksTools };