multicoyn-sdk 0.1.8 → 0.1.9
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 +212 -66
- package/dist/{ccip-BamGZKKI.js → ccip-DIsMfc62.js} +1 -1
- package/dist/{ccip-BBBr8vlp.cjs → ccip-DpYR9KrU.cjs} +1 -1
- package/dist/components/PaymentModal.d.ts +1 -1
- package/dist/{index-C1S0YnyW.js → index-BqTi7WKI.js} +1102 -1090
- package/dist/{index-Daw_yCWZ.cjs → index-DqlG-QlC.cjs} +8 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/multicoyn-sdk.css +1 -1
- package/package.json +1 -1
|
@@ -5,356 +5,6 @@ import { createPortal as Tr } from "react-dom";
|
|
|
5
5
|
import { parseUnits as vr, maxUint256 as Er, formatUnits as Ce, defineChain as Pr } from "viem";
|
|
6
6
|
import { QueryClientProvider as Sr, QueryClient as Ar } from "@tanstack/react-query";
|
|
7
7
|
import { getDefaultConfig as $r, RainbowKitProvider as Cr } from "@rainbow-me/rainbowkit";
|
|
8
|
-
function Ir({ size: e = 26, className: t = "" }) {
|
|
9
|
-
return /* @__PURE__ */ u(
|
|
10
|
-
"svg",
|
|
11
|
-
{
|
|
12
|
-
width: e,
|
|
13
|
-
height: e,
|
|
14
|
-
viewBox: "0 0 26 26",
|
|
15
|
-
fill: "none",
|
|
16
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
-
className: t,
|
|
18
|
-
children: /* @__PURE__ */ u(
|
|
19
|
-
"path",
|
|
20
|
-
{
|
|
21
|
-
d: "M6.5 6.5L19.5 19.5M6.5 19.5L19.5 6.5",
|
|
22
|
-
stroke: "currentColor",
|
|
23
|
-
strokeWidth: "2.5",
|
|
24
|
-
strokeLinecap: "round",
|
|
25
|
-
strokeLinejoin: "round"
|
|
26
|
-
}
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
function kr({ size: e = 16, className: t = "" }) {
|
|
32
|
-
return /* @__PURE__ */ w(
|
|
33
|
-
"svg",
|
|
34
|
-
{
|
|
35
|
-
width: e,
|
|
36
|
-
height: e,
|
|
37
|
-
viewBox: "0 0 16 16",
|
|
38
|
-
fill: "none",
|
|
39
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
-
className: t,
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ u(
|
|
43
|
-
"path",
|
|
44
|
-
{
|
|
45
|
-
d: "M7.33333 12.6667C10.2789 12.6667 12.6667 10.2789 12.6667 7.33333C12.6667 4.38781 10.2789 2 7.33333 2C4.38781 2 2 4.38781 2 7.33333C2 10.2789 4.38781 12.6667 7.33333 12.6667Z",
|
|
46
|
-
stroke: "currentColor",
|
|
47
|
-
strokeWidth: "1.5",
|
|
48
|
-
strokeLinecap: "round",
|
|
49
|
-
strokeLinejoin: "round"
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
/* @__PURE__ */ u(
|
|
53
|
-
"path",
|
|
54
|
-
{
|
|
55
|
-
d: "M14 14L11.1 11.1",
|
|
56
|
-
stroke: "currentColor",
|
|
57
|
-
strokeWidth: "1.5",
|
|
58
|
-
strokeLinecap: "round",
|
|
59
|
-
strokeLinejoin: "round"
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
function Nr({ size: e = 16, className: t = "" }) {
|
|
67
|
-
return /* @__PURE__ */ w(
|
|
68
|
-
"svg",
|
|
69
|
-
{
|
|
70
|
-
width: e,
|
|
71
|
-
height: e,
|
|
72
|
-
viewBox: "0 0 16 16",
|
|
73
|
-
fill: "none",
|
|
74
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
75
|
-
className: t,
|
|
76
|
-
children: [
|
|
77
|
-
/* @__PURE__ */ u(
|
|
78
|
-
"path",
|
|
79
|
-
{
|
|
80
|
-
d: "M8 14.6667C11.6819 14.6667 14.6667 11.6819 14.6667 8C14.6667 4.3181 11.6819 1.33333 8 1.33333C4.3181 1.33333 1.33333 4.3181 1.33333 8C1.33333 11.6819 4.3181 14.6667 8 14.6667Z",
|
|
81
|
-
stroke: "currentColor",
|
|
82
|
-
strokeWidth: "1.5",
|
|
83
|
-
strokeLinecap: "round",
|
|
84
|
-
strokeLinejoin: "round"
|
|
85
|
-
}
|
|
86
|
-
),
|
|
87
|
-
/* @__PURE__ */ u(
|
|
88
|
-
"path",
|
|
89
|
-
{
|
|
90
|
-
d: "M8 10.6667V8",
|
|
91
|
-
stroke: "currentColor",
|
|
92
|
-
strokeWidth: "1.5",
|
|
93
|
-
strokeLinecap: "round",
|
|
94
|
-
strokeLinejoin: "round"
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ u(
|
|
98
|
-
"path",
|
|
99
|
-
{
|
|
100
|
-
d: "M8 5.33333H8.00667",
|
|
101
|
-
stroke: "currentColor",
|
|
102
|
-
strokeWidth: "1.5",
|
|
103
|
-
strokeLinecap: "round",
|
|
104
|
-
strokeLinejoin: "round"
|
|
105
|
-
}
|
|
106
|
-
)
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
function Rr({
|
|
112
|
-
size: e = 134,
|
|
113
|
-
className: t = ""
|
|
114
|
-
}) {
|
|
115
|
-
return /* @__PURE__ */ w(
|
|
116
|
-
"svg",
|
|
117
|
-
{
|
|
118
|
-
width: e,
|
|
119
|
-
height: e,
|
|
120
|
-
viewBox: "0 0 134 132",
|
|
121
|
-
fill: "none",
|
|
122
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
123
|
-
className: t,
|
|
124
|
-
children: [
|
|
125
|
-
/* @__PURE__ */ u("circle", { cx: "67", cy: "66", r: "55", fill: "#5EEAD4", fillOpacity: "0.2" }),
|
|
126
|
-
/* @__PURE__ */ u("circle", { cx: "67", cy: "66", r: "45", fill: "#5EEAD4", fillOpacity: "0.3" }),
|
|
127
|
-
/* @__PURE__ */ u("rect", { x: "35", y: "30", width: "45", height: "72", rx: "4", fill: "#14B8A6" }),
|
|
128
|
-
/* @__PURE__ */ u("rect", { x: "38", y: "35", width: "39", height: "55", rx: "2", fill: "#0D9488" }),
|
|
129
|
-
/* @__PURE__ */ w("g", { className: "animate-pulse", children: [
|
|
130
|
-
/* @__PURE__ */ u("rect", { x: "55", y: "50", width: "50", height: "32", rx: "3", fill: "#1E293B" }),
|
|
131
|
-
/* @__PURE__ */ u("rect", { x: "60", y: "56", width: "20", height: "3", rx: "1", fill: "#475569" }),
|
|
132
|
-
/* @__PURE__ */ u("rect", { x: "60", y: "62", width: "30", height: "2", rx: "1", fill: "#475569" }),
|
|
133
|
-
/* @__PURE__ */ u("rect", { x: "60", y: "68", width: "15", height: "2", rx: "1", fill: "#475569" })
|
|
134
|
-
] }),
|
|
135
|
-
/* @__PURE__ */ u("ellipse", { cx: "95", cy: "85", rx: "12", ry: "8", fill: "#FCD9BD" }),
|
|
136
|
-
/* @__PURE__ */ u("rect", { x: "88", y: "78", width: "8", height: "20", rx: "4", fill: "#FCD9BD" }),
|
|
137
|
-
/* @__PURE__ */ u("circle", { cx: "20", cy: "25", r: "8", fill: "#FCD34D" }),
|
|
138
|
-
/* @__PURE__ */ u("text", { x: "20", y: "29", textAnchor: "middle", fontSize: "10", fill: "#92400E", children: "$" }),
|
|
139
|
-
/* @__PURE__ */ u("circle", { cx: "115", cy: "35", r: "6", fill: "#FCD34D" }),
|
|
140
|
-
/* @__PURE__ */ u("text", { x: "115", y: "38", textAnchor: "middle", fontSize: "8", fill: "#92400E", children: "$" }),
|
|
141
|
-
/* @__PURE__ */ u("circle", { cx: "110", cy: "20", r: "5", fill: "#FCD34D", fillOpacity: "0.6" })
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
function Mr({ size: e = 95, className: t = "" }) {
|
|
147
|
-
return /* @__PURE__ */ w(
|
|
148
|
-
"svg",
|
|
149
|
-
{
|
|
150
|
-
width: e * 2.1,
|
|
151
|
-
height: e,
|
|
152
|
-
viewBox: "0 0 200 95",
|
|
153
|
-
fill: "none",
|
|
154
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
155
|
-
className: t,
|
|
156
|
-
children: [
|
|
157
|
-
/* @__PURE__ */ u("circle", { cx: "30", cy: "20", r: "3", fill: "#FCD34D" }),
|
|
158
|
-
/* @__PURE__ */ u("circle", { cx: "170", cy: "25", r: "4", fill: "#5EEAD4" }),
|
|
159
|
-
/* @__PURE__ */ u("circle", { cx: "25", cy: "70", r: "2", fill: "#A78BFA" }),
|
|
160
|
-
/* @__PURE__ */ u("circle", { cx: "175", cy: "65", r: "3", fill: "#F472B6" }),
|
|
161
|
-
/* @__PURE__ */ u("circle", { cx: "50", cy: "85", r: "2", fill: "#60A5FA" }),
|
|
162
|
-
/* @__PURE__ */ u("circle", { cx: "150", cy: "80", r: "2", fill: "#FCD34D" }),
|
|
163
|
-
/* @__PURE__ */ u("path", { d: "M45 30L46 33L49 33L47 35L48 38L45 36L42 38L43 35L41 33L44 33Z", fill: "#FCD34D" }),
|
|
164
|
-
/* @__PURE__ */ u("path", { d: "M160 45L161 47L163 47L161.5 48.5L162 51L160 49.5L158 51L158.5 48.5L157 47L159 47Z", fill: "#FCD34D" }),
|
|
165
|
-
/* @__PURE__ */ u("circle", { cx: "100", cy: "47", r: "35", fill: "url(#successGradient)" }),
|
|
166
|
-
/* @__PURE__ */ u("circle", { cx: "100", cy: "47", r: "30", fill: "#22C55E" }),
|
|
167
|
-
/* @__PURE__ */ u(
|
|
168
|
-
"path",
|
|
169
|
-
{
|
|
170
|
-
d: "M85 47L95 57L115 37",
|
|
171
|
-
stroke: "white",
|
|
172
|
-
strokeWidth: "5",
|
|
173
|
-
strokeLinecap: "round",
|
|
174
|
-
strokeLinejoin: "round"
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
/* @__PURE__ */ u("circle", { cx: "100", cy: "47", r: "38", stroke: "#22C55E", strokeWidth: "2", strokeOpacity: "0.3" }),
|
|
178
|
-
/* @__PURE__ */ u("circle", { cx: "100", cy: "47", r: "42", stroke: "#22C55E", strokeWidth: "1", strokeOpacity: "0.2" }),
|
|
179
|
-
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ w("linearGradient", { id: "successGradient", x1: "65", y1: "12", x2: "135", y2: "82", gradientUnits: "userSpaceOnUse", children: [
|
|
180
|
-
/* @__PURE__ */ u("stop", { stopColor: "#4ADE80" }),
|
|
181
|
-
/* @__PURE__ */ u("stop", { offset: "1", stopColor: "#16A34A" })
|
|
182
|
-
] }) })
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
const ho = 30, go = 3e-3, wo = 5, Dr = 8, Or = 10 ** Dr, xo = BigInt(
|
|
188
|
-
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
|
189
|
-
), F = {
|
|
190
|
-
ETH: { symbol: "ETH", decimals: 18, name: "Ether" },
|
|
191
|
-
USDC: { symbol: "USDC", decimals: 6, name: "USD Coin" },
|
|
192
|
-
USDT: { symbol: "USDT", decimals: 6, name: "Tether USD" },
|
|
193
|
-
DAI: { symbol: "DAI", decimals: 18, name: "Dai Stablecoin" },
|
|
194
|
-
WBTC: { symbol: "WBTC", decimals: 8, name: "Wrapped Bitcoin" },
|
|
195
|
-
IDRX: { symbol: "IDRX", decimals: 18, name: "Indonesian Rupiah" }
|
|
196
|
-
};
|
|
197
|
-
function Tt(e) {
|
|
198
|
-
if (!e) return "USDT";
|
|
199
|
-
switch (e.toUpperCase()) {
|
|
200
|
-
case "IDR":
|
|
201
|
-
return "IDRX";
|
|
202
|
-
case "USD":
|
|
203
|
-
return "USDT";
|
|
204
|
-
default:
|
|
205
|
-
return e.toUpperCase();
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function be(e, t = 2) {
|
|
209
|
-
const n = e.toFixed(t), [r, s] = n.split("."), i = r.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
210
|
-
return s ? `${i}.${s}` : i;
|
|
211
|
-
}
|
|
212
|
-
function Br({
|
|
213
|
-
token: e,
|
|
214
|
-
onChange: t,
|
|
215
|
-
totalAmount: n,
|
|
216
|
-
displayAmount: r,
|
|
217
|
-
currency: s,
|
|
218
|
-
disabled: i = !1
|
|
219
|
-
}) {
|
|
220
|
-
const a = (h) => {
|
|
221
|
-
t(Number(h.target.value));
|
|
222
|
-
}, o = n * e.percentage / 100, c = e.priceUSD > 0 ? o / e.priceUSD : 0, d = c <= e.amount, l = e.priceUSD > 0, y = Tt(s), m = (r ?? n) * e.percentage / 100;
|
|
223
|
-
return /* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-1.5 mc:w-full", children: [
|
|
224
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-3 mc:w-35", children: [
|
|
225
|
-
/* @__PURE__ */ w("div", { className: "mc:relative mc:size-[30px]", children: [
|
|
226
|
-
/* @__PURE__ */ u(
|
|
227
|
-
"div",
|
|
228
|
-
{
|
|
229
|
-
className: `mc:size-[30px] mc:rounded-full mc:bg-dark-4 mc:overflow-hidden mc:flex mc:items-center mc:justify-center ${l ? "" : "mc:opacity-50"}`,
|
|
230
|
-
children: e.tokenIcon ? /* @__PURE__ */ u(
|
|
231
|
-
"img",
|
|
232
|
-
{
|
|
233
|
-
src: e.tokenIcon,
|
|
234
|
-
alt: e.name,
|
|
235
|
-
className: "mc:size-full mc:object-cover"
|
|
236
|
-
}
|
|
237
|
-
) : /* @__PURE__ */ u("span", { className: "mc:text-xs mc:font-semibold mc:text-white", children: e.symbol.slice(0, 2) })
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
/* @__PURE__ */ u("div", { className: "mc:absolute mc:right-[-2px] mc:bottom-[-2px] mc:size-[12px] mc:rounded-full mc:bg-dark-3 mc:border mc:border-dark-2 mc:overflow-hidden mc:flex mc:items-center mc:justify-center", children: e.chainIcon ? /* @__PURE__ */ u(
|
|
241
|
-
"img",
|
|
242
|
-
{
|
|
243
|
-
src: e.chainIcon,
|
|
244
|
-
alt: e.chain,
|
|
245
|
-
className: "mc:size-full mc:object-cover"
|
|
246
|
-
}
|
|
247
|
-
) : /* @__PURE__ */ u("span", { className: "mc:text-[6px] mc:font-semibold mc:text-white", children: e.chain.slice(0, 1) }) })
|
|
248
|
-
] }),
|
|
249
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-1 mc:text-xs mc:text-white", children: [
|
|
250
|
-
/* @__PURE__ */ u("span", { className: "mc:font-semibold", children: e.name }),
|
|
251
|
-
/* @__PURE__ */ w("span", { className: "mc:font-normal mc:opacity-75", children: [
|
|
252
|
-
e.amount.toFixed(4),
|
|
253
|
-
" ",
|
|
254
|
-
e.symbol
|
|
255
|
-
] }),
|
|
256
|
-
/* @__PURE__ */ u(
|
|
257
|
-
"span",
|
|
258
|
-
{
|
|
259
|
-
className: `mc:text-[10px] ${l ? "mc:text-white/50" : "mc:text-yellow-500"}`,
|
|
260
|
-
children: l ? `$${e.priceUSD.toFixed(2)}/${e.symbol}` : "Price loading..."
|
|
261
|
-
}
|
|
262
|
-
)
|
|
263
|
-
] })
|
|
264
|
-
] }),
|
|
265
|
-
/* @__PURE__ */ w(
|
|
266
|
-
"div",
|
|
267
|
-
{
|
|
268
|
-
className: `mc:flex-1 mc:relative mc:h-1.5 ${i ? "mc:opacity-50" : ""}`,
|
|
269
|
-
children: [
|
|
270
|
-
/* @__PURE__ */ u("div", { className: "mc:absolute mc:inset-0 mc:bg-white/40 mc:rounded-full" }),
|
|
271
|
-
/* @__PURE__ */ u(
|
|
272
|
-
"div",
|
|
273
|
-
{
|
|
274
|
-
className: "mc:absolute mc:left-0 mc:top-0 mc:h-full mc:bg-secondary mc:rounded-full mc:transition-all",
|
|
275
|
-
style: { width: `${e.percentage}%` }
|
|
276
|
-
}
|
|
277
|
-
),
|
|
278
|
-
/* @__PURE__ */ u(
|
|
279
|
-
"input",
|
|
280
|
-
{
|
|
281
|
-
type: "range",
|
|
282
|
-
min: "0",
|
|
283
|
-
max: "100",
|
|
284
|
-
value: e.percentage,
|
|
285
|
-
onChange: a,
|
|
286
|
-
className: `mc:absolute mc:inset-0 mc:w-full mc:h-full mc:opacity-0 ${i ? "mc:cursor-not-allowed" : "mc:cursor-pointer"}`,
|
|
287
|
-
disabled: i || e.amount === 0 || !l
|
|
288
|
-
}
|
|
289
|
-
)
|
|
290
|
-
]
|
|
291
|
-
}
|
|
292
|
-
),
|
|
293
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:items-end mc:gap-0.5 mc:min-w-25", children: [
|
|
294
|
-
/* @__PURE__ */ w("span", { className: "mc:text-xs mc:font-semibold mc:text-white", children: [
|
|
295
|
-
e.percentage,
|
|
296
|
-
"% = ",
|
|
297
|
-
be(m),
|
|
298
|
-
" ",
|
|
299
|
-
y
|
|
300
|
-
] }),
|
|
301
|
-
e.percentage > 0 && /* @__PURE__ */ w(
|
|
302
|
-
"span",
|
|
303
|
-
{
|
|
304
|
-
className: `mc:text-[10px] ${d ? "mc:text-white/60" : "mc:text-red-500"}`,
|
|
305
|
-
children: [
|
|
306
|
-
be(c, 4),
|
|
307
|
-
" ",
|
|
308
|
-
e.symbol,
|
|
309
|
-
!d && " ⚠️"
|
|
310
|
-
]
|
|
311
|
-
}
|
|
312
|
-
)
|
|
313
|
-
] })
|
|
314
|
-
] });
|
|
315
|
-
}
|
|
316
|
-
function Ur({
|
|
317
|
-
items: e,
|
|
318
|
-
fee: t = 0.3,
|
|
319
|
-
currency: n
|
|
320
|
-
}) {
|
|
321
|
-
const s = e.reduce((a, o) => a + o.price, 0) + t, i = Tt(n);
|
|
322
|
-
return /* @__PURE__ */ w("div", { className: "mc:bg-dark-4 mc:rounded-md mc:p-3 mc:flex mc:flex-col mc:gap-3 mc:w-full", children: [
|
|
323
|
-
/* @__PURE__ */ u("p", { className: "mc:font-medium mc:text-base mc:text-white", children: "Payment Summary" }),
|
|
324
|
-
e.map((a, o) => /* @__PURE__ */ w(
|
|
325
|
-
"div",
|
|
326
|
-
{
|
|
327
|
-
className: "mc:flex mc:items-center mc:justify-between mc:text-xs mc:text-white",
|
|
328
|
-
children: [
|
|
329
|
-
/* @__PURE__ */ u("span", { className: "mc:flex-1", children: a.name }),
|
|
330
|
-
/* @__PURE__ */ w("span", { className: "mc:text-right", children: [
|
|
331
|
-
be(a.price),
|
|
332
|
-
" ",
|
|
333
|
-
i
|
|
334
|
-
] })
|
|
335
|
-
]
|
|
336
|
-
},
|
|
337
|
-
o
|
|
338
|
-
)),
|
|
339
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:justify-between mc:text-xs mc:text-white", children: [
|
|
340
|
-
/* @__PURE__ */ u("span", { className: "mc:flex-1", children: "Fee" }),
|
|
341
|
-
/* @__PURE__ */ w("span", { className: "mc:text-right", children: [
|
|
342
|
-
be(t),
|
|
343
|
-
" ",
|
|
344
|
-
i
|
|
345
|
-
] })
|
|
346
|
-
] }),
|
|
347
|
-
/* @__PURE__ */ u("div", { className: "mc:h-px mc:bg-white/20" }),
|
|
348
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:justify-between mc:text-white", children: [
|
|
349
|
-
/* @__PURE__ */ u("span", { className: "mc:text-xs", children: "Total Payment" }),
|
|
350
|
-
/* @__PURE__ */ w("span", { className: "mc:text-base mc:font-semibold mc:text-right", children: [
|
|
351
|
-
be(s),
|
|
352
|
-
" ",
|
|
353
|
-
i
|
|
354
|
-
] })
|
|
355
|
-
] })
|
|
356
|
-
] });
|
|
357
|
-
}
|
|
358
8
|
const O = {
|
|
359
9
|
PAYMENT_ROUTER: "0x73Dbc7447E3B097cFc8b08ee7896a9D27D67e2B4",
|
|
360
10
|
TOKEN_REGISTRY: "0x1d2C6dfB2f127d6F3c14859c9E54cbc27bd7FcCE"
|
|
@@ -367,7 +17,7 @@ const O = {
|
|
|
367
17
|
WBTC: "0x1BEC7ec7F995B9bcd93F411B2cE7d289C6b05f03",
|
|
368
18
|
// Settlement Tokens
|
|
369
19
|
IDRX: "0x39B9205cDC53114c0B0F22F04C1215A13197b4d9"
|
|
370
|
-
}, Lr = /* @__PURE__ */ JSON.parse('[{"inputs":[{"internalType":"address","name":"_tokenRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CashbackSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"CollectedTokensWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"EmergencyPoolWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"merchant","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MerchantSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"newMinimum","type":"uint256"}],"name":"MinimumPoolBalanceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"paymentId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"merchant","type":"address"},{"indexed":true,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalPaidUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"productPriceUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"excessUSD","type":"uint256"},{"indexed":false,"internalType":"bool","name":"settleInIDR","type":"bool"},{"indexed":false,"internalType":"uint256","name":"settlementAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cashbackAmount","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"externalCallSuccess","type":"bool"}],"name":"PaymentExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SettlementPoolFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"idrx","type":"address"},{"indexed":true,"internalType":"address","name":"usdt","type":"address"}],"name":"SettlementTokensUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"FEE_BASIS_POINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"IDRX_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_CASHBACK_USD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDT_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"calculateTotalValue","outputs":[{"internalType":"uint256","name":"totalUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateUSDValue","outputs":[{"internalType":"uint256","name":"usdValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"collectedBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyWithdrawPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"fundSettlementPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getCollectedBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"paymentId","type":"bytes32"}],"name":"getPayment","outputs":[{"components":[{"internalType":"address","name":"merchant","type":"address"},{"internalType":"address","name":"payer","type":"address"},{"internalType":"uint256","name":"totalPaidUSD","type":"uint256"},{"internalType":"uint256","name":"productPriceUSD","type":"uint256"},{"internalType":"uint256","name":"feeUSD","type":"uint256"},{"internalType":"uint256","name":"excessUSD","type":"uint256"},{"internalType":"bool","name":"settleInIDR","type":"bool"},{"internalType":"uint256","name":"settlementAmount","type":"uint256"},{"internalType":"uint256","name":"cashbackAmount","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct IPaymentRouter.Payment","name":"payment","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getSettlementPoolBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minimumPoolBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"merchantAddress","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"productPriceUSD","type":"uint256"},{"internalType":"bool","name":"settleInIDR","type":"bool"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"name":"pay","outputs":[{"internalType":"bytes32","name":"paymentId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"setMinimumPoolBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_idrx","type":"address"},{"internalType":"address","name":"_usdt","type":"address"}],"name":"setSettlementTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"settlementPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenRegistry","outputs":[{"internalType":"contract ITokenRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"expectedUSD","type":"uint256"}],"name":"validatePayment","outputs":[{"internalType":"bool","name":"valid","type":"bool"},{"internalType":"uint256","name":"actualUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawCollectedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]'), Fr = [
|
|
20
|
+
}, kr = /* @__PURE__ */ JSON.parse('[{"inputs":[{"internalType":"address","name":"_tokenRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CashbackSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"CollectedTokensWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"EmergencyPoolWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"merchant","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MerchantSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"newMinimum","type":"uint256"}],"name":"MinimumPoolBalanceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"paymentId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"merchant","type":"address"},{"indexed":true,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalPaidUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"productPriceUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"excessUSD","type":"uint256"},{"indexed":false,"internalType":"bool","name":"settleInIDR","type":"bool"},{"indexed":false,"internalType":"uint256","name":"settlementAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cashbackAmount","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"externalCallSuccess","type":"bool"}],"name":"PaymentExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SettlementPoolFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"idrx","type":"address"},{"indexed":true,"internalType":"address","name":"usdt","type":"address"}],"name":"SettlementTokensUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"FEE_BASIS_POINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"IDRX_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_CASHBACK_USD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDT_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"calculateTotalValue","outputs":[{"internalType":"uint256","name":"totalUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateUSDValue","outputs":[{"internalType":"uint256","name":"usdValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"collectedBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyWithdrawPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"fundSettlementPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getCollectedBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"paymentId","type":"bytes32"}],"name":"getPayment","outputs":[{"components":[{"internalType":"address","name":"merchant","type":"address"},{"internalType":"address","name":"payer","type":"address"},{"internalType":"uint256","name":"totalPaidUSD","type":"uint256"},{"internalType":"uint256","name":"productPriceUSD","type":"uint256"},{"internalType":"uint256","name":"feeUSD","type":"uint256"},{"internalType":"uint256","name":"excessUSD","type":"uint256"},{"internalType":"bool","name":"settleInIDR","type":"bool"},{"internalType":"uint256","name":"settlementAmount","type":"uint256"},{"internalType":"uint256","name":"cashbackAmount","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct IPaymentRouter.Payment","name":"payment","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getSettlementPoolBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minimumPoolBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"merchantAddress","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"productPriceUSD","type":"uint256"},{"internalType":"bool","name":"settleInIDR","type":"bool"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"name":"pay","outputs":[{"internalType":"bytes32","name":"paymentId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"setMinimumPoolBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_idrx","type":"address"},{"internalType":"address","name":"_usdt","type":"address"}],"name":"setSettlementTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"settlementPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenRegistry","outputs":[{"internalType":"contract ITokenRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"expectedUSD","type":"uint256"}],"name":"validatePayment","outputs":[{"internalType":"bool","name":"valid","type":"bool"},{"internalType":"uint256","name":"actualUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawCollectedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]'), Ir = [
|
|
371
21
|
{
|
|
372
22
|
inputs: [],
|
|
373
23
|
stateMutability: "nonpayable",
|
|
@@ -849,7 +499,7 @@ const O = {
|
|
|
849
499
|
stateMutability: "nonpayable",
|
|
850
500
|
type: "function"
|
|
851
501
|
}
|
|
852
|
-
],
|
|
502
|
+
], Nr = [
|
|
853
503
|
{
|
|
854
504
|
inputs: [],
|
|
855
505
|
stateMutability: "nonpayable",
|
|
@@ -1234,137 +884,487 @@ const O = {
|
|
|
1234
884
|
type: "address"
|
|
1235
885
|
},
|
|
1236
886
|
{
|
|
1237
|
-
internalType: "address",
|
|
1238
|
-
name: "to",
|
|
1239
|
-
type: "address"
|
|
887
|
+
internalType: "address",
|
|
888
|
+
name: "to",
|
|
889
|
+
type: "address"
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
internalType: "uint256",
|
|
893
|
+
name: "value",
|
|
894
|
+
type: "uint256"
|
|
895
|
+
}
|
|
896
|
+
],
|
|
897
|
+
name: "transferFrom",
|
|
898
|
+
outputs: [
|
|
899
|
+
{
|
|
900
|
+
internalType: "bool",
|
|
901
|
+
name: "",
|
|
902
|
+
type: "bool"
|
|
903
|
+
}
|
|
904
|
+
],
|
|
905
|
+
stateMutability: "nonpayable",
|
|
906
|
+
type: "function"
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
inputs: [
|
|
910
|
+
{
|
|
911
|
+
internalType: "address",
|
|
912
|
+
name: "newOwner",
|
|
913
|
+
type: "address"
|
|
914
|
+
}
|
|
915
|
+
],
|
|
916
|
+
name: "transferOwnership",
|
|
917
|
+
outputs: [],
|
|
918
|
+
stateMutability: "nonpayable",
|
|
919
|
+
type: "function"
|
|
920
|
+
}
|
|
921
|
+
], De = kr, Z = Ir, te = Nr;
|
|
922
|
+
function Tt() {
|
|
923
|
+
const { writeContract: e, data: t, isPending: n, error: r } = wt(), { isLoading: s, isSuccess: a } = xt({
|
|
924
|
+
hash: t
|
|
925
|
+
});
|
|
926
|
+
return {
|
|
927
|
+
// Write functions
|
|
928
|
+
registerToken: (b, x, S, N) => {
|
|
929
|
+
e({
|
|
930
|
+
address: O.TOKEN_REGISTRY,
|
|
931
|
+
abi: Z,
|
|
932
|
+
functionName: "registerToken",
|
|
933
|
+
args: [b, x, S, N]
|
|
934
|
+
});
|
|
935
|
+
},
|
|
936
|
+
setTokenEnabled: (b, x) => {
|
|
937
|
+
e({
|
|
938
|
+
address: O.TOKEN_REGISTRY,
|
|
939
|
+
abi: Z,
|
|
940
|
+
functionName: "setTokenEnabled",
|
|
941
|
+
args: [b, x]
|
|
942
|
+
});
|
|
943
|
+
},
|
|
944
|
+
updatePriceFeed: (b, x) => {
|
|
945
|
+
e({
|
|
946
|
+
address: O.TOKEN_REGISTRY,
|
|
947
|
+
abi: Z,
|
|
948
|
+
functionName: "updatePriceFeed",
|
|
949
|
+
args: [b, x]
|
|
950
|
+
});
|
|
951
|
+
},
|
|
952
|
+
setMinPaymentAmount: (b, x) => {
|
|
953
|
+
e({
|
|
954
|
+
address: O.TOKEN_REGISTRY,
|
|
955
|
+
abi: Z,
|
|
956
|
+
functionName: "setMinPaymentAmount",
|
|
957
|
+
args: [b, x]
|
|
958
|
+
});
|
|
959
|
+
},
|
|
960
|
+
grantRole: (b, x) => {
|
|
961
|
+
e({
|
|
962
|
+
address: O.TOKEN_REGISTRY,
|
|
963
|
+
abi: Z,
|
|
964
|
+
functionName: "grantRole",
|
|
965
|
+
args: [b, x]
|
|
966
|
+
});
|
|
967
|
+
},
|
|
968
|
+
revokeRole: (b, x) => {
|
|
969
|
+
e({
|
|
970
|
+
address: O.TOKEN_REGISTRY,
|
|
971
|
+
abi: Z,
|
|
972
|
+
functionName: "revokeRole",
|
|
973
|
+
args: [b, x]
|
|
974
|
+
});
|
|
975
|
+
},
|
|
976
|
+
// Read hooks
|
|
977
|
+
useGetTokenConfig: (b) => j({
|
|
978
|
+
address: O.TOKEN_REGISTRY,
|
|
979
|
+
abi: Z,
|
|
980
|
+
functionName: "getTokenConfig",
|
|
981
|
+
args: [b]
|
|
982
|
+
}),
|
|
983
|
+
useGetTokenPrice: (b) => j({
|
|
984
|
+
address: O.TOKEN_REGISTRY,
|
|
985
|
+
abi: Z,
|
|
986
|
+
functionName: "getTokenPriceUSD",
|
|
987
|
+
args: [b]
|
|
988
|
+
}),
|
|
989
|
+
useGetRegisteredTokens: () => j({
|
|
990
|
+
address: O.TOKEN_REGISTRY,
|
|
991
|
+
abi: Z,
|
|
992
|
+
functionName: "getRegisteredTokens"
|
|
993
|
+
}),
|
|
994
|
+
useGetRegisteredTokenCount: () => j({
|
|
995
|
+
address: O.TOKEN_REGISTRY,
|
|
996
|
+
abi: Z,
|
|
997
|
+
functionName: "getRegisteredTokenCount"
|
|
998
|
+
}),
|
|
999
|
+
useIsTokenEnabled: (b) => j({
|
|
1000
|
+
address: O.TOKEN_REGISTRY,
|
|
1001
|
+
abi: Z,
|
|
1002
|
+
functionName: "isTokenEnabled",
|
|
1003
|
+
args: [b]
|
|
1004
|
+
}),
|
|
1005
|
+
useHasRole: (b, x) => j({
|
|
1006
|
+
address: O.TOKEN_REGISTRY,
|
|
1007
|
+
abi: Z,
|
|
1008
|
+
functionName: "hasRole",
|
|
1009
|
+
args: [b, x]
|
|
1010
|
+
}),
|
|
1011
|
+
// Transaction state
|
|
1012
|
+
hash: t,
|
|
1013
|
+
isPending: n,
|
|
1014
|
+
isConfirming: s,
|
|
1015
|
+
isConfirmed: a,
|
|
1016
|
+
error: r
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
const ho = 30, go = 3e-3, wo = 5, Rr = 8, Mr = 10 ** Rr, xo = BigInt(
|
|
1020
|
+
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
|
1021
|
+
), F = {
|
|
1022
|
+
ETH: { symbol: "ETH", decimals: 18, name: "Ether" },
|
|
1023
|
+
USDC: { symbol: "USDC", decimals: 6, name: "USD Coin" },
|
|
1024
|
+
USDT: { symbol: "USDT", decimals: 6, name: "Tether USD" },
|
|
1025
|
+
DAI: { symbol: "DAI", decimals: 18, name: "Dai Stablecoin" },
|
|
1026
|
+
WBTC: { symbol: "WBTC", decimals: 8, name: "Wrapped Bitcoin" },
|
|
1027
|
+
IDRX: { symbol: "IDRX", decimals: 18, name: "Indonesian Rupiah" }
|
|
1028
|
+
};
|
|
1029
|
+
function vt(e) {
|
|
1030
|
+
if (!e) return "USDT";
|
|
1031
|
+
switch (e.toUpperCase()) {
|
|
1032
|
+
case "IDR":
|
|
1033
|
+
return "IDRX";
|
|
1034
|
+
case "USD":
|
|
1035
|
+
return "USDT";
|
|
1036
|
+
default:
|
|
1037
|
+
return e.toUpperCase();
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
function be(e, t = 2) {
|
|
1041
|
+
const n = e.toFixed(t), [r, s] = n.split("."), a = r.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1042
|
+
return s ? `${a}.${s}` : a;
|
|
1043
|
+
}
|
|
1044
|
+
function Dr({ size: e = 26, className: t = "" }) {
|
|
1045
|
+
return /* @__PURE__ */ u(
|
|
1046
|
+
"svg",
|
|
1047
|
+
{
|
|
1048
|
+
width: e,
|
|
1049
|
+
height: e,
|
|
1050
|
+
viewBox: "0 0 26 26",
|
|
1051
|
+
fill: "none",
|
|
1052
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1053
|
+
className: t,
|
|
1054
|
+
children: /* @__PURE__ */ u(
|
|
1055
|
+
"path",
|
|
1056
|
+
{
|
|
1057
|
+
d: "M6.5 6.5L19.5 19.5M6.5 19.5L19.5 6.5",
|
|
1058
|
+
stroke: "currentColor",
|
|
1059
|
+
strokeWidth: "2.5",
|
|
1060
|
+
strokeLinecap: "round",
|
|
1061
|
+
strokeLinejoin: "round"
|
|
1062
|
+
}
|
|
1063
|
+
)
|
|
1064
|
+
}
|
|
1065
|
+
);
|
|
1066
|
+
}
|
|
1067
|
+
function Or({ size: e = 16, className: t = "" }) {
|
|
1068
|
+
return /* @__PURE__ */ w(
|
|
1069
|
+
"svg",
|
|
1070
|
+
{
|
|
1071
|
+
width: e,
|
|
1072
|
+
height: e,
|
|
1073
|
+
viewBox: "0 0 16 16",
|
|
1074
|
+
fill: "none",
|
|
1075
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1076
|
+
className: t,
|
|
1077
|
+
children: [
|
|
1078
|
+
/* @__PURE__ */ u(
|
|
1079
|
+
"path",
|
|
1080
|
+
{
|
|
1081
|
+
d: "M7.33333 12.6667C10.2789 12.6667 12.6667 10.2789 12.6667 7.33333C12.6667 4.38781 10.2789 2 7.33333 2C4.38781 2 2 4.38781 2 7.33333C2 10.2789 4.38781 12.6667 7.33333 12.6667Z",
|
|
1082
|
+
stroke: "currentColor",
|
|
1083
|
+
strokeWidth: "1.5",
|
|
1084
|
+
strokeLinecap: "round",
|
|
1085
|
+
strokeLinejoin: "round"
|
|
1086
|
+
}
|
|
1087
|
+
),
|
|
1088
|
+
/* @__PURE__ */ u(
|
|
1089
|
+
"path",
|
|
1090
|
+
{
|
|
1091
|
+
d: "M14 14L11.1 11.1",
|
|
1092
|
+
stroke: "currentColor",
|
|
1093
|
+
strokeWidth: "1.5",
|
|
1094
|
+
strokeLinecap: "round",
|
|
1095
|
+
strokeLinejoin: "round"
|
|
1096
|
+
}
|
|
1097
|
+
)
|
|
1098
|
+
]
|
|
1099
|
+
}
|
|
1100
|
+
);
|
|
1101
|
+
}
|
|
1102
|
+
function Br({ size: e = 16, className: t = "" }) {
|
|
1103
|
+
return /* @__PURE__ */ w(
|
|
1104
|
+
"svg",
|
|
1105
|
+
{
|
|
1106
|
+
width: e,
|
|
1107
|
+
height: e,
|
|
1108
|
+
viewBox: "0 0 16 16",
|
|
1109
|
+
fill: "none",
|
|
1110
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1111
|
+
className: t,
|
|
1112
|
+
children: [
|
|
1113
|
+
/* @__PURE__ */ u(
|
|
1114
|
+
"path",
|
|
1115
|
+
{
|
|
1116
|
+
d: "M8 14.6667C11.6819 14.6667 14.6667 11.6819 14.6667 8C14.6667 4.3181 11.6819 1.33333 8 1.33333C4.3181 1.33333 1.33333 4.3181 1.33333 8C1.33333 11.6819 4.3181 14.6667 8 14.6667Z",
|
|
1117
|
+
stroke: "currentColor",
|
|
1118
|
+
strokeWidth: "1.5",
|
|
1119
|
+
strokeLinecap: "round",
|
|
1120
|
+
strokeLinejoin: "round"
|
|
1121
|
+
}
|
|
1122
|
+
),
|
|
1123
|
+
/* @__PURE__ */ u(
|
|
1124
|
+
"path",
|
|
1125
|
+
{
|
|
1126
|
+
d: "M8 10.6667V8",
|
|
1127
|
+
stroke: "currentColor",
|
|
1128
|
+
strokeWidth: "1.5",
|
|
1129
|
+
strokeLinecap: "round",
|
|
1130
|
+
strokeLinejoin: "round"
|
|
1131
|
+
}
|
|
1132
|
+
),
|
|
1133
|
+
/* @__PURE__ */ u(
|
|
1134
|
+
"path",
|
|
1135
|
+
{
|
|
1136
|
+
d: "M8 5.33333H8.00667",
|
|
1137
|
+
stroke: "currentColor",
|
|
1138
|
+
strokeWidth: "1.5",
|
|
1139
|
+
strokeLinecap: "round",
|
|
1140
|
+
strokeLinejoin: "round"
|
|
1141
|
+
}
|
|
1142
|
+
)
|
|
1143
|
+
]
|
|
1144
|
+
}
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
function Ur({
|
|
1148
|
+
size: e = 134,
|
|
1149
|
+
className: t = ""
|
|
1150
|
+
}) {
|
|
1151
|
+
return /* @__PURE__ */ w(
|
|
1152
|
+
"svg",
|
|
1153
|
+
{
|
|
1154
|
+
width: e,
|
|
1155
|
+
height: e,
|
|
1156
|
+
viewBox: "0 0 134 132",
|
|
1157
|
+
fill: "none",
|
|
1158
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1159
|
+
className: t,
|
|
1160
|
+
children: [
|
|
1161
|
+
/* @__PURE__ */ u("circle", { cx: "67", cy: "66", r: "55", fill: "#5EEAD4", fillOpacity: "0.2" }),
|
|
1162
|
+
/* @__PURE__ */ u("circle", { cx: "67", cy: "66", r: "45", fill: "#5EEAD4", fillOpacity: "0.3" }),
|
|
1163
|
+
/* @__PURE__ */ u("rect", { x: "35", y: "30", width: "45", height: "72", rx: "4", fill: "#14B8A6" }),
|
|
1164
|
+
/* @__PURE__ */ u("rect", { x: "38", y: "35", width: "39", height: "55", rx: "2", fill: "#0D9488" }),
|
|
1165
|
+
/* @__PURE__ */ w("g", { className: "animate-pulse", children: [
|
|
1166
|
+
/* @__PURE__ */ u("rect", { x: "55", y: "50", width: "50", height: "32", rx: "3", fill: "#1E293B" }),
|
|
1167
|
+
/* @__PURE__ */ u("rect", { x: "60", y: "56", width: "20", height: "3", rx: "1", fill: "#475569" }),
|
|
1168
|
+
/* @__PURE__ */ u("rect", { x: "60", y: "62", width: "30", height: "2", rx: "1", fill: "#475569" }),
|
|
1169
|
+
/* @__PURE__ */ u("rect", { x: "60", y: "68", width: "15", height: "2", rx: "1", fill: "#475569" })
|
|
1170
|
+
] }),
|
|
1171
|
+
/* @__PURE__ */ u("ellipse", { cx: "95", cy: "85", rx: "12", ry: "8", fill: "#FCD9BD" }),
|
|
1172
|
+
/* @__PURE__ */ u("rect", { x: "88", y: "78", width: "8", height: "20", rx: "4", fill: "#FCD9BD" }),
|
|
1173
|
+
/* @__PURE__ */ u("circle", { cx: "20", cy: "25", r: "8", fill: "#FCD34D" }),
|
|
1174
|
+
/* @__PURE__ */ u("text", { x: "20", y: "29", textAnchor: "middle", fontSize: "10", fill: "#92400E", children: "$" }),
|
|
1175
|
+
/* @__PURE__ */ u("circle", { cx: "115", cy: "35", r: "6", fill: "#FCD34D" }),
|
|
1176
|
+
/* @__PURE__ */ u("text", { x: "115", y: "38", textAnchor: "middle", fontSize: "8", fill: "#92400E", children: "$" }),
|
|
1177
|
+
/* @__PURE__ */ u("circle", { cx: "110", cy: "20", r: "5", fill: "#FCD34D", fillOpacity: "0.6" })
|
|
1178
|
+
]
|
|
1179
|
+
}
|
|
1180
|
+
);
|
|
1181
|
+
}
|
|
1182
|
+
function Lr({ size: e = 95, className: t = "" }) {
|
|
1183
|
+
return /* @__PURE__ */ w(
|
|
1184
|
+
"svg",
|
|
1185
|
+
{
|
|
1186
|
+
width: e * 2.1,
|
|
1187
|
+
height: e,
|
|
1188
|
+
viewBox: "0 0 200 95",
|
|
1189
|
+
fill: "none",
|
|
1190
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1191
|
+
className: t,
|
|
1192
|
+
children: [
|
|
1193
|
+
/* @__PURE__ */ u("circle", { cx: "30", cy: "20", r: "3", fill: "#FCD34D" }),
|
|
1194
|
+
/* @__PURE__ */ u("circle", { cx: "170", cy: "25", r: "4", fill: "#5EEAD4" }),
|
|
1195
|
+
/* @__PURE__ */ u("circle", { cx: "25", cy: "70", r: "2", fill: "#A78BFA" }),
|
|
1196
|
+
/* @__PURE__ */ u("circle", { cx: "175", cy: "65", r: "3", fill: "#F472B6" }),
|
|
1197
|
+
/* @__PURE__ */ u("circle", { cx: "50", cy: "85", r: "2", fill: "#60A5FA" }),
|
|
1198
|
+
/* @__PURE__ */ u("circle", { cx: "150", cy: "80", r: "2", fill: "#FCD34D" }),
|
|
1199
|
+
/* @__PURE__ */ u("path", { d: "M45 30L46 33L49 33L47 35L48 38L45 36L42 38L43 35L41 33L44 33Z", fill: "#FCD34D" }),
|
|
1200
|
+
/* @__PURE__ */ u("path", { d: "M160 45L161 47L163 47L161.5 48.5L162 51L160 49.5L158 51L158.5 48.5L157 47L159 47Z", fill: "#FCD34D" }),
|
|
1201
|
+
/* @__PURE__ */ u("circle", { cx: "100", cy: "47", r: "35", fill: "url(#successGradient)" }),
|
|
1202
|
+
/* @__PURE__ */ u("circle", { cx: "100", cy: "47", r: "30", fill: "#22C55E" }),
|
|
1203
|
+
/* @__PURE__ */ u(
|
|
1204
|
+
"path",
|
|
1205
|
+
{
|
|
1206
|
+
d: "M85 47L95 57L115 37",
|
|
1207
|
+
stroke: "white",
|
|
1208
|
+
strokeWidth: "5",
|
|
1209
|
+
strokeLinecap: "round",
|
|
1210
|
+
strokeLinejoin: "round"
|
|
1211
|
+
}
|
|
1212
|
+
),
|
|
1213
|
+
/* @__PURE__ */ u("circle", { cx: "100", cy: "47", r: "38", stroke: "#22C55E", strokeWidth: "2", strokeOpacity: "0.3" }),
|
|
1214
|
+
/* @__PURE__ */ u("circle", { cx: "100", cy: "47", r: "42", stroke: "#22C55E", strokeWidth: "1", strokeOpacity: "0.2" }),
|
|
1215
|
+
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ w("linearGradient", { id: "successGradient", x1: "65", y1: "12", x2: "135", y2: "82", gradientUnits: "userSpaceOnUse", children: [
|
|
1216
|
+
/* @__PURE__ */ u("stop", { stopColor: "#4ADE80" }),
|
|
1217
|
+
/* @__PURE__ */ u("stop", { offset: "1", stopColor: "#16A34A" })
|
|
1218
|
+
] }) })
|
|
1219
|
+
]
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1222
|
+
}
|
|
1223
|
+
function Fr({
|
|
1224
|
+
items: e,
|
|
1225
|
+
fee: t = 0.3,
|
|
1226
|
+
currency: n
|
|
1227
|
+
}) {
|
|
1228
|
+
const s = e.reduce((i, o) => i + o.price, 0) + t, a = vt(n);
|
|
1229
|
+
return /* @__PURE__ */ w("div", { className: "mc:bg-dark-4 mc:rounded-md mc:p-3 mc:flex mc:flex-col mc:gap-3 mc:w-full", children: [
|
|
1230
|
+
/* @__PURE__ */ u("p", { className: "mc:font-medium mc:text-sm mc:sm:text-base mc:text-white mc:break-words", children: "Payment Summary" }),
|
|
1231
|
+
e.map((i, o) => /* @__PURE__ */ w(
|
|
1232
|
+
"div",
|
|
1233
|
+
{
|
|
1234
|
+
className: "mc:flex mc:items-center mc:justify-between mc:text-xs mc:text-white mc:gap-2",
|
|
1235
|
+
children: [
|
|
1236
|
+
/* @__PURE__ */ u("span", { className: "mc:flex-1 mc:min-w-0 mc:break-words", children: i.name }),
|
|
1237
|
+
/* @__PURE__ */ w("span", { className: "mc:text-right mc:flex-shrink-0", children: [
|
|
1238
|
+
be(i.price),
|
|
1239
|
+
" ",
|
|
1240
|
+
a
|
|
1241
|
+
] })
|
|
1242
|
+
]
|
|
1240
1243
|
},
|
|
1244
|
+
o
|
|
1245
|
+
)),
|
|
1246
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:justify-between mc:text-xs mc:text-white mc:gap-2", children: [
|
|
1247
|
+
/* @__PURE__ */ u("span", { className: "mc:flex-1", children: "Fee" }),
|
|
1248
|
+
/* @__PURE__ */ w("span", { className: "mc:text-right mc:flex-shrink-0", children: [
|
|
1249
|
+
be(t),
|
|
1250
|
+
" ",
|
|
1251
|
+
a
|
|
1252
|
+
] })
|
|
1253
|
+
] }),
|
|
1254
|
+
/* @__PURE__ */ u("div", { className: "mc:h-px mc:bg-white/20" }),
|
|
1255
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:justify-between mc:text-white mc:gap-2", children: [
|
|
1256
|
+
/* @__PURE__ */ u("span", { className: "mc:text-xs", children: "Total Payment" }),
|
|
1257
|
+
/* @__PURE__ */ w("span", { className: "mc:text-sm mc:sm:text-base mc:font-semibold mc:text-right mc:break-words", children: [
|
|
1258
|
+
be(s),
|
|
1259
|
+
" ",
|
|
1260
|
+
a
|
|
1261
|
+
] })
|
|
1262
|
+
] })
|
|
1263
|
+
] });
|
|
1264
|
+
}
|
|
1265
|
+
function jr({
|
|
1266
|
+
token: e,
|
|
1267
|
+
onChange: t,
|
|
1268
|
+
totalAmount: n,
|
|
1269
|
+
displayAmount: r,
|
|
1270
|
+
currency: s,
|
|
1271
|
+
disabled: a = !1
|
|
1272
|
+
}) {
|
|
1273
|
+
const i = (h) => {
|
|
1274
|
+
t(Number(h.target.value));
|
|
1275
|
+
}, o = n * e.percentage / 100, c = e.priceUSD > 0 ? o / e.priceUSD : 0, d = c <= e.amount, l = e.priceUSD > 0, y = vt(s), m = (r ?? n) * e.percentage / 100;
|
|
1276
|
+
return /* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-1.5 mc:sm:gap-2 mc:w-full mc:flex-wrap", children: [
|
|
1277
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-2 mc:sm:gap-3 mc:min-w-0 mc:flex-1 mc:sm:flex-initial", children: [
|
|
1278
|
+
/* @__PURE__ */ w("div", { className: "mc:relative mc:size-[30px] mc:shrink-0", children: [
|
|
1279
|
+
/* @__PURE__ */ u(
|
|
1280
|
+
"div",
|
|
1281
|
+
{
|
|
1282
|
+
className: `mc:size-[30px] mc:rounded-full mc:bg-dark-4 mc:overflow-hidden mc:flex mc:items-center mc:justify-center ${l ? "" : "mc:opacity-50"}`,
|
|
1283
|
+
children: e.tokenIcon ? /* @__PURE__ */ u(
|
|
1284
|
+
"img",
|
|
1285
|
+
{
|
|
1286
|
+
src: e.tokenIcon,
|
|
1287
|
+
alt: e.name,
|
|
1288
|
+
className: "mc:size-full mc:object-cover"
|
|
1289
|
+
}
|
|
1290
|
+
) : /* @__PURE__ */ u("span", { className: "mc:text-xs mc:font-semibold mc:text-white", children: e.symbol.slice(0, 2) })
|
|
1291
|
+
}
|
|
1292
|
+
),
|
|
1293
|
+
/* @__PURE__ */ u("div", { className: "mc:absolute mc:right-[-2px] mc:bottom-[-2px] mc:size-[12px] mc:rounded-full mc:bg-dark-3 mc:border mc:border-dark-2 mc:overflow-hidden mc:flex mc:items-center mc:justify-center", children: e.chainIcon ? /* @__PURE__ */ u(
|
|
1294
|
+
"img",
|
|
1295
|
+
{
|
|
1296
|
+
src: e.chainIcon,
|
|
1297
|
+
alt: e.chain,
|
|
1298
|
+
className: "mc:size-full mc:object-cover"
|
|
1299
|
+
}
|
|
1300
|
+
) : /* @__PURE__ */ u("span", { className: "mc:text-[6px] mc:font-semibold mc:text-white", children: e.chain.slice(0, 1) }) })
|
|
1301
|
+
] }),
|
|
1302
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-1 mc:text-xs mc:text-white mc:min-w-0", children: [
|
|
1303
|
+
/* @__PURE__ */ u("span", { className: "mc:font-semibold mc:wrap-break-word", children: e.name }),
|
|
1304
|
+
/* @__PURE__ */ w("span", { className: "mc:font-normal mc:opacity-75 mc:wrap-break-word", children: [
|
|
1305
|
+
e.amount.toFixed(4),
|
|
1306
|
+
" ",
|
|
1307
|
+
e.symbol
|
|
1308
|
+
] }),
|
|
1309
|
+
/* @__PURE__ */ u(
|
|
1310
|
+
"span",
|
|
1311
|
+
{
|
|
1312
|
+
className: `mc:text-[10px] mc:wrap-break-word ${l ? "mc:text-white/50" : "mc:text-yellow-500"}`,
|
|
1313
|
+
children: l ? `$${e.priceUSD.toFixed(2)}/${e.symbol}` : "Price loading..."
|
|
1314
|
+
}
|
|
1315
|
+
)
|
|
1316
|
+
] })
|
|
1317
|
+
] }),
|
|
1318
|
+
/* @__PURE__ */ w(
|
|
1319
|
+
"div",
|
|
1241
1320
|
{
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1321
|
+
className: `mc:flex-1 mc:relative mc:h-1.5 mc:min-w-[100px] ${a ? "mc:opacity-50" : ""}`,
|
|
1322
|
+
children: [
|
|
1323
|
+
/* @__PURE__ */ u("div", { className: "mc:absolute mc:inset-0 mc:bg-white/40 mc:rounded-full" }),
|
|
1324
|
+
/* @__PURE__ */ u(
|
|
1325
|
+
"div",
|
|
1326
|
+
{
|
|
1327
|
+
className: "mc:absolute mc:left-0 mc:top-0 mc:h-full mc:bg-secondary mc:rounded-full mc:transition-all",
|
|
1328
|
+
style: { width: `${e.percentage}%` }
|
|
1329
|
+
}
|
|
1330
|
+
),
|
|
1331
|
+
/* @__PURE__ */ u(
|
|
1332
|
+
"input",
|
|
1333
|
+
{
|
|
1334
|
+
type: "range",
|
|
1335
|
+
min: "0",
|
|
1336
|
+
max: "100",
|
|
1337
|
+
value: e.percentage,
|
|
1338
|
+
onChange: i,
|
|
1339
|
+
className: `mc:absolute mc:inset-0 mc:w-full mc:h-full mc:opacity-0 ${a ? "mc:cursor-not-allowed" : "mc:cursor-pointer"}`,
|
|
1340
|
+
disabled: a || e.amount === 0 || !l
|
|
1341
|
+
}
|
|
1342
|
+
)
|
|
1343
|
+
]
|
|
1264
1344
|
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
address: O.TOKEN_REGISTRY,
|
|
1289
|
-
abi: Z,
|
|
1290
|
-
functionName: "setTokenEnabled",
|
|
1291
|
-
args: [b, x]
|
|
1292
|
-
});
|
|
1293
|
-
},
|
|
1294
|
-
updatePriceFeed: (b, x) => {
|
|
1295
|
-
e({
|
|
1296
|
-
address: O.TOKEN_REGISTRY,
|
|
1297
|
-
abi: Z,
|
|
1298
|
-
functionName: "updatePriceFeed",
|
|
1299
|
-
args: [b, x]
|
|
1300
|
-
});
|
|
1301
|
-
},
|
|
1302
|
-
setMinPaymentAmount: (b, x) => {
|
|
1303
|
-
e({
|
|
1304
|
-
address: O.TOKEN_REGISTRY,
|
|
1305
|
-
abi: Z,
|
|
1306
|
-
functionName: "setMinPaymentAmount",
|
|
1307
|
-
args: [b, x]
|
|
1308
|
-
});
|
|
1309
|
-
},
|
|
1310
|
-
grantRole: (b, x) => {
|
|
1311
|
-
e({
|
|
1312
|
-
address: O.TOKEN_REGISTRY,
|
|
1313
|
-
abi: Z,
|
|
1314
|
-
functionName: "grantRole",
|
|
1315
|
-
args: [b, x]
|
|
1316
|
-
});
|
|
1317
|
-
},
|
|
1318
|
-
revokeRole: (b, x) => {
|
|
1319
|
-
e({
|
|
1320
|
-
address: O.TOKEN_REGISTRY,
|
|
1321
|
-
abi: Z,
|
|
1322
|
-
functionName: "revokeRole",
|
|
1323
|
-
args: [b, x]
|
|
1324
|
-
});
|
|
1325
|
-
},
|
|
1326
|
-
// Read hooks
|
|
1327
|
-
useGetTokenConfig: (b) => j({
|
|
1328
|
-
address: O.TOKEN_REGISTRY,
|
|
1329
|
-
abi: Z,
|
|
1330
|
-
functionName: "getTokenConfig",
|
|
1331
|
-
args: [b]
|
|
1332
|
-
}),
|
|
1333
|
-
useGetTokenPrice: (b) => j({
|
|
1334
|
-
address: O.TOKEN_REGISTRY,
|
|
1335
|
-
abi: Z,
|
|
1336
|
-
functionName: "getTokenPriceUSD",
|
|
1337
|
-
args: [b]
|
|
1338
|
-
}),
|
|
1339
|
-
useGetRegisteredTokens: () => j({
|
|
1340
|
-
address: O.TOKEN_REGISTRY,
|
|
1341
|
-
abi: Z,
|
|
1342
|
-
functionName: "getRegisteredTokens"
|
|
1343
|
-
}),
|
|
1344
|
-
useGetRegisteredTokenCount: () => j({
|
|
1345
|
-
address: O.TOKEN_REGISTRY,
|
|
1346
|
-
abi: Z,
|
|
1347
|
-
functionName: "getRegisteredTokenCount"
|
|
1348
|
-
}),
|
|
1349
|
-
useIsTokenEnabled: (b) => j({
|
|
1350
|
-
address: O.TOKEN_REGISTRY,
|
|
1351
|
-
abi: Z,
|
|
1352
|
-
functionName: "isTokenEnabled",
|
|
1353
|
-
args: [b]
|
|
1354
|
-
}),
|
|
1355
|
-
useHasRole: (b, x) => j({
|
|
1356
|
-
address: O.TOKEN_REGISTRY,
|
|
1357
|
-
abi: Z,
|
|
1358
|
-
functionName: "hasRole",
|
|
1359
|
-
args: [b, x]
|
|
1360
|
-
}),
|
|
1361
|
-
// Transaction state
|
|
1362
|
-
hash: t,
|
|
1363
|
-
isPending: n,
|
|
1364
|
-
isConfirming: s,
|
|
1365
|
-
isConfirmed: i,
|
|
1366
|
-
error: r
|
|
1367
|
-
};
|
|
1345
|
+
),
|
|
1346
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:items-end mc:gap-0.5 mc:min-w-0 mc:w-full mc:sm:w-auto", children: [
|
|
1347
|
+
/* @__PURE__ */ w("span", { className: "mc:text-xs mc:font-semibold mc:text-white mc:text-right mc:wrap-break-word", children: [
|
|
1348
|
+
e.percentage,
|
|
1349
|
+
"% = ",
|
|
1350
|
+
be(m),
|
|
1351
|
+
" ",
|
|
1352
|
+
y
|
|
1353
|
+
] }),
|
|
1354
|
+
e.percentage > 0 && /* @__PURE__ */ w(
|
|
1355
|
+
"span",
|
|
1356
|
+
{
|
|
1357
|
+
className: `mc:text-[10px] mc:text-right mc:wrap-break-word ${d ? "mc:text-white/60" : "mc:text-red-500"}`,
|
|
1358
|
+
children: [
|
|
1359
|
+
be(c, 4),
|
|
1360
|
+
" ",
|
|
1361
|
+
e.symbol,
|
|
1362
|
+
!d && " ⚠️"
|
|
1363
|
+
]
|
|
1364
|
+
}
|
|
1365
|
+
)
|
|
1366
|
+
] })
|
|
1367
|
+
] });
|
|
1368
1368
|
}
|
|
1369
1369
|
const zr = 1e8;
|
|
1370
1370
|
function _r({
|
|
@@ -1373,25 +1373,25 @@ function _r({
|
|
|
1373
1373
|
totalAmount: n,
|
|
1374
1374
|
currency: r = "USD",
|
|
1375
1375
|
items: s,
|
|
1376
|
-
tokens:
|
|
1377
|
-
onPaymentSubmit:
|
|
1376
|
+
tokens: a,
|
|
1377
|
+
onPaymentSubmit: i,
|
|
1378
1378
|
fee: o = 3e-3,
|
|
1379
1379
|
transactionHash: c,
|
|
1380
1380
|
isProcessing: d,
|
|
1381
1381
|
isSuccess: l,
|
|
1382
1382
|
conversionRate: y = 1
|
|
1383
1383
|
}) {
|
|
1384
|
-
const p =
|
|
1384
|
+
const p = Tt(), { data: m } = p.useGetTokenPrice(E.NATIVE), { data: h } = p.useGetTokenPrice(E.USDC), { data: v } = p.useGetTokenPrice(E.USDT), { data: P } = p.useGetTokenPrice(E.DAI), { data: T } = p.useGetTokenPrice(E.WBTC), [b, x] = V([]), [S, N] = V(""), [D, J] = V(!0), [Q, H] = V("form"), [q, U] = V(0), [le, $] = V(""), [L, M] = V([]), [z, W] = V(
|
|
1385
1385
|
"Preparing payment..."
|
|
1386
1386
|
), re = mr(
|
|
1387
1387
|
() => JSON.stringify(
|
|
1388
|
-
|
|
1388
|
+
a.map((g) => ({
|
|
1389
1389
|
id: g.id,
|
|
1390
1390
|
amount: g.amount,
|
|
1391
1391
|
priceUSD: g.priceUSD
|
|
1392
1392
|
}))
|
|
1393
1393
|
),
|
|
1394
|
-
[
|
|
1394
|
+
[a]
|
|
1395
1395
|
), R = (g) => {
|
|
1396
1396
|
if (!g) return 0;
|
|
1397
1397
|
if (Array.isArray(g) && g.length >= 1) {
|
|
@@ -1402,36 +1402,36 @@ function _r({
|
|
|
1402
1402
|
return 0;
|
|
1403
1403
|
};
|
|
1404
1404
|
ve(() => {
|
|
1405
|
-
if (e &&
|
|
1406
|
-
const g =
|
|
1407
|
-
let
|
|
1408
|
-
return A.address === E.NATIVE && m ?
|
|
1405
|
+
if (e && a.length > 0) {
|
|
1406
|
+
const g = a.map((A) => {
|
|
1407
|
+
let I = A.priceUSD;
|
|
1408
|
+
return A.address === E.NATIVE && m ? I = R(m) : A.address === E.USDC && h ? I = R(h) : A.address === E.USDT && v ? I = R(v) : A.address === E.DAI && P ? I = R(P) : A.address === E.WBTC && T && (I = R(T)), { ...A, priceUSD: I };
|
|
1409
1409
|
});
|
|
1410
1410
|
if (D) {
|
|
1411
1411
|
g.forEach((C) => {
|
|
1412
1412
|
C.percentage = 0;
|
|
1413
1413
|
});
|
|
1414
|
-
const A = n + o * n,
|
|
1414
|
+
const A = n + o * n, I = g.filter(
|
|
1415
1415
|
(C) => (C.address === E.USDC || C.address === E.USDT || C.address === E.DAI) && C.amount > 0 && C.priceUSD > 0
|
|
1416
1416
|
), G = g.filter(
|
|
1417
1417
|
(C) => C.address !== E.USDC && C.address !== E.USDT && C.address !== E.DAI && C.amount > 0 && C.priceUSD > 0
|
|
1418
|
-
), xe =
|
|
1418
|
+
), xe = I.reduce(
|
|
1419
1419
|
(C, Y) => C + Y.amount * Y.priceUSD,
|
|
1420
1420
|
0
|
|
1421
1421
|
);
|
|
1422
|
-
if (
|
|
1423
|
-
const C = Math.floor(100 /
|
|
1424
|
-
|
|
1422
|
+
if (I.length > 0 && xe >= A) {
|
|
1423
|
+
const C = Math.floor(100 / I.length), Y = 100 - C * I.length;
|
|
1424
|
+
I.forEach((Me, ye) => {
|
|
1425
1425
|
Me.percentage = C + (ye === 0 ? Y : 0);
|
|
1426
1426
|
});
|
|
1427
|
-
} else if (
|
|
1427
|
+
} else if (I.length > 0) {
|
|
1428
1428
|
const C = xe / A * 100, Y = Math.floor(
|
|
1429
|
-
C /
|
|
1429
|
+
C / I.length
|
|
1430
1430
|
);
|
|
1431
|
-
|
|
1431
|
+
I.forEach((fe) => {
|
|
1432
1432
|
fe.percentage = Y;
|
|
1433
1433
|
});
|
|
1434
|
-
const ye = 100 -
|
|
1434
|
+
const ye = 100 - I.reduce(
|
|
1435
1435
|
(fe, Xe) => fe + Xe.percentage,
|
|
1436
1436
|
0
|
|
1437
1437
|
);
|
|
@@ -1471,7 +1471,7 @@ function _r({
|
|
|
1471
1471
|
}, [e]), ve(() => {
|
|
1472
1472
|
l && c ? (U(100), $(c), H("success"), W("Payment completed!")) : d && (U(80), W("Confirming transaction..."));
|
|
1473
1473
|
}, [l, d, c]);
|
|
1474
|
-
const K = b.reduce((g, A) => g + A.percentage, 0), me =
|
|
1474
|
+
const K = b.reduce((g, A) => g + A.percentage, 0), me = vt(r), ee = r === "IDR" ? 1 / y : 1, nr = s.map((g) => ({
|
|
1475
1475
|
...g,
|
|
1476
1476
|
price: g.price
|
|
1477
1477
|
})), Bt = o * n, We = n + Bt, rr = Bt * ee, Ke = We * ee, Ye = b.some((g) => g.percentage === 0 ? !1 : !g.priceUSD || g.priceUSD <= 0), Ze = b.some((g) => {
|
|
@@ -1480,20 +1480,20 @@ function _r({
|
|
|
1480
1480
|
return (g.priceUSD > 0 ? A / g.priceUSD : 0) > g.amount;
|
|
1481
1481
|
}), sr = (g, A) => {
|
|
1482
1482
|
x(
|
|
1483
|
-
(
|
|
1483
|
+
(I) => I.map((G) => G.id === g ? { ...G, percentage: A } : G)
|
|
1484
1484
|
);
|
|
1485
|
-
},
|
|
1485
|
+
}, ar = () => {
|
|
1486
1486
|
if (!D) {
|
|
1487
|
-
const g = b.filter((G) => G.amount > 0 && G.priceUSD > 0), A = Math.floor(100 / g.length),
|
|
1487
|
+
const g = b.filter((G) => G.amount > 0 && G.priceUSD > 0), A = Math.floor(100 / g.length), I = 100 - A * g.length;
|
|
1488
1488
|
x(
|
|
1489
1489
|
(G) => G.map((xe, C) => ({
|
|
1490
1490
|
...xe,
|
|
1491
|
-
percentage: xe.amount > 0 && xe.priceUSD > 0 ? A + (C === 0 ?
|
|
1491
|
+
percentage: xe.amount > 0 && xe.priceUSD > 0 ? A + (C === 0 ? I : 0) : 0
|
|
1492
1492
|
}))
|
|
1493
1493
|
);
|
|
1494
1494
|
}
|
|
1495
1495
|
J(!D);
|
|
1496
|
-
},
|
|
1496
|
+
}, ir = b.filter(
|
|
1497
1497
|
(g) => g.amount > 0 && (g.name.toLowerCase().includes(S.toLowerCase()) || g.symbol.toLowerCase().includes(S.toLowerCase()) || g.chain.toLowerCase().includes(S.toLowerCase()))
|
|
1498
1498
|
), or = async () => {
|
|
1499
1499
|
H("processing"), U(10), W("Checking token approvals...");
|
|
@@ -1502,7 +1502,7 @@ function _r({
|
|
|
1502
1502
|
);
|
|
1503
1503
|
g.length > 0 && (W(
|
|
1504
1504
|
`Requesting approval for ${g.length} token(s)...`
|
|
1505
|
-
), M(g.map((A) => A.symbol))), U(30), W("Processing payment..."),
|
|
1505
|
+
), M(g.map((A) => A.symbol))), U(30), W("Processing payment..."), i(b), U(60);
|
|
1506
1506
|
}, cr = () => {
|
|
1507
1507
|
t();
|
|
1508
1508
|
}, ur = () => (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
@@ -1511,7 +1511,7 @@ function _r({
|
|
|
1511
1511
|
year: "numeric"
|
|
1512
1512
|
});
|
|
1513
1513
|
if (!e) return null;
|
|
1514
|
-
const dr = /* @__PURE__ */ w("div", { className: "multicoyn-sdk mc:fixed mc:inset-0 mc:z-
|
|
1514
|
+
const dr = /* @__PURE__ */ w("div", { className: "multicoyn-sdk mc:fixed mc:inset-0 mc:z-9999 mc:flex mc:items-center mc:justify-center", children: [
|
|
1515
1515
|
/* @__PURE__ */ u(
|
|
1516
1516
|
"div",
|
|
1517
1517
|
{
|
|
@@ -1519,10 +1519,10 @@ function _r({
|
|
|
1519
1519
|
onClick: Q === "form" ? t : void 0
|
|
1520
1520
|
}
|
|
1521
1521
|
),
|
|
1522
|
-
Q === "processing" && /* @__PURE__ */ w("div", { className: "mc:relative mc:bg-dark-2 mc:border mc:border-border mc:rounded-xl mc:p-4 mc:flex mc:flex-col mc:gap-5 mc:items-center mc:justify-center mc:w-[400px] mc:min-h-[280px] mc:mx-4 animate-slide-in-right", children: [
|
|
1523
|
-
/* @__PURE__ */ u(
|
|
1524
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-3 mc:items-center mc:w-[300px]", children: [
|
|
1525
|
-
/* @__PURE__ */ w("div", { className: "mc:relative mc:w-[234px] mc:h-1.5", children: [
|
|
1522
|
+
Q === "processing" && /* @__PURE__ */ w("div", { className: "mc:relative mc:bg-dark-2 mc:border mc:border-border mc:rounded-xl mc:p-4 mc:flex mc:flex-col mc:gap-5 mc:items-center mc:justify-center mc:w-full mc:max-w-[400px] mc:min-h-[280px] mc:mx-4 animate-slide-in-right", children: [
|
|
1523
|
+
/* @__PURE__ */ u(Ur, { size: 134 }),
|
|
1524
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-3 mc:items-center mc:w-full mc:max-w-[300px] mc:px-2", children: [
|
|
1525
|
+
/* @__PURE__ */ w("div", { className: "mc:relative mc:w-full mc:max-w-[234px] mc:h-1.5", children: [
|
|
1526
1526
|
/* @__PURE__ */ u("div", { className: "mc:absolute mc:inset-0 mc:bg-dark-4 mc:rounded-full" }),
|
|
1527
1527
|
/* @__PURE__ */ u(
|
|
1528
1528
|
"div",
|
|
@@ -1532,29 +1532,29 @@ function _r({
|
|
|
1532
1532
|
}
|
|
1533
1533
|
)
|
|
1534
1534
|
] }),
|
|
1535
|
-
/* @__PURE__ */ u("p", { className: "mc:text-sm mc:text-white mc:text-center", children: z }),
|
|
1536
|
-
L.length > 0 && /* @__PURE__ */ w("div", { className: "mc:text-xs mc:text-white/60 mc:text-center", children: [
|
|
1535
|
+
/* @__PURE__ */ u("p", { className: "mc:text-sm mc:text-white mc:text-center mc:wrap-break-word mc:px-2", children: z }),
|
|
1536
|
+
L.length > 0 && /* @__PURE__ */ w("div", { className: "mc:text-xs mc:text-white/60 mc:text-center mc:wrap-break-word mc:px-2", children: [
|
|
1537
1537
|
"Approving: ",
|
|
1538
1538
|
L.join(", ")
|
|
1539
1539
|
] })
|
|
1540
1540
|
] })
|
|
1541
1541
|
] }),
|
|
1542
|
-
Q === "success" && /* @__PURE__ */ w("div", { className: "mc:relative mc:bg-dark-2 mc:border mc:border-border mc:rounded-xl mc:p-4 mc:flex mc:flex-col mc:gap-8 mc:items-start mc:w-[380px] mc:mx-4 animate-slide-in-right", children: [
|
|
1542
|
+
Q === "success" && /* @__PURE__ */ w("div", { className: "mc:relative mc:bg-dark-2 mc:border mc:border-border mc:rounded-xl mc:p-4 mc:flex mc:flex-col mc:gap-8 mc:items-start mc:w-full mc:max-w-[380px] mc:mx-4 animate-slide-in-right", children: [
|
|
1543
1543
|
/* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-6 mc:items-center mc:w-full", children: [
|
|
1544
|
-
/* @__PURE__ */ u(
|
|
1545
|
-
/* @__PURE__ */ u("div", { className: "mc:flex mc:flex-col mc:items-center mc:justify-center mc:w-full", children: /* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-1 mc:items-center mc:text-white", children: [
|
|
1546
|
-
/* @__PURE__ */ u("p", { className: "mc:text-lg mc:font-semibold", children: "Payment Success" }),
|
|
1547
|
-
/* @__PURE__ */ u("p", { className: "mc:text-sm", children: "Your payment has been successfully done." })
|
|
1544
|
+
/* @__PURE__ */ u(Lr, { size: 95 }),
|
|
1545
|
+
/* @__PURE__ */ u("div", { className: "mc:flex mc:flex-col mc:items-center mc:justify-center mc:w-full", children: /* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-1 mc:items-center mc:text-white mc:px-2", children: [
|
|
1546
|
+
/* @__PURE__ */ u("p", { className: "mc:text-lg mc:font-semibold mc:text-center", children: "Payment Success" }),
|
|
1547
|
+
/* @__PURE__ */ u("p", { className: "mc:text-sm mc:text-center", children: "Your payment has been successfully done." })
|
|
1548
1548
|
] }) }),
|
|
1549
|
-
/* @__PURE__ */ u("div", { className: "mc:bg-dark-4 mc:border mc:border-white/10 mc:rounded-lg mc:py-3 mc:px-
|
|
1549
|
+
/* @__PURE__ */ u("div", { className: "mc:bg-dark-4 mc:border mc:border-white/10 mc:rounded-lg mc:py-3 mc:px-4 mc:w-full mc:max-w-[348px] mc:flex mc:flex-col mc:items-center", children: /* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-2 mc:w-full", children: [
|
|
1550
1550
|
/* @__PURE__ */ u("p", { className: "mc:text-xs mc:text-white", children: "Order Details:" }),
|
|
1551
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-8 mc:text-sm mc:text-white mc:w-full", children: [
|
|
1552
|
-
/* @__PURE__ */ u("span", { className: "mc:w-[85px]", children: "Item" }),
|
|
1553
|
-
/* @__PURE__ */ u("span", { className: "mc:flex-1 mc:text-right", children: s[0]?.name || "Item" })
|
|
1551
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-4 mc:sm:gap-8 mc:text-sm mc:text-white mc:w-full", children: [
|
|
1552
|
+
/* @__PURE__ */ u("span", { className: "mc:min-w-[85px] mc:shrink-0", children: "Item" }),
|
|
1553
|
+
/* @__PURE__ */ u("span", { className: "mc:flex-1 mc:text-right mc:wrap-break-word", children: s[0]?.name || "Item" })
|
|
1554
1554
|
] }),
|
|
1555
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-8 mc:text-white mc:w-full", children: [
|
|
1556
|
-
/* @__PURE__ */ u("span", { className: "mc:text-sm mc:w-[106px]", children: "Total Payment" }),
|
|
1557
|
-
/* @__PURE__ */ w("span", { className: "mc:flex-1 mc:text-base mc:font-semibold mc:text-right", children: [
|
|
1555
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-4 mc:sm:gap-8 mc:text-white mc:w-full", children: [
|
|
1556
|
+
/* @__PURE__ */ u("span", { className: "mc:text-sm mc:min-w-[106px] mc:shrink-0", children: "Total Payment" }),
|
|
1557
|
+
/* @__PURE__ */ w("span", { className: "mc:flex-1 mc:text-base mc:font-semibold mc:text-right mc:wrap-break-word", children: [
|
|
1558
1558
|
be(Ke),
|
|
1559
1559
|
" ",
|
|
1560
1560
|
me
|
|
@@ -1562,16 +1562,16 @@ function _r({
|
|
|
1562
1562
|
] })
|
|
1563
1563
|
] }) })
|
|
1564
1564
|
] }),
|
|
1565
|
-
/* @__PURE__ */ u("div", { className: "mc:h-px mc:w-[320px] mc:bg-white/20" }),
|
|
1565
|
+
/* @__PURE__ */ u("div", { className: "mc:h-px mc:w-full mc:max-w-[320px] mc:bg-white/20" }),
|
|
1566
1566
|
/* @__PURE__ */ w("div", { className: "mc:flex mc:flex-col mc:gap-2 mc:items-center mc:justify-center mc:w-full mc:text-xs mc:text-white mc:px-5", children: [
|
|
1567
|
-
/* @__PURE__ */ u("p", { children: ur() }),
|
|
1567
|
+
/* @__PURE__ */ u("p", { className: "mc:text-center", children: ur() }),
|
|
1568
1568
|
le && /* @__PURE__ */ u(
|
|
1569
1569
|
"a",
|
|
1570
1570
|
{
|
|
1571
1571
|
href: `https://sepolia-blockscout.lisk.com/tx/${le}`,
|
|
1572
1572
|
target: "_blank",
|
|
1573
1573
|
rel: "noopener noreferrer",
|
|
1574
|
-
className: "mc:text-cyan hover:mc:underline",
|
|
1574
|
+
className: "mc:text-cyan hover:mc:underline mc:text-center mc:break-all",
|
|
1575
1575
|
children: "View Transaction"
|
|
1576
1576
|
}
|
|
1577
1577
|
)
|
|
@@ -1587,33 +1587,39 @@ function _r({
|
|
|
1587
1587
|
] }),
|
|
1588
1588
|
Q === "form" && /* @__PURE__ */ w("div", { className: "mc:relative mc:bg-dark-2 mc:border mc:border-border mc:rounded-xl mc:p-4 mc:flex mc:flex-col mc:gap-5 mc:max-w-[1000px] mc:w-full mc:mx-4 mc:max-h-[90vh] mc:overflow-y-auto animate-slide-in-right", children: [
|
|
1589
1589
|
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-4", children: [
|
|
1590
|
-
/* @__PURE__ */ w("div", { className: "mc:flex-1 mc:flex mc:flex-col mc:gap-1", children: [
|
|
1591
|
-
/* @__PURE__ */ u("h2", { className: "mc:text-xl mc:text-white mc:font-normal", children: "Complete Payment" }),
|
|
1592
|
-
/* @__PURE__ */ u("p", { className: "mc:text-base mc:text-white/70", children: "Choose how you want to pay (supports multi-token for wallets)" })
|
|
1590
|
+
/* @__PURE__ */ w("div", { className: "mc:flex-1 mc:flex mc:flex-col mc:gap-1 mc:min-w-0", children: [
|
|
1591
|
+
/* @__PURE__ */ u("h2", { className: "mc:text-lg mc:sm:text-xl mc:text-white mc:font-normal mc:wrap-break-word", children: "Complete Payment" }),
|
|
1592
|
+
/* @__PURE__ */ u("p", { className: "mc:text-sm mc:sm:text-base mc:text-white/70 mc:wrap-break-word", children: "Choose how you want to pay (supports multi-token for wallets)" })
|
|
1593
1593
|
] }),
|
|
1594
1594
|
/* @__PURE__ */ u(
|
|
1595
1595
|
"button",
|
|
1596
1596
|
{
|
|
1597
1597
|
onClick: t,
|
|
1598
|
-
className: "mc:text-white/60 hover:mc:text-white mc:transition-colors",
|
|
1599
|
-
children: /* @__PURE__ */ u(
|
|
1598
|
+
className: "mc:text-white/60 hover:mc:text-white mc:transition-colors mc:shrink-0",
|
|
1599
|
+
children: /* @__PURE__ */ u(Dr, { size: 26 })
|
|
1600
1600
|
}
|
|
1601
1601
|
)
|
|
1602
1602
|
] }),
|
|
1603
1603
|
/* @__PURE__ */ w("div", { className: "mc:flex mc:gap-5 mc:flex-col mc:lg:flex-row", children: [
|
|
1604
1604
|
/* @__PURE__ */ w("div", { className: "mc:flex-1 mc:flex mc:flex-col mc:gap-5", children: [
|
|
1605
|
-
/* @__PURE__ */ w("div", { className: "mc:bg-dark-4 mc:rounded-md mc:p-4 mc:flex mc:items-center mc:gap-5", children: [
|
|
1606
|
-
/* @__PURE__ */ u("span", { className: "mc:text-base mc:text-white/60 mc:w-[
|
|
1607
|
-
/* @__PURE__ */ w("span", { className: "mc:text-xl mc:font-bold mc:text-white mc:text-right mc:flex-1", children: [
|
|
1605
|
+
/* @__PURE__ */ w("div", { className: "mc:bg-dark-4 mc:rounded-md mc:p-4 mc:flex mc:items-center mc:gap-3 mc:sm:gap-5 mc:flex-col mc:md:flex-row", children: [
|
|
1606
|
+
/* @__PURE__ */ u("span", { className: "mc:text-sm mc:sm:text-base mc:text-white/60 mc:min-w-[120px] mc:shrink-0", children: "Total Required" }),
|
|
1607
|
+
/* @__PURE__ */ w("span", { className: "mc:text-lg mc:sm:text-xl mc:font-bold mc:text-white mc:text-right mc:flex-1 mc:min-w-0 mc:wrap-break-word", children: [
|
|
1608
1608
|
be(Ke),
|
|
1609
1609
|
" ",
|
|
1610
1610
|
me
|
|
1611
1611
|
] })
|
|
1612
1612
|
] }),
|
|
1613
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-5", children: [
|
|
1614
|
-
/* @__PURE__ */ u("span", { className: "mc:text-base mc:text-white mc:flex-1", children: "Use your tokens" }),
|
|
1615
|
-
/* @__PURE__ */ w("div", { className: "mc:bg-dark-4 mc:rounded-md mc:px-3 mc:py-2 mc:flex mc:items-center mc:gap-2", children: [
|
|
1616
|
-
/* @__PURE__ */ u(
|
|
1613
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-3 mc:sm:gap-5 mc:flex-wrap", children: [
|
|
1614
|
+
/* @__PURE__ */ u("span", { className: "mc:text-sm mc:sm:text-base mc:text-white mc:flex-1 mc:min-w-0", children: "Use your tokens" }),
|
|
1615
|
+
/* @__PURE__ */ w("div", { className: "mc:bg-dark-4 mc:rounded-md mc:px-3 mc:py-2 mc:flex mc:items-center mc:gap-2 mc:flex-1 mc:sm:flex-initial mc:min-w-0", children: [
|
|
1616
|
+
/* @__PURE__ */ u(
|
|
1617
|
+
Or,
|
|
1618
|
+
{
|
|
1619
|
+
size: 16,
|
|
1620
|
+
className: "mc:text-white/60 mc:shrink-0"
|
|
1621
|
+
}
|
|
1622
|
+
),
|
|
1617
1623
|
/* @__PURE__ */ u(
|
|
1618
1624
|
"input",
|
|
1619
1625
|
{
|
|
@@ -1621,20 +1627,26 @@ function _r({
|
|
|
1621
1627
|
placeholder: "Search token or chain..",
|
|
1622
1628
|
value: S,
|
|
1623
1629
|
onChange: (g) => N(g.target.value),
|
|
1624
|
-
className: "mc:bg-transparent mc:border-none mc:outline-none mc:text-base mc:text-white/60 placeholder:mc:text-white/60"
|
|
1630
|
+
className: "mc:bg-transparent mc:border-none mc:outline-none mc:text-sm mc:sm:text-base mc:text-white/60 placeholder:mc:text-white/60 mc:w-full mc:min-w-0"
|
|
1625
1631
|
}
|
|
1626
1632
|
)
|
|
1627
1633
|
] })
|
|
1628
1634
|
] }),
|
|
1629
1635
|
/* @__PURE__ */ w("div", { className: "mc:bg-dark-3 mc:rounded-md mc:p-3 mc:flex mc:flex-col mc:gap-4", children: [
|
|
1630
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-6", children: [
|
|
1631
|
-
/* @__PURE__ */ w("div", { className: "mc:flex-1 mc:flex mc:items-center mc:gap-2", children: [
|
|
1632
|
-
/* @__PURE__ */ u(
|
|
1633
|
-
|
|
1636
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-3 mc:sm:gap-6 mc:flex-col mc:md:flex-row", children: [
|
|
1637
|
+
/* @__PURE__ */ w("div", { className: "mc:flex-1 mc:flex mc:items-center mc:gap-2 mc:min-w-0 mc:flex-wrap", children: [
|
|
1638
|
+
/* @__PURE__ */ u(
|
|
1639
|
+
Br,
|
|
1640
|
+
{
|
|
1641
|
+
size: 16,
|
|
1642
|
+
className: "mc:text-white/60 mc:shrink-0"
|
|
1643
|
+
}
|
|
1644
|
+
),
|
|
1645
|
+
/* @__PURE__ */ u("span", { className: "mc:text-xs mc:sm:text-sm mc:italic mc:text-white mc:wrap-break-word", children: "Set the coins amount until 100%" }),
|
|
1634
1646
|
/* @__PURE__ */ w(
|
|
1635
1647
|
"span",
|
|
1636
1648
|
{
|
|
1637
|
-
className: `mc:bg-dark-4 mc:rounded-full mc:px-2 mc:py-1 mc:text-xs mc:font-semibold ${K === 100 ? "mc:text-cyan" : "mc:text-warning"}`,
|
|
1649
|
+
className: `mc:bg-dark-4 mc:rounded-full mc:px-2 mc:py-1 mc:text-xs mc:font-semibold mc:shrink-0 ${K === 100 ? "mc:text-cyan" : "mc:text-warning"}`,
|
|
1638
1650
|
children: [
|
|
1639
1651
|
K,
|
|
1640
1652
|
"/100%"
|
|
@@ -1642,12 +1654,12 @@ function _r({
|
|
|
1642
1654
|
}
|
|
1643
1655
|
)
|
|
1644
1656
|
] }),
|
|
1645
|
-
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-2", children: [
|
|
1646
|
-
/* @__PURE__ */ u("span", { className: "mc:text-sm mc:text-white", children: "Auto Optimize" }),
|
|
1657
|
+
/* @__PURE__ */ w("div", { className: "mc:flex mc:items-center mc:gap-2 mc:shrink-0", children: [
|
|
1658
|
+
/* @__PURE__ */ u("span", { className: "mc:text-xs mc:sm:text-sm mc:text-white", children: "Auto Optimize" }),
|
|
1647
1659
|
/* @__PURE__ */ u(
|
|
1648
1660
|
"button",
|
|
1649
1661
|
{
|
|
1650
|
-
onClick:
|
|
1662
|
+
onClick: ar,
|
|
1651
1663
|
className: `mc:w-7 mc:h-4 mc:rounded-full mc:relative mc:transition-colors ${D ? "mc:bg-cyan" : "mc:bg-white/40"}`,
|
|
1652
1664
|
children: /* @__PURE__ */ u(
|
|
1653
1665
|
"div",
|
|
@@ -1659,8 +1671,8 @@ function _r({
|
|
|
1659
1671
|
)
|
|
1660
1672
|
] })
|
|
1661
1673
|
] }),
|
|
1662
|
-
|
|
1663
|
-
|
|
1674
|
+
ir.map((g) => /* @__PURE__ */ u(
|
|
1675
|
+
jr,
|
|
1664
1676
|
{
|
|
1665
1677
|
token: g,
|
|
1666
1678
|
totalAmount: We,
|
|
@@ -1674,7 +1686,7 @@ function _r({
|
|
|
1674
1686
|
] })
|
|
1675
1687
|
] }),
|
|
1676
1688
|
/* @__PURE__ */ u("div", { className: "mc:w-full mc:lg:w-[320px]", children: /* @__PURE__ */ u(
|
|
1677
|
-
|
|
1689
|
+
Fr,
|
|
1678
1690
|
{
|
|
1679
1691
|
items: nr,
|
|
1680
1692
|
fee: rr,
|
|
@@ -1687,8 +1699,8 @@ function _r({
|
|
|
1687
1699
|
{
|
|
1688
1700
|
onClick: or,
|
|
1689
1701
|
disabled: K !== 100 || Ze || Ye,
|
|
1690
|
-
className: `mc:w-full mc:lg:w-[620px] mc:h-[42px] mc:rounded-lg mc:flex mc:items-center mc:justify-center mc:text-sm mc:font-semibold mc:text-white mc:transition-all ${K === 100 && !Ze && !Ye ? "mc:bg-secondary hover:mc:bg-secondary/90" : "mc:bg-secondary/50 mc:cursor-not-allowed"}`,
|
|
1691
|
-
children: Ye ? "Price data unavailable - Please wait" : Ze ? "Insufficient Balance" : K !== 100 ? `Complete to 100% (${K}%)` : "Pay with MultiCoyn"
|
|
1702
|
+
className: `mc:w-full mc:lg:w-[620px] mc:h-[42px] mc:rounded-lg mc:flex mc:items-center mc:justify-center mc:text-xs mc:sm:text-sm mc:font-semibold mc:text-white mc:transition-all mc:px-2 mc:wrap-break-word ${K === 100 && !Ze && !Ye ? "mc:bg-secondary hover:mc:bg-secondary/90" : "mc:bg-secondary/50 mc:cursor-not-allowed"}`,
|
|
1703
|
+
children: /* @__PURE__ */ u("span", { className: "mc:text-center", children: Ye ? "Price data unavailable - Please wait" : Ze ? "Insufficient Balance" : K !== 100 ? `Complete to 100% (${K}%)` : "Pay with MultiCoyn" })
|
|
1692
1704
|
}
|
|
1693
1705
|
)
|
|
1694
1706
|
] })
|
|
@@ -1840,16 +1852,16 @@ let Je = {
|
|
|
1840
1852
|
version: `viem@${en}`
|
|
1841
1853
|
}, f = class st extends Error {
|
|
1842
1854
|
constructor(t, n = {}) {
|
|
1843
|
-
const r = n.cause instanceof st ? n.cause.details : n.cause?.message ? n.cause.message : n.details, s = n.cause instanceof st && n.cause.docsPath || n.docsPath,
|
|
1855
|
+
const r = n.cause instanceof st ? n.cause.details : n.cause?.message ? n.cause.message : n.details, s = n.cause instanceof st && n.cause.docsPath || n.docsPath, a = Je.getDocsUrl?.({ ...n, docsPath: s }), i = [
|
|
1844
1856
|
t || "An error occurred.",
|
|
1845
1857
|
"",
|
|
1846
1858
|
...n.metaMessages ? [...n.metaMessages, ""] : [],
|
|
1847
|
-
...
|
|
1859
|
+
...a ? [`Docs: ${a}`] : [],
|
|
1848
1860
|
...r ? [`Details: ${r}`] : [],
|
|
1849
1861
|
...Je.version ? [`Version: ${Je.version}`] : []
|
|
1850
1862
|
].join(`
|
|
1851
1863
|
`);
|
|
1852
|
-
super(
|
|
1864
|
+
super(i, n.cause ? { cause: n.cause } : void 0), Object.defineProperty(this, "details", {
|
|
1853
1865
|
enumerable: !0,
|
|
1854
1866
|
configurable: !0,
|
|
1855
1867
|
writable: !0,
|
|
@@ -2153,14 +2165,14 @@ function ts(e, { dir: t, size: n = 32 } = {}) {
|
|
|
2153
2165
|
});
|
|
2154
2166
|
const r = new Uint8Array(n);
|
|
2155
2167
|
for (let s = 0; s < n; s++) {
|
|
2156
|
-
const
|
|
2157
|
-
r[
|
|
2168
|
+
const a = t === "right";
|
|
2169
|
+
r[a ? s : n - s - 1] = e[a ? s : e.length - s - 1];
|
|
2158
2170
|
}
|
|
2159
2171
|
return r;
|
|
2160
2172
|
}
|
|
2161
2173
|
let an = class extends f {
|
|
2162
|
-
constructor({ max: t, min: n, signed: r, size: s, value:
|
|
2163
|
-
super(`Number "${
|
|
2174
|
+
constructor({ max: t, min: n, signed: r, size: s, value: a }) {
|
|
2175
|
+
super(`Number "${a}" is not in safe ${s ? `${s * 8}-bit ${r ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${n} to ${t})` : `(above ${n})`}`, { name: "IntegerOutOfRangeError" });
|
|
2164
2176
|
}
|
|
2165
2177
|
};
|
|
2166
2178
|
class ns extends f {
|
|
@@ -2194,15 +2206,15 @@ function on(e, t = {}) {
|
|
|
2194
2206
|
const r = BigInt(e);
|
|
2195
2207
|
if (!n)
|
|
2196
2208
|
return r;
|
|
2197
|
-
const s = (e.length - 2) / 2,
|
|
2198
|
-
return r <=
|
|
2209
|
+
const s = (e.length - 2) / 2, a = (1n << BigInt(s) * 8n - 1n) - 1n;
|
|
2210
|
+
return r <= a ? r : r - BigInt(`0x${"f".padStart(s * 2, "f")}`) - 1n;
|
|
2199
2211
|
}
|
|
2200
2212
|
function ss(e, t = {}) {
|
|
2201
2213
|
return Number(on(e, t));
|
|
2202
2214
|
}
|
|
2203
|
-
const
|
|
2204
|
-
function
|
|
2205
|
-
return typeof e == "number" || typeof e == "bigint" ?
|
|
2215
|
+
const as = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
2216
|
+
function is(e, t = {}) {
|
|
2217
|
+
return typeof e == "number" || typeof e == "bigint" ? k(e, t) : typeof e == "string" ? un(e, t) : typeof e == "boolean" ? cn(e, t) : ue(e, t);
|
|
2206
2218
|
}
|
|
2207
2219
|
function cn(e, t = {}) {
|
|
2208
2220
|
const n = `0x${Number(e)}`;
|
|
@@ -2211,20 +2223,20 @@ function cn(e, t = {}) {
|
|
|
2211
2223
|
function ue(e, t = {}) {
|
|
2212
2224
|
let n = "";
|
|
2213
2225
|
for (let s = 0; s < e.length; s++)
|
|
2214
|
-
n +=
|
|
2226
|
+
n += as[e[s]];
|
|
2215
2227
|
const r = `0x${n}`;
|
|
2216
2228
|
return typeof t.size == "number" ? (se(r, { size: t.size }), Ae(r, { dir: "right", size: t.size })) : r;
|
|
2217
2229
|
}
|
|
2218
|
-
function
|
|
2230
|
+
function k(e, t = {}) {
|
|
2219
2231
|
const { signed: n, size: r } = t, s = BigInt(e);
|
|
2220
|
-
let
|
|
2221
|
-
r ? n ?
|
|
2222
|
-
const
|
|
2223
|
-
if (
|
|
2232
|
+
let a;
|
|
2233
|
+
r ? n ? a = (1n << BigInt(r) * 8n - 1n) - 1n : a = 2n ** (BigInt(r) * 8n) - 1n : typeof e == "number" && (a = BigInt(Number.MAX_SAFE_INTEGER));
|
|
2234
|
+
const i = typeof a == "bigint" && n ? -a - 1n : 0;
|
|
2235
|
+
if (a && s > a || s < i) {
|
|
2224
2236
|
const c = typeof e == "bigint" ? "n" : "";
|
|
2225
2237
|
throw new an({
|
|
2226
|
-
max:
|
|
2227
|
-
min: `${
|
|
2238
|
+
max: a ? `${a}${c}` : void 0,
|
|
2239
|
+
min: `${i}${c}`,
|
|
2228
2240
|
signed: n,
|
|
2229
2241
|
size: r,
|
|
2230
2242
|
value: `${e}${c}`
|
|
@@ -2246,7 +2258,7 @@ function us(e, t = {}) {
|
|
|
2246
2258
|
const n = new Uint8Array(1);
|
|
2247
2259
|
return n[0] = Number(e), typeof t.size == "number" ? (se(n, { size: t.size }), Ae(n, { size: t.size })) : n;
|
|
2248
2260
|
}
|
|
2249
|
-
const
|
|
2261
|
+
const ae = {
|
|
2250
2262
|
zero: 48,
|
|
2251
2263
|
nine: 57,
|
|
2252
2264
|
A: 65,
|
|
@@ -2255,29 +2267,29 @@ const ie = {
|
|
|
2255
2267
|
f: 102
|
|
2256
2268
|
};
|
|
2257
2269
|
function jt(e) {
|
|
2258
|
-
if (e >=
|
|
2259
|
-
return e -
|
|
2260
|
-
if (e >=
|
|
2261
|
-
return e - (
|
|
2262
|
-
if (e >=
|
|
2263
|
-
return e - (
|
|
2270
|
+
if (e >= ae.zero && e <= ae.nine)
|
|
2271
|
+
return e - ae.zero;
|
|
2272
|
+
if (e >= ae.A && e <= ae.F)
|
|
2273
|
+
return e - (ae.A - 10);
|
|
2274
|
+
if (e >= ae.a && e <= ae.f)
|
|
2275
|
+
return e - (ae.a - 10);
|
|
2264
2276
|
}
|
|
2265
2277
|
function At(e, t = {}) {
|
|
2266
2278
|
let n = e;
|
|
2267
2279
|
t.size && (se(n, { size: t.size }), n = Ae(n, { dir: "right", size: t.size }));
|
|
2268
2280
|
let r = n.slice(2);
|
|
2269
2281
|
r.length % 2 && (r = `0${r}`);
|
|
2270
|
-
const s = r.length / 2,
|
|
2271
|
-
for (let
|
|
2282
|
+
const s = r.length / 2, a = new Uint8Array(s);
|
|
2283
|
+
for (let i = 0, o = 0; i < s; i++) {
|
|
2272
2284
|
const c = jt(r.charCodeAt(o++)), d = jt(r.charCodeAt(o++));
|
|
2273
2285
|
if (c === void 0 || d === void 0)
|
|
2274
2286
|
throw new f(`Invalid byte sequence ("${r[o - 2]}${r[o - 1]}" in "${r}").`);
|
|
2275
|
-
i
|
|
2287
|
+
a[i] = c * 16 + d;
|
|
2276
2288
|
}
|
|
2277
|
-
return
|
|
2289
|
+
return a;
|
|
2278
2290
|
}
|
|
2279
2291
|
function ds(e, t) {
|
|
2280
|
-
const n =
|
|
2292
|
+
const n = k(e, t);
|
|
2281
2293
|
return At(n);
|
|
2282
2294
|
}
|
|
2283
2295
|
function ln(e, t = {}) {
|
|
@@ -2291,9 +2303,9 @@ function ls(e, t = !1) {
|
|
|
2291
2303
|
function fs(e, t = !1) {
|
|
2292
2304
|
const n = e.length;
|
|
2293
2305
|
let r = new Uint32Array(n), s = new Uint32Array(n);
|
|
2294
|
-
for (let
|
|
2295
|
-
const { h:
|
|
2296
|
-
[r[
|
|
2306
|
+
for (let a = 0; a < n; a++) {
|
|
2307
|
+
const { h: i, l: o } = ls(e[a], t);
|
|
2308
|
+
[r[a], s[a]] = [i, o];
|
|
2297
2309
|
}
|
|
2298
2310
|
return [r, s];
|
|
2299
2311
|
}
|
|
@@ -2354,35 +2366,35 @@ function Ss(e) {
|
|
|
2354
2366
|
const t = (r) => e().update(pn(r)).digest(), n = e();
|
|
2355
2367
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
|
|
2356
2368
|
}
|
|
2357
|
-
const As = BigInt(0),
|
|
2358
|
-
for (let e = 0, t =
|
|
2369
|
+
const As = BigInt(0), ke = BigInt(1), $s = BigInt(2), Cs = BigInt(7), ks = BigInt(256), Is = BigInt(113), mn = [], yn = [], bn = [];
|
|
2370
|
+
for (let e = 0, t = ke, n = 1, r = 0; e < 24; e++) {
|
|
2359
2371
|
[n, r] = [r, (2 * n + 3 * r) % 5], mn.push(2 * (5 * r + n)), yn.push((e + 1) * (e + 2) / 2 % 64);
|
|
2360
2372
|
let s = As;
|
|
2361
|
-
for (let
|
|
2362
|
-
t = (t <<
|
|
2373
|
+
for (let a = 0; a < 7; a++)
|
|
2374
|
+
t = (t << ke ^ (t >> Cs) * Is) % ks, t & $s && (s ^= ke << (ke << /* @__PURE__ */ BigInt(a)) - ke);
|
|
2363
2375
|
bn.push(s);
|
|
2364
2376
|
}
|
|
2365
2377
|
const hn = fs(bn, !0), Ns = hn[0], Rs = hn[1], Ht = (e, t, n) => n > 32 ? ys(e, t, n) : ps(e, t, n), Wt = (e, t, n) => n > 32 ? bs(e, t, n) : ms(e, t, n);
|
|
2366
2378
|
function Ms(e, t = 24) {
|
|
2367
2379
|
const n = new Uint32Array(10);
|
|
2368
2380
|
for (let r = 24 - t; r < 24; r++) {
|
|
2369
|
-
for (let
|
|
2370
|
-
n[
|
|
2371
|
-
for (let
|
|
2372
|
-
const o = (
|
|
2381
|
+
for (let i = 0; i < 10; i++)
|
|
2382
|
+
n[i] = e[i] ^ e[i + 10] ^ e[i + 20] ^ e[i + 30] ^ e[i + 40];
|
|
2383
|
+
for (let i = 0; i < 10; i += 2) {
|
|
2384
|
+
const o = (i + 8) % 10, c = (i + 2) % 10, d = n[c], l = n[c + 1], y = Ht(d, l, 1) ^ n[o], p = Wt(d, l, 1) ^ n[o + 1];
|
|
2373
2385
|
for (let m = 0; m < 50; m += 10)
|
|
2374
|
-
e[
|
|
2386
|
+
e[i + m] ^= y, e[i + m + 1] ^= p;
|
|
2375
2387
|
}
|
|
2376
|
-
let s = e[2],
|
|
2377
|
-
for (let
|
|
2378
|
-
const o = yn[
|
|
2379
|
-
s = e[l],
|
|
2388
|
+
let s = e[2], a = e[3];
|
|
2389
|
+
for (let i = 0; i < 24; i++) {
|
|
2390
|
+
const o = yn[i], c = Ht(s, a, o), d = Wt(s, a, o), l = mn[i];
|
|
2391
|
+
s = e[l], a = e[l + 1], e[l] = c, e[l + 1] = d;
|
|
2380
2392
|
}
|
|
2381
|
-
for (let
|
|
2393
|
+
for (let i = 0; i < 50; i += 10) {
|
|
2382
2394
|
for (let o = 0; o < 10; o++)
|
|
2383
|
-
n[o] = e[
|
|
2395
|
+
n[o] = e[i + o];
|
|
2384
2396
|
for (let o = 0; o < 10; o++)
|
|
2385
|
-
e[
|
|
2397
|
+
e[i + o] ^= ~n[(o + 2) % 10] & n[(o + 4) % 10];
|
|
2386
2398
|
}
|
|
2387
2399
|
e[0] ^= Ns[r], e[1] ^= Rs[r];
|
|
2388
2400
|
}
|
|
@@ -2390,8 +2402,8 @@ function Ms(e, t = 24) {
|
|
|
2390
2402
|
}
|
|
2391
2403
|
class $t extends Ps {
|
|
2392
2404
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
2393
|
-
constructor(t, n, r, s = !1,
|
|
2394
|
-
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = n, this.outputLen = r, this.enableXOF = s, this.rounds =
|
|
2405
|
+
constructor(t, n, r, s = !1, a = 24) {
|
|
2406
|
+
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = n, this.outputLen = r, this.enableXOF = s, this.rounds = a, _t(r), !(0 < t && t < 200))
|
|
2395
2407
|
throw new Error("only keccak-f1600 function is supported");
|
|
2396
2408
|
this.state = new Uint8Array(200), this.state32 = ws(this.state);
|
|
2397
2409
|
}
|
|
@@ -2404,10 +2416,10 @@ class $t extends Ps {
|
|
|
2404
2416
|
update(t) {
|
|
2405
2417
|
Gt(this), t = pn(t), Fe(t);
|
|
2406
2418
|
const { blockLen: n, state: r } = this, s = t.length;
|
|
2407
|
-
for (let
|
|
2408
|
-
const
|
|
2409
|
-
for (let o = 0; o <
|
|
2410
|
-
r[this.pos++] ^= t[
|
|
2419
|
+
for (let a = 0; a < s; ) {
|
|
2420
|
+
const i = Math.min(n - this.pos, s - a);
|
|
2421
|
+
for (let o = 0; o < i; o++)
|
|
2422
|
+
r[this.pos++] ^= t[a++];
|
|
2411
2423
|
this.pos === n && this.keccak();
|
|
2412
2424
|
}
|
|
2413
2425
|
return this;
|
|
@@ -2422,10 +2434,10 @@ class $t extends Ps {
|
|
|
2422
2434
|
writeInto(t) {
|
|
2423
2435
|
Gt(this, !1), Fe(t), this.finish();
|
|
2424
2436
|
const n = this.state, { blockLen: r } = this;
|
|
2425
|
-
for (let s = 0,
|
|
2437
|
+
for (let s = 0, a = t.length; s < a; ) {
|
|
2426
2438
|
this.posOut >= r && this.keccak();
|
|
2427
|
-
const
|
|
2428
|
-
t.set(n.subarray(this.posOut, this.posOut +
|
|
2439
|
+
const i = Math.min(r - this.posOut, a - s);
|
|
2440
|
+
t.set(n.subarray(this.posOut, this.posOut + i), s), this.posOut += i, s += i;
|
|
2429
2441
|
}
|
|
2430
2442
|
return t;
|
|
2431
2443
|
}
|
|
@@ -2449,14 +2461,14 @@ class $t extends Ps {
|
|
|
2449
2461
|
this.destroyed = !0, fn(this.state);
|
|
2450
2462
|
}
|
|
2451
2463
|
_cloneInto(t) {
|
|
2452
|
-
const { blockLen: n, suffix: r, outputLen: s, rounds:
|
|
2453
|
-
return t || (t = new $t(n, r, s,
|
|
2464
|
+
const { blockLen: n, suffix: r, outputLen: s, rounds: a, enableXOF: i } = this;
|
|
2465
|
+
return t || (t = new $t(n, r, s, i, a)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = a, t.suffix = r, t.outputLen = s, t.enableXOF = i, t.destroyed = this.destroyed, t;
|
|
2454
2466
|
}
|
|
2455
2467
|
}
|
|
2456
2468
|
const Ds = (e, t, n) => Ss(() => new $t(t, e, n)), Os = Ds(1, 136, 256 / 8);
|
|
2457
2469
|
function gn(e, t) {
|
|
2458
2470
|
const n = t || "hex", r = Os(Re(e, { strict: !1 }) ? dn(e) : e);
|
|
2459
|
-
return n === "bytes" ? r :
|
|
2471
|
+
return n === "bytes" ? r : is(r);
|
|
2460
2472
|
}
|
|
2461
2473
|
class wn extends Map {
|
|
2462
2474
|
constructor(t) {
|
|
@@ -2492,10 +2504,10 @@ function xn(e, t) {
|
|
|
2492
2504
|
if (qe.has(`${e}.${t}`))
|
|
2493
2505
|
return qe.get(`${e}.${t}`);
|
|
2494
2506
|
const n = e.substring(2).toLowerCase(), r = gn(ln(n), "bytes"), s = n.split("");
|
|
2495
|
-
for (let
|
|
2496
|
-
r[
|
|
2497
|
-
const
|
|
2498
|
-
return qe.set(`${e}.${t}`,
|
|
2507
|
+
for (let i = 0; i < 40; i += 2)
|
|
2508
|
+
r[i >> 1] >> 4 >= 8 && s[i] && (s[i] = s[i].toUpperCase()), (r[i >> 1] & 15) >= 8 && s[i + 1] && (s[i + 1] = s[i + 1].toUpperCase());
|
|
2509
|
+
const a = `0x${s.join("")}`;
|
|
2510
|
+
return qe.set(`${e}.${t}`, a), a;
|
|
2499
2511
|
}
|
|
2500
2512
|
class Kt extends f {
|
|
2501
2513
|
constructor({ offset: t }) {
|
|
@@ -2719,23 +2731,23 @@ function Pn(e, t) {
|
|
|
2719
2731
|
const n = Ks({
|
|
2720
2732
|
params: e,
|
|
2721
2733
|
values: t
|
|
2722
|
-
}), r =
|
|
2734
|
+
}), r = It(n);
|
|
2723
2735
|
return r.length === 0 ? "0x" : r;
|
|
2724
2736
|
}
|
|
2725
2737
|
function Ks({ params: e, values: t }) {
|
|
2726
2738
|
const n = [];
|
|
2727
2739
|
for (let r = 0; r < e.length; r++)
|
|
2728
|
-
n.push(
|
|
2740
|
+
n.push(kt({ param: e[r], value: t[r] }));
|
|
2729
2741
|
return n;
|
|
2730
2742
|
}
|
|
2731
|
-
function
|
|
2743
|
+
function kt({ param: e, value: t }) {
|
|
2732
2744
|
const n = Nt(e.type);
|
|
2733
2745
|
if (n) {
|
|
2734
2746
|
const [r, s] = n;
|
|
2735
2747
|
return Zs(t, { length: r, param: { ...e, type: s } });
|
|
2736
2748
|
}
|
|
2737
2749
|
if (e.type === "tuple")
|
|
2738
|
-
return
|
|
2750
|
+
return ea(t, {
|
|
2739
2751
|
param: e
|
|
2740
2752
|
});
|
|
2741
2753
|
if (e.type === "address")
|
|
@@ -2757,17 +2769,17 @@ function It({ param: e, value: t }) {
|
|
|
2757
2769
|
docsPath: "/docs/contract/encodeAbiParameters"
|
|
2758
2770
|
});
|
|
2759
2771
|
}
|
|
2760
|
-
function
|
|
2772
|
+
function It(e) {
|
|
2761
2773
|
let t = 0;
|
|
2762
|
-
for (let
|
|
2763
|
-
const { dynamic:
|
|
2764
|
-
|
|
2774
|
+
for (let a = 0; a < e.length; a++) {
|
|
2775
|
+
const { dynamic: i, encoded: o } = e[a];
|
|
2776
|
+
i ? t += 32 : t += B(o);
|
|
2765
2777
|
}
|
|
2766
2778
|
const n = [], r = [];
|
|
2767
2779
|
let s = 0;
|
|
2768
|
-
for (let
|
|
2769
|
-
const { dynamic:
|
|
2770
|
-
|
|
2780
|
+
for (let a = 0; a < e.length; a++) {
|
|
2781
|
+
const { dynamic: i, encoded: o } = e[a];
|
|
2782
|
+
i ? (n.push(k(t + s, { size: 32 })), r.push(o), s += B(o)) : n.push(o);
|
|
2771
2783
|
}
|
|
2772
2784
|
return Se([...n, ...r]);
|
|
2773
2785
|
}
|
|
@@ -2787,26 +2799,26 @@ function Zs(e, { length: t, param: n }) {
|
|
|
2787
2799
|
type: `${n.type}[${t}]`
|
|
2788
2800
|
});
|
|
2789
2801
|
let s = !1;
|
|
2790
|
-
const
|
|
2791
|
-
for (let
|
|
2792
|
-
const o =
|
|
2793
|
-
o.dynamic && (s = !0),
|
|
2802
|
+
const a = [];
|
|
2803
|
+
for (let i = 0; i < e.length; i++) {
|
|
2804
|
+
const o = kt({ param: n, value: e[i] });
|
|
2805
|
+
o.dynamic && (s = !0), a.push(o);
|
|
2794
2806
|
}
|
|
2795
2807
|
if (r || s) {
|
|
2796
|
-
const
|
|
2808
|
+
const i = It(a);
|
|
2797
2809
|
if (r) {
|
|
2798
|
-
const o =
|
|
2810
|
+
const o = k(a.length, { size: 32 });
|
|
2799
2811
|
return {
|
|
2800
2812
|
dynamic: !0,
|
|
2801
|
-
encoded:
|
|
2813
|
+
encoded: a.length > 0 ? Se([o, i]) : o
|
|
2802
2814
|
};
|
|
2803
2815
|
}
|
|
2804
2816
|
if (s)
|
|
2805
|
-
return { dynamic: !0, encoded:
|
|
2817
|
+
return { dynamic: !0, encoded: i };
|
|
2806
2818
|
}
|
|
2807
2819
|
return {
|
|
2808
2820
|
dynamic: !1,
|
|
2809
|
-
encoded: Se(
|
|
2821
|
+
encoded: Se(a.map(({ encoded: i }) => i))
|
|
2810
2822
|
};
|
|
2811
2823
|
}
|
|
2812
2824
|
function Xs(e, { param: t }) {
|
|
@@ -2818,7 +2830,7 @@ function Xs(e, { param: t }) {
|
|
|
2818
2830
|
size: Math.ceil((e.length - 2) / 2 / 32) * 32
|
|
2819
2831
|
})), {
|
|
2820
2832
|
dynamic: !0,
|
|
2821
|
-
encoded: Se([pe(
|
|
2833
|
+
encoded: Se([pe(k(r, { size: 32 })), s])
|
|
2822
2834
|
};
|
|
2823
2835
|
}
|
|
2824
2836
|
if (r !== Number.parseInt(n, 10))
|
|
@@ -2847,7 +2859,7 @@ function Qs(e, { signed: t, size: n = 256 }) {
|
|
|
2847
2859
|
}
|
|
2848
2860
|
return {
|
|
2849
2861
|
dynamic: !1,
|
|
2850
|
-
encoded:
|
|
2862
|
+
encoded: k(e, {
|
|
2851
2863
|
size: 32,
|
|
2852
2864
|
signed: t
|
|
2853
2865
|
})
|
|
@@ -2862,24 +2874,24 @@ function qs(e) {
|
|
|
2862
2874
|
return {
|
|
2863
2875
|
dynamic: !0,
|
|
2864
2876
|
encoded: Se([
|
|
2865
|
-
pe(
|
|
2877
|
+
pe(k(B(t), { size: 32 })),
|
|
2866
2878
|
...r
|
|
2867
2879
|
])
|
|
2868
2880
|
};
|
|
2869
2881
|
}
|
|
2870
|
-
function
|
|
2882
|
+
function ea(e, { param: t }) {
|
|
2871
2883
|
let n = !1;
|
|
2872
2884
|
const r = [];
|
|
2873
2885
|
for (let s = 0; s < t.components.length; s++) {
|
|
2874
|
-
const
|
|
2875
|
-
param:
|
|
2876
|
-
value: e[
|
|
2886
|
+
const a = t.components[s], i = Array.isArray(e) ? s : a.name, o = kt({
|
|
2887
|
+
param: a,
|
|
2888
|
+
value: e[i]
|
|
2877
2889
|
});
|
|
2878
2890
|
r.push(o), o.dynamic && (n = !0);
|
|
2879
2891
|
}
|
|
2880
2892
|
return {
|
|
2881
2893
|
dynamic: n,
|
|
2882
|
-
encoded: n ?
|
|
2894
|
+
encoded: n ? It(r) : Se(r.map(({ encoded: s }) => s))
|
|
2883
2895
|
};
|
|
2884
2896
|
}
|
|
2885
2897
|
function Nt(e) {
|
|
@@ -2900,47 +2912,47 @@ function Sn(e, t) {
|
|
|
2900
2912
|
size: B(t)
|
|
2901
2913
|
});
|
|
2902
2914
|
let s = 0;
|
|
2903
|
-
const
|
|
2904
|
-
for (let
|
|
2905
|
-
const o = e[
|
|
2915
|
+
const a = [];
|
|
2916
|
+
for (let i = 0; i < e.length; ++i) {
|
|
2917
|
+
const o = e[i];
|
|
2906
2918
|
r.setPosition(s);
|
|
2907
2919
|
const [c, d] = Ee(r, o, {
|
|
2908
2920
|
staticPosition: 0
|
|
2909
2921
|
});
|
|
2910
|
-
s += d,
|
|
2922
|
+
s += d, a.push(c);
|
|
2911
2923
|
}
|
|
2912
|
-
return
|
|
2924
|
+
return a;
|
|
2913
2925
|
}
|
|
2914
2926
|
function Ee(e, t, { staticPosition: n }) {
|
|
2915
2927
|
const r = Nt(t.type);
|
|
2916
2928
|
if (r) {
|
|
2917
|
-
const [s,
|
|
2918
|
-
return
|
|
2929
|
+
const [s, a] = r;
|
|
2930
|
+
return na(e, { ...t, type: a }, { length: s, staticPosition: n });
|
|
2919
2931
|
}
|
|
2920
2932
|
if (t.type === "tuple")
|
|
2921
|
-
return
|
|
2933
|
+
return ia(e, t, { staticPosition: n });
|
|
2922
2934
|
if (t.type === "address")
|
|
2923
|
-
return
|
|
2935
|
+
return ta(e);
|
|
2924
2936
|
if (t.type === "bool")
|
|
2925
|
-
return
|
|
2937
|
+
return ra(e);
|
|
2926
2938
|
if (t.type.startsWith("bytes"))
|
|
2927
|
-
return
|
|
2939
|
+
return sa(e, t, { staticPosition: n });
|
|
2928
2940
|
if (t.type.startsWith("uint") || t.type.startsWith("int"))
|
|
2929
|
-
return
|
|
2941
|
+
return aa(e, t);
|
|
2930
2942
|
if (t.type === "string")
|
|
2931
|
-
return
|
|
2943
|
+
return oa(e, { staticPosition: n });
|
|
2932
2944
|
throw new Qr(t.type, {
|
|
2933
2945
|
docsPath: "/docs/contract/decodeAbiParameters"
|
|
2934
2946
|
});
|
|
2935
2947
|
}
|
|
2936
|
-
const Yt = 32,
|
|
2937
|
-
function
|
|
2948
|
+
const Yt = 32, at = 32;
|
|
2949
|
+
function ta(e) {
|
|
2938
2950
|
const t = e.readBytes(32);
|
|
2939
2951
|
return [xn(ue(En(t, -20))), 32];
|
|
2940
2952
|
}
|
|
2941
|
-
function
|
|
2953
|
+
function na(e, t, { length: n, staticPosition: r }) {
|
|
2942
2954
|
if (!n) {
|
|
2943
|
-
const
|
|
2955
|
+
const i = ce(e.readBytes(at)), o = r + i, c = o + Yt;
|
|
2944
2956
|
e.setPosition(o);
|
|
2945
2957
|
const d = ce(e.readBytes(Yt)), l = Ne(t);
|
|
2946
2958
|
let y = 0;
|
|
@@ -2955,7 +2967,7 @@ function ni(e, t, { length: n, staticPosition: r }) {
|
|
|
2955
2967
|
return e.setPosition(r + 32), [p, 32];
|
|
2956
2968
|
}
|
|
2957
2969
|
if (Ne(t)) {
|
|
2958
|
-
const
|
|
2970
|
+
const i = ce(e.readBytes(at)), o = r + i, c = [];
|
|
2959
2971
|
for (let d = 0; d < n; ++d) {
|
|
2960
2972
|
e.setPosition(o + d * 32);
|
|
2961
2973
|
const [l] = Ee(e, t, {
|
|
@@ -2966,23 +2978,23 @@ function ni(e, t, { length: n, staticPosition: r }) {
|
|
|
2966
2978
|
return e.setPosition(r + 32), [c, 32];
|
|
2967
2979
|
}
|
|
2968
2980
|
let s = 0;
|
|
2969
|
-
const
|
|
2970
|
-
for (let
|
|
2981
|
+
const a = [];
|
|
2982
|
+
for (let i = 0; i < n; ++i) {
|
|
2971
2983
|
const [o, c] = Ee(e, t, {
|
|
2972
2984
|
staticPosition: r + s
|
|
2973
2985
|
});
|
|
2974
|
-
s += c,
|
|
2986
|
+
s += c, a.push(o);
|
|
2975
2987
|
}
|
|
2976
|
-
return [
|
|
2988
|
+
return [a, s];
|
|
2977
2989
|
}
|
|
2978
|
-
function
|
|
2990
|
+
function ra(e) {
|
|
2979
2991
|
return [Gs(e.readBytes(32), { size: 32 }), 32];
|
|
2980
2992
|
}
|
|
2981
|
-
function
|
|
2993
|
+
function sa(e, t, { staticPosition: n }) {
|
|
2982
2994
|
const [r, s] = t.type.split("bytes");
|
|
2983
2995
|
if (!s) {
|
|
2984
|
-
const
|
|
2985
|
-
e.setPosition(n +
|
|
2996
|
+
const i = ce(e.readBytes(32));
|
|
2997
|
+
e.setPosition(n + i);
|
|
2986
2998
|
const o = ce(e.readBytes(32));
|
|
2987
2999
|
if (o === 0)
|
|
2988
3000
|
return e.setPosition(n + 32), ["0x", 32];
|
|
@@ -2991,44 +3003,44 @@ function si(e, t, { staticPosition: n }) {
|
|
|
2991
3003
|
}
|
|
2992
3004
|
return [ue(e.readBytes(Number.parseInt(s, 10), 32)), 32];
|
|
2993
3005
|
}
|
|
2994
|
-
function
|
|
3006
|
+
function aa(e, t) {
|
|
2995
3007
|
const n = t.type.startsWith("int"), r = Number.parseInt(t.type.split("int")[1] || "256", 10), s = e.readBytes(32);
|
|
2996
3008
|
return [
|
|
2997
3009
|
r > 48 ? _s(s, { signed: n }) : ce(s, { signed: n }),
|
|
2998
3010
|
32
|
|
2999
3011
|
];
|
|
3000
3012
|
}
|
|
3001
|
-
function
|
|
3002
|
-
const r = t.components.length === 0 || t.components.some(({ name:
|
|
3003
|
-
let
|
|
3013
|
+
function ia(e, t, { staticPosition: n }) {
|
|
3014
|
+
const r = t.components.length === 0 || t.components.some(({ name: i }) => !i), s = r ? [] : {};
|
|
3015
|
+
let a = 0;
|
|
3004
3016
|
if (Ne(t)) {
|
|
3005
|
-
const
|
|
3017
|
+
const i = ce(e.readBytes(at)), o = n + i;
|
|
3006
3018
|
for (let c = 0; c < t.components.length; ++c) {
|
|
3007
3019
|
const d = t.components[c];
|
|
3008
|
-
e.setPosition(o +
|
|
3020
|
+
e.setPosition(o + a);
|
|
3009
3021
|
const [l, y] = Ee(e, d, {
|
|
3010
3022
|
staticPosition: o
|
|
3011
3023
|
});
|
|
3012
|
-
|
|
3024
|
+
a += y, s[r ? c : d?.name] = l;
|
|
3013
3025
|
}
|
|
3014
3026
|
return e.setPosition(n + 32), [s, 32];
|
|
3015
3027
|
}
|
|
3016
|
-
for (let
|
|
3017
|
-
const o = t.components[
|
|
3028
|
+
for (let i = 0; i < t.components.length; ++i) {
|
|
3029
|
+
const o = t.components[i], [c, d] = Ee(e, o, {
|
|
3018
3030
|
staticPosition: n
|
|
3019
3031
|
});
|
|
3020
|
-
s[r ?
|
|
3032
|
+
s[r ? i : o?.name] = c, a += d;
|
|
3021
3033
|
}
|
|
3022
|
-
return [s,
|
|
3034
|
+
return [s, a];
|
|
3023
3035
|
}
|
|
3024
|
-
function
|
|
3036
|
+
function oa(e, { staticPosition: t }) {
|
|
3025
3037
|
const n = ce(e.readBytes(32)), r = t + n;
|
|
3026
3038
|
e.setPosition(r);
|
|
3027
3039
|
const s = ce(e.readBytes(32));
|
|
3028
3040
|
if (s === 0)
|
|
3029
3041
|
return e.setPosition(t + 32), ["", 32];
|
|
3030
|
-
const
|
|
3031
|
-
return e.setPosition(t + 32), [
|
|
3042
|
+
const a = e.readBytes(s, 32), i = Vs(St(a));
|
|
3043
|
+
return e.setPosition(t + 32), [i, 32];
|
|
3032
3044
|
}
|
|
3033
3045
|
function Ne(e) {
|
|
3034
3046
|
const { type: t } = e;
|
|
@@ -3039,23 +3051,23 @@ function Ne(e) {
|
|
|
3039
3051
|
const n = Nt(e.type);
|
|
3040
3052
|
return !!(n && Ne({ ...e, type: n[1] }));
|
|
3041
3053
|
}
|
|
3042
|
-
const
|
|
3043
|
-
function
|
|
3044
|
-
return
|
|
3054
|
+
const ca = (e) => gn(dn(e));
|
|
3055
|
+
function ua(e) {
|
|
3056
|
+
return ca(e);
|
|
3045
3057
|
}
|
|
3046
|
-
const
|
|
3047
|
-
let X = class
|
|
3058
|
+
const da = "1.2.3";
|
|
3059
|
+
let X = class it extends Error {
|
|
3048
3060
|
constructor(t, n = {}) {
|
|
3049
|
-
const r = n.cause instanceof
|
|
3061
|
+
const r = n.cause instanceof it ? n.cause.details : n.cause?.message ? n.cause.message : n.details, s = n.cause instanceof it && n.cause.docsPath || n.docsPath, a = [
|
|
3050
3062
|
t || "An error occurred.",
|
|
3051
3063
|
"",
|
|
3052
3064
|
...n.metaMessages ? [...n.metaMessages, ""] : [],
|
|
3053
3065
|
...s ? [`Docs: https://abitype.dev${s}`] : [],
|
|
3054
3066
|
...r ? [`Details: ${r}`] : [],
|
|
3055
|
-
`Version: abitype@${
|
|
3067
|
+
`Version: abitype@${da}`
|
|
3056
3068
|
].join(`
|
|
3057
3069
|
`);
|
|
3058
|
-
super(
|
|
3070
|
+
super(a), Object.defineProperty(this, "details", {
|
|
3059
3071
|
enumerable: !0,
|
|
3060
3072
|
configurable: !0,
|
|
3061
3073
|
writable: !0,
|
|
@@ -3093,8 +3105,8 @@ function ot(e) {
|
|
|
3093
3105
|
t = "(";
|
|
3094
3106
|
const n = e.components.length;
|
|
3095
3107
|
for (let s = 0; s < n; s++) {
|
|
3096
|
-
const
|
|
3097
|
-
t += ot(
|
|
3108
|
+
const a = e.components[s];
|
|
3109
|
+
t += ot(a), s < n - 1 && (t += ", ");
|
|
3098
3110
|
}
|
|
3099
3111
|
const r = de(Zt, e.type);
|
|
3100
3112
|
return t += `)${r?.array || ""}`, ot({
|
|
@@ -3104,7 +3116,7 @@ function ot(e) {
|
|
|
3104
3116
|
}
|
|
3105
3117
|
return "indexed" in e && e.indexed && (t = `${t} indexed`), e.name ? `${t} ${e.name}` : t;
|
|
3106
3118
|
}
|
|
3107
|
-
function
|
|
3119
|
+
function Ie(e) {
|
|
3108
3120
|
let t = "";
|
|
3109
3121
|
const n = e.length;
|
|
3110
3122
|
for (let r = 0; r < n; r++) {
|
|
@@ -3113,61 +3125,61 @@ function ke(e) {
|
|
|
3113
3125
|
}
|
|
3114
3126
|
return t;
|
|
3115
3127
|
}
|
|
3116
|
-
function
|
|
3117
|
-
return e.type === "function" ? `function ${e.name}(${
|
|
3128
|
+
function la(e) {
|
|
3129
|
+
return e.type === "function" ? `function ${e.name}(${Ie(e.inputs)})${e.stateMutability && e.stateMutability !== "nonpayable" ? ` ${e.stateMutability}` : ""}${e.outputs?.length ? ` returns (${Ie(e.outputs)})` : ""}` : e.type === "event" ? `event ${e.name}(${Ie(e.inputs)})` : e.type === "error" ? `error ${e.name}(${Ie(e.inputs)})` : e.type === "constructor" ? `constructor(${Ie(e.inputs)})${e.stateMutability === "payable" ? " payable" : ""}` : e.type === "fallback" ? `fallback() external${e.stateMutability === "payable" ? " payable" : ""}` : "receive() external payable";
|
|
3118
3130
|
}
|
|
3119
|
-
const
|
|
3120
|
-
function
|
|
3121
|
-
return In.test(e);
|
|
3122
|
-
}
|
|
3123
|
-
function pi(e) {
|
|
3124
|
-
return de(In, e);
|
|
3125
|
-
}
|
|
3126
|
-
const kn = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
3127
|
-
function mi(e) {
|
|
3131
|
+
const kn = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
3132
|
+
function fa(e) {
|
|
3128
3133
|
return kn.test(e);
|
|
3129
3134
|
}
|
|
3130
|
-
function
|
|
3135
|
+
function pa(e) {
|
|
3131
3136
|
return de(kn, e);
|
|
3132
3137
|
}
|
|
3138
|
+
const In = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
3139
|
+
function ma(e) {
|
|
3140
|
+
return In.test(e);
|
|
3141
|
+
}
|
|
3142
|
+
function ya(e) {
|
|
3143
|
+
return de(In, e);
|
|
3144
|
+
}
|
|
3133
3145
|
const Nn = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
|
|
3134
|
-
function
|
|
3146
|
+
function ba(e) {
|
|
3135
3147
|
return Nn.test(e);
|
|
3136
3148
|
}
|
|
3137
|
-
function
|
|
3149
|
+
function ha(e) {
|
|
3138
3150
|
return de(Nn, e);
|
|
3139
3151
|
}
|
|
3140
3152
|
const Rn = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
3141
3153
|
function Mn(e) {
|
|
3142
3154
|
return Rn.test(e);
|
|
3143
3155
|
}
|
|
3144
|
-
function
|
|
3156
|
+
function ga(e) {
|
|
3145
3157
|
return de(Rn, e);
|
|
3146
3158
|
}
|
|
3147
3159
|
const Dn = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
|
|
3148
|
-
function
|
|
3160
|
+
function wa(e) {
|
|
3149
3161
|
return Dn.test(e);
|
|
3150
3162
|
}
|
|
3151
|
-
function
|
|
3163
|
+
function xa(e) {
|
|
3152
3164
|
return de(Dn, e);
|
|
3153
3165
|
}
|
|
3154
3166
|
const On = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
|
|
3155
|
-
function
|
|
3167
|
+
function Ta(e) {
|
|
3156
3168
|
return On.test(e);
|
|
3157
3169
|
}
|
|
3158
|
-
function
|
|
3170
|
+
function va(e) {
|
|
3159
3171
|
return de(On, e);
|
|
3160
3172
|
}
|
|
3161
|
-
const
|
|
3162
|
-
function
|
|
3163
|
-
return
|
|
3173
|
+
const Ea = /^receive\(\) external payable$/;
|
|
3174
|
+
function Pa(e) {
|
|
3175
|
+
return Ea.test(e);
|
|
3164
3176
|
}
|
|
3165
|
-
const
|
|
3177
|
+
const Sa = /* @__PURE__ */ new Set(["indexed"]), ct = /* @__PURE__ */ new Set([
|
|
3166
3178
|
"calldata",
|
|
3167
3179
|
"memory",
|
|
3168
3180
|
"storage"
|
|
3169
3181
|
]);
|
|
3170
|
-
class
|
|
3182
|
+
class Aa extends X {
|
|
3171
3183
|
constructor({ type: t }) {
|
|
3172
3184
|
super("Unknown type.", {
|
|
3173
3185
|
metaMessages: [
|
|
@@ -3181,7 +3193,7 @@ class Ai extends X {
|
|
|
3181
3193
|
});
|
|
3182
3194
|
}
|
|
3183
3195
|
}
|
|
3184
|
-
class $
|
|
3196
|
+
class $a extends X {
|
|
3185
3197
|
constructor({ type: t }) {
|
|
3186
3198
|
super("Unknown type.", {
|
|
3187
3199
|
metaMessages: [`Type "${t}" is not a valid ABI type.`]
|
|
@@ -3193,7 +3205,7 @@ class $i extends X {
|
|
|
3193
3205
|
});
|
|
3194
3206
|
}
|
|
3195
3207
|
}
|
|
3196
|
-
class
|
|
3208
|
+
class Ca extends X {
|
|
3197
3209
|
constructor({ param: t }) {
|
|
3198
3210
|
super("Invalid ABI parameter.", {
|
|
3199
3211
|
details: t
|
|
@@ -3205,7 +3217,7 @@ class Ci extends X {
|
|
|
3205
3217
|
});
|
|
3206
3218
|
}
|
|
3207
3219
|
}
|
|
3208
|
-
class
|
|
3220
|
+
class ka extends X {
|
|
3209
3221
|
constructor({ param: t, name: n }) {
|
|
3210
3222
|
super("Invalid ABI parameter.", {
|
|
3211
3223
|
details: t,
|
|
@@ -3220,7 +3232,7 @@ class Ii extends X {
|
|
|
3220
3232
|
});
|
|
3221
3233
|
}
|
|
3222
3234
|
}
|
|
3223
|
-
class
|
|
3235
|
+
class Ia extends X {
|
|
3224
3236
|
constructor({ param: t, type: n, modifier: r }) {
|
|
3225
3237
|
super("Invalid ABI parameter.", {
|
|
3226
3238
|
details: t,
|
|
@@ -3235,7 +3247,7 @@ class ki extends X {
|
|
|
3235
3247
|
});
|
|
3236
3248
|
}
|
|
3237
3249
|
}
|
|
3238
|
-
class
|
|
3250
|
+
class Na extends X {
|
|
3239
3251
|
constructor({ param: t, type: n, modifier: r }) {
|
|
3240
3252
|
super("Invalid ABI parameter.", {
|
|
3241
3253
|
details: t,
|
|
@@ -3251,7 +3263,7 @@ class Ni extends X {
|
|
|
3251
3263
|
});
|
|
3252
3264
|
}
|
|
3253
3265
|
}
|
|
3254
|
-
class
|
|
3266
|
+
class Ra extends X {
|
|
3255
3267
|
constructor({ abiParameter: t }) {
|
|
3256
3268
|
super("Invalid ABI parameter.", {
|
|
3257
3269
|
details: JSON.stringify(t, null, 2),
|
|
@@ -3276,7 +3288,7 @@ class $e extends X {
|
|
|
3276
3288
|
});
|
|
3277
3289
|
}
|
|
3278
3290
|
}
|
|
3279
|
-
class
|
|
3291
|
+
class Ma extends X {
|
|
3280
3292
|
constructor({ signature: t }) {
|
|
3281
3293
|
super("Unknown signature.", {
|
|
3282
3294
|
details: t
|
|
@@ -3288,7 +3300,7 @@ class Mi extends X {
|
|
|
3288
3300
|
});
|
|
3289
3301
|
}
|
|
3290
3302
|
}
|
|
3291
|
-
class
|
|
3303
|
+
class Da extends X {
|
|
3292
3304
|
constructor({ signature: t }) {
|
|
3293
3305
|
super("Invalid struct signature.", {
|
|
3294
3306
|
details: t,
|
|
@@ -3301,7 +3313,7 @@ class Di extends X {
|
|
|
3301
3313
|
});
|
|
3302
3314
|
}
|
|
3303
3315
|
}
|
|
3304
|
-
class
|
|
3316
|
+
class Oa extends X {
|
|
3305
3317
|
constructor({ type: t }) {
|
|
3306
3318
|
super("Circular reference detected.", {
|
|
3307
3319
|
metaMessages: [`Struct "${t}" is a circular reference.`]
|
|
@@ -3313,7 +3325,7 @@ class Oi extends X {
|
|
|
3313
3325
|
});
|
|
3314
3326
|
}
|
|
3315
3327
|
}
|
|
3316
|
-
class
|
|
3328
|
+
class Ba extends X {
|
|
3317
3329
|
constructor({ current: t, depth: n }) {
|
|
3318
3330
|
super("Unbalanced parentheses.", {
|
|
3319
3331
|
metaMessages: [
|
|
@@ -3328,16 +3340,16 @@ class Bi extends X {
|
|
|
3328
3340
|
});
|
|
3329
3341
|
}
|
|
3330
3342
|
}
|
|
3331
|
-
function
|
|
3343
|
+
function Ua(e, t, n) {
|
|
3332
3344
|
let r = "";
|
|
3333
3345
|
if (n)
|
|
3334
3346
|
for (const s of Object.entries(n)) {
|
|
3335
3347
|
if (!s)
|
|
3336
3348
|
continue;
|
|
3337
|
-
let
|
|
3338
|
-
for (const
|
|
3339
|
-
|
|
3340
|
-
r += `(${s[0]}{${
|
|
3349
|
+
let a = "";
|
|
3350
|
+
for (const i of s[1])
|
|
3351
|
+
a += `[${i.type}${i.name ? `:${i.name}` : ""}]`;
|
|
3352
|
+
r += `(${s[0]}{${a}})`;
|
|
3341
3353
|
}
|
|
3342
3354
|
return t ? `${t}:${e}${r}` : `${e}${r}`;
|
|
3343
3355
|
}
|
|
@@ -3395,40 +3407,40 @@ const et = /* @__PURE__ */ new Map([
|
|
|
3395
3407
|
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
3396
3408
|
]
|
|
3397
3409
|
]);
|
|
3398
|
-
function
|
|
3399
|
-
if (
|
|
3400
|
-
return
|
|
3401
|
-
if (
|
|
3402
|
-
return
|
|
3403
|
-
if (
|
|
3404
|
-
return
|
|
3405
|
-
if (
|
|
3406
|
-
return
|
|
3407
|
-
if (
|
|
3408
|
-
return
|
|
3409
|
-
if (
|
|
3410
|
+
function La(e, t = {}) {
|
|
3411
|
+
if (ba(e))
|
|
3412
|
+
return Fa(e, t);
|
|
3413
|
+
if (ma(e))
|
|
3414
|
+
return ja(e, t);
|
|
3415
|
+
if (fa(e))
|
|
3416
|
+
return za(e, t);
|
|
3417
|
+
if (wa(e))
|
|
3418
|
+
return _a(e, t);
|
|
3419
|
+
if (Ta(e))
|
|
3420
|
+
return Ga(e);
|
|
3421
|
+
if (Pa(e))
|
|
3410
3422
|
return {
|
|
3411
3423
|
type: "receive",
|
|
3412
3424
|
stateMutability: "payable"
|
|
3413
3425
|
};
|
|
3414
|
-
throw new
|
|
3426
|
+
throw new Ma({ signature: e });
|
|
3415
3427
|
}
|
|
3416
|
-
function
|
|
3417
|
-
const n =
|
|
3428
|
+
function Fa(e, t = {}) {
|
|
3429
|
+
const n = ha(e);
|
|
3418
3430
|
if (!n)
|
|
3419
3431
|
throw new $e({ signature: e, type: "function" });
|
|
3420
|
-
const r = ne(n.parameters), s = [],
|
|
3421
|
-
for (let o = 0; o <
|
|
3432
|
+
const r = ne(n.parameters), s = [], a = r.length;
|
|
3433
|
+
for (let o = 0; o < a; o++)
|
|
3422
3434
|
s.push(we(r[o], {
|
|
3423
3435
|
modifiers: ct,
|
|
3424
3436
|
structs: t,
|
|
3425
3437
|
type: "function"
|
|
3426
3438
|
}));
|
|
3427
|
-
const
|
|
3439
|
+
const i = [];
|
|
3428
3440
|
if (n.returns) {
|
|
3429
3441
|
const o = ne(n.returns), c = o.length;
|
|
3430
3442
|
for (let d = 0; d < c; d++)
|
|
3431
|
-
|
|
3443
|
+
i.push(we(o[d], {
|
|
3432
3444
|
modifiers: ct,
|
|
3433
3445
|
structs: t,
|
|
3434
3446
|
type: "function"
|
|
@@ -3439,46 +3451,46 @@ function Fi(e, t = {}) {
|
|
|
3439
3451
|
type: "function",
|
|
3440
3452
|
stateMutability: n.stateMutability ?? "nonpayable",
|
|
3441
3453
|
inputs: s,
|
|
3442
|
-
outputs:
|
|
3454
|
+
outputs: i
|
|
3443
3455
|
};
|
|
3444
3456
|
}
|
|
3445
|
-
function
|
|
3446
|
-
const n =
|
|
3457
|
+
function ja(e, t = {}) {
|
|
3458
|
+
const n = ya(e);
|
|
3447
3459
|
if (!n)
|
|
3448
3460
|
throw new $e({ signature: e, type: "event" });
|
|
3449
|
-
const r = ne(n.parameters), s = [],
|
|
3450
|
-
for (let
|
|
3451
|
-
s.push(we(r[
|
|
3452
|
-
modifiers:
|
|
3461
|
+
const r = ne(n.parameters), s = [], a = r.length;
|
|
3462
|
+
for (let i = 0; i < a; i++)
|
|
3463
|
+
s.push(we(r[i], {
|
|
3464
|
+
modifiers: Sa,
|
|
3453
3465
|
structs: t,
|
|
3454
3466
|
type: "event"
|
|
3455
3467
|
}));
|
|
3456
3468
|
return { name: n.name, type: "event", inputs: s };
|
|
3457
3469
|
}
|
|
3458
|
-
function
|
|
3459
|
-
const n =
|
|
3470
|
+
function za(e, t = {}) {
|
|
3471
|
+
const n = pa(e);
|
|
3460
3472
|
if (!n)
|
|
3461
3473
|
throw new $e({ signature: e, type: "error" });
|
|
3462
|
-
const r = ne(n.parameters), s = [],
|
|
3463
|
-
for (let
|
|
3464
|
-
s.push(we(r[
|
|
3474
|
+
const r = ne(n.parameters), s = [], a = r.length;
|
|
3475
|
+
for (let i = 0; i < a; i++)
|
|
3476
|
+
s.push(we(r[i], { structs: t, type: "error" }));
|
|
3465
3477
|
return { name: n.name, type: "error", inputs: s };
|
|
3466
3478
|
}
|
|
3467
|
-
function
|
|
3468
|
-
const n =
|
|
3479
|
+
function _a(e, t = {}) {
|
|
3480
|
+
const n = xa(e);
|
|
3469
3481
|
if (!n)
|
|
3470
3482
|
throw new $e({ signature: e, type: "constructor" });
|
|
3471
|
-
const r = ne(n.parameters), s = [],
|
|
3472
|
-
for (let
|
|
3473
|
-
s.push(we(r[
|
|
3483
|
+
const r = ne(n.parameters), s = [], a = r.length;
|
|
3484
|
+
for (let i = 0; i < a; i++)
|
|
3485
|
+
s.push(we(r[i], { structs: t, type: "constructor" }));
|
|
3474
3486
|
return {
|
|
3475
3487
|
type: "constructor",
|
|
3476
3488
|
stateMutability: n.stateMutability ?? "nonpayable",
|
|
3477
3489
|
inputs: s
|
|
3478
3490
|
};
|
|
3479
3491
|
}
|
|
3480
|
-
function
|
|
3481
|
-
const t =
|
|
3492
|
+
function Ga(e) {
|
|
3493
|
+
const t = va(e);
|
|
3482
3494
|
if (!t)
|
|
3483
3495
|
throw new $e({ signature: e, type: "fallback" });
|
|
3484
3496
|
return {
|
|
@@ -3486,17 +3498,17 @@ function Gi(e) {
|
|
|
3486
3498
|
stateMutability: t.stateMutability ?? "nonpayable"
|
|
3487
3499
|
};
|
|
3488
3500
|
}
|
|
3489
|
-
const
|
|
3501
|
+
const Va = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, Ha = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, Wa = /^u?int$/;
|
|
3490
3502
|
function we(e, t) {
|
|
3491
|
-
const n =
|
|
3503
|
+
const n = Ua(e, t?.type, t?.structs);
|
|
3492
3504
|
if (et.has(n))
|
|
3493
3505
|
return et.get(n);
|
|
3494
|
-
const r = Cn.test(e), s = de(r ?
|
|
3506
|
+
const r = Cn.test(e), s = de(r ? Ha : Va, e);
|
|
3495
3507
|
if (!s)
|
|
3496
|
-
throw new
|
|
3497
|
-
if (s.name &&
|
|
3498
|
-
throw new
|
|
3499
|
-
const
|
|
3508
|
+
throw new Ca({ param: e });
|
|
3509
|
+
if (s.name && Ya(s.name))
|
|
3510
|
+
throw new ka({ param: e, name: s.name });
|
|
3511
|
+
const a = s.name ? { name: s.name } : {}, i = s.modifier === "indexed" ? { indexed: !0 } : {}, o = t?.structs ?? {};
|
|
3500
3512
|
let c, d = {};
|
|
3501
3513
|
if (r) {
|
|
3502
3514
|
c = "tuple";
|
|
@@ -3506,21 +3518,21 @@ function we(e, t) {
|
|
|
3506
3518
|
d = { components: p };
|
|
3507
3519
|
} else if (s.type in o)
|
|
3508
3520
|
c = "tuple", d = { components: o[s.type] };
|
|
3509
|
-
else if (
|
|
3521
|
+
else if (Wa.test(s.type))
|
|
3510
3522
|
c = `${s.type}256`;
|
|
3511
3523
|
else if (s.type === "address payable")
|
|
3512
3524
|
c = "address";
|
|
3513
3525
|
else if (c = s.type, t?.type !== "struct" && !Bn(c))
|
|
3514
|
-
throw new $
|
|
3526
|
+
throw new $a({ type: c });
|
|
3515
3527
|
if (s.modifier) {
|
|
3516
3528
|
if (!t?.modifiers?.has?.(s.modifier))
|
|
3517
|
-
throw new
|
|
3529
|
+
throw new Ia({
|
|
3518
3530
|
param: e,
|
|
3519
3531
|
type: t?.type,
|
|
3520
3532
|
modifier: s.modifier
|
|
3521
3533
|
});
|
|
3522
|
-
if (ct.has(s.modifier) && !
|
|
3523
|
-
throw new
|
|
3534
|
+
if (ct.has(s.modifier) && !Za(c, !!s.array))
|
|
3535
|
+
throw new Na({
|
|
3524
3536
|
param: e,
|
|
3525
3537
|
type: t?.type,
|
|
3526
3538
|
modifier: s.modifier
|
|
@@ -3528,50 +3540,50 @@ function we(e, t) {
|
|
|
3528
3540
|
}
|
|
3529
3541
|
const l = {
|
|
3530
3542
|
type: `${c}${s.array ?? ""}`,
|
|
3531
|
-
...i,
|
|
3532
3543
|
...a,
|
|
3544
|
+
...i,
|
|
3533
3545
|
...d
|
|
3534
3546
|
};
|
|
3535
3547
|
return et.set(n, l), l;
|
|
3536
3548
|
}
|
|
3537
3549
|
function ne(e, t = [], n = "", r = 0) {
|
|
3538
3550
|
const s = e.trim().length;
|
|
3539
|
-
for (let
|
|
3540
|
-
const
|
|
3541
|
-
switch (
|
|
3551
|
+
for (let a = 0; a < s; a++) {
|
|
3552
|
+
const i = e[a], o = e.slice(a + 1);
|
|
3553
|
+
switch (i) {
|
|
3542
3554
|
case ",":
|
|
3543
|
-
return r === 0 ? ne(o, [...t, n.trim()]) : ne(o, t, `${n}${
|
|
3555
|
+
return r === 0 ? ne(o, [...t, n.trim()]) : ne(o, t, `${n}${i}`, r);
|
|
3544
3556
|
case "(":
|
|
3545
|
-
return ne(o, t, `${n}${
|
|
3557
|
+
return ne(o, t, `${n}${i}`, r + 1);
|
|
3546
3558
|
case ")":
|
|
3547
|
-
return ne(o, t, `${n}${
|
|
3559
|
+
return ne(o, t, `${n}${i}`, r - 1);
|
|
3548
3560
|
default:
|
|
3549
|
-
return ne(o, t, `${n}${
|
|
3561
|
+
return ne(o, t, `${n}${i}`, r);
|
|
3550
3562
|
}
|
|
3551
3563
|
}
|
|
3552
3564
|
if (n === "")
|
|
3553
3565
|
return t;
|
|
3554
3566
|
if (r !== 0)
|
|
3555
|
-
throw new
|
|
3567
|
+
throw new Ba({ current: n, depth: r });
|
|
3556
3568
|
return t.push(n.trim()), t;
|
|
3557
3569
|
}
|
|
3558
3570
|
function Bn(e) {
|
|
3559
3571
|
return e === "address" || e === "bool" || e === "function" || e === "string" || An.test(e) || $n.test(e);
|
|
3560
3572
|
}
|
|
3561
|
-
const
|
|
3562
|
-
function
|
|
3563
|
-
return e === "address" || e === "bool" || e === "function" || e === "string" || e === "tuple" || An.test(e) || $n.test(e) ||
|
|
3573
|
+
const Ka = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;
|
|
3574
|
+
function Ya(e) {
|
|
3575
|
+
return e === "address" || e === "bool" || e === "function" || e === "string" || e === "tuple" || An.test(e) || $n.test(e) || Ka.test(e);
|
|
3564
3576
|
}
|
|
3565
|
-
function
|
|
3577
|
+
function Za(e, t) {
|
|
3566
3578
|
return t || e === "bytes" || e === "string" || e === "tuple";
|
|
3567
3579
|
}
|
|
3568
|
-
function
|
|
3580
|
+
function Xa(e) {
|
|
3569
3581
|
const t = {}, n = e.length;
|
|
3570
|
-
for (let
|
|
3571
|
-
const o = e[
|
|
3582
|
+
for (let i = 0; i < n; i++) {
|
|
3583
|
+
const o = e[i];
|
|
3572
3584
|
if (!Mn(o))
|
|
3573
3585
|
continue;
|
|
3574
|
-
const c =
|
|
3586
|
+
const c = ga(o);
|
|
3575
3587
|
if (!c)
|
|
3576
3588
|
throw new $e({ signature: o, type: "struct" });
|
|
3577
3589
|
const d = c.properties.split(";"), l = [], y = d.length;
|
|
@@ -3585,93 +3597,93 @@ function Xi(e) {
|
|
|
3585
3597
|
l.push(v);
|
|
3586
3598
|
}
|
|
3587
3599
|
if (!l.length)
|
|
3588
|
-
throw new
|
|
3600
|
+
throw new Da({ signature: o });
|
|
3589
3601
|
t[c.name] = l;
|
|
3590
3602
|
}
|
|
3591
|
-
const r = {}, s = Object.entries(t),
|
|
3592
|
-
for (let
|
|
3593
|
-
const [o, c] = s[
|
|
3603
|
+
const r = {}, s = Object.entries(t), a = s.length;
|
|
3604
|
+
for (let i = 0; i < a; i++) {
|
|
3605
|
+
const [o, c] = s[i];
|
|
3594
3606
|
r[o] = Un(c, t);
|
|
3595
3607
|
}
|
|
3596
3608
|
return r;
|
|
3597
3609
|
}
|
|
3598
|
-
const
|
|
3610
|
+
const Ja = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
|
|
3599
3611
|
function Un(e = [], t = {}, n = /* @__PURE__ */ new Set()) {
|
|
3600
3612
|
const r = [], s = e.length;
|
|
3601
|
-
for (let
|
|
3602
|
-
const
|
|
3603
|
-
if (Cn.test(
|
|
3604
|
-
r.push(
|
|
3613
|
+
for (let a = 0; a < s; a++) {
|
|
3614
|
+
const i = e[a];
|
|
3615
|
+
if (Cn.test(i.type))
|
|
3616
|
+
r.push(i);
|
|
3605
3617
|
else {
|
|
3606
|
-
const c = de(
|
|
3618
|
+
const c = de(Ja, i.type);
|
|
3607
3619
|
if (!c?.type)
|
|
3608
|
-
throw new
|
|
3620
|
+
throw new Ra({ abiParameter: i });
|
|
3609
3621
|
const { array: d, type: l } = c;
|
|
3610
3622
|
if (l in t) {
|
|
3611
3623
|
if (n.has(l))
|
|
3612
|
-
throw new
|
|
3624
|
+
throw new Oa({ type: l });
|
|
3613
3625
|
r.push({
|
|
3614
|
-
...
|
|
3626
|
+
...i,
|
|
3615
3627
|
type: `tuple${d ?? ""}`,
|
|
3616
3628
|
components: Un(t[l], t, /* @__PURE__ */ new Set([...n, l]))
|
|
3617
3629
|
});
|
|
3618
3630
|
} else if (Bn(l))
|
|
3619
|
-
r.push(
|
|
3631
|
+
r.push(i);
|
|
3620
3632
|
else
|
|
3621
|
-
throw new
|
|
3633
|
+
throw new Aa({ type: l });
|
|
3622
3634
|
}
|
|
3623
3635
|
}
|
|
3624
3636
|
return r;
|
|
3625
3637
|
}
|
|
3626
3638
|
function Ln(e) {
|
|
3627
|
-
const t =
|
|
3639
|
+
const t = Xa(e), n = [], r = e.length;
|
|
3628
3640
|
for (let s = 0; s < r; s++) {
|
|
3629
|
-
const
|
|
3630
|
-
Mn(
|
|
3641
|
+
const a = e[s];
|
|
3642
|
+
Mn(a) || n.push(La(a, t));
|
|
3631
3643
|
}
|
|
3632
3644
|
return n;
|
|
3633
3645
|
}
|
|
3634
|
-
function
|
|
3635
|
-
let t = !0, n = "", r = 0, s = "",
|
|
3636
|
-
for (let
|
|
3637
|
-
const o = e[
|
|
3646
|
+
function Qa(e) {
|
|
3647
|
+
let t = !0, n = "", r = 0, s = "", a = !1;
|
|
3648
|
+
for (let i = 0; i < e.length; i++) {
|
|
3649
|
+
const o = e[i];
|
|
3638
3650
|
if (["(", ")", ","].includes(o) && (t = !0), o === "(" && r++, o === ")" && r--, !!t) {
|
|
3639
3651
|
if (r === 0) {
|
|
3640
3652
|
if (o === " " && ["event", "function", ""].includes(s))
|
|
3641
3653
|
s = "";
|
|
3642
3654
|
else if (s += o, o === ")") {
|
|
3643
|
-
|
|
3655
|
+
a = !0;
|
|
3644
3656
|
break;
|
|
3645
3657
|
}
|
|
3646
3658
|
continue;
|
|
3647
3659
|
}
|
|
3648
3660
|
if (o === " ") {
|
|
3649
|
-
e[
|
|
3661
|
+
e[i - 1] !== "," && n !== "," && n !== ",(" && (n = "", t = !1);
|
|
3650
3662
|
continue;
|
|
3651
3663
|
}
|
|
3652
3664
|
s += o, n += o;
|
|
3653
3665
|
}
|
|
3654
3666
|
}
|
|
3655
|
-
if (!
|
|
3667
|
+
if (!a)
|
|
3656
3668
|
throw new f("Unable to normalize signature.");
|
|
3657
3669
|
return s;
|
|
3658
3670
|
}
|
|
3659
|
-
const
|
|
3660
|
-
const t = typeof e == "string" ? e :
|
|
3661
|
-
return
|
|
3671
|
+
const qa = (e) => {
|
|
3672
|
+
const t = typeof e == "string" ? e : la(e);
|
|
3673
|
+
return Qa(t);
|
|
3662
3674
|
};
|
|
3663
3675
|
function Fn(e) {
|
|
3664
|
-
return
|
|
3676
|
+
return ua(qa(e));
|
|
3665
3677
|
}
|
|
3666
|
-
const
|
|
3678
|
+
const ei = Fn, Rt = (e) => je(Fn(e), 0, 4);
|
|
3667
3679
|
function Mt(e) {
|
|
3668
|
-
const { abi: t, args: n = [], name: r } = e, s = Re(r, { strict: !1 }),
|
|
3669
|
-
if (
|
|
3680
|
+
const { abi: t, args: n = [], name: r } = e, s = Re(r, { strict: !1 }), a = t.filter((o) => s ? o.type === "function" ? Rt(o) === r : o.type === "event" ? ei(o) === r : !1 : "name" in o && o.name === r);
|
|
3681
|
+
if (a.length === 0)
|
|
3670
3682
|
return;
|
|
3671
|
-
if (
|
|
3672
|
-
return
|
|
3673
|
-
let
|
|
3674
|
-
for (const o of
|
|
3683
|
+
if (a.length === 1)
|
|
3684
|
+
return a[0];
|
|
3685
|
+
let i;
|
|
3686
|
+
for (const o of a) {
|
|
3675
3687
|
if (!("inputs" in o))
|
|
3676
3688
|
continue;
|
|
3677
3689
|
if (!n || n.length === 0) {
|
|
@@ -3685,21 +3697,21 @@ function Mt(e) {
|
|
|
3685
3697
|
const y = "inputs" in o && o.inputs[l];
|
|
3686
3698
|
return y ? ut(d, y) : !1;
|
|
3687
3699
|
})) {
|
|
3688
|
-
if (
|
|
3689
|
-
const d = jn(o.inputs,
|
|
3700
|
+
if (i && "inputs" in i && i.inputs) {
|
|
3701
|
+
const d = jn(o.inputs, i.inputs, n);
|
|
3690
3702
|
if (d)
|
|
3691
3703
|
throw new Xr({
|
|
3692
3704
|
abiItem: o,
|
|
3693
3705
|
type: d[0]
|
|
3694
3706
|
}, {
|
|
3695
|
-
abiItem:
|
|
3707
|
+
abiItem: i,
|
|
3696
3708
|
type: d[1]
|
|
3697
3709
|
});
|
|
3698
3710
|
}
|
|
3699
|
-
|
|
3711
|
+
i = o;
|
|
3700
3712
|
}
|
|
3701
3713
|
}
|
|
3702
|
-
return
|
|
3714
|
+
return i || a[0];
|
|
3703
3715
|
}
|
|
3704
3716
|
function ut(e, t) {
|
|
3705
3717
|
const n = typeof e, r = t.type;
|
|
@@ -3713,7 +3725,7 @@ function ut(e, t) {
|
|
|
3713
3725
|
case "string":
|
|
3714
3726
|
return n === "string";
|
|
3715
3727
|
default:
|
|
3716
|
-
return r === "tuple" && "components" in t ? Object.values(t.components).every((s,
|
|
3728
|
+
return r === "tuple" && "components" in t ? Object.values(t.components).every((s, a) => n === "object" && ut(Object.values(e)[a], s)) : /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r) ? n === "number" || n === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r) ? n === "string" || e instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r) ? Array.isArray(e) && e.every((s) => ut(s, {
|
|
3717
3729
|
...t,
|
|
3718
3730
|
// Pop off `[]` or `[M]` from end of type
|
|
3719
3731
|
type: r.replace(/(\[[0-9]{0,}\])$/, "")
|
|
@@ -3722,47 +3734,47 @@ function ut(e, t) {
|
|
|
3722
3734
|
}
|
|
3723
3735
|
function jn(e, t, n) {
|
|
3724
3736
|
for (const r in e) {
|
|
3725
|
-
const s = e[r],
|
|
3726
|
-
if (s.type === "tuple" &&
|
|
3727
|
-
return jn(s.components,
|
|
3728
|
-
const
|
|
3729
|
-
if (
|
|
3730
|
-
return
|
|
3737
|
+
const s = e[r], a = t[r];
|
|
3738
|
+
if (s.type === "tuple" && a.type === "tuple" && "components" in s && "components" in a)
|
|
3739
|
+
return jn(s.components, a.components, n[r]);
|
|
3740
|
+
const i = [s.type, a.type];
|
|
3741
|
+
if (i.includes("address") && i.includes("bytes20") ? !0 : i.includes("address") && i.includes("string") ? ge(n[r], { strict: !1 }) : i.includes("address") && i.includes("bytes") ? ge(n[r], { strict: !1 }) : !1)
|
|
3742
|
+
return i;
|
|
3731
3743
|
}
|
|
3732
3744
|
}
|
|
3733
3745
|
const tt = "/docs/contract/decodeFunctionResult";
|
|
3734
3746
|
function zn(e) {
|
|
3735
3747
|
const { abi: t, args: n, functionName: r, data: s } = e;
|
|
3736
|
-
let
|
|
3748
|
+
let a = t[0];
|
|
3737
3749
|
if (r) {
|
|
3738
3750
|
const o = Mt({ abi: t, args: n, name: r });
|
|
3739
3751
|
if (!o)
|
|
3740
3752
|
throw new Ue(r, { docsPath: tt });
|
|
3741
|
-
|
|
3753
|
+
a = o;
|
|
3742
3754
|
}
|
|
3743
|
-
if (
|
|
3755
|
+
if (a.type !== "function")
|
|
3744
3756
|
throw new Ue(void 0, { docsPath: tt });
|
|
3745
|
-
if (!
|
|
3746
|
-
throw new Zr(
|
|
3747
|
-
const
|
|
3748
|
-
if (
|
|
3749
|
-
return
|
|
3750
|
-
if (
|
|
3751
|
-
return
|
|
3757
|
+
if (!a.outputs)
|
|
3758
|
+
throw new Zr(a.name, { docsPath: tt });
|
|
3759
|
+
const i = Sn(a.outputs, s);
|
|
3760
|
+
if (i && i.length > 1)
|
|
3761
|
+
return i;
|
|
3762
|
+
if (i && i.length === 1)
|
|
3763
|
+
return i[0];
|
|
3752
3764
|
}
|
|
3753
3765
|
const Xt = "/docs/contract/encodeFunctionData";
|
|
3754
|
-
function
|
|
3766
|
+
function ti(e) {
|
|
3755
3767
|
const { abi: t, args: n, functionName: r } = e;
|
|
3756
3768
|
let s = t[0];
|
|
3757
3769
|
if (r) {
|
|
3758
|
-
const
|
|
3770
|
+
const a = Mt({
|
|
3759
3771
|
abi: t,
|
|
3760
3772
|
args: n,
|
|
3761
3773
|
name: r
|
|
3762
3774
|
});
|
|
3763
|
-
if (!
|
|
3775
|
+
if (!a)
|
|
3764
3776
|
throw new Ue(r, { docsPath: Xt });
|
|
3765
|
-
s =
|
|
3777
|
+
s = a;
|
|
3766
3778
|
}
|
|
3767
3779
|
if (s.type !== "function")
|
|
3768
3780
|
throw new Ue(void 0, { docsPath: Xt });
|
|
@@ -3772,8 +3784,8 @@ function ta(e) {
|
|
|
3772
3784
|
};
|
|
3773
3785
|
}
|
|
3774
3786
|
function _n(e) {
|
|
3775
|
-
const { args: t } = e, { abi: n, functionName: r } = e.abi.length === 1 && e.functionName?.startsWith("0x") ? e :
|
|
3776
|
-
return Ct([
|
|
3787
|
+
const { args: t } = e, { abi: n, functionName: r } = e.abi.length === 1 && e.functionName?.startsWith("0x") ? e : ti(e), s = n[0], a = r, i = "inputs" in s && s.inputs ? Pn(s.inputs, t ?? []) : void 0;
|
|
3788
|
+
return Ct([a, i ?? "0x"]);
|
|
3777
3789
|
}
|
|
3778
3790
|
class dt extends f {
|
|
3779
3791
|
constructor({ blockNumber: t, chain: n, contract: r }) {
|
|
@@ -3797,7 +3809,7 @@ class Gn extends f {
|
|
|
3797
3809
|
});
|
|
3798
3810
|
}
|
|
3799
3811
|
}
|
|
3800
|
-
function
|
|
3812
|
+
function ni({ blockNumber: e, chain: t, contract: n }) {
|
|
3801
3813
|
const r = t?.contracts?.[n];
|
|
3802
3814
|
if (!r)
|
|
3803
3815
|
throw new dt({
|
|
@@ -3818,7 +3830,7 @@ function na({ blockNumber: e, chain: t, contract: n }) {
|
|
|
3818
3830
|
function Dt(e) {
|
|
3819
3831
|
return typeof e == "string" ? { address: e, type: "json-rpc" } : e;
|
|
3820
3832
|
}
|
|
3821
|
-
const
|
|
3833
|
+
const ri = {
|
|
3822
3834
|
1: "An `assert` condition failed.",
|
|
3823
3835
|
17: "Arithmetic operation resulted in underflow or overflow.",
|
|
3824
3836
|
18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
|
|
@@ -3828,7 +3840,7 @@ const ra = {
|
|
|
3828
3840
|
50: "Array index is out of bounds.",
|
|
3829
3841
|
65: "Allocated too much memory or created an array which is too large.",
|
|
3830
3842
|
81: "Attempted to call a zero-initialized variable of internal function type."
|
|
3831
|
-
},
|
|
3843
|
+
}, si = {
|
|
3832
3844
|
inputs: [
|
|
3833
3845
|
{
|
|
3834
3846
|
name: "message",
|
|
@@ -3837,7 +3849,7 @@ const ra = {
|
|
|
3837
3849
|
],
|
|
3838
3850
|
name: "Error",
|
|
3839
3851
|
type: "error"
|
|
3840
|
-
},
|
|
3852
|
+
}, ai = {
|
|
3841
3853
|
inputs: [
|
|
3842
3854
|
{
|
|
3843
3855
|
name: "reason",
|
|
@@ -3847,30 +3859,30 @@ const ra = {
|
|
|
3847
3859
|
name: "Panic",
|
|
3848
3860
|
type: "error"
|
|
3849
3861
|
};
|
|
3850
|
-
function
|
|
3862
|
+
function ii(e) {
|
|
3851
3863
|
const { abi: t, data: n } = e, r = je(n, 0, 4);
|
|
3852
3864
|
if (r === "0x")
|
|
3853
3865
|
throw new Pt();
|
|
3854
|
-
const
|
|
3855
|
-
if (!
|
|
3866
|
+
const a = [...t || [], si, ai].find((i) => i.type === "error" && r === Rt(Pe(i)));
|
|
3867
|
+
if (!a)
|
|
3856
3868
|
throw new nn(r, {
|
|
3857
3869
|
docsPath: "/docs/contract/decodeErrorResult"
|
|
3858
3870
|
});
|
|
3859
3871
|
return {
|
|
3860
|
-
abiItem:
|
|
3861
|
-
args: "inputs" in
|
|
3862
|
-
errorName:
|
|
3872
|
+
abiItem: a,
|
|
3873
|
+
args: "inputs" in a && a.inputs && a.inputs.length > 0 ? Sn(a.inputs, je(n, 4)) : void 0,
|
|
3874
|
+
errorName: a.name
|
|
3863
3875
|
};
|
|
3864
3876
|
}
|
|
3865
3877
|
const Ot = (e, t, n) => JSON.stringify(e, (r, s) => typeof s == "bigint" ? s.toString() : s, n);
|
|
3866
3878
|
function Vn({ abiItem: e, args: t, includeFunctionName: n = !0, includeName: r = !1 }) {
|
|
3867
3879
|
if ("name" in e && "inputs" in e && e.inputs)
|
|
3868
|
-
return `${n ? e.name : ""}(${e.inputs.map((s,
|
|
3880
|
+
return `${n ? e.name : ""}(${e.inputs.map((s, a) => `${r && s.name ? `${s.name}: ` : ""}${typeof t[a] == "object" ? Ot(t[a]) : t[a]}`).join(", ")})`;
|
|
3869
3881
|
}
|
|
3870
|
-
const
|
|
3882
|
+
const oi = {
|
|
3871
3883
|
gwei: 9,
|
|
3872
3884
|
wei: 18
|
|
3873
|
-
},
|
|
3885
|
+
}, ci = {
|
|
3874
3886
|
ether: -9,
|
|
3875
3887
|
wei: 9
|
|
3876
3888
|
};
|
|
@@ -3878,26 +3890,26 @@ function Hn(e, t) {
|
|
|
3878
3890
|
let n = e.toString();
|
|
3879
3891
|
const r = n.startsWith("-");
|
|
3880
3892
|
r && (n = n.slice(1)), n = n.padStart(t, "0");
|
|
3881
|
-
let [s,
|
|
3893
|
+
let [s, a] = [
|
|
3882
3894
|
n.slice(0, n.length - t),
|
|
3883
3895
|
n.slice(n.length - t)
|
|
3884
3896
|
];
|
|
3885
|
-
return
|
|
3897
|
+
return a = a.replace(/(0+)$/, ""), `${r ? "-" : ""}${s || "0"}${a ? `.${a}` : ""}`;
|
|
3886
3898
|
}
|
|
3887
|
-
function
|
|
3888
|
-
return Hn(e,
|
|
3899
|
+
function ui(e, t = "wei") {
|
|
3900
|
+
return Hn(e, oi[t]);
|
|
3889
3901
|
}
|
|
3890
3902
|
function he(e, t = "wei") {
|
|
3891
|
-
return Hn(e,
|
|
3903
|
+
return Hn(e, ci[t]);
|
|
3892
3904
|
}
|
|
3893
|
-
class
|
|
3905
|
+
class di extends f {
|
|
3894
3906
|
constructor({ address: t }) {
|
|
3895
3907
|
super(`State for account "${t}" is set multiple times.`, {
|
|
3896
3908
|
name: "AccountStateConflictError"
|
|
3897
3909
|
});
|
|
3898
3910
|
}
|
|
3899
3911
|
}
|
|
3900
|
-
class
|
|
3912
|
+
class li extends f {
|
|
3901
3913
|
constructor() {
|
|
3902
3914
|
super("state and stateDiff are set on the same account.", {
|
|
3903
3915
|
name: "StateAssignmentConflictError"
|
|
@@ -3908,7 +3920,7 @@ function Jt(e) {
|
|
|
3908
3920
|
return e.reduce((t, { slot: n, value: r }) => `${t} ${n}: ${r}
|
|
3909
3921
|
`, "");
|
|
3910
3922
|
}
|
|
3911
|
-
function
|
|
3923
|
+
function fi(e) {
|
|
3912
3924
|
return e.reduce((t, { address: n, ...r }) => {
|
|
3913
3925
|
let s = `${t} ${n}:
|
|
3914
3926
|
`;
|
|
@@ -3926,23 +3938,23 @@ function Wn(e) {
|
|
|
3926
3938
|
return t.map(([r, s]) => ` ${`${r}:`.padEnd(n + 1)} ${s}`).join(`
|
|
3927
3939
|
`);
|
|
3928
3940
|
}
|
|
3929
|
-
const
|
|
3930
|
-
class
|
|
3931
|
-
constructor(t, { account: n, docsPath: r, chain: s, data:
|
|
3941
|
+
const pi = (e) => e, Kn = (e) => e;
|
|
3942
|
+
class mi extends f {
|
|
3943
|
+
constructor(t, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: c, maxPriorityFeePerGas: d, nonce: l, to: y, value: p, stateOverride: m }) {
|
|
3932
3944
|
const h = n ? Dt(n) : void 0;
|
|
3933
3945
|
let v = Wn({
|
|
3934
3946
|
from: h?.address,
|
|
3935
3947
|
to: y,
|
|
3936
|
-
value: typeof p < "u" && `${
|
|
3937
|
-
data:
|
|
3938
|
-
gas:
|
|
3948
|
+
value: typeof p < "u" && `${ui(p)} ${s?.nativeCurrency?.symbol || "ETH"}`,
|
|
3949
|
+
data: a,
|
|
3950
|
+
gas: i,
|
|
3939
3951
|
gasPrice: typeof o < "u" && `${he(o)} gwei`,
|
|
3940
3952
|
maxFeePerGas: typeof c < "u" && `${he(c)} gwei`,
|
|
3941
3953
|
maxPriorityFeePerGas: typeof d < "u" && `${he(d)} gwei`,
|
|
3942
3954
|
nonce: l
|
|
3943
3955
|
});
|
|
3944
3956
|
m && (v += `
|
|
3945
|
-
${
|
|
3957
|
+
${fi(m)}`), super(t.shortMessage, {
|
|
3946
3958
|
cause: t,
|
|
3947
3959
|
docsPath: r,
|
|
3948
3960
|
metaMessages: [
|
|
@@ -3959,22 +3971,22 @@ ${fa(m)}`), super(t.shortMessage, {
|
|
|
3959
3971
|
}), this.cause = t;
|
|
3960
3972
|
}
|
|
3961
3973
|
}
|
|
3962
|
-
class
|
|
3963
|
-
constructor(t, { abi: n, args: r, contractAddress: s, docsPath:
|
|
3964
|
-
const c = Mt({ abi: n, args: r, name:
|
|
3974
|
+
class yi extends f {
|
|
3975
|
+
constructor(t, { abi: n, args: r, contractAddress: s, docsPath: a, functionName: i, sender: o }) {
|
|
3976
|
+
const c = Mt({ abi: n, args: r, name: i }), d = c ? Vn({
|
|
3965
3977
|
abiItem: c,
|
|
3966
3978
|
args: r,
|
|
3967
3979
|
includeFunctionName: !1,
|
|
3968
3980
|
includeName: !1
|
|
3969
3981
|
}) : void 0, l = c ? Pe(c, { includeName: !0 }) : void 0, y = Wn({
|
|
3970
|
-
address: s &&
|
|
3982
|
+
address: s && pi(s),
|
|
3971
3983
|
function: l,
|
|
3972
|
-
args: d && d !== "()" && `${[...Array(
|
|
3984
|
+
args: d && d !== "()" && `${[...Array(i?.length ?? 0).keys()].map(() => " ").join("")}${d}`,
|
|
3973
3985
|
sender: o
|
|
3974
3986
|
});
|
|
3975
|
-
super(t.shortMessage || `An unknown error occurred while executing the contract function "${
|
|
3987
|
+
super(t.shortMessage || `An unknown error occurred while executing the contract function "${i}".`, {
|
|
3976
3988
|
cause: t,
|
|
3977
|
-
docsPath:
|
|
3989
|
+
docsPath: a,
|
|
3978
3990
|
metaMessages: [
|
|
3979
3991
|
...t.metaMessages ? [...t.metaMessages, " "] : [],
|
|
3980
3992
|
y && "Contract Call:",
|
|
@@ -4016,21 +4028,21 @@ class ya extends f {
|
|
|
4016
4028
|
configurable: !0,
|
|
4017
4029
|
writable: !0,
|
|
4018
4030
|
value: void 0
|
|
4019
|
-
}), this.abi = n, this.args = r, this.cause = t, this.contractAddress = s, this.functionName =
|
|
4031
|
+
}), this.abi = n, this.args = r, this.cause = t, this.contractAddress = s, this.functionName = i, this.sender = o;
|
|
4020
4032
|
}
|
|
4021
4033
|
}
|
|
4022
|
-
class
|
|
4034
|
+
class bi extends f {
|
|
4023
4035
|
constructor({ abi: t, data: n, functionName: r, message: s }) {
|
|
4024
|
-
let
|
|
4036
|
+
let a, i, o, c;
|
|
4025
4037
|
if (n && n !== "0x")
|
|
4026
4038
|
try {
|
|
4027
|
-
|
|
4028
|
-
const { abiItem: l, errorName: y, args: p } =
|
|
4039
|
+
i = ii({ abi: t, data: n });
|
|
4040
|
+
const { abiItem: l, errorName: y, args: p } = i;
|
|
4029
4041
|
if (y === "Error")
|
|
4030
4042
|
c = p[0];
|
|
4031
4043
|
else if (y === "Panic") {
|
|
4032
4044
|
const [m] = p;
|
|
4033
|
-
c =
|
|
4045
|
+
c = ri[m];
|
|
4034
4046
|
} else {
|
|
4035
4047
|
const m = l ? Pe(l, { includeName: !0 }) : void 0, h = l && p ? Vn({
|
|
4036
4048
|
abiItem: l,
|
|
@@ -4044,11 +4056,11 @@ class ba extends f {
|
|
|
4044
4056
|
];
|
|
4045
4057
|
}
|
|
4046
4058
|
} catch (l) {
|
|
4047
|
-
|
|
4059
|
+
a = l;
|
|
4048
4060
|
}
|
|
4049
4061
|
else s && (c = s);
|
|
4050
4062
|
let d;
|
|
4051
|
-
|
|
4063
|
+
a instanceof nn && (d = a.signature, o = [
|
|
4052
4064
|
`Unable to decode signature "${d}" as it was not found on the provided ABI.`,
|
|
4053
4065
|
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
4054
4066
|
`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${d}.`
|
|
@@ -4057,7 +4069,7 @@ class ba extends f {
|
|
|
4057
4069
|
c || d
|
|
4058
4070
|
].join(`
|
|
4059
4071
|
`) : `The contract function "${r}" reverted.`, {
|
|
4060
|
-
cause:
|
|
4072
|
+
cause: a,
|
|
4061
4073
|
metaMessages: o,
|
|
4062
4074
|
name: "ContractFunctionRevertedError"
|
|
4063
4075
|
}), Object.defineProperty(this, "data", {
|
|
@@ -4080,10 +4092,10 @@ class ba extends f {
|
|
|
4080
4092
|
configurable: !0,
|
|
4081
4093
|
writable: !0,
|
|
4082
4094
|
value: void 0
|
|
4083
|
-
}), this.data =
|
|
4095
|
+
}), this.data = i, this.raw = n, this.reason = c, this.signature = d;
|
|
4084
4096
|
}
|
|
4085
4097
|
}
|
|
4086
|
-
class
|
|
4098
|
+
class hi extends f {
|
|
4087
4099
|
constructor({ functionName: t }) {
|
|
4088
4100
|
super(`The contract function "${t}" returned no data ("0x").`, {
|
|
4089
4101
|
metaMessages: [
|
|
@@ -4096,7 +4108,7 @@ class ha extends f {
|
|
|
4096
4108
|
});
|
|
4097
4109
|
}
|
|
4098
4110
|
}
|
|
4099
|
-
class
|
|
4111
|
+
class gi extends f {
|
|
4100
4112
|
constructor({ factory: t }) {
|
|
4101
4113
|
super(`Deployment for counterfactual contract call failed${t ? ` for factory "${t}".` : ""}`, {
|
|
4102
4114
|
metaMessages: [
|
|
@@ -4123,21 +4135,21 @@ class Yn extends f {
|
|
|
4123
4135
|
}), this.data = t;
|
|
4124
4136
|
}
|
|
4125
4137
|
}
|
|
4126
|
-
function
|
|
4138
|
+
function wi(e, t, n) {
|
|
4127
4139
|
const r = e[t.name];
|
|
4128
4140
|
if (typeof r == "function")
|
|
4129
4141
|
return r;
|
|
4130
4142
|
const s = e[n];
|
|
4131
|
-
return typeof s == "function" ? s : (
|
|
4143
|
+
return typeof s == "function" ? s : (a) => t(e, a);
|
|
4132
4144
|
}
|
|
4133
4145
|
class Co extends f {
|
|
4134
|
-
constructor({ body: t, cause: n, details: r, headers: s, status:
|
|
4146
|
+
constructor({ body: t, cause: n, details: r, headers: s, status: a, url: i }) {
|
|
4135
4147
|
super("HTTP request failed.", {
|
|
4136
4148
|
cause: n,
|
|
4137
4149
|
details: r,
|
|
4138
4150
|
metaMessages: [
|
|
4139
|
-
|
|
4140
|
-
`URL: ${Kn(
|
|
4151
|
+
a && `Status: ${a}`,
|
|
4152
|
+
`URL: ${Kn(i)}`,
|
|
4141
4153
|
t && `Request body: ${Ot(t)}`
|
|
4142
4154
|
].filter(Boolean),
|
|
4143
4155
|
name: "HttpRequestError"
|
|
@@ -4161,7 +4173,7 @@ class Co extends f {
|
|
|
4161
4173
|
configurable: !0,
|
|
4162
4174
|
writable: !0,
|
|
4163
4175
|
value: void 0
|
|
4164
|
-
}), this.body = t, this.headers = s, this.status =
|
|
4176
|
+
}), this.body = t, this.headers = s, this.status = a, this.url = i;
|
|
4165
4177
|
}
|
|
4166
4178
|
}
|
|
4167
4179
|
class Zn extends f {
|
|
@@ -4189,20 +4201,20 @@ class Zn extends f {
|
|
|
4189
4201
|
}), this.code = n.code, this.data = n.data, this.url = r;
|
|
4190
4202
|
}
|
|
4191
4203
|
}
|
|
4192
|
-
const
|
|
4204
|
+
const xi = -1;
|
|
4193
4205
|
class Xn extends f {
|
|
4194
|
-
constructor(t, { code: n, docsPath: r, metaMessages: s, name:
|
|
4195
|
-
super(
|
|
4206
|
+
constructor(t, { code: n, docsPath: r, metaMessages: s, name: a, shortMessage: i }) {
|
|
4207
|
+
super(i, {
|
|
4196
4208
|
cause: t,
|
|
4197
4209
|
docsPath: r,
|
|
4198
4210
|
metaMessages: s || t?.metaMessages,
|
|
4199
|
-
name:
|
|
4211
|
+
name: a || "RpcError"
|
|
4200
4212
|
}), Object.defineProperty(this, "code", {
|
|
4201
4213
|
enumerable: !0,
|
|
4202
4214
|
configurable: !0,
|
|
4203
4215
|
writable: !0,
|
|
4204
4216
|
value: void 0
|
|
4205
|
-
}), this.name =
|
|
4217
|
+
}), this.name = a || t.name, this.code = t instanceof Zn ? t.code : n ?? xi;
|
|
4206
4218
|
}
|
|
4207
4219
|
}
|
|
4208
4220
|
class Ve extends Xn {
|
|
@@ -4239,26 +4251,26 @@ Object.defineProperty(He, "code", {
|
|
|
4239
4251
|
writable: !0,
|
|
4240
4252
|
value: -32e3
|
|
4241
4253
|
});
|
|
4242
|
-
const
|
|
4243
|
-
function
|
|
4244
|
-
const o = e instanceof Yn ? e : e instanceof f ? e.walk((h) => "data" in h) || e.walk() : {}, { code: c, data: d, details: l, message: y, shortMessage: p } = o, m = e instanceof Pt ? new
|
|
4254
|
+
const Ti = 3;
|
|
4255
|
+
function vi(e, { abi: t, address: n, args: r, docsPath: s, functionName: a, sender: i }) {
|
|
4256
|
+
const o = e instanceof Yn ? e : e instanceof f ? e.walk((h) => "data" in h) || e.walk() : {}, { code: c, data: d, details: l, message: y, shortMessage: p } = o, m = e instanceof Pt ? new hi({ functionName: a }) : [Ti, Ve.code].includes(c) && (d || l || y || p) || c === He.code && l === "execution reverted" && d ? new bi({
|
|
4245
4257
|
abi: t,
|
|
4246
4258
|
data: typeof d == "object" ? d.data : d,
|
|
4247
|
-
functionName:
|
|
4259
|
+
functionName: a,
|
|
4248
4260
|
message: o instanceof Zn ? l : p ?? y
|
|
4249
4261
|
}) : e;
|
|
4250
|
-
return new
|
|
4262
|
+
return new yi(m, {
|
|
4251
4263
|
abi: t,
|
|
4252
4264
|
args: r,
|
|
4253
4265
|
contractAddress: n,
|
|
4254
4266
|
docsPath: s,
|
|
4255
|
-
functionName:
|
|
4256
|
-
sender:
|
|
4267
|
+
functionName: a,
|
|
4268
|
+
sender: i
|
|
4257
4269
|
});
|
|
4258
4270
|
}
|
|
4259
|
-
const
|
|
4260
|
-
function
|
|
4261
|
-
return
|
|
4271
|
+
const Ei = "0.1.1";
|
|
4272
|
+
function Pi() {
|
|
4273
|
+
return Ei;
|
|
4262
4274
|
}
|
|
4263
4275
|
class _ extends Error {
|
|
4264
4276
|
static setStaticOptions(t) {
|
|
@@ -4273,13 +4285,13 @@ class _ extends Error {
|
|
|
4273
4285
|
return n.cause.shortMessage;
|
|
4274
4286
|
}
|
|
4275
4287
|
return n.cause && "details" in n.cause && typeof n.cause.details == "string" ? n.cause.details : n.cause?.message ? n.cause.message : n.details;
|
|
4276
|
-
})(), s = n.cause instanceof _ && n.cause.docsPath || n.docsPath,
|
|
4288
|
+
})(), s = n.cause instanceof _ && n.cause.docsPath || n.docsPath, a = n.docsOrigin ?? _.prototype.docsOrigin, i = `${a}${s ?? ""}`, o = !!(n.version ?? _.prototype.showVersion), c = n.version ?? _.prototype.version, d = [
|
|
4277
4289
|
t || "An error occurred.",
|
|
4278
4290
|
...n.metaMessages ? ["", ...n.metaMessages] : [],
|
|
4279
4291
|
...r || s || o ? [
|
|
4280
4292
|
"",
|
|
4281
4293
|
r ? `Details: ${r}` : void 0,
|
|
4282
|
-
s ? `See: ${
|
|
4294
|
+
s ? `See: ${i}` : void 0,
|
|
4283
4295
|
o ? `Version: ${c}` : void 0
|
|
4284
4296
|
] : []
|
|
4285
4297
|
].filter((l) => typeof l == "string").join(`
|
|
@@ -4329,7 +4341,7 @@ class _ extends Error {
|
|
|
4329
4341
|
configurable: !0,
|
|
4330
4342
|
writable: !0,
|
|
4331
4343
|
value: "BaseError"
|
|
4332
|
-
}), this.cause = n.cause, this.details = r, this.docs =
|
|
4344
|
+
}), this.cause = n.cause, this.details = r, this.docs = i, this.docsOrigin = a, this.docsPath = s, this.shortMessage = t, this.showVersion = o, this.version = c;
|
|
4333
4345
|
}
|
|
4334
4346
|
walk(t) {
|
|
4335
4347
|
return Jn(this, t);
|
|
@@ -4342,20 +4354,20 @@ Object.defineProperty(_, "defaultStaticOptions", {
|
|
|
4342
4354
|
value: {
|
|
4343
4355
|
docsOrigin: "https://oxlib.sh",
|
|
4344
4356
|
showVersion: !1,
|
|
4345
|
-
version: `ox@${
|
|
4357
|
+
version: `ox@${Pi()}`
|
|
4346
4358
|
}
|
|
4347
4359
|
});
|
|
4348
4360
|
_.setStaticOptions(_.defaultStaticOptions);
|
|
4349
4361
|
function Jn(e, t) {
|
|
4350
4362
|
return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause ? Jn(e.cause, t) : t ? null : e;
|
|
4351
4363
|
}
|
|
4352
|
-
function
|
|
4364
|
+
function Si(e, t = {}) {
|
|
4353
4365
|
const { dir: n, size: r = 32 } = t;
|
|
4354
4366
|
if (r === 0)
|
|
4355
4367
|
return e;
|
|
4356
4368
|
const s = e.replace("0x", "");
|
|
4357
4369
|
if (s.length > r * 2)
|
|
4358
|
-
throw new
|
|
4370
|
+
throw new Ci({
|
|
4359
4371
|
size: Math.ceil(s.length / 2),
|
|
4360
4372
|
targetSize: r,
|
|
4361
4373
|
type: "Hex"
|
|
@@ -4364,28 +4376,28 @@ function Sa(e, t = {}) {
|
|
|
4364
4376
|
}
|
|
4365
4377
|
function oe(e, t = {}) {
|
|
4366
4378
|
const { signed: n, size: r } = t, s = BigInt(e);
|
|
4367
|
-
let
|
|
4368
|
-
r ? n ?
|
|
4369
|
-
const
|
|
4370
|
-
if (
|
|
4379
|
+
let a;
|
|
4380
|
+
r ? n ? a = (1n << BigInt(r) * 8n - 1n) - 1n : a = 2n ** (BigInt(r) * 8n) - 1n : typeof e == "number" && (a = BigInt(Number.MAX_SAFE_INTEGER));
|
|
4381
|
+
const i = typeof a == "bigint" && n ? -a - 1n : 0;
|
|
4382
|
+
if (a && s > a || s < i) {
|
|
4371
4383
|
const d = typeof e == "bigint" ? "n" : "";
|
|
4372
|
-
throw new $
|
|
4373
|
-
max:
|
|
4374
|
-
min: `${
|
|
4384
|
+
throw new $i({
|
|
4385
|
+
max: a ? `${a}${d}` : void 0,
|
|
4386
|
+
min: `${i}${d}`,
|
|
4375
4387
|
signed: n,
|
|
4376
4388
|
size: r,
|
|
4377
4389
|
value: `${e}${d}`
|
|
4378
4390
|
});
|
|
4379
4391
|
}
|
|
4380
4392
|
const c = `0x${(n && s < 0 ? BigInt.asUintN(r * 8, BigInt(s)) : s).toString(16)}`;
|
|
4381
|
-
return r ?
|
|
4393
|
+
return r ? Ai(c, r) : c;
|
|
4382
4394
|
}
|
|
4383
|
-
function
|
|
4384
|
-
return
|
|
4395
|
+
function Ai(e, t) {
|
|
4396
|
+
return Si(e, { dir: "left", size: t });
|
|
4385
4397
|
}
|
|
4386
|
-
class $
|
|
4387
|
-
constructor({ max: t, min: n, signed: r, size: s, value:
|
|
4388
|
-
super(`Number \`${
|
|
4398
|
+
class $i extends _ {
|
|
4399
|
+
constructor({ max: t, min: n, signed: r, size: s, value: a }) {
|
|
4400
|
+
super(`Number \`${a}\` is not in safe${s ? ` ${s * 8}-bit` : ""}${r ? " signed" : " unsigned"} integer range ${t ? `(\`${n}\` to \`${t}\`)` : `(above \`${n}\`)`}`), Object.defineProperty(this, "name", {
|
|
4389
4401
|
enumerable: !0,
|
|
4390
4402
|
configurable: !0,
|
|
4391
4403
|
writable: !0,
|
|
@@ -4393,7 +4405,7 @@ class $a extends _ {
|
|
|
4393
4405
|
});
|
|
4394
4406
|
}
|
|
4395
4407
|
}
|
|
4396
|
-
class
|
|
4408
|
+
class Ci extends _ {
|
|
4397
4409
|
constructor({ size: t, targetSize: n, type: r }) {
|
|
4398
4410
|
super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`), Object.defineProperty(this, "name", {
|
|
4399
4411
|
enumerable: !0,
|
|
@@ -4403,7 +4415,7 @@ class Ca extends _ {
|
|
|
4403
4415
|
});
|
|
4404
4416
|
}
|
|
4405
4417
|
}
|
|
4406
|
-
function
|
|
4418
|
+
function ki(e) {
|
|
4407
4419
|
return {
|
|
4408
4420
|
address: e.address,
|
|
4409
4421
|
amount: oe(e.amount),
|
|
@@ -4411,7 +4423,7 @@ function Ia(e) {
|
|
|
4411
4423
|
validatorIndex: oe(e.validatorIndex)
|
|
4412
4424
|
};
|
|
4413
4425
|
}
|
|
4414
|
-
function
|
|
4426
|
+
function Ii(e) {
|
|
4415
4427
|
return {
|
|
4416
4428
|
...typeof e.baseFeePerGas == "bigint" && {
|
|
4417
4429
|
baseFeePerGas: oe(e.baseFeePerGas)
|
|
@@ -4435,24 +4447,24 @@ function ka(e) {
|
|
|
4435
4447
|
time: oe(e.time)
|
|
4436
4448
|
},
|
|
4437
4449
|
...e.withdrawals && {
|
|
4438
|
-
withdrawals: e.withdrawals.map(
|
|
4450
|
+
withdrawals: e.withdrawals.map(ki)
|
|
4439
4451
|
}
|
|
4440
4452
|
};
|
|
4441
4453
|
}
|
|
4442
|
-
const Na = "0x82ad56cb", Ra = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe", Ma = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe", Da = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033", nt = "/docs/contract/encodeDeployData";
|
|
4454
|
+
const Ni = "0x82ad56cb", Ri = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe", Mi = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe", Di = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033", nt = "/docs/contract/encodeDeployData";
|
|
4443
4455
|
function Qn(e) {
|
|
4444
4456
|
const { abi: t, args: n, bytecode: r } = e;
|
|
4445
4457
|
if (!n || n.length === 0)
|
|
4446
4458
|
return r;
|
|
4447
|
-
const s = t.find((
|
|
4459
|
+
const s = t.find((i) => "type" in i && i.type === "constructor");
|
|
4448
4460
|
if (!s)
|
|
4449
4461
|
throw new Vr({ docsPath: nt });
|
|
4450
4462
|
if (!("inputs" in s))
|
|
4451
4463
|
throw new Lt({ docsPath: nt });
|
|
4452
4464
|
if (!s.inputs || s.inputs.length === 0)
|
|
4453
4465
|
throw new Lt({ docsPath: nt });
|
|
4454
|
-
const
|
|
4455
|
-
return Ct([r,
|
|
4466
|
+
const a = Pn(s.inputs, n);
|
|
4467
|
+
return Ct([r, a]);
|
|
4456
4468
|
}
|
|
4457
4469
|
class Te extends f {
|
|
4458
4470
|
constructor({ cause: t, message: n } = {}) {
|
|
@@ -4634,7 +4646,7 @@ class qn extends f {
|
|
|
4634
4646
|
});
|
|
4635
4647
|
}
|
|
4636
4648
|
}
|
|
4637
|
-
function
|
|
4649
|
+
function Oi(e, t) {
|
|
4638
4650
|
const n = (e.details || "").toLowerCase(), r = e instanceof f ? e.walk((s) => s?.code === Te.code) : e;
|
|
4639
4651
|
return r instanceof f ? new Te({
|
|
4640
4652
|
cause: e,
|
|
@@ -4656,51 +4668,51 @@ function Oa(e, t) {
|
|
|
4656
4668
|
cause: e
|
|
4657
4669
|
});
|
|
4658
4670
|
}
|
|
4659
|
-
function
|
|
4671
|
+
function Bi(e, { docsPath: t, ...n }) {
|
|
4660
4672
|
const r = (() => {
|
|
4661
|
-
const s =
|
|
4673
|
+
const s = Oi(e, n);
|
|
4662
4674
|
return s instanceof qn ? e : s;
|
|
4663
4675
|
})();
|
|
4664
|
-
return new
|
|
4676
|
+
return new mi(r, {
|
|
4665
4677
|
docsPath: t,
|
|
4666
4678
|
...n
|
|
4667
4679
|
});
|
|
4668
4680
|
}
|
|
4669
|
-
function
|
|
4681
|
+
function Ui(e, { format: t }) {
|
|
4670
4682
|
if (!t)
|
|
4671
4683
|
return {};
|
|
4672
4684
|
const n = {};
|
|
4673
|
-
function r(
|
|
4674
|
-
const
|
|
4675
|
-
for (const o of
|
|
4676
|
-
o in e && (n[o] = e[o]),
|
|
4685
|
+
function r(a) {
|
|
4686
|
+
const i = Object.keys(a);
|
|
4687
|
+
for (const o of i)
|
|
4688
|
+
o in e && (n[o] = e[o]), a[o] && typeof a[o] == "object" && !Array.isArray(a[o]) && r(a[o]);
|
|
4677
4689
|
}
|
|
4678
4690
|
const s = t(e || {});
|
|
4679
4691
|
return r(s), n;
|
|
4680
4692
|
}
|
|
4681
|
-
const
|
|
4693
|
+
const Li = {
|
|
4682
4694
|
legacy: "0x0",
|
|
4683
4695
|
eip2930: "0x1",
|
|
4684
4696
|
eip1559: "0x2",
|
|
4685
4697
|
eip4844: "0x3",
|
|
4686
4698
|
eip7702: "0x4"
|
|
4687
4699
|
};
|
|
4688
|
-
function
|
|
4700
|
+
function Fi(e, t) {
|
|
4689
4701
|
const n = {};
|
|
4690
|
-
return typeof e.authorizationList < "u" && (n.authorizationList =
|
|
4702
|
+
return typeof e.authorizationList < "u" && (n.authorizationList = ji(e.authorizationList)), typeof e.accessList < "u" && (n.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (n.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? n.blobs = e.blobs.map((r) => ue(r)) : n.blobs = e.blobs), typeof e.data < "u" && (n.data = e.data), e.account && (n.from = e.account.address), typeof e.from < "u" && (n.from = e.from), typeof e.gas < "u" && (n.gas = k(e.gas)), typeof e.gasPrice < "u" && (n.gasPrice = k(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (n.maxFeePerBlobGas = k(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (n.maxFeePerGas = k(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (n.maxPriorityFeePerGas = k(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (n.nonce = k(e.nonce)), typeof e.to < "u" && (n.to = e.to), typeof e.type < "u" && (n.type = Li[e.type]), typeof e.value < "u" && (n.value = k(e.value)), n;
|
|
4691
4703
|
}
|
|
4692
|
-
function
|
|
4704
|
+
function ji(e) {
|
|
4693
4705
|
return e.map((t) => ({
|
|
4694
4706
|
address: t.address,
|
|
4695
|
-
r: t.r ?
|
|
4696
|
-
s: t.s ?
|
|
4697
|
-
chainId:
|
|
4698
|
-
nonce:
|
|
4699
|
-
...typeof t.yParity < "u" ? { yParity:
|
|
4700
|
-
...typeof t.v < "u" && typeof t.yParity > "u" ? { v:
|
|
4707
|
+
r: t.r ? k(BigInt(t.r)) : t.r,
|
|
4708
|
+
s: t.s ? k(BigInt(t.s)) : t.s,
|
|
4709
|
+
chainId: k(t.chainId),
|
|
4710
|
+
nonce: k(t.nonce),
|
|
4711
|
+
...typeof t.yParity < "u" ? { yParity: k(t.yParity) } : {},
|
|
4712
|
+
...typeof t.v < "u" && typeof t.yParity > "u" ? { v: k(t.v) } : {}
|
|
4701
4713
|
}));
|
|
4702
4714
|
}
|
|
4703
|
-
function
|
|
4715
|
+
function zi() {
|
|
4704
4716
|
let e = () => {
|
|
4705
4717
|
}, t = () => {
|
|
4706
4718
|
};
|
|
@@ -4709,10 +4721,10 @@ function za() {
|
|
|
4709
4721
|
}), resolve: e, reject: t };
|
|
4710
4722
|
}
|
|
4711
4723
|
const rt = /* @__PURE__ */ new Map();
|
|
4712
|
-
function
|
|
4713
|
-
const
|
|
4724
|
+
function _i({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: s }) {
|
|
4725
|
+
const a = async () => {
|
|
4714
4726
|
const l = c();
|
|
4715
|
-
|
|
4727
|
+
i();
|
|
4716
4728
|
const y = l.map(({ args: p }) => p);
|
|
4717
4729
|
y.length !== 0 && e(y).then((p) => {
|
|
4718
4730
|
s && Array.isArray(p) && p.sort(s);
|
|
@@ -4726,12 +4738,12 @@ function _a({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: s }) {
|
|
|
4726
4738
|
h?.(p);
|
|
4727
4739
|
}
|
|
4728
4740
|
});
|
|
4729
|
-
},
|
|
4741
|
+
}, i = () => rt.delete(t), o = () => c().map(({ args: l }) => l), c = () => rt.get(t) || [], d = (l) => rt.set(t, [...c(), l]);
|
|
4730
4742
|
return {
|
|
4731
|
-
flush:
|
|
4743
|
+
flush: i,
|
|
4732
4744
|
async schedule(l) {
|
|
4733
|
-
const { promise: y, resolve: p, reject: m } =
|
|
4734
|
-
return n?.([...o(), l]) &&
|
|
4745
|
+
const { promise: y, resolve: p, reject: m } = zi();
|
|
4746
|
+
return n?.([...o(), l]) && a(), c().length > 0 ? (d({ args: l, resolve: p, reject: m }), y) : (d({ args: l, resolve: p, reject: m }), setTimeout(a, r), y);
|
|
4735
4747
|
}
|
|
4736
4748
|
};
|
|
4737
4749
|
}
|
|
@@ -4753,16 +4765,16 @@ function Qt(e) {
|
|
|
4753
4765
|
return t[n] = r, t;
|
|
4754
4766
|
}, {});
|
|
4755
4767
|
}
|
|
4756
|
-
function
|
|
4757
|
-
const { balance: t, nonce: n, state: r, stateDiff: s, code:
|
|
4758
|
-
if (
|
|
4759
|
-
if (
|
|
4760
|
-
throw new
|
|
4761
|
-
|
|
4768
|
+
function Gi(e) {
|
|
4769
|
+
const { balance: t, nonce: n, state: r, stateDiff: s, code: a } = e, i = {};
|
|
4770
|
+
if (a !== void 0 && (i.code = a), t !== void 0 && (i.balance = k(t)), n !== void 0 && (i.nonce = k(n)), r !== void 0 && (i.state = Qt(r)), s !== void 0) {
|
|
4771
|
+
if (i.state)
|
|
4772
|
+
throw new li();
|
|
4773
|
+
i.stateDiff = Qt(s);
|
|
4762
4774
|
}
|
|
4763
|
-
return
|
|
4775
|
+
return i;
|
|
4764
4776
|
}
|
|
4765
|
-
function
|
|
4777
|
+
function Vi(e) {
|
|
4766
4778
|
if (!e)
|
|
4767
4779
|
return;
|
|
4768
4780
|
const t = {};
|
|
@@ -4770,25 +4782,25 @@ function Va(e) {
|
|
|
4770
4782
|
if (!ge(n, { strict: !1 }))
|
|
4771
4783
|
throw new Le({ address: n });
|
|
4772
4784
|
if (t[n])
|
|
4773
|
-
throw new
|
|
4774
|
-
t[n] =
|
|
4785
|
+
throw new di({ address: n });
|
|
4786
|
+
t[n] = Gi(r);
|
|
4775
4787
|
}
|
|
4776
4788
|
return t;
|
|
4777
4789
|
}
|
|
4778
|
-
const
|
|
4779
|
-
function
|
|
4780
|
-
const { account: t, maxFeePerGas: n, maxPriorityFeePerGas: r, to: s } = e,
|
|
4781
|
-
if (
|
|
4782
|
-
throw new Le({ address:
|
|
4790
|
+
const Hi = 2n ** 256n - 1n;
|
|
4791
|
+
function Wi(e) {
|
|
4792
|
+
const { account: t, maxFeePerGas: n, maxPriorityFeePerGas: r, to: s } = e, a = t ? Dt(t) : void 0;
|
|
4793
|
+
if (a && !ge(a.address))
|
|
4794
|
+
throw new Le({ address: a.address });
|
|
4783
4795
|
if (s && !ge(s))
|
|
4784
4796
|
throw new Le({ address: s });
|
|
4785
|
-
if (n && n >
|
|
4797
|
+
if (n && n > Hi)
|
|
4786
4798
|
throw new ze({ maxFeePerGas: n });
|
|
4787
4799
|
if (r && n && r > n)
|
|
4788
4800
|
throw new _e({ maxFeePerGas: n, maxPriorityFeePerGas: r });
|
|
4789
4801
|
}
|
|
4790
|
-
async function
|
|
4791
|
-
const { account: n = e.account, authorizationList: r, batch: s = !!e.batch?.multicall, blockNumber:
|
|
4802
|
+
async function Ki(e, t) {
|
|
4803
|
+
const { account: n = e.account, authorizationList: r, batch: s = !!e.batch?.multicall, blockNumber: a, blockTag: i = e.experimental_blockTag ?? "latest", accessList: o, blobs: c, blockOverrides: d, code: l, data: y, factory: p, factoryData: m, gas: h, gasPrice: v, maxFeePerBlobGas: P, maxFeePerGas: T, maxPriorityFeePerGas: b, nonce: x, to: S, value: N, stateOverride: D, ...J } = t, Q = n ? Dt(n) : void 0;
|
|
4792
4804
|
if (l && (p || m))
|
|
4793
4805
|
throw new f("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
4794
4806
|
if (l && S)
|
|
@@ -4796,17 +4808,17 @@ async function Ka(e, t) {
|
|
|
4796
4808
|
const H = l && y, q = p && m && S && y, U = H || q, le = H ? er({
|
|
4797
4809
|
code: l,
|
|
4798
4810
|
data: y
|
|
4799
|
-
}) : q ?
|
|
4811
|
+
}) : q ? Xi({
|
|
4800
4812
|
data: y,
|
|
4801
4813
|
factory: p,
|
|
4802
4814
|
factoryData: m,
|
|
4803
4815
|
to: S
|
|
4804
4816
|
}) : y;
|
|
4805
4817
|
try {
|
|
4806
|
-
|
|
4807
|
-
const L = (typeof
|
|
4818
|
+
Wi(t);
|
|
4819
|
+
const L = (typeof a == "bigint" ? k(a) : void 0) || i, M = d ? Ii(d) : void 0, z = Vi(D), W = e.chain?.formatters?.transactionRequest?.format, R = (W || Fi)({
|
|
4808
4820
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
4809
|
-
...
|
|
4821
|
+
...Ui(J, { format: W }),
|
|
4810
4822
|
accessList: o,
|
|
4811
4823
|
account: Q,
|
|
4812
4824
|
authorizationList: r,
|
|
@@ -4821,12 +4833,12 @@ async function Ka(e, t) {
|
|
|
4821
4833
|
to: U ? void 0 : S,
|
|
4822
4834
|
value: N
|
|
4823
4835
|
}, "call");
|
|
4824
|
-
if (s &&
|
|
4836
|
+
if (s && Yi({ request: R }) && !z && !M)
|
|
4825
4837
|
try {
|
|
4826
|
-
return await
|
|
4838
|
+
return await Zi(e, {
|
|
4827
4839
|
...R,
|
|
4828
|
-
blockNumber:
|
|
4829
|
-
blockTag:
|
|
4840
|
+
blockNumber: a,
|
|
4841
|
+
blockTag: i
|
|
4830
4842
|
});
|
|
4831
4843
|
} catch (ee) {
|
|
4832
4844
|
if (!(ee instanceof Gn) && !(ee instanceof dt))
|
|
@@ -4844,34 +4856,34 @@ async function Ka(e, t) {
|
|
|
4844
4856
|
});
|
|
4845
4857
|
return me === "0x" ? { data: void 0 } : { data: me };
|
|
4846
4858
|
} catch ($) {
|
|
4847
|
-
const L =
|
|
4859
|
+
const L = Ji($), { offchainLookup: M, offchainLookupSignature: z } = await import("./ccip-DIsMfc62.js");
|
|
4848
4860
|
if (e.ccipRead !== !1 && L?.slice(0, 10) === z && S)
|
|
4849
4861
|
return { data: await M(e, { data: L, to: S }) };
|
|
4850
|
-
throw U && L?.slice(0, 10) === "0x101bb98d" ? new
|
|
4862
|
+
throw U && L?.slice(0, 10) === "0x101bb98d" ? new gi({ factory: p }) : Bi($, {
|
|
4851
4863
|
...t,
|
|
4852
4864
|
account: Q,
|
|
4853
4865
|
chain: e.chain
|
|
4854
4866
|
});
|
|
4855
4867
|
}
|
|
4856
4868
|
}
|
|
4857
|
-
function
|
|
4869
|
+
function Yi({ request: e }) {
|
|
4858
4870
|
const { data: t, to: n, ...r } = e;
|
|
4859
|
-
return !(!t || t.startsWith(
|
|
4871
|
+
return !(!t || t.startsWith(Ni) || !n || Object.values(r).filter((s) => typeof s < "u").length > 0);
|
|
4860
4872
|
}
|
|
4861
|
-
async function
|
|
4862
|
-
const { batchSize: n = 1024, deployless: r = !1, wait: s = 0 } = typeof e.batch?.multicall == "object" ? e.batch.multicall : {}, { blockNumber:
|
|
4873
|
+
async function Zi(e, t) {
|
|
4874
|
+
const { batchSize: n = 1024, deployless: r = !1, wait: s = 0 } = typeof e.batch?.multicall == "object" ? e.batch.multicall : {}, { blockNumber: a, blockTag: i = e.experimental_blockTag ?? "latest", data: o, to: c } = t, d = (() => {
|
|
4863
4875
|
if (r)
|
|
4864
4876
|
return null;
|
|
4865
4877
|
if (t.multicallAddress)
|
|
4866
4878
|
return t.multicallAddress;
|
|
4867
4879
|
if (e.chain)
|
|
4868
|
-
return
|
|
4869
|
-
blockNumber:
|
|
4880
|
+
return ni({
|
|
4881
|
+
blockNumber: a,
|
|
4870
4882
|
chain: e.chain,
|
|
4871
4883
|
contract: "multicall3"
|
|
4872
4884
|
});
|
|
4873
4885
|
throw new Gn();
|
|
4874
|
-
})(), y = (typeof
|
|
4886
|
+
})(), y = (typeof a == "bigint" ? k(a) : void 0) || i, { schedule: p } = _i({
|
|
4875
4887
|
id: `${e.uid}.${y}`,
|
|
4876
4888
|
wait: s,
|
|
4877
4889
|
shouldSplitBatch(v) {
|
|
@@ -4892,7 +4904,7 @@ async function Za(e, t) {
|
|
|
4892
4904
|
{
|
|
4893
4905
|
...d === null ? {
|
|
4894
4906
|
data: er({
|
|
4895
|
-
code:
|
|
4907
|
+
code: Di,
|
|
4896
4908
|
data: T
|
|
4897
4909
|
})
|
|
4898
4910
|
} : { to: d, data: T }
|
|
@@ -4916,70 +4928,70 @@ function er(e) {
|
|
|
4916
4928
|
const { code: t, data: n } = e;
|
|
4917
4929
|
return Qn({
|
|
4918
4930
|
abi: Ln(["constructor(bytes, bytes)"]),
|
|
4919
|
-
bytecode:
|
|
4931
|
+
bytecode: Ri,
|
|
4920
4932
|
args: [t, n]
|
|
4921
4933
|
});
|
|
4922
4934
|
}
|
|
4923
|
-
function
|
|
4935
|
+
function Xi(e) {
|
|
4924
4936
|
const { data: t, factory: n, factoryData: r, to: s } = e;
|
|
4925
4937
|
return Qn({
|
|
4926
4938
|
abi: Ln(["constructor(address, bytes, address, bytes)"]),
|
|
4927
|
-
bytecode:
|
|
4939
|
+
bytecode: Mi,
|
|
4928
4940
|
args: [s, t, n, r]
|
|
4929
4941
|
});
|
|
4930
4942
|
}
|
|
4931
|
-
function
|
|
4943
|
+
function Ji(e) {
|
|
4932
4944
|
if (!(e instanceof f))
|
|
4933
4945
|
return;
|
|
4934
4946
|
const t = e.walk();
|
|
4935
4947
|
return typeof t?.data == "object" ? t.data?.data : t.data;
|
|
4936
4948
|
}
|
|
4937
|
-
async function
|
|
4938
|
-
const { abi: n, address: r, args: s, functionName:
|
|
4949
|
+
async function Qi(e, t) {
|
|
4950
|
+
const { abi: n, address: r, args: s, functionName: a, ...i } = t, o = _n({
|
|
4939
4951
|
abi: n,
|
|
4940
4952
|
args: s,
|
|
4941
|
-
functionName:
|
|
4953
|
+
functionName: a
|
|
4942
4954
|
});
|
|
4943
4955
|
try {
|
|
4944
|
-
const { data: c } = await
|
|
4945
|
-
...
|
|
4956
|
+
const { data: c } = await wi(e, Ki, "call")({
|
|
4957
|
+
...i,
|
|
4946
4958
|
data: o,
|
|
4947
4959
|
to: r
|
|
4948
4960
|
});
|
|
4949
4961
|
return zn({
|
|
4950
4962
|
abi: n,
|
|
4951
4963
|
args: s,
|
|
4952
|
-
functionName:
|
|
4964
|
+
functionName: a,
|
|
4953
4965
|
data: c || "0x"
|
|
4954
4966
|
});
|
|
4955
4967
|
} catch (c) {
|
|
4956
|
-
throw
|
|
4968
|
+
throw vi(c, {
|
|
4957
4969
|
abi: n,
|
|
4958
4970
|
address: r,
|
|
4959
4971
|
args: s,
|
|
4960
4972
|
docsPath: "/docs/contract/readContract",
|
|
4961
|
-
functionName:
|
|
4973
|
+
functionName: a
|
|
4962
4974
|
});
|
|
4963
4975
|
}
|
|
4964
4976
|
}
|
|
4965
|
-
function
|
|
4977
|
+
function qi(e, t, n) {
|
|
4966
4978
|
const r = e[t.name];
|
|
4967
4979
|
if (typeof r == "function")
|
|
4968
4980
|
return r;
|
|
4969
4981
|
const s = e[n];
|
|
4970
|
-
return typeof s == "function" ? s : (
|
|
4982
|
+
return typeof s == "function" ? s : (a) => t(e, a);
|
|
4971
4983
|
}
|
|
4972
4984
|
function eo(e, t) {
|
|
4973
4985
|
const { chainId: n, ...r } = t, s = e.getClient({ chainId: n });
|
|
4974
|
-
return
|
|
4986
|
+
return qi(s, Qi, "readContract")(r);
|
|
4975
4987
|
}
|
|
4976
4988
|
function to() {
|
|
4977
4989
|
const { address: e } = Ge(), t = hr(), {
|
|
4978
4990
|
writeContractAsync: n,
|
|
4979
4991
|
data: r,
|
|
4980
4992
|
isPending: s,
|
|
4981
|
-
error:
|
|
4982
|
-
} = wt(), { isLoading:
|
|
4993
|
+
error: a
|
|
4994
|
+
} = wt(), { isLoading: i, isSuccess: o } = xt({
|
|
4983
4995
|
hash: r
|
|
4984
4996
|
}), c = () => j({
|
|
4985
4997
|
address: O.PAYMENT_ROUTER,
|
|
@@ -5058,7 +5070,7 @@ function to() {
|
|
|
5058
5070
|
throw new Error(`Failed to approve ${L.symbol}: ${M}`);
|
|
5059
5071
|
}
|
|
5060
5072
|
}
|
|
5061
|
-
const q = BigInt(Math.floor(P *
|
|
5073
|
+
const q = BigInt(Math.floor(P * Mr)), U = b || "0x0000000000000000000000000000000000000000", le = x || "0x";
|
|
5062
5074
|
return await n({
|
|
5063
5075
|
address: O.PAYMENT_ROUTER,
|
|
5064
5076
|
abi: De,
|
|
@@ -5082,13 +5094,13 @@ function to() {
|
|
|
5082
5094
|
// Transaction state
|
|
5083
5095
|
hash: r,
|
|
5084
5096
|
isPending: s,
|
|
5085
|
-
isConfirming:
|
|
5097
|
+
isConfirming: i,
|
|
5086
5098
|
isConfirmed: o,
|
|
5087
|
-
error:
|
|
5099
|
+
error: a
|
|
5088
5100
|
};
|
|
5089
5101
|
}
|
|
5090
5102
|
function Be(e) {
|
|
5091
|
-
const { address: t } = Ge(), { writeContract: n, data: r, isPending: s, error:
|
|
5103
|
+
const { address: t } = Ge(), { writeContract: n, data: r, isPending: s, error: a } = wt(), { isLoading: i, isSuccess: o } = xt({
|
|
5092
5104
|
hash: r
|
|
5093
5105
|
});
|
|
5094
5106
|
return {
|
|
@@ -5158,15 +5170,15 @@ function Be(e) {
|
|
|
5158
5170
|
// Transaction state
|
|
5159
5171
|
hash: r,
|
|
5160
5172
|
isPending: s,
|
|
5161
|
-
isConfirming:
|
|
5173
|
+
isConfirming: i,
|
|
5162
5174
|
isConfirmed: o,
|
|
5163
|
-
error:
|
|
5175
|
+
error: a
|
|
5164
5176
|
};
|
|
5165
5177
|
}
|
|
5166
5178
|
function no() {
|
|
5167
5179
|
const { address: e } = Ge(), { data: t, isLoading: n } = gr({
|
|
5168
5180
|
address: e
|
|
5169
|
-
}), r = Be(E.USDC), s = Be(E.USDT),
|
|
5181
|
+
}), r = Be(E.USDC), s = Be(E.USDT), a = Be(E.DAI), i = Be(E.WBTC), { data: o, isLoading: c } = r.useBalanceOf(e), { data: d, isLoading: l } = s.useBalanceOf(e), { data: y, isLoading: p } = a.useBalanceOf(e), { data: m, isLoading: h } = i.useBalanceOf(e);
|
|
5170
5182
|
return {
|
|
5171
5183
|
balances: {
|
|
5172
5184
|
ETH: t ? parseFloat(Ce(t.value, 18)) : 0,
|
|
@@ -5179,14 +5191,14 @@ function no() {
|
|
|
5179
5191
|
};
|
|
5180
5192
|
}
|
|
5181
5193
|
function ro() {
|
|
5182
|
-
const e =
|
|
5194
|
+
const e = Tt(), {
|
|
5183
5195
|
data: t,
|
|
5184
5196
|
isLoading: n,
|
|
5185
5197
|
error: r
|
|
5186
5198
|
} = e.useGetTokenPrice(E.NATIVE), {
|
|
5187
5199
|
data: s,
|
|
5188
|
-
isLoading:
|
|
5189
|
-
error:
|
|
5200
|
+
isLoading: a,
|
|
5201
|
+
error: i
|
|
5190
5202
|
} = e.useGetTokenPrice(E.USDC), {
|
|
5191
5203
|
data: o,
|
|
5192
5204
|
isLoading: c,
|
|
@@ -5216,7 +5228,7 @@ function ro() {
|
|
|
5216
5228
|
return console.error("Error converting price:", S), 0;
|
|
5217
5229
|
}
|
|
5218
5230
|
};
|
|
5219
|
-
r && console.error("ETH price error:", r),
|
|
5231
|
+
r && console.error("ETH price error:", r), i && console.error("USDC price error:", i), d && console.error("USDT price error:", d), p && console.error("DAI price error:", p), v && console.error("WBTC price error:", v);
|
|
5220
5232
|
const b = {
|
|
5221
5233
|
ETH: T(t),
|
|
5222
5234
|
USDC: T(s) || 1,
|
|
@@ -5226,17 +5238,17 @@ function ro() {
|
|
|
5226
5238
|
};
|
|
5227
5239
|
return console.log("Converted prices:", b), {
|
|
5228
5240
|
prices: b,
|
|
5229
|
-
isLoading: n ||
|
|
5241
|
+
isLoading: n || a || c || y || h,
|
|
5230
5242
|
errors: {
|
|
5231
5243
|
ETH: r,
|
|
5232
|
-
USDC:
|
|
5244
|
+
USDC: i,
|
|
5233
5245
|
USDT: d,
|
|
5234
5246
|
DAI: p,
|
|
5235
5247
|
WBTC: v
|
|
5236
5248
|
}
|
|
5237
5249
|
};
|
|
5238
5250
|
}
|
|
5239
|
-
class
|
|
5251
|
+
class ie extends Error {
|
|
5240
5252
|
code;
|
|
5241
5253
|
details;
|
|
5242
5254
|
constructor(t, n, r) {
|
|
@@ -5246,39 +5258,39 @@ class ae extends Error {
|
|
|
5246
5258
|
function qt(e) {
|
|
5247
5259
|
if (e instanceof Error) {
|
|
5248
5260
|
if (e.message.includes("User rejected") || e.message.includes("User denied"))
|
|
5249
|
-
return new
|
|
5261
|
+
return new ie("Transaction cancelled by user", "USER_REJECTED", e);
|
|
5250
5262
|
if (e.message.includes("Failed to approve"))
|
|
5251
|
-
return new
|
|
5263
|
+
return new ie(e.message, "APPROVAL_FAILED", e);
|
|
5252
5264
|
if (e.message.includes("insufficient funds"))
|
|
5253
|
-
return new
|
|
5265
|
+
return new ie(
|
|
5254
5266
|
"Insufficient funds for gas",
|
|
5255
5267
|
"INSUFFICIENT_FUNDS",
|
|
5256
5268
|
e
|
|
5257
5269
|
);
|
|
5258
5270
|
if (e.message.includes("Wallet not connected"))
|
|
5259
|
-
return new
|
|
5271
|
+
return new ie("Please connect your wallet", "WALLET_NOT_CONNECTED", e);
|
|
5260
5272
|
if (e.message.includes("network"))
|
|
5261
|
-
return new
|
|
5273
|
+
return new ie("Network error. Please check your connection", "NETWORK_ERROR", e);
|
|
5262
5274
|
if (e.message.includes("insufficient payment") || e.message.includes("PaymentRouter: insufficient"))
|
|
5263
|
-
return new
|
|
5275
|
+
return new ie("Payment amount is insufficient. This may be due to price fluctuation. Please try again.", "INSUFFICIENT_PAYMENT", e);
|
|
5264
5276
|
if (e.message.includes("execution reverted"))
|
|
5265
|
-
return new
|
|
5277
|
+
return new ie("Transaction failed. Please try again", "CONTRACT_ERROR", e);
|
|
5266
5278
|
if (e.message)
|
|
5267
|
-
return new
|
|
5279
|
+
return new ie(e.message, "ERROR", e);
|
|
5268
5280
|
}
|
|
5269
|
-
return new
|
|
5281
|
+
return new ie("An unknown error occurred. Please try again", "UNKNOWN", e);
|
|
5270
5282
|
}
|
|
5271
|
-
const so = 1e8,
|
|
5272
|
-
function
|
|
5283
|
+
const so = 1e8, ao = (e) => e.reduce((t, n) => t + n.price, 0);
|
|
5284
|
+
function ko({
|
|
5273
5285
|
merchantAddress: e,
|
|
5274
5286
|
items: t,
|
|
5275
5287
|
config: n,
|
|
5276
5288
|
onPaymentComplete: r,
|
|
5277
5289
|
onPaymentError: s,
|
|
5278
|
-
className:
|
|
5279
|
-
children:
|
|
5290
|
+
className: a = "",
|
|
5291
|
+
children: i
|
|
5280
5292
|
}) {
|
|
5281
|
-
const { isConnected: o } = Ge(), { connect: c, connectors: d } = wr(), l = n?.currency ?? "USD", y = n?.target, p = n?.callData, m =
|
|
5293
|
+
const { isConnected: o } = Ge(), { connect: c, connectors: d } = wr(), l = n?.currency ?? "USD", y = n?.target, p = n?.callData, m = ao(t), [h, v] = V(!1), [P, T] = V([]), b = Tt(), { balances: x, isLoading: S } = no(), { prices: N, isLoading: D } = ro(), { data: J } = b.useGetTokenPrice(E.IDRX), { executePayment: Q, isConfirmed: H, hash: q, error: U, isPending: le, isConfirming: $ } = to(), M = (() => {
|
|
5282
5294
|
if (!J) return 1 / 15600;
|
|
5283
5295
|
if (Array.isArray(J) && J.length >= 1) {
|
|
5284
5296
|
const R = J[0];
|
|
@@ -5397,8 +5409,8 @@ function Io({
|
|
|
5397
5409
|
{
|
|
5398
5410
|
onClick: W,
|
|
5399
5411
|
disabled: S || D,
|
|
5400
|
-
className: `mc:bg-secondary hover:mc:bg-secondary/90 mc:text-white mc:font-semibold mc:py-3 mc:px-6 mc:rounded-lg mc:transition-all disabled:mc:opacity-50 disabled:mc:cursor-not-allowed ${
|
|
5401
|
-
children:
|
|
5412
|
+
className: `mc:bg-secondary hover:mc:bg-secondary/90 mc:text-white mc:font-semibold mc:py-3 mc:px-6 mc:rounded-lg mc:transition-all disabled:mc:opacity-50 disabled:mc:cursor-not-allowed ${a}`,
|
|
5413
|
+
children: i || (o ? "Pay with MultiCoyn" : "Connect Wallet to Pay")
|
|
5402
5414
|
}
|
|
5403
5415
|
),
|
|
5404
5416
|
o && /* @__PURE__ */ u(
|
|
@@ -5419,7 +5431,7 @@ function Io({
|
|
|
5419
5431
|
)
|
|
5420
5432
|
] });
|
|
5421
5433
|
}
|
|
5422
|
-
const
|
|
5434
|
+
const io = Pr({
|
|
5423
5435
|
id: 4202,
|
|
5424
5436
|
name: "Lisk Sepolia",
|
|
5425
5437
|
nativeCurrency: {
|
|
@@ -5441,11 +5453,11 @@ const ao = Pr({
|
|
|
5441
5453
|
testnet: !0
|
|
5442
5454
|
}), oo = $r({
|
|
5443
5455
|
appName: "MultiCoyn Payment SDK",
|
|
5444
|
-
projectId: "
|
|
5445
|
-
chains: [
|
|
5456
|
+
projectId: "YOUR_PROJECT_ID",
|
|
5457
|
+
chains: [io],
|
|
5446
5458
|
ssr: !1
|
|
5447
5459
|
}), co = new Ar();
|
|
5448
|
-
function
|
|
5460
|
+
function Io({ children: e }) {
|
|
5449
5461
|
return /* @__PURE__ */ u(xr, { config: oo, children: /* @__PURE__ */ u(Sr, { client: co, children: /* @__PURE__ */ u(Cr, { children: e }) }) });
|
|
5450
5462
|
}
|
|
5451
5463
|
const tr = yr(
|
|
@@ -5455,8 +5467,8 @@ function No({
|
|
|
5455
5467
|
children: e,
|
|
5456
5468
|
initialConfig: t = {}
|
|
5457
5469
|
}) {
|
|
5458
|
-
const [n, r] = V(t), s = (
|
|
5459
|
-
r((
|
|
5470
|
+
const [n, r] = V(t), s = (a) => {
|
|
5471
|
+
r((i) => ({ ...i, ...a }));
|
|
5460
5472
|
};
|
|
5461
5473
|
return /* @__PURE__ */ u(tr.Provider, { value: { config: n, updateConfig: s }, children: e });
|
|
5462
5474
|
}
|
|
@@ -5471,7 +5483,7 @@ export {
|
|
|
5471
5483
|
f as B,
|
|
5472
5484
|
O as C,
|
|
5473
5485
|
to as D,
|
|
5474
|
-
|
|
5486
|
+
Tt as E,
|
|
5475
5487
|
Be as F,
|
|
5476
5488
|
no as G,
|
|
5477
5489
|
Co as H,
|
|
@@ -5479,15 +5491,15 @@ export {
|
|
|
5479
5491
|
ro as J,
|
|
5480
5492
|
ho as K,
|
|
5481
5493
|
go as L,
|
|
5482
|
-
|
|
5494
|
+
ko as M,
|
|
5483
5495
|
wo as N,
|
|
5484
|
-
|
|
5485
|
-
|
|
5496
|
+
Mr as O,
|
|
5497
|
+
Fr as P,
|
|
5486
5498
|
xo as Q,
|
|
5487
5499
|
F as R,
|
|
5488
5500
|
E as T,
|
|
5489
|
-
|
|
5490
|
-
|
|
5501
|
+
Rr as U,
|
|
5502
|
+
Io as W,
|
|
5491
5503
|
Po as a,
|
|
5492
5504
|
Eo as b,
|
|
5493
5505
|
Ct as c,
|
|
@@ -5498,13 +5510,13 @@ export {
|
|
|
5498
5510
|
Ue as h,
|
|
5499
5511
|
Zr as i,
|
|
5500
5512
|
vo as j,
|
|
5501
|
-
|
|
5513
|
+
si as k,
|
|
5502
5514
|
ge as l,
|
|
5503
5515
|
Le as m,
|
|
5504
5516
|
Kn as n,
|
|
5505
5517
|
Ot as o,
|
|
5506
|
-
|
|
5507
|
-
|
|
5518
|
+
ii as p,
|
|
5519
|
+
Ki as q,
|
|
5508
5520
|
Se as r,
|
|
5509
5521
|
je as s,
|
|
5510
5522
|
Rt as t,
|
|
@@ -5512,6 +5524,6 @@ export {
|
|
|
5512
5524
|
No as v,
|
|
5513
5525
|
Ro as w,
|
|
5514
5526
|
oo as x,
|
|
5515
|
-
|
|
5527
|
+
io as y,
|
|
5516
5528
|
To as z
|
|
5517
5529
|
};
|