@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.
- package/README.md +92 -0
- package/dist/shared/stacks-02actsrx.cjs +17 -0
- package/dist/shared/stacks-02actsrx.cjs.map +10 -0
- package/dist/shared/stacks-1aqm7c2h.cjs +110 -0
- package/dist/shared/stacks-1aqm7c2h.cjs.map +11 -0
- package/dist/shared/stacks-24h5k94q.cjs +74 -0
- package/dist/shared/stacks-24h5k94q.cjs.map +11 -0
- package/dist/shared/stacks-2ar4prfz.cjs +328 -0
- package/dist/shared/stacks-2ar4prfz.cjs.map +11 -0
- package/dist/shared/stacks-4py5pm0r.cjs +237 -0
- package/dist/shared/stacks-4py5pm0r.cjs.map +10 -0
- package/dist/shared/stacks-5tprhns9.cjs +54 -0
- package/dist/shared/stacks-5tprhns9.cjs.map +11 -0
- package/dist/shared/stacks-61rvzkz1.cjs +132 -0
- package/dist/shared/stacks-61rvzkz1.cjs.map +17 -0
- package/dist/shared/stacks-709tra19.js +30 -0
- package/dist/shared/stacks-709tra19.js.map +10 -0
- package/dist/shared/stacks-74k8cxgb.cjs +567 -0
- package/dist/shared/stacks-74k8cxgb.cjs.map +13 -0
- package/dist/shared/stacks-8m9byk2j.js +7 -0
- package/dist/shared/stacks-8m9byk2j.js.map +9 -0
- package/dist/shared/stacks-8yykgdww.js +125 -0
- package/dist/shared/stacks-8yykgdww.js.map +11 -0
- package/dist/shared/stacks-9g0jhab3.cjs +40 -0
- package/dist/shared/stacks-9g0jhab3.cjs.map +10 -0
- package/dist/shared/stacks-an5k8n4t.cjs +291 -0
- package/dist/shared/stacks-an5k8n4t.cjs.map +23 -0
- package/dist/shared/stacks-b008c3w8.cjs +214 -0
- package/dist/shared/stacks-b008c3w8.cjs.map +11 -0
- package/dist/shared/stacks-bnvfmt7y.cjs +31 -0
- package/dist/shared/stacks-bnvfmt7y.cjs.map +9 -0
- package/dist/shared/stacks-bycy6t9k.js +22 -0
- package/dist/shared/stacks-bycy6t9k.js.map +10 -0
- package/dist/shared/stacks-d1fmkv3p.js +258 -0
- package/dist/shared/stacks-d1fmkv3p.js.map +13 -0
- package/dist/shared/stacks-dr5en54r.cjs +119 -0
- package/dist/shared/stacks-dr5en54r.cjs.map +10 -0
- package/dist/shared/stacks-dxhntr76.js +278 -0
- package/dist/shared/stacks-dxhntr76.js.map +10 -0
- package/dist/shared/stacks-evnzth1q.cjs +35 -0
- package/dist/shared/stacks-evnzth1q.cjs.map +10 -0
- package/dist/shared/stacks-f3tk2k5s.js +27 -0
- package/dist/shared/stacks-f3tk2k5s.js.map +9 -0
- package/dist/shared/stacks-f7wdrzs3.js +285 -0
- package/dist/shared/stacks-f7wdrzs3.js.map +11 -0
- package/dist/shared/stacks-fcaefc5b.cjs +16 -0
- package/dist/shared/stacks-fcaefc5b.cjs.map +10 -0
- package/dist/shared/stacks-g9mcjcqg.cjs +3 -0
- package/dist/shared/stacks-g9mcjcqg.cjs.map +9 -0
- package/dist/shared/stacks-gck1sq7h.cjs +28 -0
- package/dist/shared/stacks-gck1sq7h.cjs.map +10 -0
- package/dist/shared/stacks-gjvbq6w7.js +46 -0
- package/dist/shared/stacks-gjvbq6w7.js.map +10 -0
- package/dist/shared/stacks-j2cy7qtt.js +237 -0
- package/dist/shared/stacks-j2cy7qtt.js.map +11 -0
- package/dist/shared/stacks-k08tgzyp.cjs +232 -0
- package/dist/shared/stacks-k08tgzyp.cjs.map +13 -0
- package/dist/shared/stacks-k2p5tv6x.js +37 -0
- package/dist/shared/stacks-k2p5tv6x.js.map +10 -0
- package/dist/shared/stacks-k58k970n.js +234 -0
- package/dist/shared/stacks-k58k970n.js.map +10 -0
- package/dist/shared/stacks-n2g56wgg.js +338 -0
- package/dist/shared/stacks-n2g56wgg.js.map +23 -0
- package/dist/shared/stacks-nqytwfcc.js +243 -0
- package/dist/shared/stacks-nqytwfcc.js.map +11 -0
- package/dist/shared/stacks-qcae5852.js +19 -0
- package/dist/shared/stacks-qcae5852.js.map +10 -0
- package/dist/shared/stacks-qt8ehebn.js +76 -0
- package/dist/shared/stacks-qt8ehebn.js.map +11 -0
- package/dist/shared/stacks-qvg7c24g.cjs +232 -0
- package/dist/shared/stacks-qvg7c24g.cjs.map +10 -0
- package/dist/shared/stacks-r1t6g3c3.cjs +241 -0
- package/dist/shared/stacks-r1t6g3c3.cjs.map +11 -0
- package/dist/shared/stacks-tjxmrssa.js +282 -0
- package/dist/shared/stacks-tjxmrssa.js.map +11 -0
- package/dist/shared/stacks-v9jqcpd4.js +18 -0
- package/dist/shared/stacks-v9jqcpd4.js.map +10 -0
- package/dist/shared/stacks-vdfag81a.cjs +121 -0
- package/dist/shared/stacks-vdfag81a.cjs.map +10 -0
- package/dist/shared/stacks-vdfs3e5v.js +134 -0
- package/dist/shared/stacks-vdfs3e5v.js.map +10 -0
- package/dist/shared/stacks-y3dh7hv1.js +60 -0
- package/dist/shared/stacks-y3dh7hv1.js.map +11 -0
- package/dist/shared/stacks-ya3x01yd.cjs +16 -0
- package/dist/shared/stacks-ya3x01yd.cjs.map +10 -0
- package/dist/shared/stacks-yfgsm6ap.js +599 -0
- package/dist/shared/stacks-yfgsm6ap.js.map +13 -0
- package/dist/shared/stacks-yfveb68e.js +121 -0
- package/dist/shared/stacks-yfveb68e.js.map +10 -0
- package/dist/shared/stacks-zm0b3tgy.js +160 -0
- package/dist/shared/stacks-zm0b3tgy.js.map +17 -0
- package/dist/shared/stacks-zyv9qqme.cjs +249 -0
- package/dist/shared/stacks-zyv9qqme.cjs.map +11 -0
- package/dist/src/accounts/index.cjs +90 -0
- package/dist/src/accounts/index.cjs.map +12 -0
- package/dist/src/accounts/index.d.cts +47 -0
- package/dist/src/accounts/index.d.ts +47 -0
- package/dist/src/accounts/index.js +104 -0
- package/dist/src/accounts/index.js.map +12 -0
- package/dist/src/actions/index.cjs +36 -0
- package/dist/src/actions/index.cjs.map +9 -0
- package/dist/src/actions/index.d.cts +886 -0
- package/dist/src/actions/index.d.ts +886 -0
- package/dist/src/actions/index.js +81 -0
- package/dist/src/actions/index.js.map +9 -0
- package/dist/src/bns/index.cjs +590 -0
- package/dist/src/bns/index.cjs.map +15 -0
- package/dist/src/bns/index.d.cts +241 -0
- package/dist/src/bns/index.d.ts +241 -0
- package/dist/src/bns/index.js +611 -0
- package/dist/src/bns/index.js.map +15 -0
- package/dist/src/chains/index.cjs +13 -0
- package/dist/src/chains/index.cjs.map +9 -0
- package/dist/src/chains/index.d.cts +53 -0
- package/dist/src/chains/index.d.ts +53 -0
- package/dist/src/chains/index.js +18 -0
- package/dist/src/chains/index.js.map +9 -0
- package/dist/src/clarity/index.cjs +3 -0
- package/dist/src/clarity/index.cjs.map +9 -0
- package/dist/src/clarity/index.d.cts +821 -0
- package/dist/src/clarity/index.d.ts +821 -0
- package/dist/src/clarity/index.js +145 -0
- package/dist/src/clarity/index.js.map +9 -0
- package/dist/src/connect/index.cjs +480 -0
- package/dist/src/connect/index.cjs.map +19 -0
- package/dist/src/connect/index.d.cts +110 -0
- package/dist/src/connect/index.d.ts +110 -0
- package/dist/src/connect/index.js +448 -0
- package/dist/src/connect/index.js.map +19 -0
- package/dist/src/connect/walletconnect/index.cjs +1322 -0
- package/dist/src/connect/walletconnect/index.cjs.map +18 -0
- package/dist/src/connect/walletconnect/index.d.cts +132 -0
- package/dist/src/connect/walletconnect/index.d.ts +132 -0
- package/dist/src/connect/walletconnect/index.js +1290 -0
- package/dist/src/connect/walletconnect/index.js.map +18 -0
- package/dist/src/index.cjs +557 -0
- package/dist/src/index.cjs.map +21 -0
- package/dist/src/index.d.cts +847 -0
- package/dist/src/index.d.ts +847 -0
- package/dist/src/index.js +629 -0
- package/dist/src/index.js.map +21 -0
- package/dist/src/postconditions/index.cjs +3 -0
- package/dist/src/postconditions/index.cjs.map +9 -0
- package/dist/src/postconditions/index.d.cts +91 -0
- package/dist/src/postconditions/index.d.ts +91 -0
- package/dist/src/postconditions/index.js +12 -0
- package/dist/src/postconditions/index.js.map +9 -0
- package/dist/src/pox/index.cjs +860 -0
- package/dist/src/pox/index.cjs.map +15 -0
- package/dist/src/pox/index.d.cts +244 -0
- package/dist/src/pox/index.d.ts +244 -0
- package/dist/src/pox/index.js +877 -0
- package/dist/src/pox/index.js.map +15 -0
- package/dist/src/stackingdao/index.cjs +300 -0
- package/dist/src/stackingdao/index.cjs.map +13 -0
- package/dist/src/stackingdao/index.d.cts +179 -0
- package/dist/src/stackingdao/index.d.ts +179 -0
- package/dist/src/stackingdao/index.js +318 -0
- package/dist/src/stackingdao/index.js.map +13 -0
- package/dist/src/subscriptions/index.cjs +14 -0
- package/dist/src/subscriptions/index.cjs.map +9 -0
- package/dist/src/subscriptions/index.d.cts +250 -0
- package/dist/src/subscriptions/index.d.ts +250 -0
- package/dist/src/subscriptions/index.js +21 -0
- package/dist/src/subscriptions/index.js.map +9 -0
- package/dist/src/transactions/index.cjs +50 -0
- package/dist/src/transactions/index.cjs.map +9 -0
- package/dist/src/transactions/index.d.cts +412 -0
- package/dist/src/transactions/index.d.ts +412 -0
- package/dist/src/transactions/index.js +101 -0
- package/dist/src/transactions/index.js.map +9 -0
- package/dist/src/utils/index.cjs +168 -0
- package/dist/src/utils/index.cjs.map +11 -0
- package/dist/src/utils/index.d.cts +140 -0
- package/dist/src/utils/index.d.ts +140 -0
- package/dist/src/utils/index.js +222 -0
- package/dist/src/utils/index.js.map +11 -0
- package/package.json +105 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
// src/clarity/abi/standards.ts
|
|
2
|
+
var SIP010_ABI = {
|
|
3
|
+
functions: [
|
|
4
|
+
{
|
|
5
|
+
name: "transfer",
|
|
6
|
+
access: "public",
|
|
7
|
+
args: [
|
|
8
|
+
{ name: "amount", type: "uint128" },
|
|
9
|
+
{ name: "sender", type: "principal" },
|
|
10
|
+
{ name: "recipient", type: "principal" },
|
|
11
|
+
{ name: "memo", type: { optional: { buff: { length: 34 } } } }
|
|
12
|
+
],
|
|
13
|
+
outputs: { response: { ok: "bool", error: "uint128" } }
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "get-balance",
|
|
17
|
+
access: "read-only",
|
|
18
|
+
args: [{ name: "account", type: "principal" }],
|
|
19
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "get-total-supply",
|
|
23
|
+
access: "read-only",
|
|
24
|
+
args: [],
|
|
25
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "get-name",
|
|
29
|
+
access: "read-only",
|
|
30
|
+
args: [],
|
|
31
|
+
outputs: {
|
|
32
|
+
response: {
|
|
33
|
+
ok: { "string-ascii": { length: 32 } },
|
|
34
|
+
error: "uint128"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "get-symbol",
|
|
40
|
+
access: "read-only",
|
|
41
|
+
args: [],
|
|
42
|
+
outputs: {
|
|
43
|
+
response: {
|
|
44
|
+
ok: { "string-ascii": { length: 10 } },
|
|
45
|
+
error: "uint128"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "get-decimals",
|
|
51
|
+
access: "read-only",
|
|
52
|
+
args: [],
|
|
53
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "get-token-uri",
|
|
57
|
+
access: "read-only",
|
|
58
|
+
args: [],
|
|
59
|
+
outputs: {
|
|
60
|
+
response: {
|
|
61
|
+
ok: { optional: { "string-utf8": { length: 256 } } },
|
|
62
|
+
error: "uint128"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
fungible_tokens: [{ name: "token" }]
|
|
68
|
+
};
|
|
69
|
+
var SIP009_ABI = {
|
|
70
|
+
functions: [
|
|
71
|
+
{
|
|
72
|
+
name: "transfer",
|
|
73
|
+
access: "public",
|
|
74
|
+
args: [
|
|
75
|
+
{ name: "id", type: "uint128" },
|
|
76
|
+
{ name: "sender", type: "principal" },
|
|
77
|
+
{ name: "recipient", type: "principal" }
|
|
78
|
+
],
|
|
79
|
+
outputs: { response: { ok: "bool", error: "uint128" } }
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "get-owner",
|
|
83
|
+
access: "read-only",
|
|
84
|
+
args: [{ name: "id", type: "uint128" }],
|
|
85
|
+
outputs: { response: { ok: { optional: "principal" }, error: "uint128" } }
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "get-last-token-id",
|
|
89
|
+
access: "read-only",
|
|
90
|
+
args: [],
|
|
91
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "get-token-uri",
|
|
95
|
+
access: "read-only",
|
|
96
|
+
args: [{ name: "id", type: "uint128" }],
|
|
97
|
+
outputs: {
|
|
98
|
+
response: {
|
|
99
|
+
ok: { optional: { "string-utf8": { length: 256 } } },
|
|
100
|
+
error: "uint128"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
non_fungible_tokens: [{ name: "nft", type: "uint128" }]
|
|
106
|
+
};
|
|
107
|
+
var SIP013_ABI = {
|
|
108
|
+
functions: [
|
|
109
|
+
{
|
|
110
|
+
name: "transfer",
|
|
111
|
+
access: "public",
|
|
112
|
+
args: [
|
|
113
|
+
{ name: "token-id", type: "uint128" },
|
|
114
|
+
{ name: "amount", type: "uint128" },
|
|
115
|
+
{ name: "sender", type: "principal" },
|
|
116
|
+
{ name: "recipient", type: "principal" }
|
|
117
|
+
],
|
|
118
|
+
outputs: { response: { ok: "bool", error: "uint128" } }
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "transfer-memo",
|
|
122
|
+
access: "public",
|
|
123
|
+
args: [
|
|
124
|
+
{ name: "token-id", type: "uint128" },
|
|
125
|
+
{ name: "amount", type: "uint128" },
|
|
126
|
+
{ name: "sender", type: "principal" },
|
|
127
|
+
{ name: "recipient", type: "principal" },
|
|
128
|
+
{ name: "memo", type: { buff: { length: 34 } } }
|
|
129
|
+
],
|
|
130
|
+
outputs: { response: { ok: "bool", error: "uint128" } }
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "transfer-many",
|
|
134
|
+
access: "public",
|
|
135
|
+
args: [
|
|
136
|
+
{
|
|
137
|
+
name: "transfers",
|
|
138
|
+
type: {
|
|
139
|
+
list: {
|
|
140
|
+
type: {
|
|
141
|
+
tuple: [
|
|
142
|
+
{ name: "token-id", type: "uint128" },
|
|
143
|
+
{ name: "amount", type: "uint128" },
|
|
144
|
+
{ name: "sender", type: "principal" },
|
|
145
|
+
{ name: "recipient", type: "principal" }
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
length: 200
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
outputs: { response: { ok: "bool", error: "uint128" } }
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "transfer-many-memo",
|
|
157
|
+
access: "public",
|
|
158
|
+
args: [
|
|
159
|
+
{
|
|
160
|
+
name: "transfers",
|
|
161
|
+
type: {
|
|
162
|
+
list: {
|
|
163
|
+
type: {
|
|
164
|
+
tuple: [
|
|
165
|
+
{ name: "token-id", type: "uint128" },
|
|
166
|
+
{ name: "amount", type: "uint128" },
|
|
167
|
+
{ name: "sender", type: "principal" },
|
|
168
|
+
{ name: "recipient", type: "principal" },
|
|
169
|
+
{ name: "memo", type: { buff: { length: 34 } } }
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
length: 200
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
outputs: { response: { ok: "bool", error: "uint128" } }
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "get-balance",
|
|
181
|
+
access: "read-only",
|
|
182
|
+
args: [
|
|
183
|
+
{ name: "token-id", type: "uint128" },
|
|
184
|
+
{ name: "account", type: "principal" }
|
|
185
|
+
],
|
|
186
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "get-overall-balance",
|
|
190
|
+
access: "read-only",
|
|
191
|
+
args: [{ name: "account", type: "principal" }],
|
|
192
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "get-total-supply",
|
|
196
|
+
access: "read-only",
|
|
197
|
+
args: [{ name: "token-id", type: "uint128" }],
|
|
198
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "get-overall-supply",
|
|
202
|
+
access: "read-only",
|
|
203
|
+
args: [],
|
|
204
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "get-decimals",
|
|
208
|
+
access: "read-only",
|
|
209
|
+
args: [{ name: "token-id", type: "uint128" }],
|
|
210
|
+
outputs: { response: { ok: "uint128", error: "uint128" } }
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "get-token-uri",
|
|
214
|
+
access: "read-only",
|
|
215
|
+
args: [{ name: "token-id", type: "uint128" }],
|
|
216
|
+
outputs: {
|
|
217
|
+
response: {
|
|
218
|
+
ok: { optional: { "string-utf8": { length: 256 } } },
|
|
219
|
+
error: "uint128"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
fungible_tokens: [],
|
|
225
|
+
non_fungible_tokens: []
|
|
226
|
+
};
|
|
227
|
+
var sip010Abi = SIP010_ABI;
|
|
228
|
+
var sip009Abi = SIP009_ABI;
|
|
229
|
+
var sip013Abi = SIP013_ABI;
|
|
230
|
+
|
|
231
|
+
//# debugId=AB6C51E03AD7EE0164756E2164756E21
|
|
232
|
+
//# sourceMappingURL=stacks-qvg7c24g.cjs.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/clarity/abi/standards.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { AbiContract } from \"./contract.ts\";\n\nexport const SIP010_ABI = {\n functions: [\n {\n name: \"transfer\",\n access: \"public\",\n args: [\n { name: \"amount\", type: \"uint128\" },\n { name: \"sender\", type: \"principal\" },\n { name: \"recipient\", type: \"principal\" },\n { name: \"memo\", type: { optional: { buff: { length: 34 } } } },\n ],\n outputs: { response: { ok: \"bool\", error: \"uint128\" } },\n },\n {\n name: \"get-balance\",\n access: \"read-only\",\n args: [{ name: \"account\", type: \"principal\" }],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-total-supply\",\n access: \"read-only\",\n args: [],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-name\",\n access: \"read-only\",\n args: [],\n outputs: {\n response: {\n ok: { \"string-ascii\": { length: 32 } },\n error: \"uint128\",\n },\n },\n },\n {\n name: \"get-symbol\",\n access: \"read-only\",\n args: [],\n outputs: {\n response: {\n ok: { \"string-ascii\": { length: 10 } },\n error: \"uint128\",\n },\n },\n },\n {\n name: \"get-decimals\",\n access: \"read-only\",\n args: [],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-token-uri\",\n access: \"read-only\",\n args: [],\n outputs: {\n response: {\n ok: { optional: { \"string-utf8\": { length: 256 } } },\n error: \"uint128\",\n },\n },\n },\n ],\n fungible_tokens: [{ name: \"token\" }],\n} as const satisfies AbiContract;\n\nexport const SIP009_ABI = {\n functions: [\n {\n name: \"transfer\",\n access: \"public\",\n args: [\n { name: \"id\", type: \"uint128\" },\n { name: \"sender\", type: \"principal\" },\n { name: \"recipient\", type: \"principal\" },\n ],\n outputs: { response: { ok: \"bool\", error: \"uint128\" } },\n },\n {\n name: \"get-owner\",\n access: \"read-only\",\n args: [{ name: \"id\", type: \"uint128\" }],\n outputs: { response: { ok: { optional: \"principal\" }, error: \"uint128\" } },\n },\n {\n name: \"get-last-token-id\",\n access: \"read-only\",\n args: [],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-token-uri\",\n access: \"read-only\",\n args: [{ name: \"id\", type: \"uint128\" }],\n outputs: {\n response: {\n ok: { optional: { \"string-utf8\": { length: 256 } } },\n error: \"uint128\",\n },\n },\n },\n ],\n non_fungible_tokens: [{ name: \"nft\", type: \"uint128\" }],\n} as const satisfies AbiContract;\n\nexport const SIP013_ABI = {\n functions: [\n {\n name: \"transfer\",\n access: \"public\",\n args: [\n { name: \"token-id\", type: \"uint128\" },\n { name: \"amount\", type: \"uint128\" },\n { name: \"sender\", type: \"principal\" },\n { name: \"recipient\", type: \"principal\" },\n ],\n outputs: { response: { ok: \"bool\", error: \"uint128\" } },\n },\n {\n name: \"transfer-memo\",\n access: \"public\",\n args: [\n { name: \"token-id\", type: \"uint128\" },\n { name: \"amount\", type: \"uint128\" },\n { name: \"sender\", type: \"principal\" },\n { name: \"recipient\", type: \"principal\" },\n { name: \"memo\", type: { buff: { length: 34 } } },\n ],\n outputs: { response: { ok: \"bool\", error: \"uint128\" } },\n },\n {\n name: \"transfer-many\",\n access: \"public\",\n args: [\n {\n name: \"transfers\",\n type: {\n list: {\n type: {\n tuple: [\n { name: \"token-id\", type: \"uint128\" },\n { name: \"amount\", type: \"uint128\" },\n { name: \"sender\", type: \"principal\" },\n { name: \"recipient\", type: \"principal\" },\n ],\n },\n length: 200,\n },\n },\n },\n ],\n outputs: { response: { ok: \"bool\", error: \"uint128\" } },\n },\n {\n name: \"transfer-many-memo\",\n access: \"public\",\n args: [\n {\n name: \"transfers\",\n type: {\n list: {\n type: {\n tuple: [\n { name: \"token-id\", type: \"uint128\" },\n { name: \"amount\", type: \"uint128\" },\n { name: \"sender\", type: \"principal\" },\n { name: \"recipient\", type: \"principal\" },\n { name: \"memo\", type: { buff: { length: 34 } } },\n ],\n },\n length: 200,\n },\n },\n },\n ],\n outputs: { response: { ok: \"bool\", error: \"uint128\" } },\n },\n {\n name: \"get-balance\",\n access: \"read-only\",\n args: [\n { name: \"token-id\", type: \"uint128\" },\n { name: \"account\", type: \"principal\" },\n ],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-overall-balance\",\n access: \"read-only\",\n args: [{ name: \"account\", type: \"principal\" }],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-total-supply\",\n access: \"read-only\",\n args: [{ name: \"token-id\", type: \"uint128\" }],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-overall-supply\",\n access: \"read-only\",\n args: [],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-decimals\",\n access: \"read-only\",\n args: [{ name: \"token-id\", type: \"uint128\" }],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n {\n name: \"get-token-uri\",\n access: \"read-only\",\n args: [{ name: \"token-id\", type: \"uint128\" }],\n outputs: {\n response: {\n ok: { optional: { \"string-utf8\": { length: 256 } } },\n error: \"uint128\",\n },\n },\n },\n ],\n fungible_tokens: [],\n non_fungible_tokens: [],\n} as const satisfies AbiContract;\n\n// Camel-case aliases for better DX\nexport const sip010Abi = SIP010_ABI;\nexport const sip009Abi = SIP009_ABI;\nexport const sip013Abi = SIP013_ABI;\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AAEO,IAAM,aAAa;AAAA,EACxB,WAAW;AAAA,IACT;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,MAAM;AAAA,QACJ,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,QAClC,EAAE,MAAM,UAAU,MAA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;AAAA,MACR,MAAM,CAAC;AAAA,MACP,SAAS,EAAE,UAAU,EAAE,IAAI,WAAW,OAAO,UAAU,EAAE;AAAA,IAC3D;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,MAAM,CAAC,EAAE,MAAM,YAAY,MAAM,UAAU,CAAC;AAAA,MAC5C,SAAS,EAAE,UAAU,EAAE,IAAI,WAAW,OAAO,UAAU,EAAE;AAAA,IAC3D;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,MAAM,CAAC,EAAE,MAAM,YAAY,MAAM,UAAU,CAAC;AAAA,MAC5C,SAAS;AAAA,QACP,UAAU;AAAA,UACR,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,IAAI,EAAE,EAAE;AAAA,UACnD,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB,CAAC;AAAA,EAClB,qBAAqB,CAAC;AACxB;AAGO,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,YAAY;",
|
|
8
|
+
"debugId": "AB6C51E03AD7EE0164756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// src/utils/encoding.ts
|
|
2
|
+
var hexes = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
3
|
+
function bytesToHex(bytes) {
|
|
4
|
+
let hex = "";
|
|
5
|
+
for (const b of bytes) {
|
|
6
|
+
hex += hexes[b];
|
|
7
|
+
}
|
|
8
|
+
return hex;
|
|
9
|
+
}
|
|
10
|
+
function hexToBytes(hex) {
|
|
11
|
+
hex = without0x(hex);
|
|
12
|
+
if (hex.length % 2)
|
|
13
|
+
hex = `0${hex}`;
|
|
14
|
+
const array = new Uint8Array(hex.length / 2);
|
|
15
|
+
for (let i = 0;i < array.length; i++) {
|
|
16
|
+
const j = i * 2;
|
|
17
|
+
const byte = Number.parseInt(hex.slice(j, j + 2), 16);
|
|
18
|
+
if (Number.isNaN(byte) || byte < 0)
|
|
19
|
+
throw new Error("Invalid byte sequence");
|
|
20
|
+
array[i] = byte;
|
|
21
|
+
}
|
|
22
|
+
return array;
|
|
23
|
+
}
|
|
24
|
+
function with0x(value) {
|
|
25
|
+
return /^0x/i.test(value) ? value : `0x${value}`;
|
|
26
|
+
}
|
|
27
|
+
function without0x(value) {
|
|
28
|
+
return /^0x/i.test(value) ? value.slice(2) : value;
|
|
29
|
+
}
|
|
30
|
+
function utf8ToBytes(str) {
|
|
31
|
+
return new TextEncoder().encode(str);
|
|
32
|
+
}
|
|
33
|
+
function bytesToUtf8(bytes) {
|
|
34
|
+
return new TextDecoder().decode(bytes);
|
|
35
|
+
}
|
|
36
|
+
function asciiToBytes(str) {
|
|
37
|
+
const bytes = new Uint8Array(str.length);
|
|
38
|
+
for (let i = 0;i < str.length; i++) {
|
|
39
|
+
bytes[i] = str.charCodeAt(i) & 255;
|
|
40
|
+
}
|
|
41
|
+
return bytes;
|
|
42
|
+
}
|
|
43
|
+
function bytesToAscii(bytes) {
|
|
44
|
+
return String.fromCharCode(...bytes);
|
|
45
|
+
}
|
|
46
|
+
function concatBytes(...arrays) {
|
|
47
|
+
if (arrays.length === 1)
|
|
48
|
+
return arrays[0];
|
|
49
|
+
const length = arrays.reduce((a, arr) => a + arr.length, 0);
|
|
50
|
+
const result = new Uint8Array(length);
|
|
51
|
+
let pad = 0;
|
|
52
|
+
for (const arr of arrays) {
|
|
53
|
+
result.set(arr, pad);
|
|
54
|
+
pad += arr.length;
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
function intToBigInt(value) {
|
|
59
|
+
if (typeof value === "bigint")
|
|
60
|
+
return value;
|
|
61
|
+
if (typeof value === "string")
|
|
62
|
+
return BigInt(value);
|
|
63
|
+
if (typeof value === "number") {
|
|
64
|
+
if (!Number.isInteger(value))
|
|
65
|
+
throw new RangeError("Values of type 'number' must be an integer.");
|
|
66
|
+
if (value > Number.MAX_SAFE_INTEGER)
|
|
67
|
+
throw new RangeError(`Values of type 'number' must be <= ${Number.MAX_SAFE_INTEGER}. Use BigInt instead.`);
|
|
68
|
+
return BigInt(value);
|
|
69
|
+
}
|
|
70
|
+
if (value instanceof Uint8Array)
|
|
71
|
+
return BigInt(`0x${bytesToHex(value)}`);
|
|
72
|
+
throw new TypeError("Must be a number, bigint, string, or Uint8Array.");
|
|
73
|
+
}
|
|
74
|
+
function intToBytes(value, byteLength) {
|
|
75
|
+
return bigIntToBytes(intToBigInt(value), byteLength);
|
|
76
|
+
}
|
|
77
|
+
function bigIntToBytes(value, length = 16) {
|
|
78
|
+
const hex = value.toString(16).padStart(length * 2, "0");
|
|
79
|
+
return hexToBytes(hex);
|
|
80
|
+
}
|
|
81
|
+
function intToHex(integer, byteLength = 8) {
|
|
82
|
+
const value = typeof integer === "bigint" ? integer : intToBigInt(integer);
|
|
83
|
+
return value.toString(16).padStart(byteLength * 2, "0");
|
|
84
|
+
}
|
|
85
|
+
function toTwos(value, width) {
|
|
86
|
+
const limit = BigInt(1) << width - BigInt(1);
|
|
87
|
+
if (value < -limit || value > limit - BigInt(1)) {
|
|
88
|
+
throw new Error(`Unable to represent integer in width: ${width}`);
|
|
89
|
+
}
|
|
90
|
+
if (value >= BigInt(0))
|
|
91
|
+
return value;
|
|
92
|
+
return value + (BigInt(1) << width);
|
|
93
|
+
}
|
|
94
|
+
function fromTwos(value, width) {
|
|
95
|
+
if (value & BigInt(1) << width - BigInt(1)) {
|
|
96
|
+
return value - (BigInt(1) << width);
|
|
97
|
+
}
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
function bytesToTwosBigInt(bytes) {
|
|
101
|
+
return fromTwos(BigInt(`0x${bytesToHex(bytes)}`), BigInt(bytes.byteLength * 8));
|
|
102
|
+
}
|
|
103
|
+
function writeUInt32BE(value) {
|
|
104
|
+
const buf = new Uint8Array(4);
|
|
105
|
+
buf[0] = value >>> 24 & 255;
|
|
106
|
+
buf[1] = value >>> 16 & 255;
|
|
107
|
+
buf[2] = value >>> 8 & 255;
|
|
108
|
+
buf[3] = value & 255;
|
|
109
|
+
return buf;
|
|
110
|
+
}
|
|
111
|
+
function readUInt32BE(bytes, offset = 0) {
|
|
112
|
+
return (bytes[offset] << 24 | bytes[offset + 1] << 16 | bytes[offset + 2] << 8 | bytes[offset + 3]) >>> 0;
|
|
113
|
+
}
|
|
114
|
+
function writeUInt16BE(value) {
|
|
115
|
+
const buf = new Uint8Array(2);
|
|
116
|
+
buf[0] = value >>> 8 & 255;
|
|
117
|
+
buf[1] = value & 255;
|
|
118
|
+
return buf;
|
|
119
|
+
}
|
|
120
|
+
function readUInt16BE(bytes, offset = 0) {
|
|
121
|
+
return (bytes[offset] << 8 | bytes[offset + 1]) >>> 0;
|
|
122
|
+
}
|
|
123
|
+
function writeUInt8(value) {
|
|
124
|
+
return new Uint8Array([value & 255]);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// src/utils/c32.ts
|
|
128
|
+
var import_sha2 = require("@noble/hashes/sha2.js");
|
|
129
|
+
var C32 = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
130
|
+
var HEX = "0123456789abcdef";
|
|
131
|
+
function c32normalize(input) {
|
|
132
|
+
return input.toUpperCase().replace(/O/g, "0").replace(/L|I/g, "1");
|
|
133
|
+
}
|
|
134
|
+
function c32encode(inputHex) {
|
|
135
|
+
if (inputHex.length % 2 !== 0)
|
|
136
|
+
inputHex = `0${inputHex}`;
|
|
137
|
+
inputHex = inputHex.toLowerCase();
|
|
138
|
+
const res = [];
|
|
139
|
+
let carry = 0;
|
|
140
|
+
for (let i = inputHex.length - 1;i >= 0; i--) {
|
|
141
|
+
if (carry < 4) {
|
|
142
|
+
const currentCode = HEX.indexOf(inputHex[i]) >> carry;
|
|
143
|
+
const nextCode = i !== 0 ? HEX.indexOf(inputHex[i - 1]) : 0;
|
|
144
|
+
const nextBits = 1 + carry;
|
|
145
|
+
const nextLowBits = nextCode % (1 << nextBits) << 5 - nextBits;
|
|
146
|
+
res.unshift(C32[currentCode + nextLowBits]);
|
|
147
|
+
carry = nextBits;
|
|
148
|
+
} else {
|
|
149
|
+
carry = 0;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
let leadingZeros = 0;
|
|
153
|
+
while (leadingZeros < res.length && res[leadingZeros] === "0")
|
|
154
|
+
leadingZeros++;
|
|
155
|
+
const stripped = res.slice(leadingZeros);
|
|
156
|
+
const bytes = hexToBytes(inputHex);
|
|
157
|
+
let zeroBytesCount = 0;
|
|
158
|
+
while (zeroBytesCount < bytes.length && bytes[zeroBytesCount] === 0)
|
|
159
|
+
zeroBytesCount++;
|
|
160
|
+
const prefix = Array(zeroBytesCount).fill(C32[0]);
|
|
161
|
+
return [...prefix, ...stripped].join("");
|
|
162
|
+
}
|
|
163
|
+
function c32decode(c32input) {
|
|
164
|
+
c32input = c32normalize(c32input);
|
|
165
|
+
if (!c32input.match(`^[${C32}]*$`))
|
|
166
|
+
throw new Error("Not a c32-encoded string");
|
|
167
|
+
const zeroPrefix = c32input.match(`^${C32[0]}*`);
|
|
168
|
+
const numLeadingZeroBytes = zeroPrefix ? zeroPrefix[0].length : 0;
|
|
169
|
+
const res = [];
|
|
170
|
+
let carry = 0;
|
|
171
|
+
let carryBits = 0;
|
|
172
|
+
for (let i = c32input.length - 1;i >= 0; i--) {
|
|
173
|
+
if (carryBits === 4) {
|
|
174
|
+
res.unshift(HEX[carry]);
|
|
175
|
+
carryBits = 0;
|
|
176
|
+
carry = 0;
|
|
177
|
+
}
|
|
178
|
+
const currentValue = (C32.indexOf(c32input[i]) << carryBits) + carry;
|
|
179
|
+
res.unshift(HEX[currentValue % 16]);
|
|
180
|
+
carryBits += 1;
|
|
181
|
+
carry = currentValue >> 4;
|
|
182
|
+
if (carry > 1 << carryBits)
|
|
183
|
+
throw new Error("Panic error in c32 decoding");
|
|
184
|
+
}
|
|
185
|
+
res.unshift(HEX[carry]);
|
|
186
|
+
if (res.length % 2 === 1)
|
|
187
|
+
res.unshift("0");
|
|
188
|
+
let hexLeadingZeros = 0;
|
|
189
|
+
while (hexLeadingZeros < res.length && res[hexLeadingZeros] === "0")
|
|
190
|
+
hexLeadingZeros++;
|
|
191
|
+
let hexStr = res.slice(hexLeadingZeros - hexLeadingZeros % 2).join("");
|
|
192
|
+
for (let i = 0;i < numLeadingZeroBytes; i++)
|
|
193
|
+
hexStr = `00${hexStr}`;
|
|
194
|
+
return hexStr;
|
|
195
|
+
}
|
|
196
|
+
function c32checksum(dataHex) {
|
|
197
|
+
return bytesToHex(import_sha2.sha256(import_sha2.sha256(hexToBytes(dataHex))).slice(0, 4));
|
|
198
|
+
}
|
|
199
|
+
function c32checkEncode(version, data) {
|
|
200
|
+
if (version < 0 || version >= 32)
|
|
201
|
+
throw new Error("Invalid version (must be between 0 and 31)");
|
|
202
|
+
if (!data.match(/^[0-9a-fA-F]*$/))
|
|
203
|
+
throw new Error("Invalid data (not a hex string)");
|
|
204
|
+
data = data.toLowerCase();
|
|
205
|
+
if (data.length % 2 !== 0)
|
|
206
|
+
data = `0${data}`;
|
|
207
|
+
let versionHex = version.toString(16);
|
|
208
|
+
if (versionHex.length === 1)
|
|
209
|
+
versionHex = `0${versionHex}`;
|
|
210
|
+
const checksumHex = c32checksum(`${versionHex}${data}`);
|
|
211
|
+
return `${C32[version]}${c32encode(`${data}${checksumHex}`)}`;
|
|
212
|
+
}
|
|
213
|
+
function c32checkDecode(c32data) {
|
|
214
|
+
c32data = c32normalize(c32data);
|
|
215
|
+
const dataHex = c32decode(c32data.slice(1));
|
|
216
|
+
const version = C32.indexOf(c32data[0]);
|
|
217
|
+
const checksum = dataHex.slice(-8);
|
|
218
|
+
let versionHex = version.toString(16);
|
|
219
|
+
if (versionHex.length === 1)
|
|
220
|
+
versionHex = `0${versionHex}`;
|
|
221
|
+
if (c32checksum(`${versionHex}${dataHex.substring(0, dataHex.length - 8)}`) !== checksum) {
|
|
222
|
+
throw new Error("Invalid c32check string: checksum mismatch");
|
|
223
|
+
}
|
|
224
|
+
return [version, dataHex.substring(0, dataHex.length - 8)];
|
|
225
|
+
}
|
|
226
|
+
function c32address(version, hash160hex) {
|
|
227
|
+
if (!hash160hex.match(/^[0-9a-fA-F]{40}$/)) {
|
|
228
|
+
throw new Error("Invalid argument: not a hash160 hex string");
|
|
229
|
+
}
|
|
230
|
+
return `S${c32checkEncode(version, hash160hex)}`;
|
|
231
|
+
}
|
|
232
|
+
function c32addressDecode(c32addr) {
|
|
233
|
+
if (c32addr.length <= 5)
|
|
234
|
+
throw new Error("Invalid c32 address: invalid length");
|
|
235
|
+
if (c32addr[0] !== "S")
|
|
236
|
+
throw new Error('Invalid c32 address: must start with "S"');
|
|
237
|
+
return c32checkDecode(c32addr.slice(1));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
//# debugId=8867D374DFC77CCA64756E2164756E21
|
|
241
|
+
//# sourceMappingURL=stacks-r1t6g3c3.cjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utils/encoding.ts", "../src/utils/c32.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"const hexes = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, \"0\"));\n\nexport function bytesToHex(bytes: Uint8Array): string {\n let hex = \"\";\n for (const b of bytes) {\n hex += hexes[b];\n }\n return hex;\n}\n\nexport function hexToBytes(hex: string): Uint8Array {\n hex = without0x(hex);\n if (hex.length % 2) hex = `0${hex}`;\n\n const array = new Uint8Array(hex.length / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const byte = Number.parseInt(hex.slice(j, j + 2), 16);\n if (Number.isNaN(byte) || byte < 0) throw new Error(\"Invalid byte sequence\");\n array[i] = byte;\n }\n return array;\n}\n\nexport function with0x(value: string): string {\n return /^0x/i.test(value) ? value : `0x${value}`;\n}\n\nexport function without0x(value: string): string {\n return /^0x/i.test(value) ? value.slice(2) : value;\n}\n\nexport function utf8ToBytes(str: string): Uint8Array {\n return new TextEncoder().encode(str);\n}\n\nexport function bytesToUtf8(bytes: Uint8Array): string {\n return new TextDecoder().decode(bytes);\n}\n\nexport function asciiToBytes(str: string): Uint8Array {\n const bytes = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\nexport function bytesToAscii(bytes: Uint8Array): string {\n return String.fromCharCode(...bytes);\n}\n\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n if (arrays.length === 1) return arrays[0]!;\n const length = arrays.reduce((a, arr) => a + arr.length, 0);\n const result = new Uint8Array(length);\n let pad = 0;\n for (const arr of arrays) {\n result.set(arr, pad);\n pad += arr.length;\n }\n return result;\n}\n\nexport type IntegerType = number | string | bigint | Uint8Array;\n\nexport function intToBigInt(value: IntegerType): bigint {\n if (typeof value === \"bigint\") return value;\n if (typeof value === \"string\") return BigInt(value);\n if (typeof value === \"number\") {\n if (!Number.isInteger(value))\n throw new RangeError(\"Values of type 'number' must be an integer.\");\n if (value > Number.MAX_SAFE_INTEGER)\n throw new RangeError(\n `Values of type 'number' must be <= ${Number.MAX_SAFE_INTEGER}. Use BigInt instead.`\n );\n return BigInt(value);\n }\n if (value instanceof Uint8Array) return BigInt(`0x${bytesToHex(value)}`);\n throw new TypeError(\"Must be a number, bigint, string, or Uint8Array.\");\n}\n\nexport function intToBytes(value: IntegerType, byteLength: number): Uint8Array {\n return bigIntToBytes(intToBigInt(value), byteLength);\n}\n\nexport function bigIntToBytes(value: bigint, length: number = 16): Uint8Array {\n const hex = value.toString(16).padStart(length * 2, \"0\");\n return hexToBytes(hex);\n}\n\nexport function intToHex(integer: IntegerType, byteLength = 8): string {\n const value = typeof integer === \"bigint\" ? integer : intToBigInt(integer);\n return value.toString(16).padStart(byteLength * 2, \"0\");\n}\n\nexport function toTwos(value: bigint, width: bigint): bigint {\n const limit = BigInt(1) << (width - BigInt(1));\n if (value < -limit || value > limit - BigInt(1)) {\n throw new Error(`Unable to represent integer in width: ${width}`);\n }\n if (value >= BigInt(0)) return value;\n return value + (BigInt(1) << width);\n}\n\nexport function fromTwos(value: bigint, width: bigint): bigint {\n if (value & (BigInt(1) << (width - BigInt(1)))) {\n return value - (BigInt(1) << width);\n }\n return value;\n}\n\nexport function bytesToTwosBigInt(bytes: Uint8Array): bigint {\n return fromTwos(BigInt(`0x${bytesToHex(bytes)}`), BigInt(bytes.byteLength * 8));\n}\n\nexport function writeUInt32BE(value: number): Uint8Array {\n const buf = new Uint8Array(4);\n buf[0] = (value >>> 24) & 0xff;\n buf[1] = (value >>> 16) & 0xff;\n buf[2] = (value >>> 8) & 0xff;\n buf[3] = value & 0xff;\n return buf;\n}\n\nexport function readUInt32BE(bytes: Uint8Array, offset = 0): number {\n return (\n ((bytes[offset]! << 24) |\n (bytes[offset + 1]! << 16) |\n (bytes[offset + 2]! << 8) |\n bytes[offset + 3]!) >>>\n 0\n );\n}\n\nexport function writeUInt16BE(value: number): Uint8Array {\n const buf = new Uint8Array(2);\n buf[0] = (value >>> 8) & 0xff;\n buf[1] = value & 0xff;\n return buf;\n}\n\nexport function readUInt16BE(bytes: Uint8Array, offset = 0): number {\n return ((bytes[offset]! << 8) | bytes[offset + 1]!) >>> 0;\n}\n\nexport function writeUInt8(value: number): Uint8Array {\n return new Uint8Array([value & 0xff]);\n}\n",
|
|
6
|
+
"import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { bytesToHex, hexToBytes } from \"./encoding.ts\";\n\nconst C32 = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nconst HEX = \"0123456789abcdef\";\n\nfunction c32normalize(input: string): string {\n return input.toUpperCase().replace(/O/g, \"0\").replace(/L|I/g, \"1\");\n}\n\nfunction c32encode(inputHex: string): string {\n if (inputHex.length % 2 !== 0) inputHex = `0${inputHex}`;\n inputHex = inputHex.toLowerCase();\n\n const res: string[] = [];\n let carry = 0;\n for (let i = inputHex.length - 1; i >= 0; i--) {\n if (carry < 4) {\n const currentCode = HEX.indexOf(inputHex[i]!) >> carry;\n const nextCode = i !== 0 ? HEX.indexOf(inputHex[i - 1]!) : 0;\n const nextBits = 1 + carry;\n const nextLowBits = (nextCode % (1 << nextBits)) << (5 - nextBits);\n res.unshift(C32[currentCode + nextLowBits]!);\n carry = nextBits;\n } else {\n carry = 0;\n }\n }\n\n // Strip leading c32 zeros\n let leadingZeros = 0;\n while (leadingZeros < res.length && res[leadingZeros] === \"0\") leadingZeros++;\n const stripped = res.slice(leadingZeros);\n\n // Preserve leading zero bytes from hex\n const bytes = hexToBytes(inputHex);\n let zeroBytesCount = 0;\n while (zeroBytesCount < bytes.length && bytes[zeroBytesCount] === 0) zeroBytesCount++;\n const prefix = Array(zeroBytesCount).fill(C32[0]) as string[];\n\n return [...prefix, ...stripped].join(\"\");\n}\n\nfunction c32decode(c32input: string): string {\n c32input = c32normalize(c32input);\n if (!c32input.match(`^[${C32}]*$`)) throw new Error(\"Not a c32-encoded string\");\n\n const zeroPrefix = c32input.match(`^${C32[0]}*`);\n const numLeadingZeroBytes = zeroPrefix ? zeroPrefix[0]!.length : 0;\n\n const res: string[] = [];\n let carry = 0;\n let carryBits = 0;\n for (let i = c32input.length - 1; i >= 0; i--) {\n if (carryBits === 4) {\n res.unshift(HEX[carry]!);\n carryBits = 0;\n carry = 0;\n }\n const currentValue = (C32.indexOf(c32input[i]!) << carryBits) + carry;\n res.unshift(HEX[currentValue % 16]!);\n carryBits += 1;\n carry = currentValue >> 4;\n if (carry > 1 << carryBits) throw new Error(\"Panic error in c32 decoding\");\n }\n res.unshift(HEX[carry]!);\n\n if (res.length % 2 === 1) res.unshift(\"0\");\n\n // Strip leading hex zeros\n let hexLeadingZeros = 0;\n while (hexLeadingZeros < res.length && res[hexLeadingZeros] === \"0\") hexLeadingZeros++;\n let hexStr = res.slice(hexLeadingZeros - (hexLeadingZeros % 2)).join(\"\");\n\n for (let i = 0; i < numLeadingZeroBytes; i++) hexStr = `00${hexStr}`;\n\n return hexStr;\n}\n\nfunction c32checksum(dataHex: string): string {\n return bytesToHex(sha256(sha256(hexToBytes(dataHex))).slice(0, 4));\n}\n\nfunction c32checkEncode(version: number, data: string): string {\n if (version < 0 || version >= 32) throw new Error(\"Invalid version (must be between 0 and 31)\");\n if (!data.match(/^[0-9a-fA-F]*$/)) throw new Error(\"Invalid data (not a hex string)\");\n\n data = data.toLowerCase();\n if (data.length % 2 !== 0) data = `0${data}`;\n\n let versionHex = version.toString(16);\n if (versionHex.length === 1) versionHex = `0${versionHex}`;\n\n const checksumHex = c32checksum(`${versionHex}${data}`);\n return `${C32[version]}${c32encode(`${data}${checksumHex}`)}`;\n}\n\nfunction c32checkDecode(c32data: string): [number, string] {\n c32data = c32normalize(c32data);\n const dataHex = c32decode(c32data.slice(1));\n const version = C32.indexOf(c32data[0]!);\n const checksum = dataHex.slice(-8);\n\n let versionHex = version.toString(16);\n if (versionHex.length === 1) versionHex = `0${versionHex}`;\n\n if (c32checksum(`${versionHex}${dataHex.substring(0, dataHex.length - 8)}`) !== checksum) {\n throw new Error(\"Invalid c32check string: checksum mismatch\");\n }\n\n return [version, dataHex.substring(0, dataHex.length - 8)];\n}\n\nexport function c32address(version: number, hash160hex: string): string {\n if (!hash160hex.match(/^[0-9a-fA-F]{40}$/)) {\n throw new Error(\"Invalid argument: not a hash160 hex string\");\n }\n return `S${c32checkEncode(version, hash160hex)}`;\n}\n\nexport function c32addressDecode(c32addr: string): [number, string] {\n if (c32addr.length <= 5) throw new Error(\"Invalid c32 address: invalid length\");\n if (c32addr[0] !== \"S\") throw new Error('Invalid c32 address: must start with \"S\"');\n return c32checkDecode(c32addr.slice(1));\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";AAAA,IAAM,QAAQ,MAAM,KAAK,EAAE,QAAQ,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE,EAAE,SA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