multicoyn-sdk 0.1.2 → 0.1.3
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/dist/{ccip-Do0z8AZp.js → ccip-DjOOvUZr.js} +1 -1
- package/dist/{ccip-BXLlQVZi.cjs → ccip-DqoTg55K.cjs} +1 -1
- package/dist/components/PaymentModal.d.ts +1 -1
- package/dist/{index-QyDcHjLV.js → index-B_5-qm4i.js} +394 -391
- package/dist/{index-C71hhSSX.cjs → index-CIr9hCZh.cjs} +20 -20
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as u, jsxs as h, Fragment as
|
|
2
|
-
import { useState as _, useMemo as
|
|
3
|
-
import { useWriteContract as dt, useWaitForTransactionReceipt as lt, useReadContract as D, useAccount as Ue, useConfig as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsx as u, jsxs as h, Fragment as Qn } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useMemo as qn, useEffect as me, createContext as er, useContext as tr } from "react";
|
|
3
|
+
import { useWriteContract as dt, useWaitForTransactionReceipt as lt, useReadContract as D, useAccount as Ue, useConfig as nr, useBalance as rr, useConnect as sr, WagmiProvider as ir } from "wagmi";
|
|
4
|
+
import { createPortal as ar } from "react-dom";
|
|
5
|
+
import { parseUnits as or, maxUint256 as cr, formatUnits as ve, defineChain as ur } from "viem";
|
|
6
|
+
import { QueryClient as dr, QueryClientProvider as lr } from "@tanstack/react-query";
|
|
7
|
+
import { getDefaultConfig as fr, RainbowKitProvider as pr } from "@rainbow-me/rainbowkit";
|
|
8
|
+
function yr({ size: e = 26, className: t = "" }) {
|
|
8
9
|
return /* @__PURE__ */ u(
|
|
9
10
|
"svg",
|
|
10
11
|
{
|
|
@@ -27,7 +28,7 @@ function fr({ size: e = 26, className: t = "" }) {
|
|
|
27
28
|
}
|
|
28
29
|
);
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function br({ size: e = 16, className: t = "" }) {
|
|
31
32
|
return /* @__PURE__ */ h(
|
|
32
33
|
"svg",
|
|
33
34
|
{
|
|
@@ -62,7 +63,7 @@ function pr({ size: e = 16, className: t = "" }) {
|
|
|
62
63
|
}
|
|
63
64
|
);
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
+
function mr({ size: e = 16, className: t = "" }) {
|
|
66
67
|
return /* @__PURE__ */ h(
|
|
67
68
|
"svg",
|
|
68
69
|
{
|
|
@@ -107,7 +108,7 @@ function yr({ size: e = 16, className: t = "" }) {
|
|
|
107
108
|
}
|
|
108
109
|
);
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function hr({
|
|
111
112
|
size: e = 134,
|
|
112
113
|
className: t = ""
|
|
113
114
|
}) {
|
|
@@ -142,7 +143,7 @@ function br({
|
|
|
142
143
|
}
|
|
143
144
|
);
|
|
144
145
|
}
|
|
145
|
-
function
|
|
146
|
+
function gr({ size: e = 95, className: t = "" }) {
|
|
146
147
|
return /* @__PURE__ */ h(
|
|
147
148
|
"svg",
|
|
148
149
|
{
|
|
@@ -183,7 +184,7 @@ function mr({ size: e = 95, className: t = "" }) {
|
|
|
183
184
|
}
|
|
184
185
|
);
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
+
function wr({
|
|
187
188
|
token: e,
|
|
188
189
|
onChange: t,
|
|
189
190
|
totalAmount: n
|
|
@@ -276,7 +277,7 @@ function hr({
|
|
|
276
277
|
] })
|
|
277
278
|
] });
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
+
function xr({ items: e, fee: t = 0.3 }) {
|
|
280
281
|
const r = e.reduce((s, i) => s + i.price, 0) + t;
|
|
281
282
|
return /* @__PURE__ */ h("div", { className: "bg-dark-4 rounded-md p-3 flex flex-col gap-3 w-full", children: [
|
|
282
283
|
/* @__PURE__ */ u("p", { className: "font-medium text-base text-white", children: "Payment Summary" }),
|
|
@@ -323,7 +324,7 @@ const k = {
|
|
|
323
324
|
WBTC: "0x437f0b6328892ac36E01836aBc865d16c875D291",
|
|
324
325
|
// Settlement Tokens
|
|
325
326
|
IDRX: "0x5324Cd3e781cf85Cf63253138Ef6c6E84143de7B"
|
|
326
|
-
}, wr = /* @__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[]"}],"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":"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"}],"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"}]'), xr = [
|
|
327
|
+
}, Tr = /* @__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[]"}],"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":"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"}],"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"}]'), vr = [
|
|
327
328
|
{
|
|
328
329
|
inputs: [],
|
|
329
330
|
stateMutability: "nonpayable",
|
|
@@ -805,7 +806,7 @@ const k = {
|
|
|
805
806
|
stateMutability: "nonpayable",
|
|
806
807
|
type: "function"
|
|
807
808
|
}
|
|
808
|
-
],
|
|
809
|
+
], Er = [
|
|
809
810
|
{
|
|
810
811
|
inputs: [],
|
|
811
812
|
stateMutability: "nonpayable",
|
|
@@ -1224,7 +1225,7 @@ const k = {
|
|
|
1224
1225
|
stateMutability: "nonpayable",
|
|
1225
1226
|
type: "function"
|
|
1226
1227
|
}
|
|
1227
|
-
], Ce =
|
|
1228
|
+
], Ce = Tr, W = vr, Z = Er;
|
|
1228
1229
|
function ft() {
|
|
1229
1230
|
const { writeContract: e, data: t, isPending: n, error: r } = dt(), { isLoading: s, isSuccess: i } = lt({
|
|
1230
1231
|
hash: t
|
|
@@ -1322,7 +1323,7 @@ function ft() {
|
|
|
1322
1323
|
error: r
|
|
1323
1324
|
};
|
|
1324
1325
|
}
|
|
1325
|
-
function
|
|
1326
|
+
function Pr({
|
|
1326
1327
|
isOpen: e,
|
|
1327
1328
|
onClose: t,
|
|
1328
1329
|
totalAmount: n,
|
|
@@ -1337,7 +1338,7 @@ function vr({
|
|
|
1337
1338
|
}) {
|
|
1338
1339
|
const [y, b] = _([]), [m, g] = _(""), [E, T] = _(!0), [v, f] = _("form"), [x, A] = _(0), [L, Y] = _(""), [te, G] = _(
|
|
1339
1340
|
"Preparing payment..."
|
|
1340
|
-
), [$, H] = _([]), I = ft(), { data: ne } = I.useGetTokenPrice(S.NATIVE), { data: J } = I.useGetTokenPrice(S.USDC), { data: N } = I.useGetTokenPrice(S.USDT), { data: B } = I.useGetTokenPrice(S.DAI), { data: F } = I.useGetTokenPrice(S.WBTC), ye = 1e8, j =
|
|
1341
|
+
), [$, H] = _([]), I = ft(), { data: ne } = I.useGetTokenPrice(S.NATIVE), { data: J } = I.useGetTokenPrice(S.USDC), { data: N } = I.useGetTokenPrice(S.USDT), { data: B } = I.useGetTokenPrice(S.DAI), { data: F } = I.useGetTokenPrice(S.WBTC), ye = 1e8, j = qn(
|
|
1341
1342
|
() => JSON.stringify(
|
|
1342
1343
|
i.map((w) => ({
|
|
1343
1344
|
id: w.id,
|
|
@@ -1415,7 +1416,8 @@ function vr({
|
|
|
1415
1416
|
month: "long",
|
|
1416
1417
|
year: "numeric"
|
|
1417
1418
|
});
|
|
1418
|
-
|
|
1419
|
+
if (!e) return null;
|
|
1420
|
+
const Jn = /* @__PURE__ */ h("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center", children: [
|
|
1419
1421
|
/* @__PURE__ */ u(
|
|
1420
1422
|
"div",
|
|
1421
1423
|
{
|
|
@@ -1424,7 +1426,7 @@ function vr({
|
|
|
1424
1426
|
}
|
|
1425
1427
|
),
|
|
1426
1428
|
v === "processing" && /* @__PURE__ */ h("div", { className: "relative bg-dark-2 border border-border rounded-xl p-4 flex flex-col gap-5 items-center justify-center w-[400px] min-h-[280px] mx-4 animate-slide-in-right", children: [
|
|
1427
|
-
/* @__PURE__ */ u(
|
|
1429
|
+
/* @__PURE__ */ u(hr, { size: 134 }),
|
|
1428
1430
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-3 items-center w-[300px]", children: [
|
|
1429
1431
|
/* @__PURE__ */ h("div", { className: "relative w-[234px] h-1.5", children: [
|
|
1430
1432
|
/* @__PURE__ */ u("div", { className: "absolute inset-0 bg-dark-4 rounded-full" }),
|
|
@@ -1445,7 +1447,7 @@ function vr({
|
|
|
1445
1447
|
] }),
|
|
1446
1448
|
v === "success" && /* @__PURE__ */ h("div", { className: "relative bg-dark-2 border border-border rounded-xl p-4 flex flex-col gap-8 items-start w-[380px] mx-4 animate-slide-in-right", children: [
|
|
1447
1449
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-6 items-center w-full", children: [
|
|
1448
|
-
/* @__PURE__ */ u(
|
|
1450
|
+
/* @__PURE__ */ u(gr, { size: 95 }),
|
|
1449
1451
|
/* @__PURE__ */ u("div", { className: "flex flex-col items-center justify-center w-full", children: /* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center text-white", children: [
|
|
1450
1452
|
/* @__PURE__ */ u("p", { className: "text-lg font-semibold", children: "Payment Success" }),
|
|
1451
1453
|
/* @__PURE__ */ u("p", { className: "text-sm", children: "Your payment has been successfully done." })
|
|
@@ -1499,7 +1501,7 @@ function vr({
|
|
|
1499
1501
|
{
|
|
1500
1502
|
onClick: t,
|
|
1501
1503
|
className: "text-white/60 hover:text-white transition-colors",
|
|
1502
|
-
children: /* @__PURE__ */ u(
|
|
1504
|
+
children: /* @__PURE__ */ u(yr, { size: 26 })
|
|
1503
1505
|
}
|
|
1504
1506
|
)
|
|
1505
1507
|
] }),
|
|
@@ -1516,7 +1518,7 @@ function vr({
|
|
|
1516
1518
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-5", children: [
|
|
1517
1519
|
/* @__PURE__ */ u("span", { className: "text-base text-white flex-1", children: "Use your tokens" }),
|
|
1518
1520
|
/* @__PURE__ */ h("div", { className: "bg-dark-4 rounded-md px-3 py-2 flex items-center gap-2", children: [
|
|
1519
|
-
/* @__PURE__ */ u(
|
|
1521
|
+
/* @__PURE__ */ u(br, { size: 16, className: "text-white/60" }),
|
|
1520
1522
|
/* @__PURE__ */ u(
|
|
1521
1523
|
"input",
|
|
1522
1524
|
{
|
|
@@ -1532,7 +1534,7 @@ function vr({
|
|
|
1532
1534
|
/* @__PURE__ */ h("div", { className: "bg-dark-3 rounded-md p-3 flex flex-col gap-4", children: [
|
|
1533
1535
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-6", children: [
|
|
1534
1536
|
/* @__PURE__ */ h("div", { className: "flex-1 flex items-center gap-2", children: [
|
|
1535
|
-
/* @__PURE__ */ u(
|
|
1537
|
+
/* @__PURE__ */ u(mr, { size: 16, className: "text-white/60" }),
|
|
1536
1538
|
/* @__PURE__ */ u("span", { className: "text-sm italic text-white", children: "Set the coins amount until 100%" }),
|
|
1537
1539
|
/* @__PURE__ */ h(
|
|
1538
1540
|
"span",
|
|
@@ -1563,7 +1565,7 @@ function vr({
|
|
|
1563
1565
|
] })
|
|
1564
1566
|
] }),
|
|
1565
1567
|
Kn.map((w) => /* @__PURE__ */ u(
|
|
1566
|
-
|
|
1568
|
+
wr,
|
|
1567
1569
|
{
|
|
1568
1570
|
token: w,
|
|
1569
1571
|
totalAmount: n,
|
|
@@ -1573,7 +1575,7 @@ function vr({
|
|
|
1573
1575
|
))
|
|
1574
1576
|
] })
|
|
1575
1577
|
] }),
|
|
1576
|
-
/* @__PURE__ */ u("div", { className: "w-full lg:w-[320px]", children: /* @__PURE__ */ u(
|
|
1578
|
+
/* @__PURE__ */ u("div", { className: "w-full lg:w-[320px]", children: /* @__PURE__ */ u(xr, { items: s, fee: o }) })
|
|
1577
1579
|
] }),
|
|
1578
1580
|
/* @__PURE__ */ u(
|
|
1579
1581
|
"button",
|
|
@@ -1585,9 +1587,10 @@ function vr({
|
|
|
1585
1587
|
}
|
|
1586
1588
|
)
|
|
1587
1589
|
] })
|
|
1588
|
-
] })
|
|
1590
|
+
] });
|
|
1591
|
+
return ar(Jn, document.body);
|
|
1589
1592
|
}
|
|
1590
|
-
function
|
|
1593
|
+
function Qa() {
|
|
1591
1594
|
const [e, t] = _(!1), [n, r] = _("form");
|
|
1592
1595
|
return {
|
|
1593
1596
|
isOpen: e,
|
|
@@ -1658,7 +1661,7 @@ const $t = [
|
|
|
1658
1661
|
stateMutability: "view",
|
|
1659
1662
|
type: "function"
|
|
1660
1663
|
}
|
|
1661
|
-
],
|
|
1664
|
+
], qa = [
|
|
1662
1665
|
{
|
|
1663
1666
|
name: "query",
|
|
1664
1667
|
type: "function",
|
|
@@ -1711,13 +1714,13 @@ const $t = [
|
|
|
1711
1714
|
];
|
|
1712
1715
|
function ge(e, { includeName: t = !1 } = {}) {
|
|
1713
1716
|
if (e.type !== "function" && e.type !== "event" && e.type !== "error")
|
|
1714
|
-
throw new
|
|
1717
|
+
throw new Br(e.type);
|
|
1715
1718
|
return `${e.name}(${pt(e.inputs, { includeName: t })})`;
|
|
1716
1719
|
}
|
|
1717
1720
|
function pt(e, { includeName: t = !1 } = {}) {
|
|
1718
|
-
return e ? e.map((n) =>
|
|
1721
|
+
return e ? e.map((n) => Ar(n, { includeName: t })).join(t ? ", " : ",") : "";
|
|
1719
1722
|
}
|
|
1720
|
-
function
|
|
1723
|
+
function Ar(e, { includeName: t }) {
|
|
1721
1724
|
return e.type.startsWith("tuple") ? `(${pt(e.components, { includeName: t })})${e.type.slice(5)}` : e.type + (t && e.name ? ` ${e.name}` : "");
|
|
1722
1725
|
}
|
|
1723
1726
|
function $e(e, { strict: t = !0 } = {}) {
|
|
@@ -1780,7 +1783,7 @@ let _e = {
|
|
|
1780
1783
|
function Ht(e, t) {
|
|
1781
1784
|
return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? Ht(e.cause, t) : t ? null : e;
|
|
1782
1785
|
}
|
|
1783
|
-
class
|
|
1786
|
+
class $r extends p {
|
|
1784
1787
|
constructor({ docsPath: t }) {
|
|
1785
1788
|
super([
|
|
1786
1789
|
"A constructor was not found on the ABI.",
|
|
@@ -1804,7 +1807,7 @@ class St extends p {
|
|
|
1804
1807
|
});
|
|
1805
1808
|
}
|
|
1806
1809
|
}
|
|
1807
|
-
class
|
|
1810
|
+
class Sr extends p {
|
|
1808
1811
|
constructor({ data: t, params: n, size: r }) {
|
|
1809
1812
|
super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
1810
1813
|
`), {
|
|
@@ -1838,7 +1841,7 @@ class yt extends p {
|
|
|
1838
1841
|
});
|
|
1839
1842
|
}
|
|
1840
1843
|
}
|
|
1841
|
-
class
|
|
1844
|
+
class Cr extends p {
|
|
1842
1845
|
constructor({ expectedLength: t, givenLength: n, type: r }) {
|
|
1843
1846
|
super([
|
|
1844
1847
|
`ABI encoding array length mismatch for type ${r}.`,
|
|
@@ -1848,12 +1851,12 @@ class $r extends p {
|
|
|
1848
1851
|
`), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
1849
1852
|
}
|
|
1850
1853
|
}
|
|
1851
|
-
class
|
|
1854
|
+
class Ir extends p {
|
|
1852
1855
|
constructor({ expectedSize: t, value: n }) {
|
|
1853
1856
|
super(`Size of bytes "${n}" (bytes${R(n)}) does not match expected size (bytes${t}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
1854
1857
|
}
|
|
1855
1858
|
}
|
|
1856
|
-
class
|
|
1859
|
+
class kr extends p {
|
|
1857
1860
|
constructor({ expectedLength: t, givenLength: n }) {
|
|
1858
1861
|
super([
|
|
1859
1862
|
"ABI encoding params/values length mismatch.",
|
|
@@ -1863,7 +1866,7 @@ class Cr extends p {
|
|
|
1863
1866
|
`), { name: "AbiEncodingLengthMismatchError" });
|
|
1864
1867
|
}
|
|
1865
1868
|
}
|
|
1866
|
-
class
|
|
1869
|
+
class eo extends p {
|
|
1867
1870
|
constructor(t, { docsPath: n }) {
|
|
1868
1871
|
super([
|
|
1869
1872
|
`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,
|
|
@@ -1876,7 +1879,7 @@ class Ja extends p {
|
|
|
1876
1879
|
});
|
|
1877
1880
|
}
|
|
1878
1881
|
}
|
|
1879
|
-
class
|
|
1882
|
+
class to extends p {
|
|
1880
1883
|
constructor(t, { docsPath: n } = {}) {
|
|
1881
1884
|
super([
|
|
1882
1885
|
`Error ${t ? `"${t}" ` : ""}not found on ABI.`,
|
|
@@ -1918,7 +1921,7 @@ class Ne extends p {
|
|
|
1918
1921
|
});
|
|
1919
1922
|
}
|
|
1920
1923
|
}
|
|
1921
|
-
class
|
|
1924
|
+
class Nr extends p {
|
|
1922
1925
|
constructor(t, { docsPath: n }) {
|
|
1923
1926
|
super([
|
|
1924
1927
|
`Function "${t}" does not contain any \`outputs\` on ABI.`,
|
|
@@ -1931,7 +1934,7 @@ class Ir extends p {
|
|
|
1931
1934
|
});
|
|
1932
1935
|
}
|
|
1933
1936
|
}
|
|
1934
|
-
class
|
|
1937
|
+
class no extends p {
|
|
1935
1938
|
constructor(t, { docsPath: n }) {
|
|
1936
1939
|
super([
|
|
1937
1940
|
`Encoded function signature "${t}" not found on ABI.`,
|
|
@@ -1944,7 +1947,7 @@ class qa extends p {
|
|
|
1944
1947
|
});
|
|
1945
1948
|
}
|
|
1946
1949
|
}
|
|
1947
|
-
class
|
|
1950
|
+
class Mr extends p {
|
|
1948
1951
|
constructor(t, n) {
|
|
1949
1952
|
super("Found ambiguous types in overloaded ABI items.", {
|
|
1950
1953
|
metaMessages: [
|
|
@@ -1958,7 +1961,7 @@ class kr extends p {
|
|
|
1958
1961
|
});
|
|
1959
1962
|
}
|
|
1960
1963
|
}
|
|
1961
|
-
class
|
|
1964
|
+
class Rr extends p {
|
|
1962
1965
|
constructor(t, { docsPath: n }) {
|
|
1963
1966
|
super([
|
|
1964
1967
|
`Type "${t}" is not a valid encoding type.`,
|
|
@@ -1967,7 +1970,7 @@ class Nr extends p {
|
|
|
1967
1970
|
`), { docsPath: n, name: "InvalidAbiEncodingType" });
|
|
1968
1971
|
}
|
|
1969
1972
|
}
|
|
1970
|
-
class
|
|
1973
|
+
class Or extends p {
|
|
1971
1974
|
constructor(t, { docsPath: n }) {
|
|
1972
1975
|
super([
|
|
1973
1976
|
`Type "${t}" is not a valid decoding type.`,
|
|
@@ -1976,7 +1979,7 @@ class Mr extends p {
|
|
|
1976
1979
|
`), { docsPath: n, name: "InvalidAbiDecodingType" });
|
|
1977
1980
|
}
|
|
1978
1981
|
}
|
|
1979
|
-
class
|
|
1982
|
+
class Dr extends p {
|
|
1980
1983
|
constructor(t) {
|
|
1981
1984
|
super([`Value "${t}" is not a valid array.`].join(`
|
|
1982
1985
|
`), {
|
|
@@ -1984,7 +1987,7 @@ class Rr extends p {
|
|
|
1984
1987
|
});
|
|
1985
1988
|
}
|
|
1986
1989
|
}
|
|
1987
|
-
class
|
|
1990
|
+
class Br extends p {
|
|
1988
1991
|
constructor(t) {
|
|
1989
1992
|
super([
|
|
1990
1993
|
`"${t}" is not a valid definition type.`,
|
|
@@ -2020,7 +2023,7 @@ class Ct extends p {
|
|
|
2020
2023
|
}
|
|
2021
2024
|
}
|
|
2022
2025
|
function xe(e, { dir: t, size: n = 32 } = {}) {
|
|
2023
|
-
return typeof e == "string" ? ue(e, { dir: t, size: n }) :
|
|
2026
|
+
return typeof e == "string" ? ue(e, { dir: t, size: n }) : Ur(e, { dir: t, size: n });
|
|
2024
2027
|
}
|
|
2025
2028
|
function ue(e, { dir: t, size: n = 32 } = {}) {
|
|
2026
2029
|
if (n === null)
|
|
@@ -2034,7 +2037,7 @@ function ue(e, { dir: t, size: n = 32 } = {}) {
|
|
|
2034
2037
|
});
|
|
2035
2038
|
return `0x${r[t === "right" ? "padEnd" : "padStart"](n * 2, "0")}`;
|
|
2036
2039
|
}
|
|
2037
|
-
function
|
|
2040
|
+
function Ur(e, { dir: t, size: n = 32 } = {}) {
|
|
2038
2041
|
if (n === null)
|
|
2039
2042
|
return e;
|
|
2040
2043
|
if (e.length > n)
|
|
@@ -2055,14 +2058,14 @@ let Yt = class extends p {
|
|
|
2055
2058
|
super(`Number "${i}" is not in safe ${s ? `${s * 8}-bit ${r ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${n} to ${t})` : `(above ${n})`}`, { name: "IntegerOutOfRangeError" });
|
|
2056
2059
|
}
|
|
2057
2060
|
};
|
|
2058
|
-
class
|
|
2061
|
+
class Lr extends p {
|
|
2059
2062
|
constructor(t) {
|
|
2060
2063
|
super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
|
|
2061
2064
|
name: "InvalidBytesBooleanError"
|
|
2062
2065
|
});
|
|
2063
2066
|
}
|
|
2064
2067
|
}
|
|
2065
|
-
class
|
|
2068
|
+
class Fr extends p {
|
|
2066
2069
|
constructor({ givenSize: t, maxSize: n }) {
|
|
2067
2070
|
super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
2068
2071
|
}
|
|
@@ -2075,7 +2078,7 @@ function bt(e, { dir: t = "left" } = {}) {
|
|
|
2075
2078
|
}
|
|
2076
2079
|
function ee(e, { size: t }) {
|
|
2077
2080
|
if (R(e) > t)
|
|
2078
|
-
throw new
|
|
2081
|
+
throw new Fr({
|
|
2079
2082
|
givenSize: R(e),
|
|
2080
2083
|
maxSize: t
|
|
2081
2084
|
});
|
|
@@ -2089,11 +2092,11 @@ function Zt(e, t = {}) {
|
|
|
2089
2092
|
const s = (e.length - 2) / 2, i = (1n << BigInt(s) * 8n - 1n) - 1n;
|
|
2090
2093
|
return r <= i ? r : r - BigInt(`0x${"f".padStart(s * 2, "f")}`) - 1n;
|
|
2091
2094
|
}
|
|
2092
|
-
function
|
|
2095
|
+
function jr(e, t = {}) {
|
|
2093
2096
|
return Number(Zt(e, t));
|
|
2094
2097
|
}
|
|
2095
|
-
const
|
|
2096
|
-
function
|
|
2098
|
+
const zr = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
2099
|
+
function _r(e, t = {}) {
|
|
2097
2100
|
return typeof e == "number" || typeof e == "bigint" ? C(e, t) : typeof e == "string" ? Jt(e, t) : typeof e == "boolean" ? Xt(e, t) : oe(e, t);
|
|
2098
2101
|
}
|
|
2099
2102
|
function Xt(e, t = {}) {
|
|
@@ -2103,7 +2106,7 @@ function Xt(e, t = {}) {
|
|
|
2103
2106
|
function oe(e, t = {}) {
|
|
2104
2107
|
let n = "";
|
|
2105
2108
|
for (let s = 0; s < e.length; s++)
|
|
2106
|
-
n +=
|
|
2109
|
+
n += zr[e[s]];
|
|
2107
2110
|
const r = `0x${n}`;
|
|
2108
2111
|
return typeof t.size == "number" ? (ee(r, { size: t.size }), xe(r, { dir: "right", size: t.size })) : r;
|
|
2109
2112
|
}
|
|
@@ -2125,16 +2128,16 @@ function C(e, t = {}) {
|
|
|
2125
2128
|
const o = `0x${(n && s < 0 ? (1n << BigInt(r * 8)) + BigInt(s) : s).toString(16)}`;
|
|
2126
2129
|
return r ? xe(o, { size: r }) : o;
|
|
2127
2130
|
}
|
|
2128
|
-
const
|
|
2131
|
+
const Gr = /* @__PURE__ */ new TextEncoder();
|
|
2129
2132
|
function Jt(e, t = {}) {
|
|
2130
|
-
const n =
|
|
2133
|
+
const n = Gr.encode(e);
|
|
2131
2134
|
return oe(n, t);
|
|
2132
2135
|
}
|
|
2133
|
-
const
|
|
2136
|
+
const Hr = /* @__PURE__ */ new TextEncoder();
|
|
2134
2137
|
function Qt(e, t = {}) {
|
|
2135
|
-
return typeof e == "number" || typeof e == "bigint" ?
|
|
2138
|
+
return typeof e == "number" || typeof e == "bigint" ? Wr(e, t) : typeof e == "boolean" ? Vr(e, t) : $e(e) ? mt(e, t) : qt(e, t);
|
|
2136
2139
|
}
|
|
2137
|
-
function
|
|
2140
|
+
function Vr(e, t = {}) {
|
|
2138
2141
|
const n = new Uint8Array(1);
|
|
2139
2142
|
return n[0] = Number(e), typeof t.size == "number" ? (ee(n, { size: t.size }), xe(n, { size: t.size })) : n;
|
|
2140
2143
|
}
|
|
@@ -2168,29 +2171,29 @@ function mt(e, t = {}) {
|
|
|
2168
2171
|
}
|
|
2169
2172
|
return i;
|
|
2170
2173
|
}
|
|
2171
|
-
function
|
|
2174
|
+
function Wr(e, t) {
|
|
2172
2175
|
const n = C(e, t);
|
|
2173
2176
|
return mt(n);
|
|
2174
2177
|
}
|
|
2175
2178
|
function qt(e, t = {}) {
|
|
2176
|
-
const n =
|
|
2179
|
+
const n = Hr.encode(e);
|
|
2177
2180
|
return typeof t.size == "number" ? (ee(n, { size: t.size }), xe(n, { dir: "right", size: t.size })) : n;
|
|
2178
2181
|
}
|
|
2179
2182
|
const Ie = /* @__PURE__ */ BigInt(2 ** 32 - 1), kt = /* @__PURE__ */ BigInt(32);
|
|
2180
|
-
function
|
|
2183
|
+
function Kr(e, t = !1) {
|
|
2181
2184
|
return t ? { h: Number(e & Ie), l: Number(e >> kt & Ie) } : { h: Number(e >> kt & Ie) | 0, l: Number(e & Ie) | 0 };
|
|
2182
2185
|
}
|
|
2183
|
-
function
|
|
2186
|
+
function Yr(e, t = !1) {
|
|
2184
2187
|
const n = e.length;
|
|
2185
2188
|
let r = new Uint32Array(n), s = new Uint32Array(n);
|
|
2186
2189
|
for (let i = 0; i < n; i++) {
|
|
2187
|
-
const { h: a, l: o } =
|
|
2190
|
+
const { h: a, l: o } = Kr(e[i], t);
|
|
2188
2191
|
[r[i], s[i]] = [a, o];
|
|
2189
2192
|
}
|
|
2190
2193
|
return [r, s];
|
|
2191
2194
|
}
|
|
2192
|
-
const
|
|
2193
|
-
function
|
|
2195
|
+
const Zr = (e, t, n) => e << n | t >>> 32 - n, Xr = (e, t, n) => t << n | e >>> 32 - n, Jr = (e, t, n) => t << n - 32 | e >>> 64 - n, Qr = (e, t, n) => e << n - 32 | t >>> 64 - n;
|
|
2196
|
+
function qr(e) {
|
|
2194
2197
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
2195
2198
|
}
|
|
2196
2199
|
function Nt(e) {
|
|
@@ -2198,7 +2201,7 @@ function Nt(e) {
|
|
|
2198
2201
|
throw new Error("positive integer expected, got " + e);
|
|
2199
2202
|
}
|
|
2200
2203
|
function Re(e, ...t) {
|
|
2201
|
-
if (!
|
|
2204
|
+
if (!qr(e))
|
|
2202
2205
|
throw new Error("Uint8Array expected");
|
|
2203
2206
|
if (t.length > 0 && !t.includes(e.length))
|
|
2204
2207
|
throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
|
|
@@ -2209,53 +2212,53 @@ function Mt(e, t = !0) {
|
|
|
2209
2212
|
if (t && e.finished)
|
|
2210
2213
|
throw new Error("Hash#digest() has already been called");
|
|
2211
2214
|
}
|
|
2212
|
-
function
|
|
2215
|
+
function es(e, t) {
|
|
2213
2216
|
Re(e);
|
|
2214
2217
|
const n = t.outputLen;
|
|
2215
2218
|
if (e.length < n)
|
|
2216
2219
|
throw new Error("digestInto() expects output buffer of length at least " + n);
|
|
2217
2220
|
}
|
|
2218
|
-
function
|
|
2221
|
+
function ts(e) {
|
|
2219
2222
|
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
2220
2223
|
}
|
|
2221
2224
|
function en(...e) {
|
|
2222
2225
|
for (let t = 0; t < e.length; t++)
|
|
2223
2226
|
e[t].fill(0);
|
|
2224
2227
|
}
|
|
2225
|
-
const
|
|
2226
|
-
function
|
|
2228
|
+
const ns = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
2229
|
+
function rs(e) {
|
|
2227
2230
|
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
2228
2231
|
}
|
|
2229
|
-
function
|
|
2232
|
+
function ss(e) {
|
|
2230
2233
|
for (let t = 0; t < e.length; t++)
|
|
2231
|
-
e[t] =
|
|
2234
|
+
e[t] = rs(e[t]);
|
|
2232
2235
|
return e;
|
|
2233
2236
|
}
|
|
2234
|
-
const Rt =
|
|
2235
|
-
function
|
|
2237
|
+
const Rt = ns ? (e) => e : ss;
|
|
2238
|
+
function is(e) {
|
|
2236
2239
|
if (typeof e != "string")
|
|
2237
2240
|
throw new Error("string expected");
|
|
2238
2241
|
return new Uint8Array(new TextEncoder().encode(e));
|
|
2239
2242
|
}
|
|
2240
2243
|
function tn(e) {
|
|
2241
|
-
return typeof e == "string" && (e =
|
|
2244
|
+
return typeof e == "string" && (e = is(e)), Re(e), e;
|
|
2242
2245
|
}
|
|
2243
|
-
class
|
|
2246
|
+
class as {
|
|
2244
2247
|
}
|
|
2245
|
-
function
|
|
2248
|
+
function os(e) {
|
|
2246
2249
|
const t = (r) => e().update(tn(r)).digest(), n = e();
|
|
2247
2250
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
|
|
2248
2251
|
}
|
|
2249
|
-
const
|
|
2252
|
+
const cs = BigInt(0), Ee = BigInt(1), us = BigInt(2), ds = BigInt(7), ls = BigInt(256), fs = BigInt(113), nn = [], rn = [], sn = [];
|
|
2250
2253
|
for (let e = 0, t = Ee, n = 1, r = 0; e < 24; e++) {
|
|
2251
2254
|
[n, r] = [r, (2 * n + 3 * r) % 5], nn.push(2 * (5 * r + n)), rn.push((e + 1) * (e + 2) / 2 % 64);
|
|
2252
|
-
let s =
|
|
2255
|
+
let s = cs;
|
|
2253
2256
|
for (let i = 0; i < 7; i++)
|
|
2254
|
-
t = (t << Ee ^ (t >>
|
|
2257
|
+
t = (t << Ee ^ (t >> ds) * fs) % ls, t & us && (s ^= Ee << (Ee << /* @__PURE__ */ BigInt(i)) - Ee);
|
|
2255
2258
|
sn.push(s);
|
|
2256
2259
|
}
|
|
2257
|
-
const an =
|
|
2258
|
-
function
|
|
2260
|
+
const an = Yr(sn, !0), ps = an[0], ys = an[1], Ot = (e, t, n) => n > 32 ? Jr(e, t, n) : Zr(e, t, n), Dt = (e, t, n) => n > 32 ? Qr(e, t, n) : Xr(e, t, n);
|
|
2261
|
+
function bs(e, t = 24) {
|
|
2259
2262
|
const n = new Uint32Array(10);
|
|
2260
2263
|
for (let r = 24 - t; r < 24; r++) {
|
|
2261
2264
|
for (let a = 0; a < 10; a++)
|
|
@@ -2276,22 +2279,22 @@ function ps(e, t = 24) {
|
|
|
2276
2279
|
for (let o = 0; o < 10; o++)
|
|
2277
2280
|
e[a + o] ^= ~n[(o + 2) % 10] & n[(o + 4) % 10];
|
|
2278
2281
|
}
|
|
2279
|
-
e[0] ^=
|
|
2282
|
+
e[0] ^= ps[r], e[1] ^= ys[r];
|
|
2280
2283
|
}
|
|
2281
2284
|
en(n);
|
|
2282
2285
|
}
|
|
2283
|
-
class ht extends
|
|
2286
|
+
class ht extends as {
|
|
2284
2287
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
2285
2288
|
constructor(t, n, r, s = !1, i = 24) {
|
|
2286
2289
|
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 = i, Nt(r), !(0 < t && t < 200))
|
|
2287
2290
|
throw new Error("only keccak-f1600 function is supported");
|
|
2288
|
-
this.state = new Uint8Array(200), this.state32 =
|
|
2291
|
+
this.state = new Uint8Array(200), this.state32 = ts(this.state);
|
|
2289
2292
|
}
|
|
2290
2293
|
clone() {
|
|
2291
2294
|
return this._cloneInto();
|
|
2292
2295
|
}
|
|
2293
2296
|
keccak() {
|
|
2294
|
-
Rt(this.state32),
|
|
2297
|
+
Rt(this.state32), bs(this.state32, this.rounds), Rt(this.state32), this.posOut = 0, this.pos = 0;
|
|
2295
2298
|
}
|
|
2296
2299
|
update(t) {
|
|
2297
2300
|
Mt(this), t = tn(t), Re(t);
|
|
@@ -2330,7 +2333,7 @@ class ht extends ss {
|
|
|
2330
2333
|
return Nt(t), this.xofInto(new Uint8Array(t));
|
|
2331
2334
|
}
|
|
2332
2335
|
digestInto(t) {
|
|
2333
|
-
if (
|
|
2336
|
+
if (es(t, this), this.finished)
|
|
2334
2337
|
throw new Error("digest() was already called");
|
|
2335
2338
|
return this.writeInto(t), this.destroy(), t;
|
|
2336
2339
|
}
|
|
@@ -2345,10 +2348,10 @@ class ht extends ss {
|
|
|
2345
2348
|
return t || (t = new ht(n, r, s, a, i)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = i, t.suffix = r, t.outputLen = s, t.enableXOF = a, t.destroyed = this.destroyed, t;
|
|
2346
2349
|
}
|
|
2347
2350
|
}
|
|
2348
|
-
const
|
|
2351
|
+
const ms = (e, t, n) => os(() => new ht(t, e, n)), hs = ms(1, 136, 256 / 8);
|
|
2349
2352
|
function on(e, t) {
|
|
2350
|
-
const n = t || "hex", r =
|
|
2351
|
-
return n === "bytes" ? r :
|
|
2353
|
+
const n = t || "hex", r = hs($e(e, { strict: !1 }) ? Qt(e) : e);
|
|
2354
|
+
return n === "bytes" ? r : _r(r);
|
|
2352
2355
|
}
|
|
2353
2356
|
class cn extends Map {
|
|
2354
2357
|
constructor(t) {
|
|
@@ -2371,12 +2374,12 @@ class cn extends Map {
|
|
|
2371
2374
|
return this;
|
|
2372
2375
|
}
|
|
2373
2376
|
}
|
|
2374
|
-
const
|
|
2377
|
+
const gs = /^0x[a-fA-F0-9]{40}$/, Ge = /* @__PURE__ */ new cn(8192);
|
|
2375
2378
|
function fe(e, t) {
|
|
2376
2379
|
const { strict: n = !0 } = t ?? {}, r = `${e}.${n}`;
|
|
2377
2380
|
if (Ge.has(r))
|
|
2378
2381
|
return Ge.get(r);
|
|
2379
|
-
const s =
|
|
2382
|
+
const s = gs.test(e) ? e.toLowerCase() === e ? !0 : n ? un(e) === e : !0 : !1;
|
|
2380
2383
|
return Ge.set(r, s), s;
|
|
2381
2384
|
}
|
|
2382
2385
|
const He = /* @__PURE__ */ new cn(8192);
|
|
@@ -2396,17 +2399,17 @@ class Bt extends p {
|
|
|
2396
2399
|
});
|
|
2397
2400
|
}
|
|
2398
2401
|
}
|
|
2399
|
-
class
|
|
2402
|
+
class ws extends p {
|
|
2400
2403
|
constructor({ length: t, position: n }) {
|
|
2401
2404
|
super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`, { name: "PositionOutOfBoundsError" });
|
|
2402
2405
|
}
|
|
2403
2406
|
}
|
|
2404
|
-
class
|
|
2407
|
+
class xs extends p {
|
|
2405
2408
|
constructor({ count: t, limit: n }) {
|
|
2406
2409
|
super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
2407
2410
|
}
|
|
2408
2411
|
}
|
|
2409
|
-
const
|
|
2412
|
+
const Ts = {
|
|
2410
2413
|
bytes: new Uint8Array(),
|
|
2411
2414
|
dataView: new DataView(new ArrayBuffer(0)),
|
|
2412
2415
|
position: 0,
|
|
@@ -2415,14 +2418,14 @@ const ws = {
|
|
|
2415
2418
|
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
|
2416
2419
|
assertReadLimit() {
|
|
2417
2420
|
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
|
2418
|
-
throw new
|
|
2421
|
+
throw new xs({
|
|
2419
2422
|
count: this.recursiveReadCount + 1,
|
|
2420
2423
|
limit: this.recursiveReadLimit
|
|
2421
2424
|
});
|
|
2422
2425
|
},
|
|
2423
2426
|
assertPosition(e) {
|
|
2424
2427
|
if (e < 0 || e > this.bytes.length - 1)
|
|
2425
|
-
throw new
|
|
2428
|
+
throw new ws({
|
|
2426
2429
|
length: this.bytes.length,
|
|
2427
2430
|
position: e
|
|
2428
2431
|
});
|
|
@@ -2528,12 +2531,12 @@ const ws = {
|
|
|
2528
2531
|
this.positionReadCount.set(this.position, e + 1), e > 0 && this.recursiveReadCount++;
|
|
2529
2532
|
}
|
|
2530
2533
|
};
|
|
2531
|
-
function
|
|
2532
|
-
const n = Object.create(
|
|
2534
|
+
function vs(e, { recursiveReadLimit: t = 8192 } = {}) {
|
|
2535
|
+
const n = Object.create(Ts);
|
|
2533
2536
|
return n.bytes = e, n.dataView = new DataView(e.buffer ?? e, e.byteOffset, e.byteLength), n.positionReadCount = /* @__PURE__ */ new Map(), n.recursiveReadLimit = t, n;
|
|
2534
2537
|
}
|
|
2535
2538
|
function Oe(e, t, n, { strict: r } = {}) {
|
|
2536
|
-
return $e(e, { strict: !1 }) ?
|
|
2539
|
+
return $e(e, { strict: !1 }) ? Es(e, t, n, {
|
|
2537
2540
|
strict: r
|
|
2538
2541
|
}) : fn(e, t, n, {
|
|
2539
2542
|
strict: r
|
|
@@ -2560,35 +2563,35 @@ function fn(e, t, n, { strict: r } = {}) {
|
|
|
2560
2563
|
const s = e.slice(t, n);
|
|
2561
2564
|
return r && ln(s, t, n), s;
|
|
2562
2565
|
}
|
|
2563
|
-
function
|
|
2566
|
+
function Es(e, t, n, { strict: r } = {}) {
|
|
2564
2567
|
dn(e, t);
|
|
2565
2568
|
const s = `0x${e.replace("0x", "").slice((t ?? 0) * 2, (n ?? e.length) * 2)}`;
|
|
2566
2569
|
return r && ln(s, t, n), s;
|
|
2567
2570
|
}
|
|
2568
|
-
function
|
|
2571
|
+
function Ps(e, t = {}) {
|
|
2569
2572
|
typeof t.size < "u" && ee(e, { size: t.size });
|
|
2570
2573
|
const n = oe(e, t);
|
|
2571
2574
|
return Zt(n, t);
|
|
2572
2575
|
}
|
|
2573
|
-
function
|
|
2576
|
+
function As(e, t = {}) {
|
|
2574
2577
|
let n = e;
|
|
2575
2578
|
if (typeof t.size < "u" && (ee(n, { size: t.size }), n = bt(n)), n.length > 1 || n[0] > 1)
|
|
2576
|
-
throw new
|
|
2579
|
+
throw new Lr(n);
|
|
2577
2580
|
return !!n[0];
|
|
2578
2581
|
}
|
|
2579
2582
|
function ae(e, t = {}) {
|
|
2580
2583
|
typeof t.size < "u" && ee(e, { size: t.size });
|
|
2581
2584
|
const n = oe(e, t);
|
|
2582
|
-
return
|
|
2585
|
+
return jr(n, t);
|
|
2583
2586
|
}
|
|
2584
|
-
function
|
|
2587
|
+
function $s(e, t = {}) {
|
|
2585
2588
|
let n = e;
|
|
2586
2589
|
return typeof t.size < "u" && (ee(n, { size: t.size }), n = bt(n, { dir: "right" })), new TextDecoder().decode(n);
|
|
2587
2590
|
}
|
|
2588
2591
|
function we(e) {
|
|
2589
|
-
return typeof e[0] == "string" ? gt(e) :
|
|
2592
|
+
return typeof e[0] == "string" ? gt(e) : Ss(e);
|
|
2590
2593
|
}
|
|
2591
|
-
function
|
|
2594
|
+
function Ss(e) {
|
|
2592
2595
|
let t = 0;
|
|
2593
2596
|
for (const s of e)
|
|
2594
2597
|
t += s.length;
|
|
@@ -2601,20 +2604,20 @@ function As(e) {
|
|
|
2601
2604
|
function gt(e) {
|
|
2602
2605
|
return `0x${e.reduce((t, n) => t + n.replace("0x", ""), "")}`;
|
|
2603
2606
|
}
|
|
2604
|
-
const
|
|
2607
|
+
const Cs = /^(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)?$/;
|
|
2605
2608
|
function pn(e, t) {
|
|
2606
2609
|
if (e.length !== t.length)
|
|
2607
|
-
throw new
|
|
2610
|
+
throw new kr({
|
|
2608
2611
|
expectedLength: e.length,
|
|
2609
2612
|
givenLength: t.length
|
|
2610
2613
|
});
|
|
2611
|
-
const n =
|
|
2614
|
+
const n = Is({
|
|
2612
2615
|
params: e,
|
|
2613
2616
|
values: t
|
|
2614
2617
|
}), r = xt(n);
|
|
2615
2618
|
return r.length === 0 ? "0x" : r;
|
|
2616
2619
|
}
|
|
2617
|
-
function
|
|
2620
|
+
function Is({ params: e, values: t }) {
|
|
2618
2621
|
const n = [];
|
|
2619
2622
|
for (let r = 0; r < e.length; r++)
|
|
2620
2623
|
n.push(wt({ param: e[r], value: t[r] }));
|
|
@@ -2624,28 +2627,28 @@ function wt({ param: e, value: t }) {
|
|
|
2624
2627
|
const n = Tt(e.type);
|
|
2625
2628
|
if (n) {
|
|
2626
2629
|
const [r, s] = n;
|
|
2627
|
-
return
|
|
2630
|
+
return Ns(t, { length: r, param: { ...e, type: s } });
|
|
2628
2631
|
}
|
|
2629
2632
|
if (e.type === "tuple")
|
|
2630
|
-
return
|
|
2633
|
+
return Bs(t, {
|
|
2631
2634
|
param: e
|
|
2632
2635
|
});
|
|
2633
2636
|
if (e.type === "address")
|
|
2634
|
-
return
|
|
2637
|
+
return ks(t);
|
|
2635
2638
|
if (e.type === "bool")
|
|
2636
|
-
return
|
|
2639
|
+
return Rs(t);
|
|
2637
2640
|
if (e.type.startsWith("uint") || e.type.startsWith("int")) {
|
|
2638
|
-
const r = e.type.startsWith("int"), [, , s = "256"] =
|
|
2639
|
-
return
|
|
2641
|
+
const r = e.type.startsWith("int"), [, , s = "256"] = Cs.exec(e.type) ?? [];
|
|
2642
|
+
return Os(t, {
|
|
2640
2643
|
signed: r,
|
|
2641
2644
|
size: Number(s)
|
|
2642
2645
|
});
|
|
2643
2646
|
}
|
|
2644
2647
|
if (e.type.startsWith("bytes"))
|
|
2645
|
-
return
|
|
2648
|
+
return Ms(t, { param: e });
|
|
2646
2649
|
if (e.type === "string")
|
|
2647
|
-
return
|
|
2648
|
-
throw new
|
|
2650
|
+
return Ds(t);
|
|
2651
|
+
throw new Rr(e.type, {
|
|
2649
2652
|
docsPath: "/docs/contract/encodeAbiParameters"
|
|
2650
2653
|
});
|
|
2651
2654
|
}
|
|
@@ -2663,17 +2666,17 @@ function xt(e) {
|
|
|
2663
2666
|
}
|
|
2664
2667
|
return we([...n, ...r]);
|
|
2665
2668
|
}
|
|
2666
|
-
function
|
|
2669
|
+
function ks(e) {
|
|
2667
2670
|
if (!fe(e))
|
|
2668
2671
|
throw new Me({ address: e });
|
|
2669
2672
|
return { dynamic: !1, encoded: ue(e.toLowerCase()) };
|
|
2670
2673
|
}
|
|
2671
|
-
function
|
|
2674
|
+
function Ns(e, { length: t, param: n }) {
|
|
2672
2675
|
const r = t === null;
|
|
2673
2676
|
if (!Array.isArray(e))
|
|
2674
|
-
throw new
|
|
2677
|
+
throw new Dr(e);
|
|
2675
2678
|
if (!r && e.length !== t)
|
|
2676
|
-
throw new
|
|
2679
|
+
throw new Cr({
|
|
2677
2680
|
expectedLength: t,
|
|
2678
2681
|
givenLength: e.length,
|
|
2679
2682
|
type: `${n.type}[${t}]`
|
|
@@ -2701,7 +2704,7 @@ function Is(e, { length: t, param: n }) {
|
|
|
2701
2704
|
encoded: we(i.map(({ encoded: a }) => a))
|
|
2702
2705
|
};
|
|
2703
2706
|
}
|
|
2704
|
-
function
|
|
2707
|
+
function Ms(e, { param: t }) {
|
|
2705
2708
|
const [, n] = t.type.split("bytes"), r = R(e);
|
|
2706
2709
|
if (!n) {
|
|
2707
2710
|
let s = e;
|
|
@@ -2714,18 +2717,18 @@ function ks(e, { param: t }) {
|
|
|
2714
2717
|
};
|
|
2715
2718
|
}
|
|
2716
2719
|
if (r !== Number.parseInt(n, 10))
|
|
2717
|
-
throw new
|
|
2720
|
+
throw new Ir({
|
|
2718
2721
|
expectedSize: Number.parseInt(n, 10),
|
|
2719
2722
|
value: e
|
|
2720
2723
|
});
|
|
2721
2724
|
return { dynamic: !1, encoded: ue(e, { dir: "right" }) };
|
|
2722
2725
|
}
|
|
2723
|
-
function
|
|
2726
|
+
function Rs(e) {
|
|
2724
2727
|
if (typeof e != "boolean")
|
|
2725
2728
|
throw new p(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
|
|
2726
2729
|
return { dynamic: !1, encoded: ue(Xt(e)) };
|
|
2727
2730
|
}
|
|
2728
|
-
function
|
|
2731
|
+
function Os(e, { signed: t, size: n = 256 }) {
|
|
2729
2732
|
if (typeof n == "number") {
|
|
2730
2733
|
const r = 2n ** (BigInt(n) - (t ? 1n : 0n)) - 1n, s = t ? -r - 1n : 0n;
|
|
2731
2734
|
if (e > r || e < s)
|
|
@@ -2745,7 +2748,7 @@ function Ms(e, { signed: t, size: n = 256 }) {
|
|
|
2745
2748
|
})
|
|
2746
2749
|
};
|
|
2747
2750
|
}
|
|
2748
|
-
function
|
|
2751
|
+
function Ds(e) {
|
|
2749
2752
|
const t = Jt(e), n = Math.ceil(R(t) / 32), r = [];
|
|
2750
2753
|
for (let s = 0; s < n; s++)
|
|
2751
2754
|
r.push(ue(Oe(t, s * 32, (s + 1) * 32), {
|
|
@@ -2759,7 +2762,7 @@ function Rs(e) {
|
|
|
2759
2762
|
])
|
|
2760
2763
|
};
|
|
2761
2764
|
}
|
|
2762
|
-
function
|
|
2765
|
+
function Bs(e, { param: t }) {
|
|
2763
2766
|
let n = !1;
|
|
2764
2767
|
const r = [];
|
|
2765
2768
|
for (let s = 0; s < t.components.length; s++) {
|
|
@@ -2782,11 +2785,11 @@ function Tt(e) {
|
|
|
2782
2785
|
) : void 0;
|
|
2783
2786
|
}
|
|
2784
2787
|
function yn(e, t) {
|
|
2785
|
-
const n = typeof t == "string" ? mt(t) : t, r =
|
|
2788
|
+
const n = typeof t == "string" ? mt(t) : t, r = vs(n);
|
|
2786
2789
|
if (R(n) === 0 && e.length > 0)
|
|
2787
2790
|
throw new yt();
|
|
2788
2791
|
if (R(t) && R(t) < 32)
|
|
2789
|
-
throw new
|
|
2792
|
+
throw new Sr({
|
|
2790
2793
|
data: typeof t == "string" ? t : oe(t),
|
|
2791
2794
|
params: e,
|
|
2792
2795
|
size: R(t)
|
|
@@ -2807,30 +2810,30 @@ function he(e, t, { staticPosition: n }) {
|
|
|
2807
2810
|
const r = Tt(t.type);
|
|
2808
2811
|
if (r) {
|
|
2809
2812
|
const [s, i] = r;
|
|
2810
|
-
return
|
|
2813
|
+
return Ls(e, { ...t, type: i }, { length: s, staticPosition: n });
|
|
2811
2814
|
}
|
|
2812
2815
|
if (t.type === "tuple")
|
|
2813
|
-
return
|
|
2816
|
+
return _s(e, t, { staticPosition: n });
|
|
2814
2817
|
if (t.type === "address")
|
|
2815
|
-
return Ds(e);
|
|
2816
|
-
if (t.type === "bool")
|
|
2817
2818
|
return Us(e);
|
|
2819
|
+
if (t.type === "bool")
|
|
2820
|
+
return Fs(e);
|
|
2818
2821
|
if (t.type.startsWith("bytes"))
|
|
2819
|
-
return
|
|
2822
|
+
return js(e, t, { staticPosition: n });
|
|
2820
2823
|
if (t.type.startsWith("uint") || t.type.startsWith("int"))
|
|
2821
|
-
return
|
|
2824
|
+
return zs(e, t);
|
|
2822
2825
|
if (t.type === "string")
|
|
2823
|
-
return
|
|
2824
|
-
throw new
|
|
2826
|
+
return Gs(e, { staticPosition: n });
|
|
2827
|
+
throw new Or(t.type, {
|
|
2825
2828
|
docsPath: "/docs/contract/decodeAbiParameters"
|
|
2826
2829
|
});
|
|
2827
2830
|
}
|
|
2828
2831
|
const Ut = 32, Xe = 32;
|
|
2829
|
-
function
|
|
2832
|
+
function Us(e) {
|
|
2830
2833
|
const t = e.readBytes(32);
|
|
2831
2834
|
return [un(oe(fn(t, -20))), 32];
|
|
2832
2835
|
}
|
|
2833
|
-
function
|
|
2836
|
+
function Ls(e, t, { length: n, staticPosition: r }) {
|
|
2834
2837
|
if (!n) {
|
|
2835
2838
|
const a = ae(e.readBytes(Xe)), o = r + a, c = o + Ut;
|
|
2836
2839
|
e.setPosition(o);
|
|
@@ -2867,10 +2870,10 @@ function Bs(e, t, { length: n, staticPosition: r }) {
|
|
|
2867
2870
|
}
|
|
2868
2871
|
return [i, s];
|
|
2869
2872
|
}
|
|
2870
|
-
function
|
|
2871
|
-
return [
|
|
2873
|
+
function Fs(e) {
|
|
2874
|
+
return [As(e.readBytes(32), { size: 32 }), 32];
|
|
2872
2875
|
}
|
|
2873
|
-
function
|
|
2876
|
+
function js(e, t, { staticPosition: n }) {
|
|
2874
2877
|
const [r, s] = t.type.split("bytes");
|
|
2875
2878
|
if (!s) {
|
|
2876
2879
|
const a = ae(e.readBytes(32));
|
|
@@ -2883,14 +2886,14 @@ function Ls(e, t, { staticPosition: n }) {
|
|
|
2883
2886
|
}
|
|
2884
2887
|
return [oe(e.readBytes(Number.parseInt(s, 10), 32)), 32];
|
|
2885
2888
|
}
|
|
2886
|
-
function
|
|
2889
|
+
function zs(e, t) {
|
|
2887
2890
|
const n = t.type.startsWith("int"), r = Number.parseInt(t.type.split("int")[1] || "256", 10), s = e.readBytes(32);
|
|
2888
2891
|
return [
|
|
2889
|
-
r > 48 ?
|
|
2892
|
+
r > 48 ? Ps(s, { signed: n }) : ae(s, { signed: n }),
|
|
2890
2893
|
32
|
|
2891
2894
|
];
|
|
2892
2895
|
}
|
|
2893
|
-
function
|
|
2896
|
+
function _s(e, t, { staticPosition: n }) {
|
|
2894
2897
|
const r = t.components.length === 0 || t.components.some(({ name: a }) => !a), s = r ? [] : {};
|
|
2895
2898
|
let i = 0;
|
|
2896
2899
|
if (Ae(t)) {
|
|
@@ -2913,13 +2916,13 @@ function js(e, t, { staticPosition: n }) {
|
|
|
2913
2916
|
}
|
|
2914
2917
|
return [s, i];
|
|
2915
2918
|
}
|
|
2916
|
-
function
|
|
2919
|
+
function Gs(e, { staticPosition: t }) {
|
|
2917
2920
|
const n = ae(e.readBytes(32)), r = t + n;
|
|
2918
2921
|
e.setPosition(r);
|
|
2919
2922
|
const s = ae(e.readBytes(32));
|
|
2920
2923
|
if (s === 0)
|
|
2921
2924
|
return e.setPosition(t + 32), ["", 32];
|
|
2922
|
-
const i = e.readBytes(s, 32), a =
|
|
2925
|
+
const i = e.readBytes(s, 32), a = $s(bt(i));
|
|
2923
2926
|
return e.setPosition(t + 32), [a, 32];
|
|
2924
2927
|
}
|
|
2925
2928
|
function Ae(e) {
|
|
@@ -2931,11 +2934,11 @@ function Ae(e) {
|
|
|
2931
2934
|
const n = Tt(e.type);
|
|
2932
2935
|
return !!(n && Ae({ ...e, type: n[1] }));
|
|
2933
2936
|
}
|
|
2934
|
-
const
|
|
2935
|
-
function
|
|
2936
|
-
return
|
|
2937
|
+
const Hs = (e) => on(Qt(e));
|
|
2938
|
+
function Vs(e) {
|
|
2939
|
+
return Hs(e);
|
|
2937
2940
|
}
|
|
2938
|
-
const
|
|
2941
|
+
const Ws = "1.2.3";
|
|
2939
2942
|
let K = class Je extends Error {
|
|
2940
2943
|
constructor(t, n = {}) {
|
|
2941
2944
|
const r = n.cause instanceof Je ? n.cause.details : n.cause?.message ? n.cause.message : n.details, s = n.cause instanceof Je && n.cause.docsPath || n.docsPath, i = [
|
|
@@ -2944,7 +2947,7 @@ let K = class Je extends Error {
|
|
|
2944
2947
|
...n.metaMessages ? [...n.metaMessages, ""] : [],
|
|
2945
2948
|
...s ? [`Docs: https://abitype.dev${s}`] : [],
|
|
2946
2949
|
...r ? [`Details: ${r}`] : [],
|
|
2947
|
-
`Version: abitype@${
|
|
2950
|
+
`Version: abitype@${Ws}`
|
|
2948
2951
|
].join(`
|
|
2949
2952
|
`);
|
|
2950
2953
|
super(i), Object.defineProperty(this, "details", {
|
|
@@ -3005,61 +3008,61 @@ function Pe(e) {
|
|
|
3005
3008
|
}
|
|
3006
3009
|
return t;
|
|
3007
3010
|
}
|
|
3008
|
-
function
|
|
3011
|
+
function Ks(e) {
|
|
3009
3012
|
return e.type === "function" ? `function ${e.name}(${Pe(e.inputs)})${e.stateMutability && e.stateMutability !== "nonpayable" ? ` ${e.stateMutability}` : ""}${e.outputs?.length ? ` returns (${Pe(e.outputs)})` : ""}` : e.type === "event" ? `event ${e.name}(${Pe(e.inputs)})` : e.type === "error" ? `error ${e.name}(${Pe(e.inputs)})` : e.type === "constructor" ? `constructor(${Pe(e.inputs)})${e.stateMutability === "payable" ? " payable" : ""}` : e.type === "fallback" ? `fallback() external${e.stateMutability === "payable" ? " payable" : ""}` : "receive() external payable";
|
|
3010
3013
|
}
|
|
3011
3014
|
const gn = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
3012
|
-
function
|
|
3015
|
+
function Ys(e) {
|
|
3013
3016
|
return gn.test(e);
|
|
3014
3017
|
}
|
|
3015
|
-
function
|
|
3018
|
+
function Zs(e) {
|
|
3016
3019
|
return ce(gn, e);
|
|
3017
3020
|
}
|
|
3018
3021
|
const wn = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
3019
|
-
function
|
|
3022
|
+
function Xs(e) {
|
|
3020
3023
|
return wn.test(e);
|
|
3021
3024
|
}
|
|
3022
|
-
function
|
|
3025
|
+
function Js(e) {
|
|
3023
3026
|
return ce(wn, e);
|
|
3024
3027
|
}
|
|
3025
3028
|
const xn = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
|
|
3026
|
-
function
|
|
3029
|
+
function Qs(e) {
|
|
3027
3030
|
return xn.test(e);
|
|
3028
3031
|
}
|
|
3029
|
-
function
|
|
3032
|
+
function qs(e) {
|
|
3030
3033
|
return ce(xn, e);
|
|
3031
3034
|
}
|
|
3032
3035
|
const Tn = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
3033
3036
|
function vn(e) {
|
|
3034
3037
|
return Tn.test(e);
|
|
3035
3038
|
}
|
|
3036
|
-
function
|
|
3039
|
+
function ei(e) {
|
|
3037
3040
|
return ce(Tn, e);
|
|
3038
3041
|
}
|
|
3039
3042
|
const En = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
|
|
3040
|
-
function
|
|
3043
|
+
function ti(e) {
|
|
3041
3044
|
return En.test(e);
|
|
3042
3045
|
}
|
|
3043
|
-
function
|
|
3046
|
+
function ni(e) {
|
|
3044
3047
|
return ce(En, e);
|
|
3045
3048
|
}
|
|
3046
3049
|
const Pn = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
|
|
3047
|
-
function
|
|
3050
|
+
function ri(e) {
|
|
3048
3051
|
return Pn.test(e);
|
|
3049
3052
|
}
|
|
3050
|
-
function
|
|
3053
|
+
function si(e) {
|
|
3051
3054
|
return ce(Pn, e);
|
|
3052
3055
|
}
|
|
3053
|
-
const
|
|
3054
|
-
function
|
|
3055
|
-
return
|
|
3056
|
+
const ii = /^receive\(\) external payable$/;
|
|
3057
|
+
function ai(e) {
|
|
3058
|
+
return ii.test(e);
|
|
3056
3059
|
}
|
|
3057
|
-
const
|
|
3060
|
+
const oi = /* @__PURE__ */ new Set(["indexed"]), qe = /* @__PURE__ */ new Set([
|
|
3058
3061
|
"calldata",
|
|
3059
3062
|
"memory",
|
|
3060
3063
|
"storage"
|
|
3061
3064
|
]);
|
|
3062
|
-
class
|
|
3065
|
+
class ci extends K {
|
|
3063
3066
|
constructor({ type: t }) {
|
|
3064
3067
|
super("Unknown type.", {
|
|
3065
3068
|
metaMessages: [
|
|
@@ -3073,7 +3076,7 @@ class ai extends K {
|
|
|
3073
3076
|
});
|
|
3074
3077
|
}
|
|
3075
3078
|
}
|
|
3076
|
-
class
|
|
3079
|
+
class ui extends K {
|
|
3077
3080
|
constructor({ type: t }) {
|
|
3078
3081
|
super("Unknown type.", {
|
|
3079
3082
|
metaMessages: [`Type "${t}" is not a valid ABI type.`]
|
|
@@ -3085,7 +3088,7 @@ class oi extends K {
|
|
|
3085
3088
|
});
|
|
3086
3089
|
}
|
|
3087
3090
|
}
|
|
3088
|
-
class
|
|
3091
|
+
class di extends K {
|
|
3089
3092
|
constructor({ param: t }) {
|
|
3090
3093
|
super("Invalid ABI parameter.", {
|
|
3091
3094
|
details: t
|
|
@@ -3097,7 +3100,7 @@ class ci extends K {
|
|
|
3097
3100
|
});
|
|
3098
3101
|
}
|
|
3099
3102
|
}
|
|
3100
|
-
class
|
|
3103
|
+
class li extends K {
|
|
3101
3104
|
constructor({ param: t, name: n }) {
|
|
3102
3105
|
super("Invalid ABI parameter.", {
|
|
3103
3106
|
details: t,
|
|
@@ -3112,7 +3115,7 @@ class ui extends K {
|
|
|
3112
3115
|
});
|
|
3113
3116
|
}
|
|
3114
3117
|
}
|
|
3115
|
-
class
|
|
3118
|
+
class fi extends K {
|
|
3116
3119
|
constructor({ param: t, type: n, modifier: r }) {
|
|
3117
3120
|
super("Invalid ABI parameter.", {
|
|
3118
3121
|
details: t,
|
|
@@ -3127,7 +3130,7 @@ class di extends K {
|
|
|
3127
3130
|
});
|
|
3128
3131
|
}
|
|
3129
3132
|
}
|
|
3130
|
-
class
|
|
3133
|
+
class pi extends K {
|
|
3131
3134
|
constructor({ param: t, type: n, modifier: r }) {
|
|
3132
3135
|
super("Invalid ABI parameter.", {
|
|
3133
3136
|
details: t,
|
|
@@ -3143,7 +3146,7 @@ class li extends K {
|
|
|
3143
3146
|
});
|
|
3144
3147
|
}
|
|
3145
3148
|
}
|
|
3146
|
-
class
|
|
3149
|
+
class yi extends K {
|
|
3147
3150
|
constructor({ abiParameter: t }) {
|
|
3148
3151
|
super("Invalid ABI parameter.", {
|
|
3149
3152
|
details: JSON.stringify(t, null, 2),
|
|
@@ -3168,7 +3171,7 @@ class Te extends K {
|
|
|
3168
3171
|
});
|
|
3169
3172
|
}
|
|
3170
3173
|
}
|
|
3171
|
-
class
|
|
3174
|
+
class bi extends K {
|
|
3172
3175
|
constructor({ signature: t }) {
|
|
3173
3176
|
super("Unknown signature.", {
|
|
3174
3177
|
details: t
|
|
@@ -3180,7 +3183,7 @@ class pi extends K {
|
|
|
3180
3183
|
});
|
|
3181
3184
|
}
|
|
3182
3185
|
}
|
|
3183
|
-
class
|
|
3186
|
+
class mi extends K {
|
|
3184
3187
|
constructor({ signature: t }) {
|
|
3185
3188
|
super("Invalid struct signature.", {
|
|
3186
3189
|
details: t,
|
|
@@ -3193,7 +3196,7 @@ class yi extends K {
|
|
|
3193
3196
|
});
|
|
3194
3197
|
}
|
|
3195
3198
|
}
|
|
3196
|
-
class
|
|
3199
|
+
class hi extends K {
|
|
3197
3200
|
constructor({ type: t }) {
|
|
3198
3201
|
super("Circular reference detected.", {
|
|
3199
3202
|
metaMessages: [`Struct "${t}" is a circular reference.`]
|
|
@@ -3205,7 +3208,7 @@ class bi extends K {
|
|
|
3205
3208
|
});
|
|
3206
3209
|
}
|
|
3207
3210
|
}
|
|
3208
|
-
class
|
|
3211
|
+
class gi extends K {
|
|
3209
3212
|
constructor({ current: t, depth: n }) {
|
|
3210
3213
|
super("Unbalanced parentheses.", {
|
|
3211
3214
|
metaMessages: [
|
|
@@ -3220,7 +3223,7 @@ class mi extends K {
|
|
|
3220
3223
|
});
|
|
3221
3224
|
}
|
|
3222
3225
|
}
|
|
3223
|
-
function
|
|
3226
|
+
function wi(e, t, n) {
|
|
3224
3227
|
let r = "";
|
|
3225
3228
|
if (n)
|
|
3226
3229
|
for (const s of Object.entries(n)) {
|
|
@@ -3287,26 +3290,26 @@ const Ve = /* @__PURE__ */ new Map([
|
|
|
3287
3290
|
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
3288
3291
|
]
|
|
3289
3292
|
]);
|
|
3290
|
-
function
|
|
3291
|
-
if (
|
|
3292
|
-
return wi(e, t);
|
|
3293
|
-
if (Ys(e))
|
|
3294
|
-
return xi(e, t);
|
|
3295
|
-
if (Ws(e))
|
|
3293
|
+
function xi(e, t = {}) {
|
|
3294
|
+
if (Qs(e))
|
|
3296
3295
|
return Ti(e, t);
|
|
3297
|
-
if (
|
|
3296
|
+
if (Xs(e))
|
|
3298
3297
|
return vi(e, t);
|
|
3298
|
+
if (Ys(e))
|
|
3299
|
+
return Ei(e, t);
|
|
3299
3300
|
if (ti(e))
|
|
3300
|
-
return
|
|
3301
|
-
if (
|
|
3301
|
+
return Pi(e, t);
|
|
3302
|
+
if (ri(e))
|
|
3303
|
+
return Ai(e);
|
|
3304
|
+
if (ai(e))
|
|
3302
3305
|
return {
|
|
3303
3306
|
type: "receive",
|
|
3304
3307
|
stateMutability: "payable"
|
|
3305
3308
|
};
|
|
3306
|
-
throw new
|
|
3309
|
+
throw new bi({ signature: e });
|
|
3307
3310
|
}
|
|
3308
|
-
function
|
|
3309
|
-
const n =
|
|
3311
|
+
function Ti(e, t = {}) {
|
|
3312
|
+
const n = qs(e);
|
|
3310
3313
|
if (!n)
|
|
3311
3314
|
throw new Te({ signature: e, type: "function" });
|
|
3312
3315
|
const r = X(n.parameters), s = [], i = r.length;
|
|
@@ -3334,21 +3337,21 @@ function wi(e, t = {}) {
|
|
|
3334
3337
|
outputs: a
|
|
3335
3338
|
};
|
|
3336
3339
|
}
|
|
3337
|
-
function
|
|
3338
|
-
const n =
|
|
3340
|
+
function vi(e, t = {}) {
|
|
3341
|
+
const n = Js(e);
|
|
3339
3342
|
if (!n)
|
|
3340
3343
|
throw new Te({ signature: e, type: "event" });
|
|
3341
3344
|
const r = X(n.parameters), s = [], i = r.length;
|
|
3342
3345
|
for (let a = 0; a < i; a++)
|
|
3343
3346
|
s.push(pe(r[a], {
|
|
3344
|
-
modifiers:
|
|
3347
|
+
modifiers: oi,
|
|
3345
3348
|
structs: t,
|
|
3346
3349
|
type: "event"
|
|
3347
3350
|
}));
|
|
3348
3351
|
return { name: n.name, type: "event", inputs: s };
|
|
3349
3352
|
}
|
|
3350
|
-
function
|
|
3351
|
-
const n =
|
|
3353
|
+
function Ei(e, t = {}) {
|
|
3354
|
+
const n = Zs(e);
|
|
3352
3355
|
if (!n)
|
|
3353
3356
|
throw new Te({ signature: e, type: "error" });
|
|
3354
3357
|
const r = X(n.parameters), s = [], i = r.length;
|
|
@@ -3356,8 +3359,8 @@ function Ti(e, t = {}) {
|
|
|
3356
3359
|
s.push(pe(r[a], { structs: t, type: "error" }));
|
|
3357
3360
|
return { name: n.name, type: "error", inputs: s };
|
|
3358
3361
|
}
|
|
3359
|
-
function
|
|
3360
|
-
const n =
|
|
3362
|
+
function Pi(e, t = {}) {
|
|
3363
|
+
const n = ni(e);
|
|
3361
3364
|
if (!n)
|
|
3362
3365
|
throw new Te({ signature: e, type: "constructor" });
|
|
3363
3366
|
const r = X(n.parameters), s = [], i = r.length;
|
|
@@ -3369,8 +3372,8 @@ function vi(e, t = {}) {
|
|
|
3369
3372
|
inputs: s
|
|
3370
3373
|
};
|
|
3371
3374
|
}
|
|
3372
|
-
function
|
|
3373
|
-
const t =
|
|
3375
|
+
function Ai(e) {
|
|
3376
|
+
const t = si(e);
|
|
3374
3377
|
if (!t)
|
|
3375
3378
|
throw new Te({ signature: e, type: "fallback" });
|
|
3376
3379
|
return {
|
|
@@ -3378,16 +3381,16 @@ function Ei(e) {
|
|
|
3378
3381
|
stateMutability: t.stateMutability ?? "nonpayable"
|
|
3379
3382
|
};
|
|
3380
3383
|
}
|
|
3381
|
-
const
|
|
3384
|
+
const $i = /^(?<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$_]*))?$/, Si = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, Ci = /^u?int$/;
|
|
3382
3385
|
function pe(e, t) {
|
|
3383
|
-
const n =
|
|
3386
|
+
const n = wi(e, t?.type, t?.structs);
|
|
3384
3387
|
if (Ve.has(n))
|
|
3385
3388
|
return Ve.get(n);
|
|
3386
|
-
const r = hn.test(e), s = ce(r ?
|
|
3389
|
+
const r = hn.test(e), s = ce(r ? Si : $i, e);
|
|
3387
3390
|
if (!s)
|
|
3388
|
-
throw new
|
|
3389
|
-
if (s.name &&
|
|
3390
|
-
throw new
|
|
3391
|
+
throw new di({ param: e });
|
|
3392
|
+
if (s.name && ki(s.name))
|
|
3393
|
+
throw new li({ param: e, name: s.name });
|
|
3391
3394
|
const i = s.name ? { name: s.name } : {}, a = s.modifier === "indexed" ? { indexed: !0 } : {}, o = t?.structs ?? {};
|
|
3392
3395
|
let c, d = {};
|
|
3393
3396
|
if (r) {
|
|
@@ -3398,21 +3401,21 @@ function pe(e, t) {
|
|
|
3398
3401
|
d = { components: b };
|
|
3399
3402
|
} else if (s.type in o)
|
|
3400
3403
|
c = "tuple", d = { components: o[s.type] };
|
|
3401
|
-
else if (
|
|
3404
|
+
else if (Ci.test(s.type))
|
|
3402
3405
|
c = `${s.type}256`;
|
|
3403
3406
|
else if (s.type === "address payable")
|
|
3404
3407
|
c = "address";
|
|
3405
3408
|
else if (c = s.type, t?.type !== "struct" && !An(c))
|
|
3406
|
-
throw new
|
|
3409
|
+
throw new ui({ type: c });
|
|
3407
3410
|
if (s.modifier) {
|
|
3408
3411
|
if (!t?.modifiers?.has?.(s.modifier))
|
|
3409
|
-
throw new
|
|
3412
|
+
throw new fi({
|
|
3410
3413
|
param: e,
|
|
3411
3414
|
type: t?.type,
|
|
3412
3415
|
modifier: s.modifier
|
|
3413
3416
|
});
|
|
3414
|
-
if (qe.has(s.modifier) && !
|
|
3415
|
-
throw new
|
|
3417
|
+
if (qe.has(s.modifier) && !Ni(c, !!s.array))
|
|
3418
|
+
throw new pi({
|
|
3416
3419
|
param: e,
|
|
3417
3420
|
type: t?.type,
|
|
3418
3421
|
modifier: s.modifier
|
|
@@ -3444,26 +3447,26 @@ function X(e, t = [], n = "", r = 0) {
|
|
|
3444
3447
|
if (n === "")
|
|
3445
3448
|
return t;
|
|
3446
3449
|
if (r !== 0)
|
|
3447
|
-
throw new
|
|
3450
|
+
throw new gi({ current: n, depth: r });
|
|
3448
3451
|
return t.push(n.trim()), t;
|
|
3449
3452
|
}
|
|
3450
3453
|
function An(e) {
|
|
3451
3454
|
return e === "address" || e === "bool" || e === "function" || e === "string" || bn.test(e) || mn.test(e);
|
|
3452
3455
|
}
|
|
3453
|
-
const
|
|
3454
|
-
function
|
|
3455
|
-
return e === "address" || e === "bool" || e === "function" || e === "string" || e === "tuple" || bn.test(e) || mn.test(e) ||
|
|
3456
|
+
const Ii = /^(?: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)$/;
|
|
3457
|
+
function ki(e) {
|
|
3458
|
+
return e === "address" || e === "bool" || e === "function" || e === "string" || e === "tuple" || bn.test(e) || mn.test(e) || Ii.test(e);
|
|
3456
3459
|
}
|
|
3457
|
-
function
|
|
3460
|
+
function Ni(e, t) {
|
|
3458
3461
|
return t || e === "bytes" || e === "string" || e === "tuple";
|
|
3459
3462
|
}
|
|
3460
|
-
function
|
|
3463
|
+
function Mi(e) {
|
|
3461
3464
|
const t = {}, n = e.length;
|
|
3462
3465
|
for (let a = 0; a < n; a++) {
|
|
3463
3466
|
const o = e[a];
|
|
3464
3467
|
if (!vn(o))
|
|
3465
3468
|
continue;
|
|
3466
|
-
const c =
|
|
3469
|
+
const c = ei(o);
|
|
3467
3470
|
if (!c)
|
|
3468
3471
|
throw new Te({ signature: o, type: "struct" });
|
|
3469
3472
|
const d = c.properties.split(";"), l = [], y = d.length;
|
|
@@ -3477,7 +3480,7 @@ function ki(e) {
|
|
|
3477
3480
|
l.push(E);
|
|
3478
3481
|
}
|
|
3479
3482
|
if (!l.length)
|
|
3480
|
-
throw new
|
|
3483
|
+
throw new mi({ signature: o });
|
|
3481
3484
|
t[c.name] = l;
|
|
3482
3485
|
}
|
|
3483
3486
|
const r = {}, s = Object.entries(t), i = s.length;
|
|
@@ -3487,7 +3490,7 @@ function ki(e) {
|
|
|
3487
3490
|
}
|
|
3488
3491
|
return r;
|
|
3489
3492
|
}
|
|
3490
|
-
const
|
|
3493
|
+
const Ri = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
|
|
3491
3494
|
function $n(e = [], t = {}, n = /* @__PURE__ */ new Set()) {
|
|
3492
3495
|
const r = [], s = e.length;
|
|
3493
3496
|
for (let i = 0; i < s; i++) {
|
|
@@ -3495,13 +3498,13 @@ function $n(e = [], t = {}, n = /* @__PURE__ */ new Set()) {
|
|
|
3495
3498
|
if (hn.test(a.type))
|
|
3496
3499
|
r.push(a);
|
|
3497
3500
|
else {
|
|
3498
|
-
const c = ce(
|
|
3501
|
+
const c = ce(Ri, a.type);
|
|
3499
3502
|
if (!c?.type)
|
|
3500
|
-
throw new
|
|
3503
|
+
throw new yi({ abiParameter: a });
|
|
3501
3504
|
const { array: d, type: l } = c;
|
|
3502
3505
|
if (l in t) {
|
|
3503
3506
|
if (n.has(l))
|
|
3504
|
-
throw new
|
|
3507
|
+
throw new hi({ type: l });
|
|
3505
3508
|
r.push({
|
|
3506
3509
|
...a,
|
|
3507
3510
|
type: `tuple${d ?? ""}`,
|
|
@@ -3510,20 +3513,20 @@ function $n(e = [], t = {}, n = /* @__PURE__ */ new Set()) {
|
|
|
3510
3513
|
} else if (An(l))
|
|
3511
3514
|
r.push(a);
|
|
3512
3515
|
else
|
|
3513
|
-
throw new
|
|
3516
|
+
throw new ci({ type: l });
|
|
3514
3517
|
}
|
|
3515
3518
|
}
|
|
3516
3519
|
return r;
|
|
3517
3520
|
}
|
|
3518
3521
|
function Sn(e) {
|
|
3519
|
-
const t =
|
|
3522
|
+
const t = Mi(e), n = [], r = e.length;
|
|
3520
3523
|
for (let s = 0; s < r; s++) {
|
|
3521
3524
|
const i = e[s];
|
|
3522
|
-
vn(i) || n.push(
|
|
3525
|
+
vn(i) || n.push(xi(i, t));
|
|
3523
3526
|
}
|
|
3524
3527
|
return n;
|
|
3525
3528
|
}
|
|
3526
|
-
function
|
|
3529
|
+
function Oi(e) {
|
|
3527
3530
|
let t = !0, n = "", r = 0, s = "", i = !1;
|
|
3528
3531
|
for (let a = 0; a < e.length; a++) {
|
|
3529
3532
|
const o = e[a];
|
|
@@ -3548,16 +3551,16 @@ function Mi(e) {
|
|
|
3548
3551
|
throw new p("Unable to normalize signature.");
|
|
3549
3552
|
return s;
|
|
3550
3553
|
}
|
|
3551
|
-
const
|
|
3552
|
-
const t = typeof e == "string" ? e :
|
|
3553
|
-
return
|
|
3554
|
+
const Di = (e) => {
|
|
3555
|
+
const t = typeof e == "string" ? e : Ks(e);
|
|
3556
|
+
return Oi(t);
|
|
3554
3557
|
};
|
|
3555
3558
|
function Cn(e) {
|
|
3556
|
-
return
|
|
3559
|
+
return Vs(Di(e));
|
|
3557
3560
|
}
|
|
3558
|
-
const
|
|
3561
|
+
const Bi = Cn, vt = (e) => Oe(Cn(e), 0, 4);
|
|
3559
3562
|
function Et(e) {
|
|
3560
|
-
const { abi: t, args: n = [], name: r } = e, s = $e(r, { strict: !1 }), i = t.filter((o) => s ? o.type === "function" ? vt(o) === r : o.type === "event" ?
|
|
3563
|
+
const { abi: t, args: n = [], name: r } = e, s = $e(r, { strict: !1 }), i = t.filter((o) => s ? o.type === "function" ? vt(o) === r : o.type === "event" ? Bi(o) === r : !1 : "name" in o && o.name === r);
|
|
3561
3564
|
if (i.length === 0)
|
|
3562
3565
|
return;
|
|
3563
3566
|
if (i.length === 1)
|
|
@@ -3580,7 +3583,7 @@ function Et(e) {
|
|
|
3580
3583
|
if (a && "inputs" in a && a.inputs) {
|
|
3581
3584
|
const d = In(o.inputs, a.inputs, n);
|
|
3582
3585
|
if (d)
|
|
3583
|
-
throw new
|
|
3586
|
+
throw new Mr({
|
|
3584
3587
|
abiItem: o,
|
|
3585
3588
|
type: d[0]
|
|
3586
3589
|
}, {
|
|
@@ -3635,7 +3638,7 @@ function kn(e) {
|
|
|
3635
3638
|
if (i.type !== "function")
|
|
3636
3639
|
throw new Ne(void 0, { docsPath: We });
|
|
3637
3640
|
if (!i.outputs)
|
|
3638
|
-
throw new
|
|
3641
|
+
throw new Nr(i.name, { docsPath: We });
|
|
3639
3642
|
const a = yn(i.outputs, s);
|
|
3640
3643
|
if (a && a.length > 1)
|
|
3641
3644
|
return a;
|
|
@@ -3643,7 +3646,7 @@ function kn(e) {
|
|
|
3643
3646
|
return a[0];
|
|
3644
3647
|
}
|
|
3645
3648
|
const Ft = "/docs/contract/encodeFunctionData";
|
|
3646
|
-
function
|
|
3649
|
+
function Ui(e) {
|
|
3647
3650
|
const { abi: t, args: n, functionName: r } = e;
|
|
3648
3651
|
let s = t[0];
|
|
3649
3652
|
if (r) {
|
|
@@ -3664,7 +3667,7 @@ function Di(e) {
|
|
|
3664
3667
|
};
|
|
3665
3668
|
}
|
|
3666
3669
|
function Nn(e) {
|
|
3667
|
-
const { args: t } = e, { abi: n, functionName: r } = e.abi.length === 1 && e.functionName?.startsWith("0x") ? e :
|
|
3670
|
+
const { args: t } = e, { abi: n, functionName: r } = e.abi.length === 1 && e.functionName?.startsWith("0x") ? e : Ui(e), s = n[0], i = r, a = "inputs" in s && s.inputs ? pn(s.inputs, t ?? []) : void 0;
|
|
3668
3671
|
return gt([i, a ?? "0x"]);
|
|
3669
3672
|
}
|
|
3670
3673
|
class tt extends p {
|
|
@@ -3689,7 +3692,7 @@ class Mn extends p {
|
|
|
3689
3692
|
});
|
|
3690
3693
|
}
|
|
3691
3694
|
}
|
|
3692
|
-
function
|
|
3695
|
+
function Li({ blockNumber: e, chain: t, contract: n }) {
|
|
3693
3696
|
const r = t?.contracts?.[n];
|
|
3694
3697
|
if (!r)
|
|
3695
3698
|
throw new tt({
|
|
@@ -3710,7 +3713,7 @@ function Bi({ blockNumber: e, chain: t, contract: n }) {
|
|
|
3710
3713
|
function Pt(e) {
|
|
3711
3714
|
return typeof e == "string" ? { address: e, type: "json-rpc" } : e;
|
|
3712
3715
|
}
|
|
3713
|
-
const
|
|
3716
|
+
const Fi = {
|
|
3714
3717
|
1: "An `assert` condition failed.",
|
|
3715
3718
|
17: "Arithmetic operation resulted in underflow or overflow.",
|
|
3716
3719
|
18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
|
|
@@ -3720,7 +3723,7 @@ const Ui = {
|
|
|
3720
3723
|
50: "Array index is out of bounds.",
|
|
3721
3724
|
65: "Allocated too much memory or created an array which is too large.",
|
|
3722
3725
|
81: "Attempted to call a zero-initialized variable of internal function type."
|
|
3723
|
-
},
|
|
3726
|
+
}, ji = {
|
|
3724
3727
|
inputs: [
|
|
3725
3728
|
{
|
|
3726
3729
|
name: "message",
|
|
@@ -3729,7 +3732,7 @@ const Ui = {
|
|
|
3729
3732
|
],
|
|
3730
3733
|
name: "Error",
|
|
3731
3734
|
type: "error"
|
|
3732
|
-
},
|
|
3735
|
+
}, zi = {
|
|
3733
3736
|
inputs: [
|
|
3734
3737
|
{
|
|
3735
3738
|
name: "reason",
|
|
@@ -3739,11 +3742,11 @@ const Ui = {
|
|
|
3739
3742
|
name: "Panic",
|
|
3740
3743
|
type: "error"
|
|
3741
3744
|
};
|
|
3742
|
-
function
|
|
3745
|
+
function _i(e) {
|
|
3743
3746
|
const { abi: t, data: n } = e, r = Oe(n, 0, 4);
|
|
3744
3747
|
if (r === "0x")
|
|
3745
3748
|
throw new yt();
|
|
3746
|
-
const i = [...t || [],
|
|
3749
|
+
const i = [...t || [], ji, zi].find((a) => a.type === "error" && r === vt(ge(a)));
|
|
3747
3750
|
if (!i)
|
|
3748
3751
|
throw new Vt(r, {
|
|
3749
3752
|
docsPath: "/docs/contract/decodeErrorResult"
|
|
@@ -3759,10 +3762,10 @@ function Rn({ abiItem: e, args: t, includeFunctionName: n = !0, includeName: r =
|
|
|
3759
3762
|
if ("name" in e && "inputs" in e && e.inputs)
|
|
3760
3763
|
return `${n ? e.name : ""}(${e.inputs.map((s, i) => `${r && s.name ? `${s.name}: ` : ""}${typeof t[i] == "object" ? At(t[i]) : t[i]}`).join(", ")})`;
|
|
3761
3764
|
}
|
|
3762
|
-
const
|
|
3765
|
+
const Gi = {
|
|
3763
3766
|
gwei: 9,
|
|
3764
3767
|
wei: 18
|
|
3765
|
-
},
|
|
3768
|
+
}, Hi = {
|
|
3766
3769
|
ether: -9,
|
|
3767
3770
|
wei: 9
|
|
3768
3771
|
};
|
|
@@ -3776,20 +3779,20 @@ function On(e, t) {
|
|
|
3776
3779
|
];
|
|
3777
3780
|
return i = i.replace(/(0+)$/, ""), `${r ? "-" : ""}${s || "0"}${i ? `.${i}` : ""}`;
|
|
3778
3781
|
}
|
|
3779
|
-
function
|
|
3780
|
-
return On(e,
|
|
3782
|
+
function Vi(e, t = "wei") {
|
|
3783
|
+
return On(e, Gi[t]);
|
|
3781
3784
|
}
|
|
3782
3785
|
function le(e, t = "wei") {
|
|
3783
|
-
return On(e,
|
|
3786
|
+
return On(e, Hi[t]);
|
|
3784
3787
|
}
|
|
3785
|
-
class
|
|
3788
|
+
class Wi extends p {
|
|
3786
3789
|
constructor({ address: t }) {
|
|
3787
3790
|
super(`State for account "${t}" is set multiple times.`, {
|
|
3788
3791
|
name: "AccountStateConflictError"
|
|
3789
3792
|
});
|
|
3790
3793
|
}
|
|
3791
3794
|
}
|
|
3792
|
-
class
|
|
3795
|
+
class Ki extends p {
|
|
3793
3796
|
constructor() {
|
|
3794
3797
|
super("state and stateDiff are set on the same account.", {
|
|
3795
3798
|
name: "StateAssignmentConflictError"
|
|
@@ -3800,7 +3803,7 @@ function jt(e) {
|
|
|
3800
3803
|
return e.reduce((t, { slot: n, value: r }) => `${t} ${n}: ${r}
|
|
3801
3804
|
`, "");
|
|
3802
3805
|
}
|
|
3803
|
-
function
|
|
3806
|
+
function Yi(e) {
|
|
3804
3807
|
return e.reduce((t, { address: n, ...r }) => {
|
|
3805
3808
|
let s = `${t} ${n}:
|
|
3806
3809
|
`;
|
|
@@ -3818,14 +3821,14 @@ function Dn(e) {
|
|
|
3818
3821
|
return t.map(([r, s]) => ` ${`${r}:`.padEnd(n + 1)} ${s}`).join(`
|
|
3819
3822
|
`);
|
|
3820
3823
|
}
|
|
3821
|
-
const
|
|
3822
|
-
class
|
|
3824
|
+
const Zi = (e) => e, Bn = (e) => e;
|
|
3825
|
+
class Xi extends p {
|
|
3823
3826
|
constructor(t, { account: n, docsPath: r, chain: s, data: i, gas: a, gasPrice: o, maxFeePerGas: c, maxPriorityFeePerGas: d, nonce: l, to: y, value: b, stateOverride: m }) {
|
|
3824
3827
|
const g = n ? Pt(n) : void 0;
|
|
3825
3828
|
let E = Dn({
|
|
3826
3829
|
from: g?.address,
|
|
3827
3830
|
to: y,
|
|
3828
|
-
value: typeof b < "u" && `${
|
|
3831
|
+
value: typeof b < "u" && `${Vi(b)} ${s?.nativeCurrency?.symbol || "ETH"}`,
|
|
3829
3832
|
data: i,
|
|
3830
3833
|
gas: a,
|
|
3831
3834
|
gasPrice: typeof o < "u" && `${le(o)} gwei`,
|
|
@@ -3834,7 +3837,7 @@ class Yi extends p {
|
|
|
3834
3837
|
nonce: l
|
|
3835
3838
|
});
|
|
3836
3839
|
m && (E += `
|
|
3837
|
-
${
|
|
3840
|
+
${Yi(m)}`), super(t.shortMessage, {
|
|
3838
3841
|
cause: t,
|
|
3839
3842
|
docsPath: r,
|
|
3840
3843
|
metaMessages: [
|
|
@@ -3851,7 +3854,7 @@ ${Wi(m)}`), super(t.shortMessage, {
|
|
|
3851
3854
|
}), this.cause = t;
|
|
3852
3855
|
}
|
|
3853
3856
|
}
|
|
3854
|
-
class
|
|
3857
|
+
class Ji extends p {
|
|
3855
3858
|
constructor(t, { abi: n, args: r, contractAddress: s, docsPath: i, functionName: a, sender: o }) {
|
|
3856
3859
|
const c = Et({ abi: n, args: r, name: a }), d = c ? Rn({
|
|
3857
3860
|
abiItem: c,
|
|
@@ -3859,7 +3862,7 @@ class Zi extends p {
|
|
|
3859
3862
|
includeFunctionName: !1,
|
|
3860
3863
|
includeName: !1
|
|
3861
3864
|
}) : void 0, l = c ? ge(c, { includeName: !0 }) : void 0, y = Dn({
|
|
3862
|
-
address: s &&
|
|
3865
|
+
address: s && Zi(s),
|
|
3863
3866
|
function: l,
|
|
3864
3867
|
args: d && d !== "()" && `${[...Array(a?.length ?? 0).keys()].map(() => " ").join("")}${d}`,
|
|
3865
3868
|
sender: o
|
|
@@ -3911,18 +3914,18 @@ class Zi extends p {
|
|
|
3911
3914
|
}), this.abi = n, this.args = r, this.cause = t, this.contractAddress = s, this.functionName = a, this.sender = o;
|
|
3912
3915
|
}
|
|
3913
3916
|
}
|
|
3914
|
-
class
|
|
3917
|
+
class Qi extends p {
|
|
3915
3918
|
constructor({ abi: t, data: n, functionName: r, message: s }) {
|
|
3916
3919
|
let i, a, o, c;
|
|
3917
3920
|
if (n && n !== "0x")
|
|
3918
3921
|
try {
|
|
3919
|
-
a =
|
|
3922
|
+
a = _i({ abi: t, data: n });
|
|
3920
3923
|
const { abiItem: l, errorName: y, args: b } = a;
|
|
3921
3924
|
if (y === "Error")
|
|
3922
3925
|
c = b[0];
|
|
3923
3926
|
else if (y === "Panic") {
|
|
3924
3927
|
const [m] = b;
|
|
3925
|
-
c =
|
|
3928
|
+
c = Fi[m];
|
|
3926
3929
|
} else {
|
|
3927
3930
|
const m = l ? ge(l, { includeName: !0 }) : void 0, g = l && b ? Rn({
|
|
3928
3931
|
abiItem: l,
|
|
@@ -3975,7 +3978,7 @@ class Xi extends p {
|
|
|
3975
3978
|
}), this.data = a, this.raw = n, this.reason = c, this.signature = d;
|
|
3976
3979
|
}
|
|
3977
3980
|
}
|
|
3978
|
-
class
|
|
3981
|
+
class qi extends p {
|
|
3979
3982
|
constructor({ functionName: t }) {
|
|
3980
3983
|
super(`The contract function "${t}" returned no data ("0x").`, {
|
|
3981
3984
|
metaMessages: [
|
|
@@ -3988,7 +3991,7 @@ class Ji extends p {
|
|
|
3988
3991
|
});
|
|
3989
3992
|
}
|
|
3990
3993
|
}
|
|
3991
|
-
class
|
|
3994
|
+
class ea extends p {
|
|
3992
3995
|
constructor({ factory: t }) {
|
|
3993
3996
|
super(`Deployment for counterfactual contract call failed${t ? ` for factory "${t}".` : ""}`, {
|
|
3994
3997
|
metaMessages: [
|
|
@@ -4015,14 +4018,14 @@ class Un extends p {
|
|
|
4015
4018
|
}), this.data = t;
|
|
4016
4019
|
}
|
|
4017
4020
|
}
|
|
4018
|
-
function
|
|
4021
|
+
function ta(e, t, n) {
|
|
4019
4022
|
const r = e[t.name];
|
|
4020
4023
|
if (typeof r == "function")
|
|
4021
4024
|
return r;
|
|
4022
4025
|
const s = e[n];
|
|
4023
4026
|
return typeof s == "function" ? s : (i) => t(e, i);
|
|
4024
4027
|
}
|
|
4025
|
-
class
|
|
4028
|
+
class io extends p {
|
|
4026
4029
|
constructor({ body: t, cause: n, details: r, headers: s, status: i, url: a }) {
|
|
4027
4030
|
super("HTTP request failed.", {
|
|
4028
4031
|
cause: n,
|
|
@@ -4081,7 +4084,7 @@ class Ln extends p {
|
|
|
4081
4084
|
}), this.code = n.code, this.data = n.data, this.url = r;
|
|
4082
4085
|
}
|
|
4083
4086
|
}
|
|
4084
|
-
const
|
|
4087
|
+
const na = -1;
|
|
4085
4088
|
class Fn extends p {
|
|
4086
4089
|
constructor(t, { code: n, docsPath: r, metaMessages: s, name: i, shortMessage: a }) {
|
|
4087
4090
|
super(a, {
|
|
@@ -4094,7 +4097,7 @@ class Fn extends p {
|
|
|
4094
4097
|
configurable: !0,
|
|
4095
4098
|
writable: !0,
|
|
4096
4099
|
value: void 0
|
|
4097
|
-
}), this.name = i || t.name, this.code = t instanceof Ln ? t.code : n ??
|
|
4100
|
+
}), this.name = i || t.name, this.code = t instanceof Ln ? t.code : n ?? na;
|
|
4098
4101
|
}
|
|
4099
4102
|
}
|
|
4100
4103
|
class Le extends Fn {
|
|
@@ -4131,15 +4134,15 @@ Object.defineProperty(Fe, "code", {
|
|
|
4131
4134
|
writable: !0,
|
|
4132
4135
|
value: -32e3
|
|
4133
4136
|
});
|
|
4134
|
-
const
|
|
4135
|
-
function
|
|
4136
|
-
const o = e instanceof Un ? e : e instanceof p ? e.walk((g) => "data" in g) || e.walk() : {}, { code: c, data: d, details: l, message: y, shortMessage: b } = o, m = e instanceof yt ? new
|
|
4137
|
+
const ra = 3;
|
|
4138
|
+
function sa(e, { abi: t, address: n, args: r, docsPath: s, functionName: i, sender: a }) {
|
|
4139
|
+
const o = e instanceof Un ? e : e instanceof p ? e.walk((g) => "data" in g) || e.walk() : {}, { code: c, data: d, details: l, message: y, shortMessage: b } = o, m = e instanceof yt ? new qi({ functionName: i }) : [ra, Le.code].includes(c) && (d || l || y || b) || c === Fe.code && l === "execution reverted" && d ? new Qi({
|
|
4137
4140
|
abi: t,
|
|
4138
4141
|
data: typeof d == "object" ? d.data : d,
|
|
4139
4142
|
functionName: i,
|
|
4140
4143
|
message: o instanceof Ln ? l : b ?? y
|
|
4141
4144
|
}) : e;
|
|
4142
|
-
return new
|
|
4145
|
+
return new Ji(m, {
|
|
4143
4146
|
abi: t,
|
|
4144
4147
|
args: r,
|
|
4145
4148
|
contractAddress: n,
|
|
@@ -4148,9 +4151,9 @@ function na(e, { abi: t, address: n, args: r, docsPath: s, functionName: i, send
|
|
|
4148
4151
|
sender: a
|
|
4149
4152
|
});
|
|
4150
4153
|
}
|
|
4151
|
-
const
|
|
4152
|
-
function
|
|
4153
|
-
return
|
|
4154
|
+
const ia = "0.1.1";
|
|
4155
|
+
function aa() {
|
|
4156
|
+
return ia;
|
|
4154
4157
|
}
|
|
4155
4158
|
class U extends Error {
|
|
4156
4159
|
static setStaticOptions(t) {
|
|
@@ -4234,20 +4237,20 @@ Object.defineProperty(U, "defaultStaticOptions", {
|
|
|
4234
4237
|
value: {
|
|
4235
4238
|
docsOrigin: "https://oxlib.sh",
|
|
4236
4239
|
showVersion: !1,
|
|
4237
|
-
version: `ox@${
|
|
4240
|
+
version: `ox@${aa()}`
|
|
4238
4241
|
}
|
|
4239
4242
|
});
|
|
4240
4243
|
U.setStaticOptions(U.defaultStaticOptions);
|
|
4241
4244
|
function jn(e, t) {
|
|
4242
4245
|
return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause ? jn(e.cause, t) : t ? null : e;
|
|
4243
4246
|
}
|
|
4244
|
-
function
|
|
4247
|
+
function oa(e, t = {}) {
|
|
4245
4248
|
const { dir: n, size: r = 32 } = t;
|
|
4246
4249
|
if (r === 0)
|
|
4247
4250
|
return e;
|
|
4248
4251
|
const s = e.replace("0x", "");
|
|
4249
4252
|
if (s.length > r * 2)
|
|
4250
|
-
throw new
|
|
4253
|
+
throw new da({
|
|
4251
4254
|
size: Math.ceil(s.length / 2),
|
|
4252
4255
|
targetSize: r,
|
|
4253
4256
|
type: "Hex"
|
|
@@ -4261,7 +4264,7 @@ function ie(e, t = {}) {
|
|
|
4261
4264
|
const a = typeof i == "bigint" && n ? -i - 1n : 0;
|
|
4262
4265
|
if (i && s > i || s < a) {
|
|
4263
4266
|
const d = typeof e == "bigint" ? "n" : "";
|
|
4264
|
-
throw new
|
|
4267
|
+
throw new ua({
|
|
4265
4268
|
max: i ? `${i}${d}` : void 0,
|
|
4266
4269
|
min: `${a}${d}`,
|
|
4267
4270
|
signed: n,
|
|
@@ -4270,12 +4273,12 @@ function ie(e, t = {}) {
|
|
|
4270
4273
|
});
|
|
4271
4274
|
}
|
|
4272
4275
|
const c = `0x${(n && s < 0 ? BigInt.asUintN(r * 8, BigInt(s)) : s).toString(16)}`;
|
|
4273
|
-
return r ?
|
|
4276
|
+
return r ? ca(c, r) : c;
|
|
4274
4277
|
}
|
|
4275
|
-
function
|
|
4276
|
-
return
|
|
4278
|
+
function ca(e, t) {
|
|
4279
|
+
return oa(e, { dir: "left", size: t });
|
|
4277
4280
|
}
|
|
4278
|
-
class
|
|
4281
|
+
class ua extends U {
|
|
4279
4282
|
constructor({ max: t, min: n, signed: r, size: s, value: i }) {
|
|
4280
4283
|
super(`Number \`${i}\` is not in safe${s ? ` ${s * 8}-bit` : ""}${r ? " signed" : " unsigned"} integer range ${t ? `(\`${n}\` to \`${t}\`)` : `(above \`${n}\`)`}`), Object.defineProperty(this, "name", {
|
|
4281
4284
|
enumerable: !0,
|
|
@@ -4285,7 +4288,7 @@ class oa extends U {
|
|
|
4285
4288
|
});
|
|
4286
4289
|
}
|
|
4287
4290
|
}
|
|
4288
|
-
class
|
|
4291
|
+
class da extends U {
|
|
4289
4292
|
constructor({ size: t, targetSize: n, type: r }) {
|
|
4290
4293
|
super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`), Object.defineProperty(this, "name", {
|
|
4291
4294
|
enumerable: !0,
|
|
@@ -4295,7 +4298,7 @@ class ca extends U {
|
|
|
4295
4298
|
});
|
|
4296
4299
|
}
|
|
4297
4300
|
}
|
|
4298
|
-
function
|
|
4301
|
+
function la(e) {
|
|
4299
4302
|
return {
|
|
4300
4303
|
address: e.address,
|
|
4301
4304
|
amount: ie(e.amount),
|
|
@@ -4303,7 +4306,7 @@ function ua(e) {
|
|
|
4303
4306
|
validatorIndex: ie(e.validatorIndex)
|
|
4304
4307
|
};
|
|
4305
4308
|
}
|
|
4306
|
-
function
|
|
4309
|
+
function fa(e) {
|
|
4307
4310
|
return {
|
|
4308
4311
|
...typeof e.baseFeePerGas == "bigint" && {
|
|
4309
4312
|
baseFeePerGas: ie(e.baseFeePerGas)
|
|
@@ -4327,18 +4330,18 @@ function da(e) {
|
|
|
4327
4330
|
time: ie(e.time)
|
|
4328
4331
|
},
|
|
4329
4332
|
...e.withdrawals && {
|
|
4330
|
-
withdrawals: e.withdrawals.map(
|
|
4333
|
+
withdrawals: e.withdrawals.map(la)
|
|
4331
4334
|
}
|
|
4332
4335
|
};
|
|
4333
4336
|
}
|
|
4334
|
-
const la = "0x82ad56cb", fa = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe", pa = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe", ya = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033", Ke = "/docs/contract/encodeDeployData";
|
|
4337
|
+
const pa = "0x82ad56cb", ya = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe", ba = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe", ma = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033", Ke = "/docs/contract/encodeDeployData";
|
|
4335
4338
|
function zn(e) {
|
|
4336
4339
|
const { abi: t, args: n, bytecode: r } = e;
|
|
4337
4340
|
if (!n || n.length === 0)
|
|
4338
4341
|
return r;
|
|
4339
4342
|
const s = t.find((a) => "type" in a && a.type === "constructor");
|
|
4340
4343
|
if (!s)
|
|
4341
|
-
throw new
|
|
4344
|
+
throw new $r({ docsPath: Ke });
|
|
4342
4345
|
if (!("inputs" in s))
|
|
4343
4346
|
throw new St({ docsPath: Ke });
|
|
4344
4347
|
if (!s.inputs || s.inputs.length === 0)
|
|
@@ -4526,7 +4529,7 @@ class _n extends p {
|
|
|
4526
4529
|
});
|
|
4527
4530
|
}
|
|
4528
4531
|
}
|
|
4529
|
-
function
|
|
4532
|
+
function ha(e, t) {
|
|
4530
4533
|
const n = (e.details || "").toLowerCase(), r = e instanceof p ? e.walk((s) => s?.code === be.code) : e;
|
|
4531
4534
|
return r instanceof p ? new be({
|
|
4532
4535
|
cause: e,
|
|
@@ -4548,17 +4551,17 @@ function ba(e, t) {
|
|
|
4548
4551
|
cause: e
|
|
4549
4552
|
});
|
|
4550
4553
|
}
|
|
4551
|
-
function
|
|
4554
|
+
function ga(e, { docsPath: t, ...n }) {
|
|
4552
4555
|
const r = (() => {
|
|
4553
|
-
const s =
|
|
4556
|
+
const s = ha(e, n);
|
|
4554
4557
|
return s instanceof _n ? e : s;
|
|
4555
4558
|
})();
|
|
4556
|
-
return new
|
|
4559
|
+
return new Xi(r, {
|
|
4557
4560
|
docsPath: t,
|
|
4558
4561
|
...n
|
|
4559
4562
|
});
|
|
4560
4563
|
}
|
|
4561
|
-
function
|
|
4564
|
+
function wa(e, { format: t }) {
|
|
4562
4565
|
if (!t)
|
|
4563
4566
|
return {};
|
|
4564
4567
|
const n = {};
|
|
@@ -4570,18 +4573,18 @@ function ha(e, { format: t }) {
|
|
|
4570
4573
|
const s = t(e || {});
|
|
4571
4574
|
return r(s), n;
|
|
4572
4575
|
}
|
|
4573
|
-
const
|
|
4576
|
+
const xa = {
|
|
4574
4577
|
legacy: "0x0",
|
|
4575
4578
|
eip2930: "0x1",
|
|
4576
4579
|
eip1559: "0x2",
|
|
4577
4580
|
eip4844: "0x3",
|
|
4578
4581
|
eip7702: "0x4"
|
|
4579
4582
|
};
|
|
4580
|
-
function
|
|
4583
|
+
function Ta(e, t) {
|
|
4581
4584
|
const n = {};
|
|
4582
|
-
return typeof e.authorizationList < "u" && (n.authorizationList =
|
|
4585
|
+
return typeof e.authorizationList < "u" && (n.authorizationList = va(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) => oe(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 = C(e.gas)), typeof e.gasPrice < "u" && (n.gasPrice = C(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (n.maxFeePerBlobGas = C(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (n.maxFeePerGas = C(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (n.maxPriorityFeePerGas = C(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (n.nonce = C(e.nonce)), typeof e.to < "u" && (n.to = e.to), typeof e.type < "u" && (n.type = xa[e.type]), typeof e.value < "u" && (n.value = C(e.value)), n;
|
|
4583
4586
|
}
|
|
4584
|
-
function
|
|
4587
|
+
function va(e) {
|
|
4585
4588
|
return e.map((t) => ({
|
|
4586
4589
|
address: t.address,
|
|
4587
4590
|
r: t.r ? C(BigInt(t.r)) : t.r,
|
|
@@ -4592,7 +4595,7 @@ function xa(e) {
|
|
|
4592
4595
|
...typeof t.v < "u" && typeof t.yParity > "u" ? { v: C(t.v) } : {}
|
|
4593
4596
|
}));
|
|
4594
4597
|
}
|
|
4595
|
-
function
|
|
4598
|
+
function Ea() {
|
|
4596
4599
|
let e = () => {
|
|
4597
4600
|
}, t = () => {
|
|
4598
4601
|
};
|
|
@@ -4601,7 +4604,7 @@ function Ta() {
|
|
|
4601
4604
|
}), resolve: e, reject: t };
|
|
4602
4605
|
}
|
|
4603
4606
|
const Ye = /* @__PURE__ */ new Map();
|
|
4604
|
-
function
|
|
4607
|
+
function Pa({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: s }) {
|
|
4605
4608
|
const i = async () => {
|
|
4606
4609
|
const l = c();
|
|
4607
4610
|
a();
|
|
@@ -4622,7 +4625,7 @@ function va({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: s }) {
|
|
|
4622
4625
|
return {
|
|
4623
4626
|
flush: a,
|
|
4624
4627
|
async schedule(l) {
|
|
4625
|
-
const { promise: y, resolve: b, reject: m } =
|
|
4628
|
+
const { promise: y, resolve: b, reject: m } = Ea();
|
|
4626
4629
|
return n?.([...o(), l]) && i(), c().length > 0 ? (d({ args: l, resolve: b, reject: m }), y) : (d({ args: l, resolve: b, reject: m }), setTimeout(i, r), y);
|
|
4627
4630
|
}
|
|
4628
4631
|
};
|
|
@@ -4645,16 +4648,16 @@ function zt(e) {
|
|
|
4645
4648
|
return t[n] = r, t;
|
|
4646
4649
|
}, {});
|
|
4647
4650
|
}
|
|
4648
|
-
function
|
|
4651
|
+
function Aa(e) {
|
|
4649
4652
|
const { balance: t, nonce: n, state: r, stateDiff: s, code: i } = e, a = {};
|
|
4650
4653
|
if (i !== void 0 && (a.code = i), t !== void 0 && (a.balance = C(t)), n !== void 0 && (a.nonce = C(n)), r !== void 0 && (a.state = zt(r)), s !== void 0) {
|
|
4651
4654
|
if (a.state)
|
|
4652
|
-
throw new
|
|
4655
|
+
throw new Ki();
|
|
4653
4656
|
a.stateDiff = zt(s);
|
|
4654
4657
|
}
|
|
4655
4658
|
return a;
|
|
4656
4659
|
}
|
|
4657
|
-
function
|
|
4660
|
+
function $a(e) {
|
|
4658
4661
|
if (!e)
|
|
4659
4662
|
return;
|
|
4660
4663
|
const t = {};
|
|
@@ -4662,24 +4665,24 @@ function Pa(e) {
|
|
|
4662
4665
|
if (!fe(n, { strict: !1 }))
|
|
4663
4666
|
throw new Me({ address: n });
|
|
4664
4667
|
if (t[n])
|
|
4665
|
-
throw new
|
|
4666
|
-
t[n] =
|
|
4668
|
+
throw new Wi({ address: n });
|
|
4669
|
+
t[n] = Aa(r);
|
|
4667
4670
|
}
|
|
4668
4671
|
return t;
|
|
4669
4672
|
}
|
|
4670
|
-
const
|
|
4671
|
-
function
|
|
4673
|
+
const Sa = 2n ** 256n - 1n;
|
|
4674
|
+
function Ca(e) {
|
|
4672
4675
|
const { account: t, maxFeePerGas: n, maxPriorityFeePerGas: r, to: s } = e, i = t ? Pt(t) : void 0;
|
|
4673
4676
|
if (i && !fe(i.address))
|
|
4674
4677
|
throw new Me({ address: i.address });
|
|
4675
4678
|
if (s && !fe(s))
|
|
4676
4679
|
throw new Me({ address: s });
|
|
4677
|
-
if (n && n >
|
|
4680
|
+
if (n && n > Sa)
|
|
4678
4681
|
throw new De({ maxFeePerGas: n });
|
|
4679
4682
|
if (r && n && r > n)
|
|
4680
4683
|
throw new Be({ maxFeePerGas: n, maxPriorityFeePerGas: r });
|
|
4681
4684
|
}
|
|
4682
|
-
async function
|
|
4685
|
+
async function Ia(e, t) {
|
|
4683
4686
|
const { account: n = e.account, authorizationList: r, batch: s = !!e.batch?.multicall, blockNumber: i, blockTag: a = e.experimental_blockTag ?? "latest", accessList: o, blobs: c, blockOverrides: d, code: l, data: y, factory: b, factoryData: m, gas: g, gasPrice: E, maxFeePerBlobGas: T, maxFeePerGas: v, maxPriorityFeePerGas: f, nonce: x, to: A, value: L, stateOverride: Y, ...te } = t, G = n ? Pt(n) : void 0;
|
|
4684
4687
|
if (l && (b || m))
|
|
4685
4688
|
throw new p("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
@@ -4688,17 +4691,17 @@ async function Sa(e, t) {
|
|
|
4688
4691
|
const $ = l && y, H = b && m && A && y, I = $ || H, ne = $ ? Gn({
|
|
4689
4692
|
code: l,
|
|
4690
4693
|
data: y
|
|
4691
|
-
}) : H ?
|
|
4694
|
+
}) : H ? Ma({
|
|
4692
4695
|
data: y,
|
|
4693
4696
|
factory: b,
|
|
4694
4697
|
factoryData: m,
|
|
4695
4698
|
to: A
|
|
4696
4699
|
}) : y;
|
|
4697
4700
|
try {
|
|
4698
|
-
|
|
4699
|
-
const N = (typeof i == "bigint" ? C(i) : void 0) || a, B = d ?
|
|
4701
|
+
Ca(t);
|
|
4702
|
+
const N = (typeof i == "bigint" ? C(i) : void 0) || a, B = d ? fa(d) : void 0, F = $a(Y), ye = e.chain?.formatters?.transactionRequest?.format, z = (ye || Ta)({
|
|
4700
4703
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
4701
|
-
...
|
|
4704
|
+
...wa(te, { format: ye }),
|
|
4702
4705
|
accessList: o,
|
|
4703
4706
|
account: G,
|
|
4704
4707
|
authorizationList: r,
|
|
@@ -4713,9 +4716,9 @@ async function Sa(e, t) {
|
|
|
4713
4716
|
to: I ? void 0 : A,
|
|
4714
4717
|
value: L
|
|
4715
4718
|
}, "call");
|
|
4716
|
-
if (s &&
|
|
4719
|
+
if (s && ka({ request: z }) && !F && !B)
|
|
4717
4720
|
try {
|
|
4718
|
-
return await
|
|
4721
|
+
return await Na(e, {
|
|
4719
4722
|
...z,
|
|
4720
4723
|
blockNumber: i,
|
|
4721
4724
|
blockTag: a
|
|
@@ -4736,34 +4739,34 @@ async function Sa(e, t) {
|
|
|
4736
4739
|
});
|
|
4737
4740
|
return Se === "0x" ? { data: void 0 } : { data: Se };
|
|
4738
4741
|
} catch (J) {
|
|
4739
|
-
const N =
|
|
4742
|
+
const N = Ra(J), { offchainLookup: B, offchainLookupSignature: F } = await import("./ccip-DjOOvUZr.js");
|
|
4740
4743
|
if (e.ccipRead !== !1 && N?.slice(0, 10) === F && A)
|
|
4741
4744
|
return { data: await B(e, { data: N, to: A }) };
|
|
4742
|
-
throw I && N?.slice(0, 10) === "0x101bb98d" ? new
|
|
4745
|
+
throw I && N?.slice(0, 10) === "0x101bb98d" ? new ea({ factory: b }) : ga(J, {
|
|
4743
4746
|
...t,
|
|
4744
4747
|
account: G,
|
|
4745
4748
|
chain: e.chain
|
|
4746
4749
|
});
|
|
4747
4750
|
}
|
|
4748
4751
|
}
|
|
4749
|
-
function
|
|
4752
|
+
function ka({ request: e }) {
|
|
4750
4753
|
const { data: t, to: n, ...r } = e;
|
|
4751
|
-
return !(!t || t.startsWith(
|
|
4754
|
+
return !(!t || t.startsWith(pa) || !n || Object.values(r).filter((s) => typeof s < "u").length > 0);
|
|
4752
4755
|
}
|
|
4753
|
-
async function
|
|
4756
|
+
async function Na(e, t) {
|
|
4754
4757
|
const { batchSize: n = 1024, deployless: r = !1, wait: s = 0 } = typeof e.batch?.multicall == "object" ? e.batch.multicall : {}, { blockNumber: i, blockTag: a = e.experimental_blockTag ?? "latest", data: o, to: c } = t, d = (() => {
|
|
4755
4758
|
if (r)
|
|
4756
4759
|
return null;
|
|
4757
4760
|
if (t.multicallAddress)
|
|
4758
4761
|
return t.multicallAddress;
|
|
4759
4762
|
if (e.chain)
|
|
4760
|
-
return
|
|
4763
|
+
return Li({
|
|
4761
4764
|
blockNumber: i,
|
|
4762
4765
|
chain: e.chain,
|
|
4763
4766
|
contract: "multicall3"
|
|
4764
4767
|
});
|
|
4765
4768
|
throw new Mn();
|
|
4766
|
-
})(), y = (typeof i == "bigint" ? C(i) : void 0) || a, { schedule: b } =
|
|
4769
|
+
})(), y = (typeof i == "bigint" ? C(i) : void 0) || a, { schedule: b } = Pa({
|
|
4767
4770
|
id: `${e.uid}.${y}`,
|
|
4768
4771
|
wait: s,
|
|
4769
4772
|
shouldSplitBatch(E) {
|
|
@@ -4784,7 +4787,7 @@ async function Ia(e, t) {
|
|
|
4784
4787
|
{
|
|
4785
4788
|
...d === null ? {
|
|
4786
4789
|
data: Gn({
|
|
4787
|
-
code:
|
|
4790
|
+
code: ma,
|
|
4788
4791
|
data: v
|
|
4789
4792
|
})
|
|
4790
4793
|
} : { to: d, data: v }
|
|
@@ -4808,32 +4811,32 @@ function Gn(e) {
|
|
|
4808
4811
|
const { code: t, data: n } = e;
|
|
4809
4812
|
return zn({
|
|
4810
4813
|
abi: Sn(["constructor(bytes, bytes)"]),
|
|
4811
|
-
bytecode:
|
|
4814
|
+
bytecode: ya,
|
|
4812
4815
|
args: [t, n]
|
|
4813
4816
|
});
|
|
4814
4817
|
}
|
|
4815
|
-
function
|
|
4818
|
+
function Ma(e) {
|
|
4816
4819
|
const { data: t, factory: n, factoryData: r, to: s } = e;
|
|
4817
4820
|
return zn({
|
|
4818
4821
|
abi: Sn(["constructor(address, bytes, address, bytes)"]),
|
|
4819
|
-
bytecode:
|
|
4822
|
+
bytecode: ba,
|
|
4820
4823
|
args: [s, t, n, r]
|
|
4821
4824
|
});
|
|
4822
4825
|
}
|
|
4823
|
-
function
|
|
4826
|
+
function Ra(e) {
|
|
4824
4827
|
if (!(e instanceof p))
|
|
4825
4828
|
return;
|
|
4826
4829
|
const t = e.walk();
|
|
4827
4830
|
return typeof t?.data == "object" ? t.data?.data : t.data;
|
|
4828
4831
|
}
|
|
4829
|
-
async function
|
|
4832
|
+
async function Oa(e, t) {
|
|
4830
4833
|
const { abi: n, address: r, args: s, functionName: i, ...a } = t, o = Nn({
|
|
4831
4834
|
abi: n,
|
|
4832
4835
|
args: s,
|
|
4833
4836
|
functionName: i
|
|
4834
4837
|
});
|
|
4835
4838
|
try {
|
|
4836
|
-
const { data: c } = await
|
|
4839
|
+
const { data: c } = await ta(e, Ia, "call")({
|
|
4837
4840
|
...a,
|
|
4838
4841
|
data: o,
|
|
4839
4842
|
to: r
|
|
@@ -4845,7 +4848,7 @@ async function Ma(e, t) {
|
|
|
4845
4848
|
data: c || "0x"
|
|
4846
4849
|
});
|
|
4847
4850
|
} catch (c) {
|
|
4848
|
-
throw
|
|
4851
|
+
throw sa(c, {
|
|
4849
4852
|
abi: n,
|
|
4850
4853
|
address: r,
|
|
4851
4854
|
args: s,
|
|
@@ -4854,18 +4857,18 @@ async function Ma(e, t) {
|
|
|
4854
4857
|
});
|
|
4855
4858
|
}
|
|
4856
4859
|
}
|
|
4857
|
-
function
|
|
4860
|
+
function Da(e, t, n) {
|
|
4858
4861
|
const r = e[t.name];
|
|
4859
4862
|
if (typeof r == "function")
|
|
4860
4863
|
return r;
|
|
4861
4864
|
const s = e[n];
|
|
4862
4865
|
return typeof s == "function" ? s : (i) => t(e, i);
|
|
4863
4866
|
}
|
|
4864
|
-
function
|
|
4867
|
+
function Ba(e, t) {
|
|
4865
4868
|
const { chainId: n, ...r } = t, s = e.getClient({ chainId: n });
|
|
4866
|
-
return
|
|
4869
|
+
return Da(s, Oa, "readContract")(r);
|
|
4867
4870
|
}
|
|
4868
|
-
const
|
|
4871
|
+
const ao = 30, oo = 3e-3, co = 5, Ua = 8, La = 10 ** Ua, uo = BigInt(
|
|
4869
4872
|
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
|
4870
4873
|
), O = {
|
|
4871
4874
|
ETH: { symbol: "ETH", decimals: 18, name: "Ether" },
|
|
@@ -4875,8 +4878,8 @@ const ro = 30, so = 3e-3, io = 5, Da = 8, Ba = 10 ** Da, ao = BigInt(
|
|
|
4875
4878
|
WBTC: { symbol: "WBTC", decimals: 8, name: "Wrapped Bitcoin" },
|
|
4876
4879
|
IDRX: { symbol: "IDRX", decimals: 18, name: "Indonesian Rupiah" }
|
|
4877
4880
|
};
|
|
4878
|
-
function
|
|
4879
|
-
const { address: e } = Ue(), t =
|
|
4881
|
+
function Fa() {
|
|
4882
|
+
const { address: e } = Ue(), t = nr(), {
|
|
4880
4883
|
writeContractAsync: n,
|
|
4881
4884
|
data: r,
|
|
4882
4885
|
isPending: s,
|
|
@@ -4897,7 +4900,7 @@ function Ua() {
|
|
|
4897
4900
|
functionName: "paused"
|
|
4898
4901
|
}), y = async (g, E) => {
|
|
4899
4902
|
try {
|
|
4900
|
-
return await
|
|
4903
|
+
return await Ba(t, {
|
|
4901
4904
|
address: g,
|
|
4902
4905
|
abi: Z,
|
|
4903
4906
|
functionName: "allowance",
|
|
@@ -4918,7 +4921,7 @@ function Ua() {
|
|
|
4918
4921
|
address: g,
|
|
4919
4922
|
abi: Z,
|
|
4920
4923
|
functionName: "approve",
|
|
4921
|
-
args: [k.PAYMENT_ROUTER,
|
|
4924
|
+
args: [k.PAYMENT_ROUTER, cr]
|
|
4922
4925
|
}));
|
|
4923
4926
|
} catch (T) {
|
|
4924
4927
|
throw console.error(`Error in approveToken for ${g}:`, T), T;
|
|
@@ -4946,7 +4949,7 @@ function Ua() {
|
|
|
4946
4949
|
if (!isFinite(I) || I <= 0)
|
|
4947
4950
|
throw new Error(`Invalid amount calculated for ${$.symbol}`);
|
|
4948
4951
|
const ne = Math.min($.decimals + 2, 18), J = I.toFixed(ne);
|
|
4949
|
-
let N =
|
|
4952
|
+
let N = or(J, $.decimals);
|
|
4950
4953
|
N = N + BigInt(1), $.address === "0x0000000000000000000000000000000000000000" ? (L = N, x.push($.address), A.push(N)) : (x.push($.address), A.push(N));
|
|
4951
4954
|
}
|
|
4952
4955
|
for (let $ = 0; $ < f.length; $++) {
|
|
@@ -4958,7 +4961,7 @@ function Ua() {
|
|
|
4958
4961
|
throw new Error(`Failed to approve ${H.symbol}: ${I}`);
|
|
4959
4962
|
}
|
|
4960
4963
|
}
|
|
4961
|
-
const G = BigInt(Math.floor(T *
|
|
4964
|
+
const G = BigInt(Math.floor(T * La));
|
|
4962
4965
|
return await n({
|
|
4963
4966
|
address: k.PAYMENT_ROUTER,
|
|
4964
4967
|
abi: Ce,
|
|
@@ -5061,8 +5064,8 @@ function ke(e) {
|
|
|
5061
5064
|
error: i
|
|
5062
5065
|
};
|
|
5063
5066
|
}
|
|
5064
|
-
function
|
|
5065
|
-
const { address: e } = Ue(), { data: t, isLoading: n } =
|
|
5067
|
+
function ja() {
|
|
5068
|
+
const { address: e } = Ue(), { data: t, isLoading: n } = rr({
|
|
5066
5069
|
address: e
|
|
5067
5070
|
}), r = ke(S.USDC), s = ke(S.USDT), i = ke(S.DAI), a = ke(S.WBTC), { data: o, isLoading: c } = r.useBalanceOf(e), { data: d, isLoading: l } = s.useBalanceOf(e), { data: y, isLoading: b } = i.useBalanceOf(e), { data: m, isLoading: g } = a.useBalanceOf(e);
|
|
5068
5071
|
return {
|
|
@@ -5076,7 +5079,7 @@ function La() {
|
|
|
5076
5079
|
isLoading: !e || n || c || l || b || g
|
|
5077
5080
|
};
|
|
5078
5081
|
}
|
|
5079
|
-
function
|
|
5082
|
+
function za() {
|
|
5080
5083
|
const e = ft(), {
|
|
5081
5084
|
data: t,
|
|
5082
5085
|
isLoading: n,
|
|
@@ -5166,7 +5169,7 @@ function _t(e) {
|
|
|
5166
5169
|
}
|
|
5167
5170
|
return new se("An unknown error occurred. Please try again", "UNKNOWN", e);
|
|
5168
5171
|
}
|
|
5169
|
-
function
|
|
5172
|
+
function lo({
|
|
5170
5173
|
totalAmount: e,
|
|
5171
5174
|
merchantAddress: t,
|
|
5172
5175
|
currency: n = "USD",
|
|
@@ -5177,9 +5180,9 @@ function oo({
|
|
|
5177
5180
|
className: o = "",
|
|
5178
5181
|
children: c
|
|
5179
5182
|
}) {
|
|
5180
|
-
const { isConnected: d } = Ue(), { connect: l, connectors: y } =
|
|
5183
|
+
const { isConnected: d } = Ue(), { connect: l, connectors: y } = sr(), [b, m] = _(!1), [g, E] = _([]), { balances: T, isLoading: v } = ja(), { prices: f, isLoading: x } = za();
|
|
5181
5184
|
console.log("Token prices from useMultiTokenPrices:", f);
|
|
5182
|
-
const { executePayment: A, isConfirmed: L, hash: Y, error: te, isPending: G, isConfirming: $ } =
|
|
5185
|
+
const { executePayment: A, isConfirmed: L, hash: Y, error: te, isPending: G, isConfirming: $ } = Fa(), H = ft(), { data: I } = H.useGetTokenPrice(S.IDRX), ne = 1e8, N = (() => {
|
|
5183
5186
|
if (!I) return 1 / 15600;
|
|
5184
5187
|
if (Array.isArray(I) && I.length >= 1) {
|
|
5185
5188
|
const j = I[0];
|
|
@@ -5292,7 +5295,7 @@ function oo({
|
|
|
5292
5295
|
a?.(Q);
|
|
5293
5296
|
}
|
|
5294
5297
|
};
|
|
5295
|
-
return /* @__PURE__ */ h(
|
|
5298
|
+
return /* @__PURE__ */ h(Qn, { children: [
|
|
5296
5299
|
/* @__PURE__ */ u(
|
|
5297
5300
|
"button",
|
|
5298
5301
|
{
|
|
@@ -5303,7 +5306,7 @@ function oo({
|
|
|
5303
5306
|
}
|
|
5304
5307
|
),
|
|
5305
5308
|
d && /* @__PURE__ */ u(
|
|
5306
|
-
|
|
5309
|
+
Pr,
|
|
5307
5310
|
{
|
|
5308
5311
|
isOpen: b,
|
|
5309
5312
|
onClose: () => m(!1),
|
|
@@ -5319,7 +5322,7 @@ function oo({
|
|
|
5319
5322
|
)
|
|
5320
5323
|
] });
|
|
5321
5324
|
}
|
|
5322
|
-
const
|
|
5325
|
+
const _a = ur({
|
|
5323
5326
|
id: 4202,
|
|
5324
5327
|
name: "Lisk Sepolia",
|
|
5325
5328
|
nativeCurrency: {
|
|
@@ -5339,19 +5342,19 @@ const ja = or({
|
|
|
5339
5342
|
}
|
|
5340
5343
|
},
|
|
5341
5344
|
testnet: !0
|
|
5342
|
-
}),
|
|
5345
|
+
}), Ga = fr({
|
|
5343
5346
|
appName: "MultiCoyn Payment SDK",
|
|
5344
5347
|
projectId: "YOUR_PROJECT_ID_HERE",
|
|
5345
|
-
chains: [
|
|
5348
|
+
chains: [_a],
|
|
5346
5349
|
ssr: !1
|
|
5347
|
-
}),
|
|
5348
|
-
function
|
|
5349
|
-
return /* @__PURE__ */ u(
|
|
5350
|
+
}), Ha = new dr();
|
|
5351
|
+
function fo({ children: e }) {
|
|
5352
|
+
return /* @__PURE__ */ u(ir, { config: Ga, children: /* @__PURE__ */ u(lr, { client: Ha, children: /* @__PURE__ */ u(pr, { children: e }) }) });
|
|
5350
5353
|
}
|
|
5351
|
-
const Hn =
|
|
5354
|
+
const Hn = er(
|
|
5352
5355
|
void 0
|
|
5353
5356
|
);
|
|
5354
|
-
function
|
|
5357
|
+
function po({
|
|
5355
5358
|
children: e,
|
|
5356
5359
|
initialConfig: t = {}
|
|
5357
5360
|
}) {
|
|
@@ -5360,58 +5363,58 @@ function uo({
|
|
|
5360
5363
|
};
|
|
5361
5364
|
return /* @__PURE__ */ u(Hn.Provider, { value: { config: n, updateConfig: s }, children: e });
|
|
5362
5365
|
}
|
|
5363
|
-
function
|
|
5364
|
-
const e =
|
|
5366
|
+
function yo() {
|
|
5367
|
+
const e = tr(Hn);
|
|
5365
5368
|
if (!e)
|
|
5366
5369
|
throw new Error("usePaymentConfig must be used within PaymentProvider");
|
|
5367
5370
|
return e;
|
|
5368
5371
|
}
|
|
5369
5372
|
export {
|
|
5370
|
-
|
|
5373
|
+
no as A,
|
|
5371
5374
|
p as B,
|
|
5372
5375
|
k as C,
|
|
5373
|
-
|
|
5376
|
+
Fa as D,
|
|
5374
5377
|
ft as E,
|
|
5375
5378
|
ke as F,
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5379
|
+
ja as G,
|
|
5380
|
+
io as H,
|
|
5381
|
+
Dr as I,
|
|
5382
|
+
za as J,
|
|
5383
|
+
ao as K,
|
|
5384
|
+
oo as L,
|
|
5385
|
+
lo as M,
|
|
5386
|
+
co as N,
|
|
5387
|
+
La as O,
|
|
5388
|
+
xr as P,
|
|
5389
|
+
uo as Q,
|
|
5387
5390
|
O as R,
|
|
5388
5391
|
S as T,
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5392
|
+
Ua as U,
|
|
5393
|
+
fo as W,
|
|
5394
|
+
to as a,
|
|
5395
|
+
eo as b,
|
|
5393
5396
|
gt as c,
|
|
5394
5397
|
yn as d,
|
|
5395
5398
|
pn as e,
|
|
5396
5399
|
ge as f,
|
|
5397
5400
|
Et as g,
|
|
5398
5401
|
Ne as h,
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
+
Nr as i,
|
|
5403
|
+
qa as j,
|
|
5404
|
+
ji as k,
|
|
5402
5405
|
fe as l,
|
|
5403
5406
|
Me as m,
|
|
5404
5407
|
Bn as n,
|
|
5405
5408
|
At as o,
|
|
5406
|
-
|
|
5407
|
-
|
|
5409
|
+
_i as p,
|
|
5410
|
+
Ia as q,
|
|
5408
5411
|
we as r,
|
|
5409
5412
|
Oe as s,
|
|
5410
5413
|
vt as t,
|
|
5411
5414
|
$e as u,
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5415
|
+
po as v,
|
|
5416
|
+
yo as w,
|
|
5417
|
+
Ga as x,
|
|
5418
|
+
_a as y,
|
|
5419
|
+
Qa as z
|
|
5417
5420
|
};
|