@secondlayer/stacks 0.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 (178) hide show
  1. package/README.md +92 -0
  2. package/dist/shared/stacks-02actsrx.cjs +17 -0
  3. package/dist/shared/stacks-02actsrx.cjs.map +10 -0
  4. package/dist/shared/stacks-1aqm7c2h.cjs +110 -0
  5. package/dist/shared/stacks-1aqm7c2h.cjs.map +11 -0
  6. package/dist/shared/stacks-24h5k94q.cjs +74 -0
  7. package/dist/shared/stacks-24h5k94q.cjs.map +11 -0
  8. package/dist/shared/stacks-2ar4prfz.cjs +328 -0
  9. package/dist/shared/stacks-2ar4prfz.cjs.map +11 -0
  10. package/dist/shared/stacks-4py5pm0r.cjs +237 -0
  11. package/dist/shared/stacks-4py5pm0r.cjs.map +10 -0
  12. package/dist/shared/stacks-5tprhns9.cjs +54 -0
  13. package/dist/shared/stacks-5tprhns9.cjs.map +11 -0
  14. package/dist/shared/stacks-61rvzkz1.cjs +132 -0
  15. package/dist/shared/stacks-61rvzkz1.cjs.map +17 -0
  16. package/dist/shared/stacks-709tra19.js +30 -0
  17. package/dist/shared/stacks-709tra19.js.map +10 -0
  18. package/dist/shared/stacks-74k8cxgb.cjs +567 -0
  19. package/dist/shared/stacks-74k8cxgb.cjs.map +13 -0
  20. package/dist/shared/stacks-8m9byk2j.js +7 -0
  21. package/dist/shared/stacks-8m9byk2j.js.map +9 -0
  22. package/dist/shared/stacks-8yykgdww.js +125 -0
  23. package/dist/shared/stacks-8yykgdww.js.map +11 -0
  24. package/dist/shared/stacks-9g0jhab3.cjs +40 -0
  25. package/dist/shared/stacks-9g0jhab3.cjs.map +10 -0
  26. package/dist/shared/stacks-an5k8n4t.cjs +291 -0
  27. package/dist/shared/stacks-an5k8n4t.cjs.map +23 -0
  28. package/dist/shared/stacks-b008c3w8.cjs +214 -0
  29. package/dist/shared/stacks-b008c3w8.cjs.map +11 -0
  30. package/dist/shared/stacks-bnvfmt7y.cjs +31 -0
  31. package/dist/shared/stacks-bnvfmt7y.cjs.map +9 -0
  32. package/dist/shared/stacks-bycy6t9k.js +22 -0
  33. package/dist/shared/stacks-bycy6t9k.js.map +10 -0
  34. package/dist/shared/stacks-d1fmkv3p.js +258 -0
  35. package/dist/shared/stacks-d1fmkv3p.js.map +13 -0
  36. package/dist/shared/stacks-dr5en54r.cjs +119 -0
  37. package/dist/shared/stacks-dr5en54r.cjs.map +10 -0
  38. package/dist/shared/stacks-dxhntr76.js +278 -0
  39. package/dist/shared/stacks-dxhntr76.js.map +10 -0
  40. package/dist/shared/stacks-evnzth1q.cjs +35 -0
  41. package/dist/shared/stacks-evnzth1q.cjs.map +10 -0
  42. package/dist/shared/stacks-f3tk2k5s.js +27 -0
  43. package/dist/shared/stacks-f3tk2k5s.js.map +9 -0
  44. package/dist/shared/stacks-f7wdrzs3.js +285 -0
  45. package/dist/shared/stacks-f7wdrzs3.js.map +11 -0
  46. package/dist/shared/stacks-fcaefc5b.cjs +16 -0
  47. package/dist/shared/stacks-fcaefc5b.cjs.map +10 -0
  48. package/dist/shared/stacks-g9mcjcqg.cjs +3 -0
  49. package/dist/shared/stacks-g9mcjcqg.cjs.map +9 -0
  50. package/dist/shared/stacks-gck1sq7h.cjs +28 -0
  51. package/dist/shared/stacks-gck1sq7h.cjs.map +10 -0
  52. package/dist/shared/stacks-gjvbq6w7.js +46 -0
  53. package/dist/shared/stacks-gjvbq6w7.js.map +10 -0
  54. package/dist/shared/stacks-j2cy7qtt.js +237 -0
  55. package/dist/shared/stacks-j2cy7qtt.js.map +11 -0
  56. package/dist/shared/stacks-k08tgzyp.cjs +232 -0
  57. package/dist/shared/stacks-k08tgzyp.cjs.map +13 -0
  58. package/dist/shared/stacks-k2p5tv6x.js +37 -0
  59. package/dist/shared/stacks-k2p5tv6x.js.map +10 -0
  60. package/dist/shared/stacks-k58k970n.js +234 -0
  61. package/dist/shared/stacks-k58k970n.js.map +10 -0
  62. package/dist/shared/stacks-n2g56wgg.js +338 -0
  63. package/dist/shared/stacks-n2g56wgg.js.map +23 -0
  64. package/dist/shared/stacks-nqytwfcc.js +243 -0
  65. package/dist/shared/stacks-nqytwfcc.js.map +11 -0
  66. package/dist/shared/stacks-qcae5852.js +19 -0
  67. package/dist/shared/stacks-qcae5852.js.map +10 -0
  68. package/dist/shared/stacks-qt8ehebn.js +76 -0
  69. package/dist/shared/stacks-qt8ehebn.js.map +11 -0
  70. package/dist/shared/stacks-qvg7c24g.cjs +232 -0
  71. package/dist/shared/stacks-qvg7c24g.cjs.map +10 -0
  72. package/dist/shared/stacks-r1t6g3c3.cjs +241 -0
  73. package/dist/shared/stacks-r1t6g3c3.cjs.map +11 -0
  74. package/dist/shared/stacks-tjxmrssa.js +282 -0
  75. package/dist/shared/stacks-tjxmrssa.js.map +11 -0
  76. package/dist/shared/stacks-v9jqcpd4.js +18 -0
  77. package/dist/shared/stacks-v9jqcpd4.js.map +10 -0
  78. package/dist/shared/stacks-vdfag81a.cjs +121 -0
  79. package/dist/shared/stacks-vdfag81a.cjs.map +10 -0
  80. package/dist/shared/stacks-vdfs3e5v.js +134 -0
  81. package/dist/shared/stacks-vdfs3e5v.js.map +10 -0
  82. package/dist/shared/stacks-y3dh7hv1.js +60 -0
  83. package/dist/shared/stacks-y3dh7hv1.js.map +11 -0
  84. package/dist/shared/stacks-ya3x01yd.cjs +16 -0
  85. package/dist/shared/stacks-ya3x01yd.cjs.map +10 -0
  86. package/dist/shared/stacks-yfgsm6ap.js +599 -0
  87. package/dist/shared/stacks-yfgsm6ap.js.map +13 -0
  88. package/dist/shared/stacks-yfveb68e.js +121 -0
  89. package/dist/shared/stacks-yfveb68e.js.map +10 -0
  90. package/dist/shared/stacks-zm0b3tgy.js +160 -0
  91. package/dist/shared/stacks-zm0b3tgy.js.map +17 -0
  92. package/dist/shared/stacks-zyv9qqme.cjs +249 -0
  93. package/dist/shared/stacks-zyv9qqme.cjs.map +11 -0
  94. package/dist/src/accounts/index.cjs +90 -0
  95. package/dist/src/accounts/index.cjs.map +12 -0
  96. package/dist/src/accounts/index.d.cts +47 -0
  97. package/dist/src/accounts/index.d.ts +47 -0
  98. package/dist/src/accounts/index.js +104 -0
  99. package/dist/src/accounts/index.js.map +12 -0
  100. package/dist/src/actions/index.cjs +36 -0
  101. package/dist/src/actions/index.cjs.map +9 -0
  102. package/dist/src/actions/index.d.cts +886 -0
  103. package/dist/src/actions/index.d.ts +886 -0
  104. package/dist/src/actions/index.js +81 -0
  105. package/dist/src/actions/index.js.map +9 -0
  106. package/dist/src/bns/index.cjs +590 -0
  107. package/dist/src/bns/index.cjs.map +15 -0
  108. package/dist/src/bns/index.d.cts +241 -0
  109. package/dist/src/bns/index.d.ts +241 -0
  110. package/dist/src/bns/index.js +611 -0
  111. package/dist/src/bns/index.js.map +15 -0
  112. package/dist/src/chains/index.cjs +13 -0
  113. package/dist/src/chains/index.cjs.map +9 -0
  114. package/dist/src/chains/index.d.cts +53 -0
  115. package/dist/src/chains/index.d.ts +53 -0
  116. package/dist/src/chains/index.js +18 -0
  117. package/dist/src/chains/index.js.map +9 -0
  118. package/dist/src/clarity/index.cjs +3 -0
  119. package/dist/src/clarity/index.cjs.map +9 -0
  120. package/dist/src/clarity/index.d.cts +821 -0
  121. package/dist/src/clarity/index.d.ts +821 -0
  122. package/dist/src/clarity/index.js +145 -0
  123. package/dist/src/clarity/index.js.map +9 -0
  124. package/dist/src/connect/index.cjs +480 -0
  125. package/dist/src/connect/index.cjs.map +19 -0
  126. package/dist/src/connect/index.d.cts +110 -0
  127. package/dist/src/connect/index.d.ts +110 -0
  128. package/dist/src/connect/index.js +448 -0
  129. package/dist/src/connect/index.js.map +19 -0
  130. package/dist/src/connect/walletconnect/index.cjs +1322 -0
  131. package/dist/src/connect/walletconnect/index.cjs.map +18 -0
  132. package/dist/src/connect/walletconnect/index.d.cts +132 -0
  133. package/dist/src/connect/walletconnect/index.d.ts +132 -0
  134. package/dist/src/connect/walletconnect/index.js +1290 -0
  135. package/dist/src/connect/walletconnect/index.js.map +18 -0
  136. package/dist/src/index.cjs +557 -0
  137. package/dist/src/index.cjs.map +21 -0
  138. package/dist/src/index.d.cts +847 -0
  139. package/dist/src/index.d.ts +847 -0
  140. package/dist/src/index.js +629 -0
  141. package/dist/src/index.js.map +21 -0
  142. package/dist/src/postconditions/index.cjs +3 -0
  143. package/dist/src/postconditions/index.cjs.map +9 -0
  144. package/dist/src/postconditions/index.d.cts +91 -0
  145. package/dist/src/postconditions/index.d.ts +91 -0
  146. package/dist/src/postconditions/index.js +12 -0
  147. package/dist/src/postconditions/index.js.map +9 -0
  148. package/dist/src/pox/index.cjs +860 -0
  149. package/dist/src/pox/index.cjs.map +15 -0
  150. package/dist/src/pox/index.d.cts +244 -0
  151. package/dist/src/pox/index.d.ts +244 -0
  152. package/dist/src/pox/index.js +877 -0
  153. package/dist/src/pox/index.js.map +15 -0
  154. package/dist/src/stackingdao/index.cjs +300 -0
  155. package/dist/src/stackingdao/index.cjs.map +13 -0
  156. package/dist/src/stackingdao/index.d.cts +179 -0
  157. package/dist/src/stackingdao/index.d.ts +179 -0
  158. package/dist/src/stackingdao/index.js +318 -0
  159. package/dist/src/stackingdao/index.js.map +13 -0
  160. package/dist/src/subscriptions/index.cjs +14 -0
  161. package/dist/src/subscriptions/index.cjs.map +9 -0
  162. package/dist/src/subscriptions/index.d.cts +250 -0
  163. package/dist/src/subscriptions/index.d.ts +250 -0
  164. package/dist/src/subscriptions/index.js +21 -0
  165. package/dist/src/subscriptions/index.js.map +9 -0
  166. package/dist/src/transactions/index.cjs +50 -0
  167. package/dist/src/transactions/index.cjs.map +9 -0
  168. package/dist/src/transactions/index.d.cts +412 -0
  169. package/dist/src/transactions/index.d.ts +412 -0
  170. package/dist/src/transactions/index.js +101 -0
  171. package/dist/src/transactions/index.js.map +9 -0
  172. package/dist/src/utils/index.cjs +168 -0
  173. package/dist/src/utils/index.cjs.map +11 -0
  174. package/dist/src/utils/index.d.cts +140 -0
  175. package/dist/src/utils/index.d.ts +140 -0
  176. package/dist/src/utils/index.js +222 -0
  177. package/dist/src/utils/index.js.map +11 -0
  178. package/package.json +105 -0
@@ -0,0 +1,821 @@
1
+ type ClarityType = "int" | "uint" | "buffer" | "true" | "false" | "address" | "contract" | "ok" | "err" | "none" | "some" | "list" | "tuple" | "ascii" | "utf8";
2
+ /** Wire type IDs matching the Stacks binary format (SIP-005) */
3
+ declare const ClarityWireType: {
4
+ readonly int: 0x00
5
+ readonly uint: 0x01
6
+ readonly buffer: 0x02
7
+ readonly true: 0x03
8
+ readonly false: 0x04
9
+ readonly address: 0x05
10
+ readonly contract: 0x06
11
+ readonly ok: 0x07
12
+ readonly err: 0x08
13
+ readonly none: 0x09
14
+ readonly some: 0x0a
15
+ readonly list: 0x0b
16
+ readonly tuple: 0x0c
17
+ readonly ascii: 0x0d
18
+ readonly utf8: 0x0e
19
+ };
20
+ declare function clarityTypeFromByte(byte: number): ClarityType;
21
+ type IntCV = {
22
+ readonly type: "int"
23
+ readonly value: bigint
24
+ };
25
+ type UIntCV = {
26
+ readonly type: "uint"
27
+ readonly value: bigint
28
+ };
29
+ type BooleanCV = TrueCV | FalseCV;
30
+ type TrueCV = {
31
+ readonly type: "true"
32
+ };
33
+ type FalseCV = {
34
+ readonly type: "false"
35
+ };
36
+ type BufferCV = {
37
+ readonly type: "buffer"
38
+ readonly value: string
39
+ };
40
+ type NoneCV = {
41
+ readonly type: "none"
42
+ };
43
+ type SomeCV = {
44
+ readonly type: "some"
45
+ readonly value: ClarityValue
46
+ };
47
+ type OptionalCV = NoneCV | SomeCV;
48
+ type ResponseOkCV = {
49
+ readonly type: "ok"
50
+ readonly value: ClarityValue
51
+ };
52
+ type ResponseErrorCV = {
53
+ readonly type: "err"
54
+ readonly value: ClarityValue
55
+ };
56
+ type ResponseCV = ResponseOkCV | ResponseErrorCV;
57
+ type StandardPrincipalCV = {
58
+ readonly type: "address"
59
+ readonly value: string
60
+ };
61
+ type ContractPrincipalCV = {
62
+ readonly type: "contract"
63
+ readonly value: string
64
+ };
65
+ type PrincipalCV = StandardPrincipalCV | ContractPrincipalCV;
66
+ type ListCV = {
67
+ type: "list"
68
+ value: ClarityValue[]
69
+ };
70
+ type TupleData = {
71
+ [key: string]: ClarityValue
72
+ };
73
+ type TupleCV = {
74
+ type: "tuple"
75
+ value: TupleData
76
+ };
77
+ type StringAsciiCV = {
78
+ readonly type: "ascii"
79
+ readonly value: string
80
+ };
81
+ type StringUtf8CV = {
82
+ readonly type: "utf8"
83
+ readonly value: string
84
+ };
85
+ type ClarityValue = IntCV | UIntCV | BooleanCV | BufferCV | NoneCV | SomeCV | ResponseOkCV | ResponseErrorCV | StandardPrincipalCV | ContractPrincipalCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV;
86
+ type IntegerType = number | string | bigint | Uint8Array;
87
+ declare function intCV(value: IntegerType): IntCV;
88
+ declare function uintCV(value: IntegerType): UIntCV;
89
+ declare const trueCV: () => TrueCV;
90
+ declare const falseCV: () => FalseCV;
91
+ declare const boolCV: (v: boolean) => BooleanCV;
92
+ declare function bufferCV(buffer: Uint8Array): BufferCV;
93
+ declare function standardPrincipalCV(address: string): StandardPrincipalCV;
94
+ declare function contractPrincipalCV(address: string, contractName: string): ContractPrincipalCV;
95
+ declare function noneCV(): NoneCV;
96
+ declare function someCV(value: ClarityValue): SomeCV;
97
+ declare function responseOkCV(value: ClarityValue): ResponseOkCV;
98
+ declare function responseErrorCV(value: ClarityValue): ResponseErrorCV;
99
+ declare function listCV(values: ClarityValue[]): ListCV;
100
+ declare function tupleCV(data: TupleData): TupleCV;
101
+ declare function stringAsciiCV(value: string): StringAsciiCV;
102
+ declare function stringUtf8CV(value: string): StringUtf8CV;
103
+ declare const Cl: {
104
+ readonly principal: (address: string) => StandardPrincipalCV | ContractPrincipalCV
105
+ readonly serialize: (value: ClarityValue) => string
106
+ };
107
+ declare function serializeCVBytes(value: ClarityValue): Uint8Array;
108
+ declare function serializeCV(value: ClarityValue): string;
109
+ declare function deserializeCVBytes<T extends ClarityValue = ClarityValue>(input: Uint8Array | string): T;
110
+ declare function deserializeCV<T extends ClarityValue = ClarityValue>(input: Uint8Array | string): T;
111
+ declare function prettyPrint(val: ClarityValue, encoding?: "tryAscii" | "hex"): string | undefined;
112
+ declare function cvToJSON(val: ClarityValue): any;
113
+ declare function cvToValue(val: ClarityValue): any;
114
+ declare const CONTRACT_NAME_REGEX: RegExp;
115
+ type AbiUInt128 = "uint128";
116
+ type AbiInt128 = "int128";
117
+ type AbiBool = "bool";
118
+ type AbiPrincipal = "principal";
119
+ type AbiTraitReference = "trait_reference";
120
+ type AbiNone = "none";
121
+ type AbiStringAscii<L extends number = number> = {
122
+ "string-ascii": {
123
+ length: L
124
+ }
125
+ };
126
+ type AbiStringUtf8<L extends number = number> = {
127
+ "string-utf8": {
128
+ length: L
129
+ }
130
+ };
131
+ type AbiBuffer<L extends number = number> = {
132
+ buff: {
133
+ length: L
134
+ }
135
+ };
136
+ type AbiPrimitiveType = AbiUInt128 | AbiInt128 | AbiBool | AbiPrincipal | AbiTraitReference | AbiNone | AbiStringAscii | AbiStringUtf8 | AbiBuffer;
137
+ interface AbiListType {
138
+ list: {
139
+ type: AbiType
140
+ length: number
141
+ };
142
+ }
143
+ interface AbiTupleType {
144
+ tuple: ReadonlyArray<{
145
+ name: string
146
+ type: AbiType
147
+ }>;
148
+ }
149
+ interface AbiOptionalType {
150
+ optional: AbiType;
151
+ }
152
+ interface AbiResponseType {
153
+ response: {
154
+ ok: AbiType
155
+ error: AbiType
156
+ };
157
+ }
158
+ /** Discriminated union of all Clarity value types (primitives, buffers, lists, tuples, optionals, responses). */
159
+ type AbiType = AbiPrimitiveType | AbiListType | AbiTupleType | AbiOptionalType | AbiResponseType;
160
+ type AbiList<
161
+ T extends AbiType = AbiType,
162
+ L extends number = number
163
+ > = {
164
+ list: {
165
+ type: T
166
+ length: L
167
+ }
168
+ };
169
+ type AbiTuple<T extends ReadonlyArray<{
170
+ name: string
171
+ type: AbiType
172
+ }>> = {
173
+ tuple: T
174
+ };
175
+ type AbiOptional<T extends AbiType = AbiType> = {
176
+ optional: T
177
+ };
178
+ type AbiResponse<
179
+ O extends AbiType = AbiType,
180
+ E extends AbiType = AbiType
181
+ > = {
182
+ response: {
183
+ ok: O
184
+ error: E
185
+ }
186
+ };
187
+ type CamelCaseInner<S extends string> = S extends `${infer P1}-${infer P2}${infer P3}` ? `${P1}${Capitalize<CamelCaseInner<`${P2}${P3}`>>}` : S;
188
+ type ToCamelCase<S extends string> = CamelCaseInner<S> extends `${number}${string}` ? `_${CamelCaseInner<S>}` : CamelCaseInner<S>;
189
+ declare function toCamelCase(str: string): string;
190
+ type TupleToObject<T extends ReadonlyArray<{
191
+ name: string
192
+ type: AbiType
193
+ }>> = { [K in T[number]["name"] as ToCamelCase<K>] : AbiToTS<Extract<T[number], {
194
+ name: K
195
+ }>["type"]> };
196
+ type AbiToTS<T extends AbiType> = T extends "none" ? never : T extends "uint128" ? bigint : T extends "int128" ? bigint : T extends "bool" ? boolean : T extends "principal" ? string : T extends "trait_reference" ? string : T extends {
197
+ "string-ascii": any
198
+ } ? string : T extends {
199
+ "string-utf8": any
200
+ } ? string : T extends {
201
+ buff: any
202
+ } ? Uint8Array : T extends {
203
+ list: {
204
+ type: infer U extends AbiType
205
+ }
206
+ } ? Array<AbiToTS<U>> : T extends {
207
+ optional: infer U extends AbiType
208
+ } ? AbiToTS<U> | null : T extends {
209
+ response: {
210
+ ok: infer O extends AbiType
211
+ error: infer E extends AbiType
212
+ }
213
+ } ? {
214
+ ok: AbiToTS<O>
215
+ } | {
216
+ err: AbiToTS<E>
217
+ } : T extends {
218
+ tuple: infer Fields extends ReadonlyArray<{
219
+ name: string
220
+ type: AbiType
221
+ }>
222
+ } ? TupleToObject<Fields> : never;
223
+ type ResponseOk<T> = {
224
+ ok: T
225
+ };
226
+ type ResponseErr<E> = {
227
+ err: E
228
+ };
229
+ type Response<
230
+ T,
231
+ E
232
+ > = ResponseOk<T> | ResponseErr<E>;
233
+ type FunctionAccess = "public" | "read-only" | "private";
234
+ interface FunctionArg {
235
+ name: string;
236
+ type: AbiType;
237
+ }
238
+ /** A single Clarity function definition with name, access level, arguments, and return type. */
239
+ interface AbiFunction {
240
+ name: string;
241
+ access: FunctionAccess;
242
+ args: ReadonlyArray<FunctionArg>;
243
+ outputs: AbiType;
244
+ }
245
+ type VariableAccess = "constant" | "variable";
246
+ interface AbiVariable {
247
+ name: string;
248
+ type: AbiType;
249
+ access: VariableAccess;
250
+ }
251
+ interface AbiMap {
252
+ name: string;
253
+ key: AbiType;
254
+ value: AbiType;
255
+ }
256
+ interface AbiFungibleToken {
257
+ name: string;
258
+ }
259
+ interface AbiNonFungibleToken {
260
+ name: string;
261
+ type: AbiType;
262
+ }
263
+ type TraitFunctionAccess = Exclude<FunctionAccess, "private">;
264
+ interface AbiTraitFunction {
265
+ name: string;
266
+ access: TraitFunctionAccess;
267
+ args: ReadonlyArray<FunctionArg>;
268
+ outputs: AbiType;
269
+ }
270
+ interface AbiTraitDefinition {
271
+ name: string;
272
+ functions: ReadonlyArray<AbiTraitFunction>;
273
+ }
274
+ /** Full Clarity contract ABI including functions, maps, variables, and token definitions. */
275
+ interface AbiContract {
276
+ functions: ReadonlyArray<AbiFunction>;
277
+ maps?: ReadonlyArray<AbiMap>;
278
+ variables?: ReadonlyArray<AbiVariable>;
279
+ fungible_tokens?: ReadonlyArray<AbiFungibleToken>;
280
+ non_fungible_tokens?: ReadonlyArray<AbiNonFungibleToken>;
281
+ implemented_traits?: ReadonlyArray<string>;
282
+ defined_traits?: ReadonlyArray<AbiTraitDefinition>;
283
+ }
284
+ type ExtractFunctionNames<
285
+ C extends AbiContract,
286
+ Access extends FunctionAccess = FunctionAccess
287
+ > = Extract<C["functions"][number], {
288
+ access: Access
289
+ }>["name"];
290
+ type ExtractFunction<
291
+ C extends AbiContract,
292
+ N extends ExtractFunctionNames<C>
293
+ > = Extract<C["functions"][number], {
294
+ name: N
295
+ }>;
296
+ type ExtractFunctionArgs<
297
+ C extends AbiContract,
298
+ N extends ExtractFunctionNames<C>
299
+ > = ExtractFunction<C, N> extends {
300
+ args: infer Args extends ReadonlyArray<{
301
+ name: string
302
+ type: any
303
+ }>
304
+ } ? { [K in Args[number]["name"] as ToCamelCase<K>] : AbiToTS<Extract<Args[number], {
305
+ name: K
306
+ }>["type"]> } : never;
307
+ type ExtractFunctionOutput<
308
+ C extends AbiContract,
309
+ N extends ExtractFunctionNames<C>
310
+ > = ExtractFunction<C, N> extends {
311
+ outputs: infer O extends AbiType
312
+ } ? AbiToTS<O> : never;
313
+ type ExtractPublicFunctions<C extends AbiContract> = ExtractFunctionNames<C, "public">;
314
+ type ExtractReadOnlyFunctions<C extends AbiContract> = ExtractFunctionNames<C, "read-only">;
315
+ type ExtractPrivateFunctions<C extends AbiContract> = ExtractFunctionNames<C, "private">;
316
+ type ExtractMapNames<C extends AbiContract> = C["maps"] extends ReadonlyArray<{
317
+ name: infer N extends string
318
+ }> ? N : never;
319
+ type ExtractMap<
320
+ C extends AbiContract,
321
+ N extends ExtractMapNames<C>
322
+ > = C["maps"] extends ReadonlyArray<infer M> ? Extract<M, {
323
+ name: N
324
+ }> : never;
325
+ type ExtractMapKey<
326
+ C extends AbiContract,
327
+ N extends ExtractMapNames<C>
328
+ > = ExtractMap<C, N> extends {
329
+ key: infer K extends AbiType
330
+ } ? AbiToTS<K> : never;
331
+ type ExtractMapValue<
332
+ C extends AbiContract,
333
+ N extends ExtractMapNames<C>
334
+ > = ExtractMap<C, N> extends {
335
+ value: infer V extends AbiType
336
+ } ? AbiToTS<V> : never;
337
+ type ExtractVariableNames<
338
+ C extends AbiContract,
339
+ Access extends VariableAccess = VariableAccess
340
+ > = C["variables"] extends ReadonlyArray<infer V> ? V extends {
341
+ name: infer N extends string
342
+ access: Access
343
+ } ? N : never : never;
344
+ type ExtractVariable<
345
+ C extends AbiContract,
346
+ N extends ExtractVariableNames<C>
347
+ > = C["variables"] extends ReadonlyArray<infer V> ? Extract<V, {
348
+ name: N
349
+ }> : never;
350
+ type ExtractVariableType<
351
+ C extends AbiContract,
352
+ N extends ExtractVariableNames<C>
353
+ > = ExtractVariable<C, N> extends {
354
+ type: infer T extends AbiType
355
+ } ? AbiToTS<T> : never;
356
+ type ExtractConstants<C extends AbiContract> = ExtractVariableNames<C, "constant">;
357
+ type ExtractDataVars<C extends AbiContract> = ExtractVariableNames<C, "variable">;
358
+ type ExtractFungibleTokenNames<C extends AbiContract> = C["fungible_tokens"] extends ReadonlyArray<{
359
+ name: infer N extends string
360
+ }> ? N : never;
361
+ type ExtractNonFungibleTokenNames<C extends AbiContract> = C["non_fungible_tokens"] extends ReadonlyArray<{
362
+ name: infer N extends string
363
+ }> ? N : never;
364
+ type ExtractNFTAssetType<
365
+ C extends AbiContract,
366
+ N extends ExtractNonFungibleTokenNames<C>
367
+ > = C["non_fungible_tokens"] extends ReadonlyArray<infer T> ? Extract<T, {
368
+ name: N
369
+ }> extends {
370
+ type: infer A extends AbiType
371
+ } ? AbiToTS<A> : never : never;
372
+ type ExtractDefinedTraitNames<C extends AbiContract> = C["defined_traits"] extends ReadonlyArray<{
373
+ name: infer N extends string
374
+ }> ? N : never;
375
+ type ExtractImplementedTraits<C extends AbiContract> = C["implemented_traits"] extends ReadonlyArray<infer T extends string> ? T : never;
376
+ declare function isUint128(value: unknown): value is bigint;
377
+ declare function isInt128(value: unknown): value is bigint;
378
+ declare function isBool(value: unknown): value is boolean;
379
+ declare function isPrincipal(value: unknown): value is string;
380
+ declare function isStandardPrincipal(value: unknown): value is string;
381
+ declare function isContractPrincipal(value: unknown): value is string;
382
+ declare function isTraitReference(value: unknown): value is string;
383
+ declare function isString(value: unknown): value is string;
384
+ declare function isUint8Array(value: unknown): value is Uint8Array;
385
+ declare function isArray<T>(value: unknown, itemGuard: (item: unknown) => item is T): value is T[];
386
+ declare function isOptional<T>(value: unknown, guard: (val: unknown) => val is T): value is T | null;
387
+ declare function isOkResponse<T>(response: {
388
+ ok: T
389
+ } | {
390
+ err: any
391
+ }): response is ResponseOk<T>;
392
+ declare function isErrResponse<E>(response: {
393
+ ok: any
394
+ } | {
395
+ err: E
396
+ }): response is ResponseErr<E>;
397
+ declare function isResponse<
398
+ T,
399
+ E
400
+ >(value: unknown, okGuard: (val: unknown) => val is T, errGuard: (val: unknown) => val is E): value is ResponseOk<T> | ResponseErr<E>;
401
+ declare function isAbiList(type: AbiType): type is AbiListType;
402
+ declare function isAbiTuple(type: AbiType): type is AbiTupleType;
403
+ declare function isAbiOptional(type: AbiType): type is AbiOptionalType;
404
+ declare function isAbiResponse(type: AbiType): type is AbiResponseType;
405
+ declare function isAbiBuffer(type: AbiType): type is AbiBuffer;
406
+ declare function isAbiStringAscii(type: AbiType): type is AbiStringAscii;
407
+ declare function isAbiStringUtf8(type: AbiType): type is AbiStringUtf8;
408
+ declare function isAbiTraitReference(type: AbiType): type is AbiTraitReference;
409
+ declare class ClarityConversionError extends Error {
410
+ readonly type: AbiType;
411
+ readonly value: unknown;
412
+ constructor(message: string, type: AbiType, value: unknown);
413
+ }
414
+ declare function jsToClarity(type: AbiType, value: unknown): unknown;
415
+ declare function prepareArgs<F extends AbiFunction>(func: F, args: Record<string, unknown>): unknown[];
416
+ declare function validateArgs<F extends AbiFunction>(func: F, args: Record<string, unknown>): void;
417
+ declare function validateArgsArray<F extends AbiFunction>(func: F, args: unknown[]): void;
418
+ declare const SIP010_ABI: {
419
+ readonly functions: readonly [{
420
+ readonly name: "transfer"
421
+ readonly access: "public"
422
+ readonly args: readonly [{
423
+ readonly name: "amount"
424
+ readonly type: "uint128"
425
+ }, {
426
+ readonly name: "sender"
427
+ readonly type: "principal"
428
+ }, {
429
+ readonly name: "recipient"
430
+ readonly type: "principal"
431
+ }, {
432
+ readonly name: "memo"
433
+ readonly type: {
434
+ readonly optional: {
435
+ readonly buff: {
436
+ readonly length: 34
437
+ }
438
+ }
439
+ }
440
+ }]
441
+ readonly outputs: {
442
+ readonly response: {
443
+ readonly ok: "bool"
444
+ readonly error: "uint128"
445
+ }
446
+ }
447
+ }, {
448
+ readonly name: "get-balance"
449
+ readonly access: "read-only"
450
+ readonly args: readonly [{
451
+ readonly name: "account"
452
+ readonly type: "principal"
453
+ }]
454
+ readonly outputs: {
455
+ readonly response: {
456
+ readonly ok: "uint128"
457
+ readonly error: "uint128"
458
+ }
459
+ }
460
+ }, {
461
+ readonly name: "get-total-supply"
462
+ readonly access: "read-only"
463
+ readonly args: readonly []
464
+ readonly outputs: {
465
+ readonly response: {
466
+ readonly ok: "uint128"
467
+ readonly error: "uint128"
468
+ }
469
+ }
470
+ }, {
471
+ readonly name: "get-name"
472
+ readonly access: "read-only"
473
+ readonly args: readonly []
474
+ readonly outputs: {
475
+ readonly response: {
476
+ readonly ok: {
477
+ readonly "string-ascii": {
478
+ readonly length: 32
479
+ }
480
+ }
481
+ readonly error: "uint128"
482
+ }
483
+ }
484
+ }, {
485
+ readonly name: "get-symbol"
486
+ readonly access: "read-only"
487
+ readonly args: readonly []
488
+ readonly outputs: {
489
+ readonly response: {
490
+ readonly ok: {
491
+ readonly "string-ascii": {
492
+ readonly length: 10
493
+ }
494
+ }
495
+ readonly error: "uint128"
496
+ }
497
+ }
498
+ }, {
499
+ readonly name: "get-decimals"
500
+ readonly access: "read-only"
501
+ readonly args: readonly []
502
+ readonly outputs: {
503
+ readonly response: {
504
+ readonly ok: "uint128"
505
+ readonly error: "uint128"
506
+ }
507
+ }
508
+ }, {
509
+ readonly name: "get-token-uri"
510
+ readonly access: "read-only"
511
+ readonly args: readonly []
512
+ readonly outputs: {
513
+ readonly response: {
514
+ readonly ok: {
515
+ readonly optional: {
516
+ readonly "string-utf8": {
517
+ readonly length: 256
518
+ }
519
+ }
520
+ }
521
+ readonly error: "uint128"
522
+ }
523
+ }
524
+ }]
525
+ readonly fungible_tokens: readonly [{
526
+ readonly name: "token"
527
+ }]
528
+ };
529
+ declare const SIP009_ABI: {
530
+ readonly functions: readonly [{
531
+ readonly name: "transfer"
532
+ readonly access: "public"
533
+ readonly args: readonly [{
534
+ readonly name: "id"
535
+ readonly type: "uint128"
536
+ }, {
537
+ readonly name: "sender"
538
+ readonly type: "principal"
539
+ }, {
540
+ readonly name: "recipient"
541
+ readonly type: "principal"
542
+ }]
543
+ readonly outputs: {
544
+ readonly response: {
545
+ readonly ok: "bool"
546
+ readonly error: "uint128"
547
+ }
548
+ }
549
+ }, {
550
+ readonly name: "get-owner"
551
+ readonly access: "read-only"
552
+ readonly args: readonly [{
553
+ readonly name: "id"
554
+ readonly type: "uint128"
555
+ }]
556
+ readonly outputs: {
557
+ readonly response: {
558
+ readonly ok: {
559
+ readonly optional: "principal"
560
+ }
561
+ readonly error: "uint128"
562
+ }
563
+ }
564
+ }, {
565
+ readonly name: "get-last-token-id"
566
+ readonly access: "read-only"
567
+ readonly args: readonly []
568
+ readonly outputs: {
569
+ readonly response: {
570
+ readonly ok: "uint128"
571
+ readonly error: "uint128"
572
+ }
573
+ }
574
+ }, {
575
+ readonly name: "get-token-uri"
576
+ readonly access: "read-only"
577
+ readonly args: readonly [{
578
+ readonly name: "id"
579
+ readonly type: "uint128"
580
+ }]
581
+ readonly outputs: {
582
+ readonly response: {
583
+ readonly ok: {
584
+ readonly optional: {
585
+ readonly "string-utf8": {
586
+ readonly length: 256
587
+ }
588
+ }
589
+ }
590
+ readonly error: "uint128"
591
+ }
592
+ }
593
+ }]
594
+ readonly non_fungible_tokens: readonly [{
595
+ readonly name: "nft"
596
+ readonly type: "uint128"
597
+ }]
598
+ };
599
+ declare const SIP013_ABI: {
600
+ readonly functions: readonly [{
601
+ readonly name: "transfer"
602
+ readonly access: "public"
603
+ readonly args: readonly [{
604
+ readonly name: "token-id"
605
+ readonly type: "uint128"
606
+ }, {
607
+ readonly name: "amount"
608
+ readonly type: "uint128"
609
+ }, {
610
+ readonly name: "sender"
611
+ readonly type: "principal"
612
+ }, {
613
+ readonly name: "recipient"
614
+ readonly type: "principal"
615
+ }]
616
+ readonly outputs: {
617
+ readonly response: {
618
+ readonly ok: "bool"
619
+ readonly error: "uint128"
620
+ }
621
+ }
622
+ }, {
623
+ readonly name: "transfer-memo"
624
+ readonly access: "public"
625
+ readonly args: readonly [{
626
+ readonly name: "token-id"
627
+ readonly type: "uint128"
628
+ }, {
629
+ readonly name: "amount"
630
+ readonly type: "uint128"
631
+ }, {
632
+ readonly name: "sender"
633
+ readonly type: "principal"
634
+ }, {
635
+ readonly name: "recipient"
636
+ readonly type: "principal"
637
+ }, {
638
+ readonly name: "memo"
639
+ readonly type: {
640
+ readonly buff: {
641
+ readonly length: 34
642
+ }
643
+ }
644
+ }]
645
+ readonly outputs: {
646
+ readonly response: {
647
+ readonly ok: "bool"
648
+ readonly error: "uint128"
649
+ }
650
+ }
651
+ }, {
652
+ readonly name: "transfer-many"
653
+ readonly access: "public"
654
+ readonly args: readonly [{
655
+ readonly name: "transfers"
656
+ readonly type: {
657
+ readonly list: {
658
+ readonly type: {
659
+ readonly tuple: readonly [{
660
+ readonly name: "token-id"
661
+ readonly type: "uint128"
662
+ }, {
663
+ readonly name: "amount"
664
+ readonly type: "uint128"
665
+ }, {
666
+ readonly name: "sender"
667
+ readonly type: "principal"
668
+ }, {
669
+ readonly name: "recipient"
670
+ readonly type: "principal"
671
+ }]
672
+ }
673
+ readonly length: 200
674
+ }
675
+ }
676
+ }]
677
+ readonly outputs: {
678
+ readonly response: {
679
+ readonly ok: "bool"
680
+ readonly error: "uint128"
681
+ }
682
+ }
683
+ }, {
684
+ readonly name: "transfer-many-memo"
685
+ readonly access: "public"
686
+ readonly args: readonly [{
687
+ readonly name: "transfers"
688
+ readonly type: {
689
+ readonly list: {
690
+ readonly type: {
691
+ readonly tuple: readonly [{
692
+ readonly name: "token-id"
693
+ readonly type: "uint128"
694
+ }, {
695
+ readonly name: "amount"
696
+ readonly type: "uint128"
697
+ }, {
698
+ readonly name: "sender"
699
+ readonly type: "principal"
700
+ }, {
701
+ readonly name: "recipient"
702
+ readonly type: "principal"
703
+ }, {
704
+ readonly name: "memo"
705
+ readonly type: {
706
+ readonly buff: {
707
+ readonly length: 34
708
+ }
709
+ }
710
+ }]
711
+ }
712
+ readonly length: 200
713
+ }
714
+ }
715
+ }]
716
+ readonly outputs: {
717
+ readonly response: {
718
+ readonly ok: "bool"
719
+ readonly error: "uint128"
720
+ }
721
+ }
722
+ }, {
723
+ readonly name: "get-balance"
724
+ readonly access: "read-only"
725
+ readonly args: readonly [{
726
+ readonly name: "token-id"
727
+ readonly type: "uint128"
728
+ }, {
729
+ readonly name: "account"
730
+ readonly type: "principal"
731
+ }]
732
+ readonly outputs: {
733
+ readonly response: {
734
+ readonly ok: "uint128"
735
+ readonly error: "uint128"
736
+ }
737
+ }
738
+ }, {
739
+ readonly name: "get-overall-balance"
740
+ readonly access: "read-only"
741
+ readonly args: readonly [{
742
+ readonly name: "account"
743
+ readonly type: "principal"
744
+ }]
745
+ readonly outputs: {
746
+ readonly response: {
747
+ readonly ok: "uint128"
748
+ readonly error: "uint128"
749
+ }
750
+ }
751
+ }, {
752
+ readonly name: "get-total-supply"
753
+ readonly access: "read-only"
754
+ readonly args: readonly [{
755
+ readonly name: "token-id"
756
+ readonly type: "uint128"
757
+ }]
758
+ readonly outputs: {
759
+ readonly response: {
760
+ readonly ok: "uint128"
761
+ readonly error: "uint128"
762
+ }
763
+ }
764
+ }, {
765
+ readonly name: "get-overall-supply"
766
+ readonly access: "read-only"
767
+ readonly args: readonly []
768
+ readonly outputs: {
769
+ readonly response: {
770
+ readonly ok: "uint128"
771
+ readonly error: "uint128"
772
+ }
773
+ }
774
+ }, {
775
+ readonly name: "get-decimals"
776
+ readonly access: "read-only"
777
+ readonly args: readonly [{
778
+ readonly name: "token-id"
779
+ readonly type: "uint128"
780
+ }]
781
+ readonly outputs: {
782
+ readonly response: {
783
+ readonly ok: "uint128"
784
+ readonly error: "uint128"
785
+ }
786
+ }
787
+ }, {
788
+ readonly name: "get-token-uri"
789
+ readonly access: "read-only"
790
+ readonly args: readonly [{
791
+ readonly name: "token-id"
792
+ readonly type: "uint128"
793
+ }]
794
+ readonly outputs: {
795
+ readonly response: {
796
+ readonly ok: {
797
+ readonly optional: {
798
+ readonly "string-utf8": {
799
+ readonly length: 256
800
+ }
801
+ }
802
+ }
803
+ readonly error: "uint128"
804
+ }
805
+ }
806
+ }]
807
+ readonly fungible_tokens: readonly []
808
+ readonly non_fungible_tokens: readonly []
809
+ };
810
+ declare const sip010Abi: unknown;
811
+ declare const sip009Abi: unknown;
812
+ declare const sip013Abi: unknown;
813
+ /**
814
+ * Convert a JS value to a ClarityValue using ABI type information.
815
+ */
816
+ declare function jsToClarityValue(abiType: AbiType, value: unknown): ClarityValue;
817
+ /**
818
+ * Convert a ClarityValue back to a typed JS value using ABI type information.
819
+ */
820
+ declare function clarityValueToJS<T extends AbiType>(abiType: T, cv: ClarityValue): AbiToTS<T>;
821
+ export { validateArgsArray, validateArgs, uintCV, tupleCV, trueCV, toCamelCase, stringUtf8CV, stringAsciiCV, standardPrincipalCV, someCV, sip013Abi, sip010Abi, sip009Abi, serializeCVBytes, serializeCV, responseOkCV, responseErrorCV, prettyPrint, prepareArgs, noneCV, listCV, jsToClarityValue, jsToClarity, isUint8Array, isUint128, isTraitReference, isString, isStandardPrincipal, isResponse, isPrincipal, isOptional, isOkResponse, isInt128, isErrResponse, isContractPrincipal, isBool, isArray, isAbiTuple, isAbiTraitReference, isAbiStringUtf8, isAbiStringAscii, isAbiResponse, isAbiOptional, isAbiList, isAbiBuffer, intCV, falseCV, deserializeCVBytes, deserializeCV, cvToValue, cvToJSON, contractPrincipalCV, clarityValueToJS, clarityTypeFromByte, bufferCV, boolCV, VariableAccess, UIntCV, TupleData, TupleCV, TrueCV, TraitFunctionAccess, ToCamelCase, StringUtf8CV, StringAsciiCV, StandardPrincipalCV, SomeCV, SIP013_ABI, SIP010_ABI, SIP009_ABI, ResponseOkCV, ResponseOk, ResponseErrorCV, ResponseErr, ResponseCV, Response, PrincipalCV, OptionalCV, NoneCV, ListCV, IntCV, FunctionArg, FunctionAccess, FalseCV, ExtractVariableType, ExtractVariableNames, ExtractVariable, ExtractReadOnlyFunctions, ExtractPublicFunctions, ExtractPrivateFunctions, ExtractNonFungibleTokenNames, ExtractNFTAssetType, ExtractMapValue, ExtractMapNames, ExtractMapKey, ExtractMap, ExtractImplementedTraits, ExtractFungibleTokenNames, ExtractFunctionOutput, ExtractFunctionNames, ExtractFunctionArgs, ExtractFunction, ExtractDefinedTraitNames, ExtractDataVars, ExtractConstants, ContractPrincipalCV, ClarityWireType, ClarityValue, ClarityType, ClarityConversionError, Cl, CONTRACT_NAME_REGEX, BufferCV, BooleanCV, AbiVariable, AbiUInt128, AbiType, AbiTupleType, AbiTuple, AbiTraitReference, AbiTraitFunction, AbiTraitDefinition, AbiToTS, AbiStringUtf8, AbiStringAscii, AbiResponseType, AbiResponse, AbiPrincipal, AbiPrimitiveType, AbiOptionalType, AbiOptional, AbiNone, AbiNonFungibleToken, AbiMap, AbiListType, AbiList, AbiInt128, AbiFungibleToken, AbiFunction, AbiContract, AbiBuffer, AbiBool };