multicoyn-sdk 0.1.4 → 0.1.6

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.
@@ -1,9 +1,9 @@
1
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";
2
+ import { useState as _, useMemo as qn, useEffect as he, createContext as er, useContext as tr } from "react";
3
+ import { useWriteContract as dt, useWaitForTransactionReceipt as lt, useReadContract as L, useAccount as Ue, useConfig as nr, useBalance as rr, useConnect as sr, WagmiProvider as ir } from "wagmi";
4
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";
5
+ import { parseUnits as or, maxUint256 as cr, formatUnits as Ee, defineChain as ur } from "viem";
6
+ import { QueryClientProvider as dr, QueryClient as lr } from "@tanstack/react-query";
7
7
  import { getDefaultConfig as fr, RainbowKitProvider as pr } from "@rainbow-me/rainbowkit";
8
8
  function yr({ size: e = 26, className: t = "" }) {
9
9
  return /* @__PURE__ */ u(
@@ -312,19 +312,19 @@ function xr({ items: e, fee: t = 0.3 }) {
312
312
  ] })
313
313
  ] });
314
314
  }
315
- const I = {
316
- PAYMENT_ROUTER: "0x7b3dfd5A3F3903237faC3D2de69d4c1915A09C9A",
317
- TOKEN_REGISTRY: "0x8515a560284AedE5D78Ff5b73f2CeCa247DCAab7"
315
+ const N = {
316
+ PAYMENT_ROUTER: "0x73Dbc7447E3B097cFc8b08ee7896a9D27D67e2B4",
317
+ TOKEN_REGISTRY: "0x1d2C6dfB2f127d6F3c14859c9E54cbc27bd7FcCE"
318
318
  }, S = {
319
319
  // Payment Tokens
320
320
  NATIVE: "0x0000000000000000000000000000000000000000",
321
- USDC: "0x5DD8eEF51d251a53D6368CfD79a88F3BC186514B",
322
- USDT: "0xc9013AD6e74A7dC418b2e601aaCD772044E59c22",
323
- DAI: "0xF84851B3A4253b74813112A5488E38E724731E2a",
324
- WBTC: "0x437f0b6328892ac36E01836aBc865d16c875D291",
321
+ USDC: "0x0Ff0aED4862e168086FD8BC38a4c27cE1830228b",
322
+ USDT: "0xBc63b0cf19b757c2a6Ef646027f8CeA7Af2c3e7F",
323
+ DAI: "0xd2aAa24D5C305B7968e955A89F0bf4E7776E7078",
324
+ WBTC: "0x1BEC7ec7F995B9bcd93F411B2cE7d289C6b05f03",
325
325
  // Settlement Tokens
326
- IDRX: "0x5324Cd3e781cf85Cf63253138Ef6c6E84143de7B"
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 = [
326
+ IDRX: "0x39B9205cDC53114c0B0F22F04C1215A13197b4d9"
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[]"},{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"externalCallSuccess","type":"bool"}],"name":"PaymentExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SettlementPoolFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"idrx","type":"address"},{"indexed":true,"internalType":"address","name":"usdt","type":"address"}],"name":"SettlementTokensUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"FEE_BASIS_POINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"IDRX_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_CASHBACK_USD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDT_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"calculateTotalValue","outputs":[{"internalType":"uint256","name":"totalUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateUSDValue","outputs":[{"internalType":"uint256","name":"usdValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"collectedBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyWithdrawPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"fundSettlementPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getCollectedBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"paymentId","type":"bytes32"}],"name":"getPayment","outputs":[{"components":[{"internalType":"address","name":"merchant","type":"address"},{"internalType":"address","name":"payer","type":"address"},{"internalType":"uint256","name":"totalPaidUSD","type":"uint256"},{"internalType":"uint256","name":"productPriceUSD","type":"uint256"},{"internalType":"uint256","name":"feeUSD","type":"uint256"},{"internalType":"uint256","name":"excessUSD","type":"uint256"},{"internalType":"bool","name":"settleInIDR","type":"bool"},{"internalType":"uint256","name":"settlementAmount","type":"uint256"},{"internalType":"uint256","name":"cashbackAmount","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct IPaymentRouter.Payment","name":"payment","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getSettlementPoolBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minimumPoolBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"merchantAddress","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"productPriceUSD","type":"uint256"},{"internalType":"bool","name":"settleInIDR","type":"bool"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"name":"pay","outputs":[{"internalType":"bytes32","name":"paymentId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"setMinimumPoolBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_idrx","type":"address"},{"internalType":"address","name":"_usdt","type":"address"}],"name":"setSettlementTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"settlementPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenRegistry","outputs":[{"internalType":"contract ITokenRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"expectedUSD","type":"uint256"}],"name":"validatePayment","outputs":[{"internalType":"bool","name":"valid","type":"bool"},{"internalType":"uint256","name":"actualUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawCollectedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]'), vr = [
328
328
  {
329
329
  inputs: [],
330
330
  stateMutability: "nonpayable",
@@ -1225,95 +1225,95 @@ const I = {
1225
1225
  stateMutability: "nonpayable",
1226
1226
  type: "function"
1227
1227
  }
1228
- ], Ce = Tr, W = vr, Z = Er;
1228
+ ], Ce = Tr, H = vr, Z = Er;
1229
1229
  function ft() {
1230
1230
  const { writeContract: e, data: t, isPending: n, error: r } = dt(), { isLoading: s, isSuccess: i } = lt({
1231
1231
  hash: t
1232
1232
  });
1233
1233
  return {
1234
1234
  // Write functions
1235
- registerToken: (f, x, A, L) => {
1235
+ registerToken: (y, T, x, F) => {
1236
1236
  e({
1237
- address: I.TOKEN_REGISTRY,
1238
- abi: W,
1237
+ address: N.TOKEN_REGISTRY,
1238
+ abi: H,
1239
1239
  functionName: "registerToken",
1240
- args: [f, x, A, L]
1240
+ args: [y, T, x, F]
1241
1241
  });
1242
1242
  },
1243
- setTokenEnabled: (f, x) => {
1243
+ setTokenEnabled: (y, T) => {
1244
1244
  e({
1245
- address: I.TOKEN_REGISTRY,
1246
- abi: W,
1245
+ address: N.TOKEN_REGISTRY,
1246
+ abi: H,
1247
1247
  functionName: "setTokenEnabled",
1248
- args: [f, x]
1248
+ args: [y, T]
1249
1249
  });
1250
1250
  },
1251
- updatePriceFeed: (f, x) => {
1251
+ updatePriceFeed: (y, T) => {
1252
1252
  e({
1253
- address: I.TOKEN_REGISTRY,
1254
- abi: W,
1253
+ address: N.TOKEN_REGISTRY,
1254
+ abi: H,
1255
1255
  functionName: "updatePriceFeed",
1256
- args: [f, x]
1256
+ args: [y, T]
1257
1257
  });
1258
1258
  },
1259
- setMinPaymentAmount: (f, x) => {
1259
+ setMinPaymentAmount: (y, T) => {
1260
1260
  e({
1261
- address: I.TOKEN_REGISTRY,
1262
- abi: W,
1261
+ address: N.TOKEN_REGISTRY,
1262
+ abi: H,
1263
1263
  functionName: "setMinPaymentAmount",
1264
- args: [f, x]
1264
+ args: [y, T]
1265
1265
  });
1266
1266
  },
1267
- grantRole: (f, x) => {
1267
+ grantRole: (y, T) => {
1268
1268
  e({
1269
- address: I.TOKEN_REGISTRY,
1270
- abi: W,
1269
+ address: N.TOKEN_REGISTRY,
1270
+ abi: H,
1271
1271
  functionName: "grantRole",
1272
- args: [f, x]
1272
+ args: [y, T]
1273
1273
  });
1274
1274
  },
1275
- revokeRole: (f, x) => {
1275
+ revokeRole: (y, T) => {
1276
1276
  e({
1277
- address: I.TOKEN_REGISTRY,
1278
- abi: W,
1277
+ address: N.TOKEN_REGISTRY,
1278
+ abi: H,
1279
1279
  functionName: "revokeRole",
1280
- args: [f, x]
1280
+ args: [y, T]
1281
1281
  });
1282
1282
  },
1283
1283
  // Read hooks
1284
- useGetTokenConfig: (f) => D({
1285
- address: I.TOKEN_REGISTRY,
1286
- abi: W,
1284
+ useGetTokenConfig: (y) => L({
1285
+ address: N.TOKEN_REGISTRY,
1286
+ abi: H,
1287
1287
  functionName: "getTokenConfig",
1288
- args: [f]
1288
+ args: [y]
1289
1289
  }),
1290
- useGetTokenPrice: (f) => D({
1291
- address: I.TOKEN_REGISTRY,
1292
- abi: W,
1290
+ useGetTokenPrice: (y) => L({
1291
+ address: N.TOKEN_REGISTRY,
1292
+ abi: H,
1293
1293
  functionName: "getTokenPriceUSD",
1294
- args: [f]
1294
+ args: [y]
1295
1295
  }),
1296
- useGetRegisteredTokens: () => D({
1297
- address: I.TOKEN_REGISTRY,
1298
- abi: W,
1296
+ useGetRegisteredTokens: () => L({
1297
+ address: N.TOKEN_REGISTRY,
1298
+ abi: H,
1299
1299
  functionName: "getRegisteredTokens"
1300
1300
  }),
1301
- useGetRegisteredTokenCount: () => D({
1302
- address: I.TOKEN_REGISTRY,
1303
- abi: W,
1301
+ useGetRegisteredTokenCount: () => L({
1302
+ address: N.TOKEN_REGISTRY,
1303
+ abi: H,
1304
1304
  functionName: "getRegisteredTokenCount"
1305
1305
  }),
1306
- useIsTokenEnabled: (f) => D({
1307
- address: I.TOKEN_REGISTRY,
1308
- abi: W,
1306
+ useIsTokenEnabled: (y) => L({
1307
+ address: N.TOKEN_REGISTRY,
1308
+ abi: H,
1309
1309
  functionName: "isTokenEnabled",
1310
- args: [f]
1310
+ args: [y]
1311
1311
  }),
1312
- useHasRole: (f, x) => D({
1313
- address: I.TOKEN_REGISTRY,
1314
- abi: W,
1312
+ useHasRole: (y, T) => L({
1313
+ address: N.TOKEN_REGISTRY,
1314
+ abi: H,
1315
1315
  functionName: "hasRole",
1316
- args: [f, x]
1316
+ args: [y, T]
1317
1317
  }),
1318
1318
  // Transaction state
1319
1319
  hash: t,
@@ -1336,9 +1336,9 @@ function Pr({
1336
1336
  isProcessing: d,
1337
1337
  isSuccess: l
1338
1338
  }) {
1339
- const [y, b] = _([]), [m, g] = _(""), [E, T] = _(!0), [v, f] = _("form"), [x, A] = _(0), [L, Y] = _(""), [te, G] = _(
1339
+ const [f, b] = _([]), [m, g] = _(""), [v, A] = _(!0), [E, y] = _("form"), [T, x] = _(0), [F, W] = _(""), [J, B] = _(
1340
1340
  "Preparing payment..."
1341
- ), [$, H] = _([]), k = ft(), { data: ne } = k.useGetTokenPrice(S.NATIVE), { data: J } = k.useGetTokenPrice(S.USDC), { data: N } = k.useGetTokenPrice(S.USDT), { data: B } = k.useGetTokenPrice(S.DAI), { data: F } = k.useGetTokenPrice(S.WBTC), ye = 1e8, j = qn(
1341
+ ), [K, ue] = _([]), G = ft(), { data: te } = G.useGetTokenPrice(S.NATIVE), { data: $ } = G.useGetTokenPrice(S.USDC), { data: M } = G.useGetTokenPrice(S.USDT), { data: k } = G.useGetTokenPrice(S.DAI), { data: D } = G.useGetTokenPrice(S.WBTC), ne = 1e8, Q = qn(
1342
1342
  () => JSON.stringify(
1343
1343
  i.map((w) => ({
1344
1344
  id: w.id,
@@ -1347,68 +1347,68 @@ function Pr({
1347
1347
  }))
1348
1348
  ),
1349
1349
  [i]
1350
- ), z = (w) => {
1350
+ ), Y = (w) => {
1351
1351
  if (!w) return 0;
1352
1352
  if (Array.isArray(w) && w.length >= 1) {
1353
1353
  const P = w[0];
1354
1354
  if (typeof P == "bigint")
1355
- return Number(P) / ye;
1355
+ return Number(P) / ne;
1356
1356
  }
1357
1357
  return 0;
1358
1358
  };
1359
- me(() => {
1359
+ he(() => {
1360
1360
  if (e && i.length > 0) {
1361
1361
  const w = i.map((P) => {
1362
- let M = P.priceUSD;
1363
- return P.address === S.NATIVE && ne ? M = z(ne) : P.address === S.USDC && J ? M = z(J) : P.address === S.USDT && N ? M = z(N) : P.address === S.DAI && B ? M = z(B) : P.address === S.WBTC && F && (M = z(F)), { ...P, priceUSD: M };
1362
+ let R = P.priceUSD;
1363
+ return P.address === S.NATIVE && te ? R = Y(te) : P.address === S.USDC && $ ? R = Y($) : P.address === S.USDT && M ? R = Y(M) : P.address === S.DAI && k ? R = Y(k) : P.address === S.WBTC && D && (R = Y(D)), { ...P, priceUSD: R };
1364
1364
  });
1365
- if (E) {
1365
+ if (v) {
1366
1366
  const P = w.filter(
1367
- (M) => M.amount > 0 && M.priceUSD > 0
1367
+ (R) => R.amount > 0 && R.priceUSD > 0
1368
1368
  );
1369
1369
  if (P.length > 0) {
1370
- const M = Math.floor(100 / P.length), q = 100 - M * P.length;
1371
- w.forEach((de, ze) => {
1372
- de.percentage = de.amount > 0 && de.priceUSD > 0 ? M + (ze === 0 ? q : 0) : 0;
1370
+ const R = Math.floor(100 / P.length), q = 100 - R * P.length;
1371
+ w.forEach((fe, ze) => {
1372
+ fe.percentage = fe.amount > 0 && fe.priceUSD > 0 ? R + (ze === 0 ? q : 0) : 0;
1373
1373
  });
1374
1374
  }
1375
1375
  }
1376
1376
  b(w);
1377
1377
  }
1378
- }, [e, j, ne, J, N, B, F]), me(() => {
1379
- e || (f("form"), A(0), Y(""));
1380
- }, [e]), me(() => {
1381
- l && c ? (A(100), Y(c), f("success"), G("Payment completed!")) : d && (A(80), G("Confirming transaction..."));
1378
+ }, [e, Q, te, $, M, k, D]), he(() => {
1379
+ e || (y("form"), x(0), W(""));
1380
+ }, [e]), he(() => {
1381
+ l && c ? (x(100), W(c), y("success"), B("Payment completed!")) : d && (x(80), B("Confirming transaction..."));
1382
1382
  }, [l, d, c]);
1383
- const Q = y.reduce((w, P) => w + P.percentage, 0), Se = s.reduce((w, P) => w + P.price, 0) + o, V = y.some((w) => w.percentage === 0 ? !1 : !w.priceUSD || w.priceUSD <= 0), je = y.some((w) => {
1383
+ const I = f.reduce((w, P) => w + P.percentage, 0), de = s.reduce((w, P) => w + P.price, 0) + o, j = f.some((w) => w.percentage === 0 ? !1 : !w.priceUSD || w.priceUSD <= 0), je = f.some((w) => {
1384
1384
  if (w.percentage === 0) return !1;
1385
1385
  const P = n * w.percentage / 100;
1386
1386
  return (w.priceUSD > 0 ? P / w.priceUSD : 0) > w.amount;
1387
1387
  }), Vn = (w, P) => {
1388
1388
  b(
1389
- (M) => M.map((q) => q.id === w ? { ...q, percentage: P } : q)
1389
+ (R) => R.map((q) => q.id === w ? { ...q, percentage: P } : q)
1390
1390
  );
1391
1391
  }, Wn = () => {
1392
- if (!E) {
1393
- const w = y.filter((q) => q.amount > 0 && q.priceUSD > 0), P = Math.floor(100 / w.length), M = 100 - P * w.length;
1392
+ if (!v) {
1393
+ const w = f.filter((q) => q.amount > 0 && q.priceUSD > 0), P = Math.floor(100 / w.length), R = 100 - P * w.length;
1394
1394
  b(
1395
- (q) => q.map((de, ze) => ({
1396
- ...de,
1397
- percentage: de.amount > 0 && de.priceUSD > 0 ? P + (ze === 0 ? M : 0) : 0
1395
+ (q) => q.map((fe, ze) => ({
1396
+ ...fe,
1397
+ percentage: fe.amount > 0 && fe.priceUSD > 0 ? P + (ze === 0 ? R : 0) : 0
1398
1398
  }))
1399
1399
  );
1400
1400
  }
1401
- T(!E);
1402
- }, Kn = y.filter(
1401
+ A(!v);
1402
+ }, Kn = f.filter(
1403
1403
  (w) => w.name.toLowerCase().includes(m.toLowerCase()) || w.symbol.toLowerCase().includes(m.toLowerCase()) || w.chain.toLowerCase().includes(m.toLowerCase())
1404
1404
  ), Yn = async () => {
1405
- f("processing"), A(10), G("Checking token approvals...");
1406
- const w = y.filter(
1405
+ y("processing"), x(10), B("Checking token approvals...");
1406
+ const w = f.filter(
1407
1407
  (P) => P.percentage > 0 && P.address !== S.NATIVE
1408
1408
  );
1409
- w.length > 0 && (G(
1409
+ w.length > 0 && (B(
1410
1410
  `Requesting approval for ${w.length} token(s)...`
1411
- ), H(w.map((P) => P.symbol))), A(30), G("Processing payment..."), a(y), A(60);
1411
+ ), ue(w.map((P) => P.symbol))), x(30), B("Processing payment..."), a(f), x(60);
1412
1412
  }, Zn = () => {
1413
1413
  t();
1414
1414
  }, Xn = () => (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
@@ -1422,10 +1422,10 @@ function Pr({
1422
1422
  "div",
1423
1423
  {
1424
1424
  className: "absolute inset-0 bg-black/60 backdrop-blur-sm",
1425
- onClick: v === "form" ? t : void 0
1425
+ onClick: E === "form" ? t : void 0
1426
1426
  }
1427
1427
  ),
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: [
1428
+ E === "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: [
1429
1429
  /* @__PURE__ */ u(hr, { size: 134 }),
1430
1430
  /* @__PURE__ */ h("div", { className: "flex flex-col gap-3 items-center w-[300px]", children: [
1431
1431
  /* @__PURE__ */ h("div", { className: "relative w-[234px] h-1.5", children: [
@@ -1434,18 +1434,18 @@ function Pr({
1434
1434
  "div",
1435
1435
  {
1436
1436
  className: "absolute left-0 top-0 h-full bg-secondary rounded-full transition-all duration-300",
1437
- style: { width: `${Math.min(x, 100)}%` }
1437
+ style: { width: `${Math.min(T, 100)}%` }
1438
1438
  }
1439
1439
  )
1440
1440
  ] }),
1441
- /* @__PURE__ */ u("p", { className: "text-sm text-white text-center", children: te }),
1442
- $.length > 0 && /* @__PURE__ */ h("div", { className: "text-xs text-white/60 text-center", children: [
1441
+ /* @__PURE__ */ u("p", { className: "text-sm text-white text-center", children: J }),
1442
+ K.length > 0 && /* @__PURE__ */ h("div", { className: "text-xs text-white/60 text-center", children: [
1443
1443
  "Approving: ",
1444
- $.join(", ")
1444
+ K.join(", ")
1445
1445
  ] })
1446
1446
  ] })
1447
1447
  ] }),
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: [
1448
+ E === "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: [
1449
1449
  /* @__PURE__ */ h("div", { className: "flex flex-col gap-6 items-center w-full", children: [
1450
1450
  /* @__PURE__ */ u(gr, { size: 95 }),
1451
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: [
@@ -1462,7 +1462,7 @@ function Pr({
1462
1462
  /* @__PURE__ */ u("span", { className: "text-sm w-[106px]", children: "Total Payment" }),
1463
1463
  /* @__PURE__ */ h("span", { className: "flex-1 text-base font-semibold text-right", children: [
1464
1464
  "$",
1465
- Se.toFixed(2)
1465
+ de.toFixed(2)
1466
1466
  ] })
1467
1467
  ] })
1468
1468
  ] }) })
@@ -1470,10 +1470,10 @@ function Pr({
1470
1470
  /* @__PURE__ */ u("div", { className: "h-px w-[320px] bg-white/20" }),
1471
1471
  /* @__PURE__ */ h("div", { className: "flex flex-col gap-2 items-center justify-center w-full text-xs text-white px-5", children: [
1472
1472
  /* @__PURE__ */ u("p", { children: Xn() }),
1473
- L && /* @__PURE__ */ u(
1473
+ F && /* @__PURE__ */ u(
1474
1474
  "a",
1475
1475
  {
1476
- href: `https://sepolia-blockscout.lisk.com/tx/${L}`,
1476
+ href: `https://sepolia-blockscout.lisk.com/tx/${F}`,
1477
1477
  target: "_blank",
1478
1478
  rel: "noopener noreferrer",
1479
1479
  className: "text-cyan hover:underline",
@@ -1490,7 +1490,7 @@ function Pr({
1490
1490
  }
1491
1491
  )
1492
1492
  ] }),
1493
- v === "form" && /* @__PURE__ */ h("div", { className: "relative bg-dark-2 border border-border rounded-xl p-4 flex flex-col gap-5 max-w-[1000px] w-full mx-4 max-h-[90vh] overflow-y-auto animate-slide-in-right", children: [
1493
+ E === "form" && /* @__PURE__ */ h("div", { className: "relative bg-dark-2 border border-border rounded-xl p-4 flex flex-col gap-5 max-w-[1000px] w-full mx-4 max-h-[90vh] overflow-y-auto animate-slide-in-right", children: [
1494
1494
  /* @__PURE__ */ h("div", { className: "flex items-center gap-4", children: [
1495
1495
  /* @__PURE__ */ h("div", { className: "flex-1 flex flex-col gap-1", children: [
1496
1496
  /* @__PURE__ */ u("h2", { className: "text-xl text-white font-normal", children: "Complete Payment" }),
@@ -1539,9 +1539,9 @@ function Pr({
1539
1539
  /* @__PURE__ */ h(
1540
1540
  "span",
1541
1541
  {
1542
- className: `bg-dark-4 rounded-full px-2 py-1 text-xs font-semibold ${Q === 100 ? "text-cyan" : "text-warning"}`,
1542
+ className: `bg-dark-4 rounded-full px-2 py-1 text-xs font-semibold ${I === 100 ? "text-cyan" : "text-warning"}`,
1543
1543
  children: [
1544
- Q,
1544
+ I,
1545
1545
  "/100%"
1546
1546
  ]
1547
1547
  }
@@ -1553,11 +1553,11 @@ function Pr({
1553
1553
  "button",
1554
1554
  {
1555
1555
  onClick: Wn,
1556
- className: `w-7 h-4 rounded-full relative transition-colors ${E ? "bg-cyan" : "bg-white/40"}`,
1556
+ className: `w-7 h-4 rounded-full relative transition-colors ${v ? "bg-cyan" : "bg-white/40"}`,
1557
1557
  children: /* @__PURE__ */ u(
1558
1558
  "div",
1559
1559
  {
1560
- className: `absolute top-0.5 size-3 rounded-full bg-white transition-transform ${E ? "translate-x-3.5" : "translate-x-0.5"}`
1560
+ className: `absolute top-0.5 size-3 rounded-full bg-white transition-transform ${v ? "translate-x-3.5" : "translate-x-0.5"}`
1561
1561
  }
1562
1562
  )
1563
1563
  }
@@ -1581,9 +1581,9 @@ function Pr({
1581
1581
  "button",
1582
1582
  {
1583
1583
  onClick: Yn,
1584
- disabled: Q !== 100 || je || V,
1585
- className: `w-full lg:w-[620px] h-[42px] rounded-lg flex items-center justify-center text-sm font-semibold text-white transition-all ${Q === 100 && !je && !V ? "bg-secondary hover:bg-secondary/90" : "bg-secondary/50 cursor-not-allowed"}`,
1586
- children: V ? "Price data unavailable - Please wait" : je ? "Insufficient Balance" : Q !== 100 ? `Complete to 100% (${Q}%)` : "Pay with MultiCoyn"
1584
+ disabled: I !== 100 || je || j,
1585
+ className: `w-full lg:w-[620px] h-[42px] rounded-lg flex items-center justify-center text-sm font-semibold text-white transition-all ${I === 100 && !je && !j ? "bg-secondary hover:bg-secondary/90" : "bg-secondary/50 cursor-not-allowed"}`,
1586
+ children: j ? "Price data unavailable - Please wait" : je ? "Insufficient Balance" : I !== 100 ? `Complete to 100% (${I}%)` : "Pay with MultiCoyn"
1587
1587
  }
1588
1588
  )
1589
1589
  ] })
@@ -1606,7 +1606,7 @@ function Qa() {
1606
1606
  showForm: () => r("form")
1607
1607
  };
1608
1608
  }
1609
- const $t = [
1609
+ const At = [
1610
1610
  {
1611
1611
  inputs: [
1612
1612
  {
@@ -1712,22 +1712,22 @@ const $t = [
1712
1712
  ]
1713
1713
  }
1714
1714
  ];
1715
- function ge(e, { includeName: t = !1 } = {}) {
1715
+ function we(e, { includeName: t = !1 } = {}) {
1716
1716
  if (e.type !== "function" && e.type !== "event" && e.type !== "error")
1717
- throw new Br(e.type);
1717
+ throw new Dr(e.type);
1718
1718
  return `${e.name}(${pt(e.inputs, { includeName: t })})`;
1719
1719
  }
1720
1720
  function pt(e, { includeName: t = !1 } = {}) {
1721
- return e ? e.map((n) => Ar(n, { includeName: t })).join(t ? ", " : ",") : "";
1721
+ return e ? e.map((n) => $r(n, { includeName: t })).join(t ? ", " : ",") : "";
1722
1722
  }
1723
- function Ar(e, { includeName: t }) {
1723
+ function $r(e, { includeName: t }) {
1724
1724
  return e.type.startsWith("tuple") ? `(${pt(e.components, { includeName: t })})${e.type.slice(5)}` : e.type + (t && e.name ? ` ${e.name}` : "");
1725
1725
  }
1726
- function $e(e, { strict: t = !0 } = {}) {
1726
+ function Se(e, { strict: t = !0 } = {}) {
1727
1727
  return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
1728
1728
  }
1729
- function R(e) {
1730
- return $e(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
1729
+ function O(e) {
1730
+ return Se(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
1731
1731
  }
1732
1732
  const Gt = "2.43.5";
1733
1733
  let _e = {
@@ -1783,7 +1783,7 @@ let _e = {
1783
1783
  function Ht(e, t) {
1784
1784
  return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? Ht(e.cause, t) : t ? null : e;
1785
1785
  }
1786
- class $r extends p {
1786
+ class Ar extends p {
1787
1787
  constructor({ docsPath: t }) {
1788
1788
  super([
1789
1789
  "A constructor was not found on the ABI.",
@@ -1853,7 +1853,7 @@ class Cr extends p {
1853
1853
  }
1854
1854
  class kr extends p {
1855
1855
  constructor({ expectedSize: t, value: n }) {
1856
- super(`Size of bytes "${n}" (bytes${R(n)}) does not match expected size (bytes${t}).`, { name: "AbiEncodingBytesSizeMismatchError" });
1856
+ super(`Size of bytes "${n}" (bytes${O(n)}) does not match expected size (bytes${t}).`, { name: "AbiEncodingBytesSizeMismatchError" });
1857
1857
  }
1858
1858
  }
1859
1859
  class Ir extends p {
@@ -1951,8 +1951,8 @@ class Mr extends p {
1951
1951
  constructor(t, n) {
1952
1952
  super("Found ambiguous types in overloaded ABI items.", {
1953
1953
  metaMessages: [
1954
- `\`${t.type}\` in \`${ge(t.abiItem)}\`, and`,
1955
- `\`${n.type}\` in \`${ge(n.abiItem)}\``,
1954
+ `\`${t.type}\` in \`${we(t.abiItem)}\`, and`,
1955
+ `\`${n.type}\` in \`${we(n.abiItem)}\``,
1956
1956
  "",
1957
1957
  "These types encode differently and cannot be distinguished at runtime.",
1958
1958
  "Remove one of the ambiguous items in the ABI."
@@ -1979,7 +1979,7 @@ class Or extends p {
1979
1979
  `), { docsPath: n, name: "InvalidAbiDecodingType" });
1980
1980
  }
1981
1981
  }
1982
- class Dr extends p {
1982
+ class Br extends p {
1983
1983
  constructor(t) {
1984
1984
  super([`Value "${t}" is not a valid array.`].join(`
1985
1985
  `), {
@@ -1987,7 +1987,7 @@ class Dr extends p {
1987
1987
  });
1988
1988
  }
1989
1989
  }
1990
- class Br extends p {
1990
+ class Dr extends p {
1991
1991
  constructor(t) {
1992
1992
  super([
1993
1993
  `"${t}" is not a valid definition type.`,
@@ -2022,10 +2022,10 @@ class Ct extends p {
2022
2022
  super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`, { name: "InvalidBytesLengthError" });
2023
2023
  }
2024
2024
  }
2025
- function xe(e, { dir: t, size: n = 32 } = {}) {
2026
- return typeof e == "string" ? ue(e, { dir: t, size: n }) : Ur(e, { dir: t, size: n });
2025
+ function Te(e, { dir: t, size: n = 32 } = {}) {
2026
+ return typeof e == "string" ? le(e, { dir: t, size: n }) : Ur(e, { dir: t, size: n });
2027
2027
  }
2028
- function ue(e, { dir: t, size: n = 32 } = {}) {
2028
+ function le(e, { dir: t, size: n = 32 } = {}) {
2029
2029
  if (n === null)
2030
2030
  return e;
2031
2031
  const r = e.replace("0x", "");
@@ -2077,9 +2077,9 @@ function bt(e, { dir: t = "left" } = {}) {
2077
2077
  return n = t === "left" ? n.slice(r) : n.slice(0, n.length - r), typeof e == "string" ? (n.length === 1 && t === "right" && (n = `${n}0`), `0x${n.length % 2 === 1 ? `0${n}` : n}`) : n;
2078
2078
  }
2079
2079
  function ee(e, { size: t }) {
2080
- if (R(e) > t)
2080
+ if (O(e) > t)
2081
2081
  throw new Fr({
2082
- givenSize: R(e),
2082
+ givenSize: O(e),
2083
2083
  maxSize: t
2084
2084
  });
2085
2085
  }
@@ -2101,14 +2101,14 @@ function _r(e, t = {}) {
2101
2101
  }
2102
2102
  function Xt(e, t = {}) {
2103
2103
  const n = `0x${Number(e)}`;
2104
- return typeof t.size == "number" ? (ee(n, { size: t.size }), xe(n, { size: t.size })) : n;
2104
+ return typeof t.size == "number" ? (ee(n, { size: t.size }), Te(n, { size: t.size })) : n;
2105
2105
  }
2106
2106
  function oe(e, t = {}) {
2107
2107
  let n = "";
2108
2108
  for (let s = 0; s < e.length; s++)
2109
2109
  n += zr[e[s]];
2110
2110
  const r = `0x${n}`;
2111
- return typeof t.size == "number" ? (ee(r, { size: t.size }), xe(r, { dir: "right", size: t.size })) : r;
2111
+ return typeof t.size == "number" ? (ee(r, { size: t.size }), Te(r, { dir: "right", size: t.size })) : r;
2112
2112
  }
2113
2113
  function C(e, t = {}) {
2114
2114
  const { signed: n, size: r } = t, s = BigInt(e);
@@ -2126,7 +2126,7 @@ function C(e, t = {}) {
2126
2126
  });
2127
2127
  }
2128
2128
  const o = `0x${(n && s < 0 ? (1n << BigInt(r * 8)) + BigInt(s) : s).toString(16)}`;
2129
- return r ? xe(o, { size: r }) : o;
2129
+ return r ? Te(o, { size: r }) : o;
2130
2130
  }
2131
2131
  const Gr = /* @__PURE__ */ new TextEncoder();
2132
2132
  function Jt(e, t = {}) {
@@ -2135,11 +2135,11 @@ function Jt(e, t = {}) {
2135
2135
  }
2136
2136
  const Hr = /* @__PURE__ */ new TextEncoder();
2137
2137
  function Qt(e, t = {}) {
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);
2138
+ return typeof e == "number" || typeof e == "bigint" ? Wr(e, t) : typeof e == "boolean" ? Vr(e, t) : Se(e) ? mt(e, t) : qt(e, t);
2139
2139
  }
2140
2140
  function Vr(e, t = {}) {
2141
2141
  const n = new Uint8Array(1);
2142
- return n[0] = Number(e), typeof t.size == "number" ? (ee(n, { size: t.size }), xe(n, { size: t.size })) : n;
2142
+ return n[0] = Number(e), typeof t.size == "number" ? (ee(n, { size: t.size }), Te(n, { size: t.size })) : n;
2143
2143
  }
2144
2144
  const re = {
2145
2145
  zero: 48,
@@ -2159,7 +2159,7 @@ function kt(e) {
2159
2159
  }
2160
2160
  function mt(e, t = {}) {
2161
2161
  let n = e;
2162
- t.size && (ee(n, { size: t.size }), n = xe(n, { dir: "right", size: t.size }));
2162
+ t.size && (ee(n, { size: t.size }), n = Te(n, { dir: "right", size: t.size }));
2163
2163
  let r = n.slice(2);
2164
2164
  r.length % 2 && (r = `0${r}`);
2165
2165
  const s = r.length / 2, i = new Uint8Array(s);
@@ -2177,7 +2177,7 @@ function Wr(e, t) {
2177
2177
  }
2178
2178
  function qt(e, t = {}) {
2179
2179
  const n = Hr.encode(e);
2180
- return typeof t.size == "number" ? (ee(n, { size: t.size }), xe(n, { dir: "right", size: t.size })) : n;
2180
+ return typeof t.size == "number" ? (ee(n, { size: t.size }), Te(n, { dir: "right", size: t.size })) : n;
2181
2181
  }
2182
2182
  const ke = /* @__PURE__ */ BigInt(2 ** 32 - 1), It = /* @__PURE__ */ BigInt(32);
2183
2183
  function Kr(e, t = !1) {
@@ -2249,28 +2249,28 @@ function os(e) {
2249
2249
  const t = (r) => e().update(tn(r)).digest(), n = e();
2250
2250
  return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
2251
2251
  }
2252
- const cs = BigInt(0), Ee = BigInt(1), us = BigInt(2), ds = BigInt(7), ls = BigInt(256), fs = BigInt(113), nn = [], rn = [], sn = [];
2253
- for (let e = 0, t = Ee, n = 1, r = 0; e < 24; e++) {
2252
+ const cs = BigInt(0), Pe = BigInt(1), us = BigInt(2), ds = BigInt(7), ls = BigInt(256), fs = BigInt(113), nn = [], rn = [], sn = [];
2253
+ for (let e = 0, t = Pe, n = 1, r = 0; e < 24; e++) {
2254
2254
  [n, r] = [r, (2 * n + 3 * r) % 5], nn.push(2 * (5 * r + n)), rn.push((e + 1) * (e + 2) / 2 % 64);
2255
2255
  let s = cs;
2256
2256
  for (let i = 0; i < 7; i++)
2257
- t = (t << Ee ^ (t >> ds) * fs) % ls, t & us && (s ^= Ee << (Ee << /* @__PURE__ */ BigInt(i)) - Ee);
2257
+ t = (t << Pe ^ (t >> ds) * fs) % ls, t & us && (s ^= Pe << (Pe << /* @__PURE__ */ BigInt(i)) - Pe);
2258
2258
  sn.push(s);
2259
2259
  }
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);
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), Bt = (e, t, n) => n > 32 ? Qr(e, t, n) : Xr(e, t, n);
2261
2261
  function bs(e, t = 24) {
2262
2262
  const n = new Uint32Array(10);
2263
2263
  for (let r = 24 - t; r < 24; r++) {
2264
2264
  for (let a = 0; a < 10; a++)
2265
2265
  n[a] = e[a] ^ e[a + 10] ^ e[a + 20] ^ e[a + 30] ^ e[a + 40];
2266
2266
  for (let a = 0; a < 10; a += 2) {
2267
- const o = (a + 8) % 10, c = (a + 2) % 10, d = n[c], l = n[c + 1], y = Ot(d, l, 1) ^ n[o], b = Dt(d, l, 1) ^ n[o + 1];
2267
+ const o = (a + 8) % 10, c = (a + 2) % 10, d = n[c], l = n[c + 1], f = Ot(d, l, 1) ^ n[o], b = Bt(d, l, 1) ^ n[o + 1];
2268
2268
  for (let m = 0; m < 50; m += 10)
2269
- e[a + m] ^= y, e[a + m + 1] ^= b;
2269
+ e[a + m] ^= f, e[a + m + 1] ^= b;
2270
2270
  }
2271
2271
  let s = e[2], i = e[3];
2272
2272
  for (let a = 0; a < 24; a++) {
2273
- const o = rn[a], c = Ot(s, i, o), d = Dt(s, i, o), l = nn[a];
2273
+ const o = rn[a], c = Ot(s, i, o), d = Bt(s, i, o), l = nn[a];
2274
2274
  s = e[l], i = e[l + 1], e[l] = c, e[l + 1] = d;
2275
2275
  }
2276
2276
  for (let a = 0; a < 50; a += 10) {
@@ -2350,7 +2350,7 @@ class ht extends as {
2350
2350
  }
2351
2351
  const ms = (e, t, n) => os(() => new ht(t, e, n)), hs = ms(1, 136, 256 / 8);
2352
2352
  function on(e, t) {
2353
- const n = t || "hex", r = hs($e(e, { strict: !1 }) ? Qt(e) : e);
2353
+ const n = t || "hex", r = hs(Se(e, { strict: !1 }) ? Qt(e) : e);
2354
2354
  return n === "bytes" ? r : _r(r);
2355
2355
  }
2356
2356
  class cn extends Map {
@@ -2375,7 +2375,7 @@ class cn extends Map {
2375
2375
  }
2376
2376
  }
2377
2377
  const gs = /^0x[a-fA-F0-9]{40}$/, Ge = /* @__PURE__ */ new cn(8192);
2378
- function fe(e, t) {
2378
+ function ye(e, t) {
2379
2379
  const { strict: n = !0 } = t ?? {}, r = `${e}.${n}`;
2380
2380
  if (Ge.has(r))
2381
2381
  return Ge.get(r);
@@ -2392,7 +2392,7 @@ function un(e, t) {
2392
2392
  const i = `0x${s.join("")}`;
2393
2393
  return He.set(`${e}.${t}`, i), i;
2394
2394
  }
2395
- class Bt extends p {
2395
+ class Dt extends p {
2396
2396
  constructor({ offset: t }) {
2397
2397
  super(`Offset \`${t}\` cannot be negative.`, {
2398
2398
  name: "NegativeOffsetError"
@@ -2432,7 +2432,7 @@ const Ts = {
2432
2432
  },
2433
2433
  decrementPosition(e) {
2434
2434
  if (e < 0)
2435
- throw new Bt({ offset: e });
2435
+ throw new Dt({ offset: e });
2436
2436
  const t = this.position - e;
2437
2437
  this.assertPosition(t), this.position = t;
2438
2438
  },
@@ -2441,7 +2441,7 @@ const Ts = {
2441
2441
  },
2442
2442
  incrementPosition(e) {
2443
2443
  if (e < 0)
2444
- throw new Bt({ offset: e });
2444
+ throw new Dt({ offset: e });
2445
2445
  const t = this.position + e;
2446
2446
  this.assertPosition(t), this.position = t;
2447
2447
  },
@@ -2536,26 +2536,26 @@ function vs(e, { recursiveReadLimit: t = 8192 } = {}) {
2536
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;
2537
2537
  }
2538
2538
  function Oe(e, t, n, { strict: r } = {}) {
2539
- return $e(e, { strict: !1 }) ? Es(e, t, n, {
2539
+ return Se(e, { strict: !1 }) ? Es(e, t, n, {
2540
2540
  strict: r
2541
2541
  }) : fn(e, t, n, {
2542
2542
  strict: r
2543
2543
  });
2544
2544
  }
2545
2545
  function dn(e, t) {
2546
- if (typeof t == "number" && t > 0 && t > R(e) - 1)
2546
+ if (typeof t == "number" && t > 0 && t > O(e) - 1)
2547
2547
  throw new Wt({
2548
2548
  offset: t,
2549
2549
  position: "start",
2550
- size: R(e)
2550
+ size: O(e)
2551
2551
  });
2552
2552
  }
2553
2553
  function ln(e, t, n) {
2554
- if (typeof t == "number" && typeof n == "number" && R(e) !== n - t)
2554
+ if (typeof t == "number" && typeof n == "number" && O(e) !== n - t)
2555
2555
  throw new Wt({
2556
2556
  offset: n,
2557
2557
  position: "end",
2558
- size: R(e)
2558
+ size: O(e)
2559
2559
  });
2560
2560
  }
2561
2561
  function fn(e, t, n, { strict: r } = {}) {
@@ -2573,7 +2573,7 @@ function Ps(e, t = {}) {
2573
2573
  const n = oe(e, t);
2574
2574
  return Zt(n, t);
2575
2575
  }
2576
- function As(e, t = {}) {
2576
+ function $s(e, t = {}) {
2577
2577
  let n = e;
2578
2578
  if (typeof t.size < "u" && (ee(n, { size: t.size }), n = bt(n)), n.length > 1 || n[0] > 1)
2579
2579
  throw new Lr(n);
@@ -2584,11 +2584,11 @@ function ae(e, t = {}) {
2584
2584
  const n = oe(e, t);
2585
2585
  return jr(n, t);
2586
2586
  }
2587
- function $s(e, t = {}) {
2587
+ function As(e, t = {}) {
2588
2588
  let n = e;
2589
2589
  return typeof t.size < "u" && (ee(n, { size: t.size }), n = bt(n, { dir: "right" })), new TextDecoder().decode(n);
2590
2590
  }
2591
- function we(e) {
2591
+ function xe(e) {
2592
2592
  return typeof e[0] == "string" ? gt(e) : Ss(e);
2593
2593
  }
2594
2594
  function Ss(e) {
@@ -2630,7 +2630,7 @@ function wt({ param: e, value: t }) {
2630
2630
  return Ns(t, { length: r, param: { ...e, type: s } });
2631
2631
  }
2632
2632
  if (e.type === "tuple")
2633
- return Bs(t, {
2633
+ return Ds(t, {
2634
2634
  param: e
2635
2635
  });
2636
2636
  if (e.type === "address")
@@ -2647,7 +2647,7 @@ function wt({ param: e, value: t }) {
2647
2647
  if (e.type.startsWith("bytes"))
2648
2648
  return Ms(t, { param: e });
2649
2649
  if (e.type === "string")
2650
- return Ds(t);
2650
+ return Bs(t);
2651
2651
  throw new Rr(e.type, {
2652
2652
  docsPath: "/docs/contract/encodeAbiParameters"
2653
2653
  });
@@ -2656,25 +2656,25 @@ function xt(e) {
2656
2656
  let t = 0;
2657
2657
  for (let i = 0; i < e.length; i++) {
2658
2658
  const { dynamic: a, encoded: o } = e[i];
2659
- a ? t += 32 : t += R(o);
2659
+ a ? t += 32 : t += O(o);
2660
2660
  }
2661
2661
  const n = [], r = [];
2662
2662
  let s = 0;
2663
2663
  for (let i = 0; i < e.length; i++) {
2664
2664
  const { dynamic: a, encoded: o } = e[i];
2665
- a ? (n.push(C(t + s, { size: 32 })), r.push(o), s += R(o)) : n.push(o);
2665
+ a ? (n.push(C(t + s, { size: 32 })), r.push(o), s += O(o)) : n.push(o);
2666
2666
  }
2667
- return we([...n, ...r]);
2667
+ return xe([...n, ...r]);
2668
2668
  }
2669
2669
  function Is(e) {
2670
- if (!fe(e))
2670
+ if (!ye(e))
2671
2671
  throw new Me({ address: e });
2672
- return { dynamic: !1, encoded: ue(e.toLowerCase()) };
2672
+ return { dynamic: !1, encoded: le(e.toLowerCase()) };
2673
2673
  }
2674
2674
  function Ns(e, { length: t, param: n }) {
2675
2675
  const r = t === null;
2676
2676
  if (!Array.isArray(e))
2677
- throw new Dr(e);
2677
+ throw new Br(e);
2678
2678
  if (!r && e.length !== t)
2679
2679
  throw new Cr({
2680
2680
  expectedLength: t,
@@ -2693,7 +2693,7 @@ function Ns(e, { length: t, param: n }) {
2693
2693
  const o = C(i.length, { size: 32 });
2694
2694
  return {
2695
2695
  dynamic: !0,
2696
- encoded: i.length > 0 ? we([o, a]) : o
2696
+ encoded: i.length > 0 ? xe([o, a]) : o
2697
2697
  };
2698
2698
  }
2699
2699
  if (s)
@@ -2701,19 +2701,19 @@ function Ns(e, { length: t, param: n }) {
2701
2701
  }
2702
2702
  return {
2703
2703
  dynamic: !1,
2704
- encoded: we(i.map(({ encoded: a }) => a))
2704
+ encoded: xe(i.map(({ encoded: a }) => a))
2705
2705
  };
2706
2706
  }
2707
2707
  function Ms(e, { param: t }) {
2708
- const [, n] = t.type.split("bytes"), r = R(e);
2708
+ const [, n] = t.type.split("bytes"), r = O(e);
2709
2709
  if (!n) {
2710
2710
  let s = e;
2711
- return r % 32 !== 0 && (s = ue(s, {
2711
+ return r % 32 !== 0 && (s = le(s, {
2712
2712
  dir: "right",
2713
2713
  size: Math.ceil((e.length - 2) / 2 / 32) * 32
2714
2714
  })), {
2715
2715
  dynamic: !0,
2716
- encoded: we([ue(C(r, { size: 32 })), s])
2716
+ encoded: xe([le(C(r, { size: 32 })), s])
2717
2717
  };
2718
2718
  }
2719
2719
  if (r !== Number.parseInt(n, 10))
@@ -2721,12 +2721,12 @@ function Ms(e, { param: t }) {
2721
2721
  expectedSize: Number.parseInt(n, 10),
2722
2722
  value: e
2723
2723
  });
2724
- return { dynamic: !1, encoded: ue(e, { dir: "right" }) };
2724
+ return { dynamic: !1, encoded: le(e, { dir: "right" }) };
2725
2725
  }
2726
2726
  function Rs(e) {
2727
2727
  if (typeof e != "boolean")
2728
2728
  throw new p(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
2729
- return { dynamic: !1, encoded: ue(Xt(e)) };
2729
+ return { dynamic: !1, encoded: le(Xt(e)) };
2730
2730
  }
2731
2731
  function Os(e, { signed: t, size: n = 256 }) {
2732
2732
  if (typeof n == "number") {
@@ -2748,21 +2748,21 @@ function Os(e, { signed: t, size: n = 256 }) {
2748
2748
  })
2749
2749
  };
2750
2750
  }
2751
- function Ds(e) {
2752
- const t = Jt(e), n = Math.ceil(R(t) / 32), r = [];
2751
+ function Bs(e) {
2752
+ const t = Jt(e), n = Math.ceil(O(t) / 32), r = [];
2753
2753
  for (let s = 0; s < n; s++)
2754
- r.push(ue(Oe(t, s * 32, (s + 1) * 32), {
2754
+ r.push(le(Oe(t, s * 32, (s + 1) * 32), {
2755
2755
  dir: "right"
2756
2756
  }));
2757
2757
  return {
2758
2758
  dynamic: !0,
2759
- encoded: we([
2760
- ue(C(R(t), { size: 32 })),
2759
+ encoded: xe([
2760
+ le(C(O(t), { size: 32 })),
2761
2761
  ...r
2762
2762
  ])
2763
2763
  };
2764
2764
  }
2765
- function Bs(e, { param: t }) {
2765
+ function Ds(e, { param: t }) {
2766
2766
  let n = !1;
2767
2767
  const r = [];
2768
2768
  for (let s = 0; s < t.components.length; s++) {
@@ -2774,7 +2774,7 @@ function Bs(e, { param: t }) {
2774
2774
  }
2775
2775
  return {
2776
2776
  dynamic: n,
2777
- encoded: n ? xt(r) : we(r.map(({ encoded: s }) => s))
2777
+ encoded: n ? xt(r) : xe(r.map(({ encoded: s }) => s))
2778
2778
  };
2779
2779
  }
2780
2780
  function Tt(e) {
@@ -2786,27 +2786,27 @@ function Tt(e) {
2786
2786
  }
2787
2787
  function yn(e, t) {
2788
2788
  const n = typeof t == "string" ? mt(t) : t, r = vs(n);
2789
- if (R(n) === 0 && e.length > 0)
2789
+ if (O(n) === 0 && e.length > 0)
2790
2790
  throw new yt();
2791
- if (R(t) && R(t) < 32)
2791
+ if (O(t) && O(t) < 32)
2792
2792
  throw new Sr({
2793
2793
  data: typeof t == "string" ? t : oe(t),
2794
2794
  params: e,
2795
- size: R(t)
2795
+ size: O(t)
2796
2796
  });
2797
2797
  let s = 0;
2798
2798
  const i = [];
2799
2799
  for (let a = 0; a < e.length; ++a) {
2800
2800
  const o = e[a];
2801
2801
  r.setPosition(s);
2802
- const [c, d] = he(r, o, {
2802
+ const [c, d] = ge(r, o, {
2803
2803
  staticPosition: 0
2804
2804
  });
2805
2805
  s += d, i.push(c);
2806
2806
  }
2807
2807
  return i;
2808
2808
  }
2809
- function he(e, t, { staticPosition: n }) {
2809
+ function ge(e, t, { staticPosition: n }) {
2810
2810
  const r = Tt(t.type);
2811
2811
  if (r) {
2812
2812
  const [s, i] = r;
@@ -2838,14 +2838,14 @@ function Ls(e, t, { length: n, staticPosition: r }) {
2838
2838
  const a = ae(e.readBytes(Xe)), o = r + a, c = o + Ut;
2839
2839
  e.setPosition(o);
2840
2840
  const d = ae(e.readBytes(Ut)), l = Ae(t);
2841
- let y = 0;
2841
+ let f = 0;
2842
2842
  const b = [];
2843
2843
  for (let m = 0; m < d; ++m) {
2844
- e.setPosition(c + (l ? m * 32 : y));
2845
- const [g, E] = he(e, t, {
2844
+ e.setPosition(c + (l ? m * 32 : f));
2845
+ const [g, v] = ge(e, t, {
2846
2846
  staticPosition: c
2847
2847
  });
2848
- y += E, b.push(g);
2848
+ f += v, b.push(g);
2849
2849
  }
2850
2850
  return e.setPosition(r + 32), [b, 32];
2851
2851
  }
@@ -2853,7 +2853,7 @@ function Ls(e, t, { length: n, staticPosition: r }) {
2853
2853
  const a = ae(e.readBytes(Xe)), o = r + a, c = [];
2854
2854
  for (let d = 0; d < n; ++d) {
2855
2855
  e.setPosition(o + d * 32);
2856
- const [l] = he(e, t, {
2856
+ const [l] = ge(e, t, {
2857
2857
  staticPosition: o
2858
2858
  });
2859
2859
  c.push(l);
@@ -2863,7 +2863,7 @@ function Ls(e, t, { length: n, staticPosition: r }) {
2863
2863
  let s = 0;
2864
2864
  const i = [];
2865
2865
  for (let a = 0; a < n; ++a) {
2866
- const [o, c] = he(e, t, {
2866
+ const [o, c] = ge(e, t, {
2867
2867
  staticPosition: r + s
2868
2868
  });
2869
2869
  s += c, i.push(o);
@@ -2871,7 +2871,7 @@ function Ls(e, t, { length: n, staticPosition: r }) {
2871
2871
  return [i, s];
2872
2872
  }
2873
2873
  function Fs(e) {
2874
- return [As(e.readBytes(32), { size: 32 }), 32];
2874
+ return [$s(e.readBytes(32), { size: 32 }), 32];
2875
2875
  }
2876
2876
  function js(e, t, { staticPosition: n }) {
2877
2877
  const [r, s] = t.type.split("bytes");
@@ -2901,15 +2901,15 @@ function _s(e, t, { staticPosition: n }) {
2901
2901
  for (let c = 0; c < t.components.length; ++c) {
2902
2902
  const d = t.components[c];
2903
2903
  e.setPosition(o + i);
2904
- const [l, y] = he(e, d, {
2904
+ const [l, f] = ge(e, d, {
2905
2905
  staticPosition: o
2906
2906
  });
2907
- i += y, s[r ? c : d?.name] = l;
2907
+ i += f, s[r ? c : d?.name] = l;
2908
2908
  }
2909
2909
  return e.setPosition(n + 32), [s, 32];
2910
2910
  }
2911
2911
  for (let a = 0; a < t.components.length; ++a) {
2912
- const o = t.components[a], [c, d] = he(e, o, {
2912
+ const o = t.components[a], [c, d] = ge(e, o, {
2913
2913
  staticPosition: n
2914
2914
  });
2915
2915
  s[r ? a : o?.name] = c, i += d;
@@ -2922,7 +2922,7 @@ function Gs(e, { staticPosition: t }) {
2922
2922
  const s = ae(e.readBytes(32));
2923
2923
  if (s === 0)
2924
2924
  return e.setPosition(t + 32), ["", 32];
2925
- const i = e.readBytes(s, 32), a = $s(bt(i));
2925
+ const i = e.readBytes(s, 32), a = As(bt(i));
2926
2926
  return e.setPosition(t + 32), [a, 32];
2927
2927
  }
2928
2928
  function Ae(e) {
@@ -2939,7 +2939,7 @@ function Vs(e) {
2939
2939
  return Hs(e);
2940
2940
  }
2941
2941
  const Ws = "1.2.3";
2942
- let K = class Je extends Error {
2942
+ let V = class Je extends Error {
2943
2943
  constructor(t, n = {}) {
2944
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 = [
2945
2945
  t || "An error occurred.",
@@ -2999,7 +2999,7 @@ function Qe(e) {
2999
2999
  }
3000
3000
  return "indexed" in e && e.indexed && (t = `${t} indexed`), e.name ? `${t} ${e.name}` : t;
3001
3001
  }
3002
- function Pe(e) {
3002
+ function $e(e) {
3003
3003
  let t = "";
3004
3004
  const n = e.length;
3005
3005
  for (let r = 0; r < n; r++) {
@@ -3009,7 +3009,7 @@ function Pe(e) {
3009
3009
  return t;
3010
3010
  }
3011
3011
  function Ks(e) {
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";
3012
+ return e.type === "function" ? `function ${e.name}(${$e(e.inputs)})${e.stateMutability && e.stateMutability !== "nonpayable" ? ` ${e.stateMutability}` : ""}${e.outputs?.length ? ` returns (${$e(e.outputs)})` : ""}` : e.type === "event" ? `event ${e.name}(${$e(e.inputs)})` : e.type === "error" ? `error ${e.name}(${$e(e.inputs)})` : e.type === "constructor" ? `constructor(${$e(e.inputs)})${e.stateMutability === "payable" ? " payable" : ""}` : e.type === "fallback" ? `fallback() external${e.stateMutability === "payable" ? " payable" : ""}` : "receive() external payable";
3013
3013
  }
3014
3014
  const gn = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
3015
3015
  function Ys(e) {
@@ -3062,7 +3062,7 @@ const oi = /* @__PURE__ */ new Set(["indexed"]), qe = /* @__PURE__ */ new Set([
3062
3062
  "memory",
3063
3063
  "storage"
3064
3064
  ]);
3065
- class ci extends K {
3065
+ class ci extends V {
3066
3066
  constructor({ type: t }) {
3067
3067
  super("Unknown type.", {
3068
3068
  metaMessages: [
@@ -3076,7 +3076,7 @@ class ci extends K {
3076
3076
  });
3077
3077
  }
3078
3078
  }
3079
- class ui extends K {
3079
+ class ui extends V {
3080
3080
  constructor({ type: t }) {
3081
3081
  super("Unknown type.", {
3082
3082
  metaMessages: [`Type "${t}" is not a valid ABI type.`]
@@ -3088,7 +3088,7 @@ class ui extends K {
3088
3088
  });
3089
3089
  }
3090
3090
  }
3091
- class di extends K {
3091
+ class di extends V {
3092
3092
  constructor({ param: t }) {
3093
3093
  super("Invalid ABI parameter.", {
3094
3094
  details: t
@@ -3100,7 +3100,7 @@ class di extends K {
3100
3100
  });
3101
3101
  }
3102
3102
  }
3103
- class li extends K {
3103
+ class li extends V {
3104
3104
  constructor({ param: t, name: n }) {
3105
3105
  super("Invalid ABI parameter.", {
3106
3106
  details: t,
@@ -3115,7 +3115,7 @@ class li extends K {
3115
3115
  });
3116
3116
  }
3117
3117
  }
3118
- class fi extends K {
3118
+ class fi extends V {
3119
3119
  constructor({ param: t, type: n, modifier: r }) {
3120
3120
  super("Invalid ABI parameter.", {
3121
3121
  details: t,
@@ -3130,7 +3130,7 @@ class fi extends K {
3130
3130
  });
3131
3131
  }
3132
3132
  }
3133
- class pi extends K {
3133
+ class pi extends V {
3134
3134
  constructor({ param: t, type: n, modifier: r }) {
3135
3135
  super("Invalid ABI parameter.", {
3136
3136
  details: t,
@@ -3146,7 +3146,7 @@ class pi extends K {
3146
3146
  });
3147
3147
  }
3148
3148
  }
3149
- class yi extends K {
3149
+ class yi extends V {
3150
3150
  constructor({ abiParameter: t }) {
3151
3151
  super("Invalid ABI parameter.", {
3152
3152
  details: JSON.stringify(t, null, 2),
@@ -3159,7 +3159,7 @@ class yi extends K {
3159
3159
  });
3160
3160
  }
3161
3161
  }
3162
- class Te extends K {
3162
+ class ve extends V {
3163
3163
  constructor({ signature: t, type: n }) {
3164
3164
  super(`Invalid ${n} signature.`, {
3165
3165
  details: t
@@ -3171,7 +3171,7 @@ class Te extends K {
3171
3171
  });
3172
3172
  }
3173
3173
  }
3174
- class bi extends K {
3174
+ class bi extends V {
3175
3175
  constructor({ signature: t }) {
3176
3176
  super("Unknown signature.", {
3177
3177
  details: t
@@ -3183,7 +3183,7 @@ class bi extends K {
3183
3183
  });
3184
3184
  }
3185
3185
  }
3186
- class mi extends K {
3186
+ class mi extends V {
3187
3187
  constructor({ signature: t }) {
3188
3188
  super("Invalid struct signature.", {
3189
3189
  details: t,
@@ -3196,7 +3196,7 @@ class mi extends K {
3196
3196
  });
3197
3197
  }
3198
3198
  }
3199
- class hi extends K {
3199
+ class hi extends V {
3200
3200
  constructor({ type: t }) {
3201
3201
  super("Circular reference detected.", {
3202
3202
  metaMessages: [`Struct "${t}" is a circular reference.`]
@@ -3208,7 +3208,7 @@ class hi extends K {
3208
3208
  });
3209
3209
  }
3210
3210
  }
3211
- class gi extends K {
3211
+ class gi extends V {
3212
3212
  constructor({ current: t, depth: n }) {
3213
3213
  super("Unbalanced parentheses.", {
3214
3214
  metaMessages: [
@@ -3300,7 +3300,7 @@ function xi(e, t = {}) {
3300
3300
  if (ti(e))
3301
3301
  return Pi(e, t);
3302
3302
  if (ri(e))
3303
- return Ai(e);
3303
+ return $i(e);
3304
3304
  if (ai(e))
3305
3305
  return {
3306
3306
  type: "receive",
@@ -3311,10 +3311,10 @@ function xi(e, t = {}) {
3311
3311
  function Ti(e, t = {}) {
3312
3312
  const n = qs(e);
3313
3313
  if (!n)
3314
- throw new Te({ signature: e, type: "function" });
3314
+ throw new ve({ signature: e, type: "function" });
3315
3315
  const r = X(n.parameters), s = [], i = r.length;
3316
3316
  for (let o = 0; o < i; o++)
3317
- s.push(pe(r[o], {
3317
+ s.push(be(r[o], {
3318
3318
  modifiers: qe,
3319
3319
  structs: t,
3320
3320
  type: "function"
@@ -3323,7 +3323,7 @@ function Ti(e, t = {}) {
3323
3323
  if (n.returns) {
3324
3324
  const o = X(n.returns), c = o.length;
3325
3325
  for (let d = 0; d < c; d++)
3326
- a.push(pe(o[d], {
3326
+ a.push(be(o[d], {
3327
3327
  modifiers: qe,
3328
3328
  structs: t,
3329
3329
  type: "function"
@@ -3340,10 +3340,10 @@ function Ti(e, t = {}) {
3340
3340
  function vi(e, t = {}) {
3341
3341
  const n = Js(e);
3342
3342
  if (!n)
3343
- throw new Te({ signature: e, type: "event" });
3343
+ throw new ve({ signature: e, type: "event" });
3344
3344
  const r = X(n.parameters), s = [], i = r.length;
3345
3345
  for (let a = 0; a < i; a++)
3346
- s.push(pe(r[a], {
3346
+ s.push(be(r[a], {
3347
3347
  modifiers: oi,
3348
3348
  structs: t,
3349
3349
  type: "event"
@@ -3353,40 +3353,40 @@ function vi(e, t = {}) {
3353
3353
  function Ei(e, t = {}) {
3354
3354
  const n = Zs(e);
3355
3355
  if (!n)
3356
- throw new Te({ signature: e, type: "error" });
3356
+ throw new ve({ signature: e, type: "error" });
3357
3357
  const r = X(n.parameters), s = [], i = r.length;
3358
3358
  for (let a = 0; a < i; a++)
3359
- s.push(pe(r[a], { structs: t, type: "error" }));
3359
+ s.push(be(r[a], { structs: t, type: "error" }));
3360
3360
  return { name: n.name, type: "error", inputs: s };
3361
3361
  }
3362
3362
  function Pi(e, t = {}) {
3363
3363
  const n = ni(e);
3364
3364
  if (!n)
3365
- throw new Te({ signature: e, type: "constructor" });
3365
+ throw new ve({ signature: e, type: "constructor" });
3366
3366
  const r = X(n.parameters), s = [], i = r.length;
3367
3367
  for (let a = 0; a < i; a++)
3368
- s.push(pe(r[a], { structs: t, type: "constructor" }));
3368
+ s.push(be(r[a], { structs: t, type: "constructor" }));
3369
3369
  return {
3370
3370
  type: "constructor",
3371
3371
  stateMutability: n.stateMutability ?? "nonpayable",
3372
3372
  inputs: s
3373
3373
  };
3374
3374
  }
3375
- function Ai(e) {
3375
+ function $i(e) {
3376
3376
  const t = si(e);
3377
3377
  if (!t)
3378
- throw new Te({ signature: e, type: "fallback" });
3378
+ throw new ve({ signature: e, type: "fallback" });
3379
3379
  return {
3380
3380
  type: "fallback",
3381
3381
  stateMutability: t.stateMutability ?? "nonpayable"
3382
3382
  };
3383
3383
  }
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$/;
3385
- function pe(e, t) {
3384
+ const Ai = /^(?<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$/;
3385
+ function be(e, t) {
3386
3386
  const n = wi(e, t?.type, t?.structs);
3387
3387
  if (Ve.has(n))
3388
3388
  return Ve.get(n);
3389
- const r = hn.test(e), s = ce(r ? Si : $i, e);
3389
+ const r = hn.test(e), s = ce(r ? Si : Ai, e);
3390
3390
  if (!s)
3391
3391
  throw new di({ param: e });
3392
3392
  if (s.name && Ii(s.name))
@@ -3395,9 +3395,9 @@ function pe(e, t) {
3395
3395
  let c, d = {};
3396
3396
  if (r) {
3397
3397
  c = "tuple";
3398
- const y = X(s.type), b = [], m = y.length;
3398
+ const f = X(s.type), b = [], m = f.length;
3399
3399
  for (let g = 0; g < m; g++)
3400
- b.push(pe(y[g], { structs: o }));
3400
+ b.push(be(f[g], { structs: o }));
3401
3401
  d = { components: b };
3402
3402
  } else if (s.type in o)
3403
3403
  c = "tuple", d = { components: o[s.type] };
@@ -3405,7 +3405,7 @@ function pe(e, t) {
3405
3405
  c = `${s.type}256`;
3406
3406
  else if (s.type === "address payable")
3407
3407
  c = "address";
3408
- else if (c = s.type, t?.type !== "struct" && !An(c))
3408
+ else if (c = s.type, t?.type !== "struct" && !$n(c))
3409
3409
  throw new ui({ type: c });
3410
3410
  if (s.modifier) {
3411
3411
  if (!t?.modifiers?.has?.(s.modifier))
@@ -3450,7 +3450,7 @@ function X(e, t = [], n = "", r = 0) {
3450
3450
  throw new gi({ current: n, depth: r });
3451
3451
  return t.push(n.trim()), t;
3452
3452
  }
3453
- function An(e) {
3453
+ function $n(e) {
3454
3454
  return e === "address" || e === "bool" || e === "function" || e === "string" || bn.test(e) || mn.test(e);
3455
3455
  }
3456
3456
  const ki = /^(?: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)$/;
@@ -3468,16 +3468,16 @@ function Mi(e) {
3468
3468
  continue;
3469
3469
  const c = ei(o);
3470
3470
  if (!c)
3471
- throw new Te({ signature: o, type: "struct" });
3472
- const d = c.properties.split(";"), l = [], y = d.length;
3473
- for (let b = 0; b < y; b++) {
3471
+ throw new ve({ signature: o, type: "struct" });
3472
+ const d = c.properties.split(";"), l = [], f = d.length;
3473
+ for (let b = 0; b < f; b++) {
3474
3474
  const g = d[b].trim();
3475
3475
  if (!g)
3476
3476
  continue;
3477
- const E = pe(g, {
3477
+ const v = be(g, {
3478
3478
  type: "struct"
3479
3479
  });
3480
- l.push(E);
3480
+ l.push(v);
3481
3481
  }
3482
3482
  if (!l.length)
3483
3483
  throw new mi({ signature: o });
@@ -3486,12 +3486,12 @@ function Mi(e) {
3486
3486
  const r = {}, s = Object.entries(t), i = s.length;
3487
3487
  for (let a = 0; a < i; a++) {
3488
3488
  const [o, c] = s[a];
3489
- r[o] = $n(c, t);
3489
+ r[o] = An(c, t);
3490
3490
  }
3491
3491
  return r;
3492
3492
  }
3493
3493
  const Ri = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
3494
- function $n(e = [], t = {}, n = /* @__PURE__ */ new Set()) {
3494
+ function An(e = [], t = {}, n = /* @__PURE__ */ new Set()) {
3495
3495
  const r = [], s = e.length;
3496
3496
  for (let i = 0; i < s; i++) {
3497
3497
  const a = e[i];
@@ -3508,9 +3508,9 @@ function $n(e = [], t = {}, n = /* @__PURE__ */ new Set()) {
3508
3508
  r.push({
3509
3509
  ...a,
3510
3510
  type: `tuple${d ?? ""}`,
3511
- components: $n(t[l], t, /* @__PURE__ */ new Set([...n, l]))
3511
+ components: An(t[l], t, /* @__PURE__ */ new Set([...n, l]))
3512
3512
  });
3513
- } else if (An(l))
3513
+ } else if ($n(l))
3514
3514
  r.push(a);
3515
3515
  else
3516
3516
  throw new ci({ type: l });
@@ -3551,16 +3551,16 @@ function Oi(e) {
3551
3551
  throw new p("Unable to normalize signature.");
3552
3552
  return s;
3553
3553
  }
3554
- const Di = (e) => {
3554
+ const Bi = (e) => {
3555
3555
  const t = typeof e == "string" ? e : Ks(e);
3556
3556
  return Oi(t);
3557
3557
  };
3558
3558
  function Cn(e) {
3559
- return Vs(Di(e));
3559
+ return Vs(Bi(e));
3560
3560
  }
3561
- const Bi = Cn, vt = (e) => Oe(Cn(e), 0, 4);
3561
+ const Di = Cn, vt = (e) => Oe(Cn(e), 0, 4);
3562
3562
  function Et(e) {
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);
3563
+ const { abi: t, args: n = [], name: r } = e, s = Se(r, { strict: !1 }), i = t.filter((o) => s ? o.type === "function" ? vt(o) === r : o.type === "event" ? Di(o) === r : !1 : "name" in o && o.name === r);
3564
3564
  if (i.length === 0)
3565
3565
  return;
3566
3566
  if (i.length === 1)
@@ -3577,8 +3577,8 @@ function Et(e) {
3577
3577
  if (!o.inputs || o.inputs.length === 0 || o.inputs.length !== n.length)
3578
3578
  continue;
3579
3579
  if (n.every((d, l) => {
3580
- const y = "inputs" in o && o.inputs[l];
3581
- return y ? et(d, y) : !1;
3580
+ const f = "inputs" in o && o.inputs[l];
3581
+ return f ? et(d, f) : !1;
3582
3582
  })) {
3583
3583
  if (a && "inputs" in a && a.inputs) {
3584
3584
  const d = kn(o.inputs, a.inputs, n);
@@ -3600,7 +3600,7 @@ function et(e, t) {
3600
3600
  const n = typeof e, r = t.type;
3601
3601
  switch (r) {
3602
3602
  case "address":
3603
- return fe(e, { strict: !1 });
3603
+ return ye(e, { strict: !1 });
3604
3604
  case "bool":
3605
3605
  return n === "boolean";
3606
3606
  case "function":
@@ -3621,7 +3621,7 @@ function kn(e, t, n) {
3621
3621
  if (s.type === "tuple" && i.type === "tuple" && "components" in s && "components" in i)
3622
3622
  return kn(s.components, i.components, n[r]);
3623
3623
  const a = [s.type, i.type];
3624
- if (a.includes("address") && a.includes("bytes20") ? !0 : a.includes("address") && a.includes("string") ? fe(n[r], { strict: !1 }) : a.includes("address") && a.includes("bytes") ? fe(n[r], { strict: !1 }) : !1)
3624
+ if (a.includes("address") && a.includes("bytes20") ? !0 : a.includes("address") && a.includes("string") ? ye(n[r], { strict: !1 }) : a.includes("address") && a.includes("bytes") ? ye(n[r], { strict: !1 }) : !1)
3625
3625
  return a;
3626
3626
  }
3627
3627
  }
@@ -3663,7 +3663,7 @@ function Ui(e) {
3663
3663
  throw new Ne(void 0, { docsPath: Ft });
3664
3664
  return {
3665
3665
  abi: [s],
3666
- functionName: vt(ge(s))
3666
+ functionName: vt(we(s))
3667
3667
  };
3668
3668
  }
3669
3669
  function Nn(e) {
@@ -3746,7 +3746,7 @@ function _i(e) {
3746
3746
  const { abi: t, data: n } = e, r = Oe(n, 0, 4);
3747
3747
  if (r === "0x")
3748
3748
  throw new yt();
3749
- const i = [...t || [], ji, zi].find((a) => a.type === "error" && r === vt(ge(a)));
3749
+ const i = [...t || [], ji, zi].find((a) => a.type === "error" && r === vt(we(a)));
3750
3750
  if (!i)
3751
3751
  throw new Vt(r, {
3752
3752
  docsPath: "/docs/contract/decodeErrorResult"
@@ -3757,10 +3757,10 @@ function _i(e) {
3757
3757
  errorName: i.name
3758
3758
  };
3759
3759
  }
3760
- const At = (e, t, n) => JSON.stringify(e, (r, s) => typeof s == "bigint" ? s.toString() : s, n);
3760
+ const $t = (e, t, n) => JSON.stringify(e, (r, s) => typeof s == "bigint" ? s.toString() : s, n);
3761
3761
  function Rn({ abiItem: e, args: t, includeFunctionName: n = !0, includeName: r = !1 }) {
3762
3762
  if ("name" in e && "inputs" in e && e.inputs)
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(", ")})`;
3763
+ return `${n ? e.name : ""}(${e.inputs.map((s, i) => `${r && s.name ? `${s.name}: ` : ""}${typeof t[i] == "object" ? $t(t[i]) : t[i]}`).join(", ")})`;
3764
3764
  }
3765
3765
  const Gi = {
3766
3766
  gwei: 9,
@@ -3782,7 +3782,7 @@ function On(e, t) {
3782
3782
  function Vi(e, t = "wei") {
3783
3783
  return On(e, Gi[t]);
3784
3784
  }
3785
- function le(e, t = "wei") {
3785
+ function pe(e, t = "wei") {
3786
3786
  return On(e, Hi[t]);
3787
3787
  }
3788
3788
  class Wi extends p {
@@ -3816,34 +3816,34 @@ function Yi(e) {
3816
3816
  }, ` State Override:
3817
3817
  `).slice(0, -1);
3818
3818
  }
3819
- function Dn(e) {
3819
+ function Bn(e) {
3820
3820
  const t = Object.entries(e).map(([r, s]) => s === void 0 || s === !1 ? null : [r, s]).filter(Boolean), n = t.reduce((r, [s]) => Math.max(r, s.length), 0);
3821
3821
  return t.map(([r, s]) => ` ${`${r}:`.padEnd(n + 1)} ${s}`).join(`
3822
3822
  `);
3823
3823
  }
3824
- const Zi = (e) => e, Bn = (e) => e;
3824
+ const Zi = (e) => e, Dn = (e) => e;
3825
3825
  class Xi extends p {
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 }) {
3826
+ constructor(t, { account: n, docsPath: r, chain: s, data: i, gas: a, gasPrice: o, maxFeePerGas: c, maxPriorityFeePerGas: d, nonce: l, to: f, value: b, stateOverride: m }) {
3827
3827
  const g = n ? Pt(n) : void 0;
3828
- let E = Dn({
3828
+ let v = Bn({
3829
3829
  from: g?.address,
3830
- to: y,
3830
+ to: f,
3831
3831
  value: typeof b < "u" && `${Vi(b)} ${s?.nativeCurrency?.symbol || "ETH"}`,
3832
3832
  data: i,
3833
3833
  gas: a,
3834
- gasPrice: typeof o < "u" && `${le(o)} gwei`,
3835
- maxFeePerGas: typeof c < "u" && `${le(c)} gwei`,
3836
- maxPriorityFeePerGas: typeof d < "u" && `${le(d)} gwei`,
3834
+ gasPrice: typeof o < "u" && `${pe(o)} gwei`,
3835
+ maxFeePerGas: typeof c < "u" && `${pe(c)} gwei`,
3836
+ maxPriorityFeePerGas: typeof d < "u" && `${pe(d)} gwei`,
3837
3837
  nonce: l
3838
3838
  });
3839
- m && (E += `
3839
+ m && (v += `
3840
3840
  ${Yi(m)}`), super(t.shortMessage, {
3841
3841
  cause: t,
3842
3842
  docsPath: r,
3843
3843
  metaMessages: [
3844
3844
  ...t.metaMessages ? [...t.metaMessages, " "] : [],
3845
3845
  "Raw Call Arguments:",
3846
- E
3846
+ v
3847
3847
  ].filter(Boolean),
3848
3848
  name: "CallExecutionError"
3849
3849
  }), Object.defineProperty(this, "cause", {
@@ -3861,7 +3861,7 @@ class Ji extends p {
3861
3861
  args: r,
3862
3862
  includeFunctionName: !1,
3863
3863
  includeName: !1
3864
- }) : void 0, l = c ? ge(c, { includeName: !0 }) : void 0, y = Dn({
3864
+ }) : void 0, l = c ? we(c, { includeName: !0 }) : void 0, f = Bn({
3865
3865
  address: s && Zi(s),
3866
3866
  function: l,
3867
3867
  args: d && d !== "()" && `${[...Array(a?.length ?? 0).keys()].map(() => " ").join("")}${d}`,
@@ -3872,8 +3872,8 @@ class Ji extends p {
3872
3872
  docsPath: i,
3873
3873
  metaMessages: [
3874
3874
  ...t.metaMessages ? [...t.metaMessages, " "] : [],
3875
- y && "Contract Call:",
3876
- y
3875
+ f && "Contract Call:",
3876
+ f
3877
3877
  ].filter(Boolean),
3878
3878
  name: "ContractFunctionExecutionError"
3879
3879
  }), Object.defineProperty(this, "abi", {
@@ -3920,14 +3920,14 @@ class Qi extends p {
3920
3920
  if (n && n !== "0x")
3921
3921
  try {
3922
3922
  a = _i({ abi: t, data: n });
3923
- const { abiItem: l, errorName: y, args: b } = a;
3924
- if (y === "Error")
3923
+ const { abiItem: l, errorName: f, args: b } = a;
3924
+ if (f === "Error")
3925
3925
  c = b[0];
3926
- else if (y === "Panic") {
3926
+ else if (f === "Panic") {
3927
3927
  const [m] = b;
3928
3928
  c = Fi[m];
3929
3929
  } else {
3930
- const m = l ? ge(l, { includeName: !0 }) : void 0, g = l && b ? Rn({
3930
+ const m = l ? we(l, { includeName: !0 }) : void 0, g = l && b ? Rn({
3931
3931
  abiItem: l,
3932
3932
  args: b,
3933
3933
  includeFunctionName: !1,
@@ -3935,7 +3935,7 @@ class Qi extends p {
3935
3935
  }) : void 0;
3936
3936
  o = [
3937
3937
  m ? `Error: ${m}` : "",
3938
- g && g !== "()" ? ` ${[...Array(y?.length ?? 0).keys()].map(() => " ").join("")}${g}` : ""
3938
+ g && g !== "()" ? ` ${[...Array(f?.length ?? 0).keys()].map(() => " ").join("")}${g}` : ""
3939
3939
  ];
3940
3940
  }
3941
3941
  } catch (l) {
@@ -4032,8 +4032,8 @@ class io extends p {
4032
4032
  details: r,
4033
4033
  metaMessages: [
4034
4034
  i && `Status: ${i}`,
4035
- `URL: ${Bn(a)}`,
4036
- t && `Request body: ${At(t)}`
4035
+ `URL: ${Dn(a)}`,
4036
+ t && `Request body: ${$t(t)}`
4037
4037
  ].filter(Boolean),
4038
4038
  name: "HttpRequestError"
4039
4039
  }), Object.defineProperty(this, "body", {
@@ -4064,7 +4064,7 @@ class Ln extends p {
4064
4064
  super("RPC Request failed.", {
4065
4065
  cause: n,
4066
4066
  details: n.message,
4067
- metaMessages: [`URL: ${Bn(r)}`, `Request body: ${At(t)}`],
4067
+ metaMessages: [`URL: ${Dn(r)}`, `Request body: ${$t(t)}`],
4068
4068
  name: "RpcRequestError"
4069
4069
  }), Object.defineProperty(this, "code", {
4070
4070
  enumerable: !0,
@@ -4136,11 +4136,11 @@ Object.defineProperty(Fe, "code", {
4136
4136
  });
4137
4137
  const ra = 3;
4138
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({
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: f, shortMessage: b } = o, m = e instanceof yt ? new qi({ functionName: i }) : [ra, Le.code].includes(c) && (d || l || f || b) || c === Fe.code && l === "execution reverted" && d ? new Qi({
4140
4140
  abi: t,
4141
4141
  data: typeof d == "object" ? d.data : d,
4142
4142
  functionName: i,
4143
- message: o instanceof Ln ? l : b ?? y
4143
+ message: o instanceof Ln ? l : b ?? f
4144
4144
  }) : e;
4145
4145
  return new Ji(m, {
4146
4146
  abi: t,
@@ -4155,20 +4155,20 @@ const ia = "0.1.1";
4155
4155
  function aa() {
4156
4156
  return ia;
4157
4157
  }
4158
- class U extends Error {
4158
+ class z extends Error {
4159
4159
  static setStaticOptions(t) {
4160
- U.prototype.docsOrigin = t.docsOrigin, U.prototype.showVersion = t.showVersion, U.prototype.version = t.version;
4160
+ z.prototype.docsOrigin = t.docsOrigin, z.prototype.showVersion = t.showVersion, z.prototype.version = t.version;
4161
4161
  }
4162
4162
  constructor(t, n = {}) {
4163
4163
  const r = (() => {
4164
- if (n.cause instanceof U) {
4164
+ if (n.cause instanceof z) {
4165
4165
  if (n.cause.details)
4166
4166
  return n.cause.details;
4167
4167
  if (n.cause.shortMessage)
4168
4168
  return n.cause.shortMessage;
4169
4169
  }
4170
4170
  return n.cause && "details" in n.cause && typeof n.cause.details == "string" ? n.cause.details : n.cause?.message ? n.cause.message : n.details;
4171
- })(), s = n.cause instanceof U && n.cause.docsPath || n.docsPath, i = n.docsOrigin ?? U.prototype.docsOrigin, a = `${i}${s ?? ""}`, o = !!(n.version ?? U.prototype.showVersion), c = n.version ?? U.prototype.version, d = [
4171
+ })(), s = n.cause instanceof z && n.cause.docsPath || n.docsPath, i = n.docsOrigin ?? z.prototype.docsOrigin, a = `${i}${s ?? ""}`, o = !!(n.version ?? z.prototype.showVersion), c = n.version ?? z.prototype.version, d = [
4172
4172
  t || "An error occurred.",
4173
4173
  ...n.metaMessages ? ["", ...n.metaMessages] : [],
4174
4174
  ...r || s || o ? [
@@ -4230,7 +4230,7 @@ class U extends Error {
4230
4230
  return jn(this, t);
4231
4231
  }
4232
4232
  }
4233
- Object.defineProperty(U, "defaultStaticOptions", {
4233
+ Object.defineProperty(z, "defaultStaticOptions", {
4234
4234
  enumerable: !0,
4235
4235
  configurable: !0,
4236
4236
  writable: !0,
@@ -4240,7 +4240,7 @@ Object.defineProperty(U, "defaultStaticOptions", {
4240
4240
  version: `ox@${aa()}`
4241
4241
  }
4242
4242
  });
4243
- U.setStaticOptions(U.defaultStaticOptions);
4243
+ z.setStaticOptions(z.defaultStaticOptions);
4244
4244
  function jn(e, t) {
4245
4245
  return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause ? jn(e.cause, t) : t ? null : e;
4246
4246
  }
@@ -4278,7 +4278,7 @@ function ie(e, t = {}) {
4278
4278
  function ca(e, t) {
4279
4279
  return oa(e, { dir: "left", size: t });
4280
4280
  }
4281
- class ua extends U {
4281
+ class ua extends z {
4282
4282
  constructor({ max: t, min: n, signed: r, size: s, value: i }) {
4283
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", {
4284
4284
  enumerable: !0,
@@ -4288,7 +4288,7 @@ class ua extends U {
4288
4288
  });
4289
4289
  }
4290
4290
  }
4291
- class da extends U {
4291
+ class da extends z {
4292
4292
  constructor({ size: t, targetSize: n, type: r }) {
4293
4293
  super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`), Object.defineProperty(this, "name", {
4294
4294
  enumerable: !0,
@@ -4341,7 +4341,7 @@ function zn(e) {
4341
4341
  return r;
4342
4342
  const s = t.find((a) => "type" in a && a.type === "constructor");
4343
4343
  if (!s)
4344
- throw new $r({ docsPath: Ke });
4344
+ throw new Ar({ docsPath: Ke });
4345
4345
  if (!("inputs" in s))
4346
4346
  throw new St({ docsPath: Ke });
4347
4347
  if (!s.inputs || s.inputs.length === 0)
@@ -4349,7 +4349,7 @@ function zn(e) {
4349
4349
  const i = pn(s.inputs, n);
4350
4350
  return gt([r, i]);
4351
4351
  }
4352
- class be extends p {
4352
+ class me extends p {
4353
4353
  constructor({ cause: t, message: n } = {}) {
4354
4354
  const r = n?.replace("execution reverted: ", "")?.replace("execution reverted", "");
4355
4355
  super(`Execution reverted ${r ? `with reason: ${r}` : "for an unknown reason"}.`, {
@@ -4358,27 +4358,27 @@ class be extends p {
4358
4358
  });
4359
4359
  }
4360
4360
  }
4361
- Object.defineProperty(be, "code", {
4361
+ Object.defineProperty(me, "code", {
4362
4362
  enumerable: !0,
4363
4363
  configurable: !0,
4364
4364
  writable: !0,
4365
4365
  value: 3
4366
4366
  });
4367
- Object.defineProperty(be, "nodeMessage", {
4367
+ Object.defineProperty(me, "nodeMessage", {
4368
4368
  enumerable: !0,
4369
4369
  configurable: !0,
4370
4370
  writable: !0,
4371
4371
  value: /execution reverted|gas required exceeds allowance/
4372
4372
  });
4373
- class De extends p {
4373
+ class Be extends p {
4374
4374
  constructor({ cause: t, maxFeePerGas: n } = {}) {
4375
- super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${le(n)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
4375
+ super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${pe(n)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
4376
4376
  cause: t,
4377
4377
  name: "FeeCapTooHighError"
4378
4378
  });
4379
4379
  }
4380
4380
  }
4381
- Object.defineProperty(De, "nodeMessage", {
4381
+ Object.defineProperty(Be, "nodeMessage", {
4382
4382
  enumerable: !0,
4383
4383
  configurable: !0,
4384
4384
  writable: !0,
@@ -4386,7 +4386,7 @@ Object.defineProperty(De, "nodeMessage", {
4386
4386
  });
4387
4387
  class nt extends p {
4388
4388
  constructor({ cause: t, maxFeePerGas: n } = {}) {
4389
- super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${le(n)}` : ""} gwei) cannot be lower than the block base fee.`, {
4389
+ super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${pe(n)}` : ""} gwei) cannot be lower than the block base fee.`, {
4390
4390
  cause: t,
4391
4391
  name: "FeeCapTooLowError"
4392
4392
  });
@@ -4504,10 +4504,10 @@ Object.defineProperty(ut, "nodeMessage", {
4504
4504
  writable: !0,
4505
4505
  value: /transaction type not valid/
4506
4506
  });
4507
- class Be extends p {
4507
+ class De extends p {
4508
4508
  constructor({ cause: t, maxPriorityFeePerGas: n, maxFeePerGas: r } = {}) {
4509
4509
  super([
4510
- `The provided tip (\`maxPriorityFeePerGas\`${n ? ` = ${le(n)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r ? ` = ${le(r)} gwei` : ""}).`
4510
+ `The provided tip (\`maxPriorityFeePerGas\`${n ? ` = ${pe(n)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r ? ` = ${pe(r)} gwei` : ""}).`
4511
4511
  ].join(`
4512
4512
  `), {
4513
4513
  cause: t,
@@ -4515,7 +4515,7 @@ class Be extends p {
4515
4515
  });
4516
4516
  }
4517
4517
  }
4518
- Object.defineProperty(Be, "nodeMessage", {
4518
+ Object.defineProperty(De, "nodeMessage", {
4519
4519
  enumerable: !0,
4520
4520
  configurable: !0,
4521
4521
  writable: !0,
@@ -4530,20 +4530,20 @@ class _n extends p {
4530
4530
  }
4531
4531
  }
4532
4532
  function ha(e, t) {
4533
- const n = (e.details || "").toLowerCase(), r = e instanceof p ? e.walk((s) => s?.code === be.code) : e;
4534
- return r instanceof p ? new be({
4533
+ const n = (e.details || "").toLowerCase(), r = e instanceof p ? e.walk((s) => s?.code === me.code) : e;
4534
+ return r instanceof p ? new me({
4535
4535
  cause: e,
4536
4536
  message: r.details
4537
- }) : be.nodeMessage.test(n) ? new be({
4537
+ }) : me.nodeMessage.test(n) ? new me({
4538
4538
  cause: e,
4539
4539
  message: e.details
4540
- }) : De.nodeMessage.test(n) ? new De({
4540
+ }) : Be.nodeMessage.test(n) ? new Be({
4541
4541
  cause: e,
4542
4542
  maxFeePerGas: t?.maxFeePerGas
4543
4543
  }) : nt.nodeMessage.test(n) ? new nt({
4544
4544
  cause: e,
4545
4545
  maxFeePerGas: t?.maxFeePerGas
4546
- }) : rt.nodeMessage.test(n) ? new rt({ cause: e, nonce: t?.nonce }) : st.nodeMessage.test(n) ? new st({ cause: e, nonce: t?.nonce }) : it.nodeMessage.test(n) ? new it({ cause: e, nonce: t?.nonce }) : at.nodeMessage.test(n) ? new at({ cause: e }) : ot.nodeMessage.test(n) ? new ot({ cause: e, gas: t?.gas }) : ct.nodeMessage.test(n) ? new ct({ cause: e, gas: t?.gas }) : ut.nodeMessage.test(n) ? new ut({ cause: e }) : Be.nodeMessage.test(n) ? new Be({
4546
+ }) : rt.nodeMessage.test(n) ? new rt({ cause: e, nonce: t?.nonce }) : st.nodeMessage.test(n) ? new st({ cause: e, nonce: t?.nonce }) : it.nodeMessage.test(n) ? new it({ cause: e, nonce: t?.nonce }) : at.nodeMessage.test(n) ? new at({ cause: e }) : ot.nodeMessage.test(n) ? new ot({ cause: e, gas: t?.gas }) : ct.nodeMessage.test(n) ? new ct({ cause: e, gas: t?.gas }) : ut.nodeMessage.test(n) ? new ut({ cause: e }) : De.nodeMessage.test(n) ? new De({
4547
4547
  cause: e,
4548
4548
  maxFeePerGas: t?.maxFeePerGas,
4549
4549
  maxPriorityFeePerGas: t?.maxPriorityFeePerGas
@@ -4608,8 +4608,8 @@ function Pa({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: s }) {
4608
4608
  const i = async () => {
4609
4609
  const l = c();
4610
4610
  a();
4611
- const y = l.map(({ args: b }) => b);
4612
- y.length !== 0 && e(y).then((b) => {
4611
+ const f = l.map(({ args: b }) => b);
4612
+ f.length !== 0 && e(f).then((b) => {
4613
4613
  s && Array.isArray(b) && b.sort(s);
4614
4614
  for (let m = 0; m < l.length; m++) {
4615
4615
  const { resolve: g } = l[m];
@@ -4625,8 +4625,8 @@ function Pa({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: s }) {
4625
4625
  return {
4626
4626
  flush: a,
4627
4627
  async schedule(l) {
4628
- const { promise: y, resolve: b, reject: m } = Ea();
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);
4628
+ const { promise: f, resolve: b, reject: m } = Ea();
4629
+ return n?.([...o(), l]) && i(), c().length > 0 ? (d({ args: l, resolve: b, reject: m }), f) : (d({ args: l, resolve: b, reject: m }), setTimeout(i, r), f);
4630
4630
  }
4631
4631
  };
4632
4632
  }
@@ -4648,7 +4648,7 @@ function zt(e) {
4648
4648
  return t[n] = r, t;
4649
4649
  }, {});
4650
4650
  }
4651
- function Aa(e) {
4651
+ function $a(e) {
4652
4652
  const { balance: t, nonce: n, state: r, stateDiff: s, code: i } = e, a = {};
4653
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) {
4654
4654
  if (a.state)
@@ -4657,94 +4657,94 @@ function Aa(e) {
4657
4657
  }
4658
4658
  return a;
4659
4659
  }
4660
- function $a(e) {
4660
+ function Aa(e) {
4661
4661
  if (!e)
4662
4662
  return;
4663
4663
  const t = {};
4664
4664
  for (const { address: n, ...r } of e) {
4665
- if (!fe(n, { strict: !1 }))
4665
+ if (!ye(n, { strict: !1 }))
4666
4666
  throw new Me({ address: n });
4667
4667
  if (t[n])
4668
4668
  throw new Wi({ address: n });
4669
- t[n] = Aa(r);
4669
+ t[n] = $a(r);
4670
4670
  }
4671
4671
  return t;
4672
4672
  }
4673
4673
  const Sa = 2n ** 256n - 1n;
4674
4674
  function Ca(e) {
4675
4675
  const { account: t, maxFeePerGas: n, maxPriorityFeePerGas: r, to: s } = e, i = t ? Pt(t) : void 0;
4676
- if (i && !fe(i.address))
4676
+ if (i && !ye(i.address))
4677
4677
  throw new Me({ address: i.address });
4678
- if (s && !fe(s))
4678
+ if (s && !ye(s))
4679
4679
  throw new Me({ address: s });
4680
4680
  if (n && n > Sa)
4681
- throw new De({ maxFeePerGas: n });
4681
+ throw new Be({ maxFeePerGas: n });
4682
4682
  if (r && n && r > n)
4683
- throw new Be({ maxFeePerGas: n, maxPriorityFeePerGas: r });
4683
+ throw new De({ maxFeePerGas: n, maxPriorityFeePerGas: r });
4684
4684
  }
4685
4685
  async function ka(e, t) {
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;
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: f, factory: b, factoryData: m, gas: g, gasPrice: v, maxFeePerBlobGas: A, maxFeePerGas: E, maxPriorityFeePerGas: y, nonce: T, to: x, value: F, stateOverride: W, ...J } = t, B = n ? Pt(n) : void 0;
4687
4687
  if (l && (b || m))
4688
4688
  throw new p("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
4689
- if (l && A)
4689
+ if (l && x)
4690
4690
  throw new p("Cannot provide both `code` & `to` as parameters.");
4691
- const $ = l && y, H = b && m && A && y, k = $ || H, ne = $ ? Gn({
4691
+ const K = l && f, ue = b && m && x && f, G = K || ue, te = K ? Gn({
4692
4692
  code: l,
4693
- data: y
4694
- }) : H ? Ma({
4695
- data: y,
4693
+ data: f
4694
+ }) : ue ? Ma({
4695
+ data: f,
4696
4696
  factory: b,
4697
4697
  factoryData: m,
4698
- to: A
4699
- }) : y;
4698
+ to: x
4699
+ }) : f;
4700
4700
  try {
4701
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)({
4702
+ const M = (typeof i == "bigint" ? C(i) : void 0) || a, k = d ? fa(d) : void 0, D = Aa(W), ne = e.chain?.formatters?.transactionRequest?.format, Y = (ne || Ta)({
4703
4703
  // Pick out extra data that might exist on the chain's transaction request type.
4704
- ...wa(te, { format: ye }),
4704
+ ...wa(J, { format: ne }),
4705
4705
  accessList: o,
4706
- account: G,
4706
+ account: B,
4707
4707
  authorizationList: r,
4708
4708
  blobs: c,
4709
- data: ne,
4709
+ data: te,
4710
4710
  gas: g,
4711
- gasPrice: E,
4712
- maxFeePerBlobGas: T,
4713
- maxFeePerGas: v,
4714
- maxPriorityFeePerGas: f,
4715
- nonce: x,
4716
- to: k ? void 0 : A,
4717
- value: L
4711
+ gasPrice: v,
4712
+ maxFeePerBlobGas: A,
4713
+ maxFeePerGas: E,
4714
+ maxPriorityFeePerGas: y,
4715
+ nonce: T,
4716
+ to: G ? void 0 : x,
4717
+ value: F
4718
4718
  }, "call");
4719
- if (s && Ia({ request: z }) && !F && !B)
4719
+ if (s && Ia({ request: Y }) && !D && !k)
4720
4720
  try {
4721
4721
  return await Na(e, {
4722
- ...z,
4722
+ ...Y,
4723
4723
  blockNumber: i,
4724
4724
  blockTag: a
4725
4725
  });
4726
- } catch (V) {
4727
- if (!(V instanceof Mn) && !(V instanceof tt))
4728
- throw V;
4726
+ } catch (j) {
4727
+ if (!(j instanceof Mn) && !(j instanceof tt))
4728
+ throw j;
4729
4729
  }
4730
- const Q = (() => {
4731
- const V = [
4732
- z,
4733
- N
4730
+ const I = (() => {
4731
+ const j = [
4732
+ Y,
4733
+ M
4734
4734
  ];
4735
- return F && B ? [...V, F, B] : F ? [...V, F] : B ? [...V, {}, B] : V;
4736
- })(), Se = await e.request({
4735
+ return D && k ? [...j, D, k] : D ? [...j, D] : k ? [...j, {}, k] : j;
4736
+ })(), de = await e.request({
4737
4737
  method: "eth_call",
4738
- params: Q
4738
+ params: I
4739
4739
  });
4740
- return Se === "0x" ? { data: void 0 } : { data: Se };
4741
- } catch (J) {
4742
- const N = Ra(J), { offchainLookup: B, offchainLookupSignature: F } = await import("./ccip-DIYBSu9T.js");
4743
- if (e.ccipRead !== !1 && N?.slice(0, 10) === F && A)
4744
- return { data: await B(e, { data: N, to: A }) };
4745
- throw k && N?.slice(0, 10) === "0x101bb98d" ? new ea({ factory: b }) : ga(J, {
4740
+ return de === "0x" ? { data: void 0 } : { data: de };
4741
+ } catch ($) {
4742
+ const M = Ra($), { offchainLookup: k, offchainLookupSignature: D } = await import("./ccip-B7nWUBYb.js");
4743
+ if (e.ccipRead !== !1 && M?.slice(0, 10) === D && x)
4744
+ return { data: await k(e, { data: M, to: x }) };
4745
+ throw G && M?.slice(0, 10) === "0x101bb98d" ? new ea({ factory: b }) : ga($, {
4746
4746
  ...t,
4747
- account: G,
4747
+ account: B,
4748
4748
  chain: e.chain
4749
4749
  });
4750
4750
  }
@@ -4766,40 +4766,40 @@ async function Na(e, t) {
4766
4766
  contract: "multicall3"
4767
4767
  });
4768
4768
  throw new Mn();
4769
- })(), y = (typeof i == "bigint" ? C(i) : void 0) || a, { schedule: b } = Pa({
4770
- id: `${e.uid}.${y}`,
4769
+ })(), f = (typeof i == "bigint" ? C(i) : void 0) || a, { schedule: b } = Pa({
4770
+ id: `${e.uid}.${f}`,
4771
4771
  wait: s,
4772
- shouldSplitBatch(E) {
4773
- return E.reduce((v, { data: f }) => v + (f.length - 2), 0) > n * 2;
4772
+ shouldSplitBatch(v) {
4773
+ return v.reduce((E, { data: y }) => E + (y.length - 2), 0) > n * 2;
4774
4774
  },
4775
- fn: async (E) => {
4776
- const T = E.map((x) => ({
4775
+ fn: async (v) => {
4776
+ const A = v.map((T) => ({
4777
4777
  allowFailure: !0,
4778
- callData: x.data,
4779
- target: x.to
4780
- })), v = Nn({
4781
- abi: $t,
4782
- args: [T],
4778
+ callData: T.data,
4779
+ target: T.to
4780
+ })), E = Nn({
4781
+ abi: At,
4782
+ args: [A],
4783
4783
  functionName: "aggregate3"
4784
- }), f = await e.request({
4784
+ }), y = await e.request({
4785
4785
  method: "eth_call",
4786
4786
  params: [
4787
4787
  {
4788
4788
  ...d === null ? {
4789
4789
  data: Gn({
4790
4790
  code: ma,
4791
- data: v
4791
+ data: E
4792
4792
  })
4793
- } : { to: d, data: v }
4793
+ } : { to: d, data: E }
4794
4794
  },
4795
- y
4795
+ f
4796
4796
  ]
4797
4797
  });
4798
4798
  return In({
4799
- abi: $t,
4800
- args: [T],
4799
+ abi: At,
4800
+ args: [A],
4801
4801
  functionName: "aggregate3",
4802
- data: f || "0x"
4802
+ data: y || "0x"
4803
4803
  });
4804
4804
  }
4805
4805
  }), [{ returnData: m, success: g }] = await b({ data: o, to: c });
@@ -4857,20 +4857,20 @@ async function Oa(e, t) {
4857
4857
  });
4858
4858
  }
4859
4859
  }
4860
- function Da(e, t, n) {
4860
+ function Ba(e, t, n) {
4861
4861
  const r = e[t.name];
4862
4862
  if (typeof r == "function")
4863
4863
  return r;
4864
4864
  const s = e[n];
4865
4865
  return typeof s == "function" ? s : (i) => t(e, i);
4866
4866
  }
4867
- function Ba(e, t) {
4867
+ function Da(e, t) {
4868
4868
  const { chainId: n, ...r } = t, s = e.getClient({ chainId: n });
4869
- return Da(s, Oa, "readContract")(r);
4869
+ return Ba(s, Oa, "readContract")(r);
4870
4870
  }
4871
4871
  const ao = 30, oo = 3e-3, co = 5, Ua = 8, La = 10 ** Ua, uo = BigInt(
4872
4872
  "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
4873
- ), O = {
4873
+ ), U = {
4874
4874
  ETH: { symbol: "ETH", decimals: 18, name: "Ether" },
4875
4875
  USDC: { symbol: "USDC", decimals: 6, name: "USD Coin" },
4876
4876
  USDT: { symbol: "USDT", decimals: 6, name: "Tether USD" },
@@ -4886,94 +4886,98 @@ function Fa() {
4886
4886
  error: i
4887
4887
  } = dt(), { isLoading: a, isSuccess: o } = lt({
4888
4888
  hash: r
4889
- }), c = () => D({
4890
- address: I.PAYMENT_ROUTER,
4889
+ }), c = () => L({
4890
+ address: N.PAYMENT_ROUTER,
4891
4891
  abi: Ce,
4892
4892
  functionName: "tokenRegistry"
4893
- }), d = () => D({
4894
- address: I.PAYMENT_ROUTER,
4893
+ }), d = () => L({
4894
+ address: N.PAYMENT_ROUTER,
4895
4895
  abi: Ce,
4896
4896
  functionName: "feePercentage"
4897
- }), l = () => D({
4898
- address: I.PAYMENT_ROUTER,
4897
+ }), l = () => L({
4898
+ address: N.PAYMENT_ROUTER,
4899
4899
  abi: Ce,
4900
4900
  functionName: "paused"
4901
- }), y = async (g, E) => {
4901
+ }), f = async (g, v) => {
4902
4902
  try {
4903
- return await Ba(t, {
4903
+ return await Da(t, {
4904
4904
  address: g,
4905
4905
  abi: Z,
4906
4906
  functionName: "allowance",
4907
- args: [E, I.PAYMENT_ROUTER]
4907
+ args: [v, N.PAYMENT_ROUTER]
4908
4908
  });
4909
- } catch (T) {
4910
- return console.error("Error checking allowance:", T), BigInt(0);
4909
+ } catch (A) {
4910
+ return console.error("Error checking allowance:", A), BigInt(0);
4911
4911
  }
4912
- }, b = async (g, E) => {
4912
+ }, b = async (g, v) => {
4913
4913
  if (!e)
4914
4914
  throw new Error("Wallet not connected");
4915
4915
  if (g === "0x0000000000000000000000000000000000000000")
4916
4916
  return null;
4917
4917
  try {
4918
- return await y(g, e) >= E ? (console.log(
4918
+ return await f(g, e) >= v ? (console.log(
4919
4919
  `Sufficient allowance for ${g}, skipping approval`
4920
4920
  ), null) : (console.log(`Requesting infinite approval for ${g}`), await n({
4921
4921
  address: g,
4922
4922
  abi: Z,
4923
4923
  functionName: "approve",
4924
- args: [I.PAYMENT_ROUTER, cr]
4924
+ args: [N.PAYMENT_ROUTER, cr]
4925
4925
  }));
4926
- } catch (T) {
4927
- throw console.error(`Error in approveToken for ${g}:`, T), T;
4926
+ } catch (A) {
4927
+ throw console.error(`Error in approveToken for ${g}:`, A), A;
4928
4928
  }
4929
4929
  };
4930
4930
  return {
4931
4931
  // Write functions
4932
4932
  executePayment: async ({
4933
4933
  merchantAddress: g,
4934
- tokens: E,
4935
- totalAmountUSD: T,
4936
- settleInIDR: v
4934
+ tokens: v,
4935
+ totalAmountUSD: A,
4936
+ settleInIDR: E,
4937
+ target: y,
4938
+ callData: T
4937
4939
  }) => {
4938
4940
  if (!e)
4939
4941
  throw new Error("Wallet not connected");
4940
- const f = E.filter(($) => $.percentage > 0), x = [], A = [];
4941
- let L = BigInt(0);
4942
- const Y = T * 3e-3, te = T + Y;
4943
- for (const $ of f) {
4942
+ const x = v.filter(($) => $.percentage > 0), F = [], W = [];
4943
+ let J = BigInt(0);
4944
+ const B = A * 3e-3, K = A + B;
4945
+ for (const $ of x) {
4944
4946
  if (!$.priceUSD || $.priceUSD <= 0)
4945
4947
  throw new Error(
4946
4948
  `Invalid price for ${$.symbol}. Price data may not be available yet. Please wait a moment and try again.`
4947
4949
  );
4948
- const k = te * $.percentage / 100 / $.priceUSD;
4950
+ const k = K * $.percentage / 100 / $.priceUSD;
4949
4951
  if (!isFinite(k) || k <= 0)
4950
4952
  throw new Error(`Invalid amount calculated for ${$.symbol}`);
4951
- const ne = Math.min($.decimals + 2, 18), J = k.toFixed(ne);
4952
- let N = or(J, $.decimals);
4953
- N = N + BigInt(1), $.address === "0x0000000000000000000000000000000000000000" ? (L = N, x.push($.address), A.push(N)) : (x.push($.address), A.push(N));
4953
+ const D = Math.min($.decimals + 2, 18), ne = k.toFixed(D);
4954
+ let Q = or(ne, $.decimals);
4955
+ Q = Q + BigInt(1), $.address === "0x0000000000000000000000000000000000000000" ? (J = Q, F.push($.address), W.push(Q)) : (F.push($.address), W.push(Q));
4954
4956
  }
4955
- for (let $ = 0; $ < f.length; $++) {
4956
- const H = f[$];
4957
- if (H.address !== "0x0000000000000000000000000000000000000000")
4957
+ for (let $ = 0; $ < x.length; $++) {
4958
+ const M = x[$];
4959
+ if (M.address !== "0x0000000000000000000000000000000000000000")
4958
4960
  try {
4959
- await b(H.address, A[$]) && console.log(`Approved infinite allowance for ${H.symbol}`);
4961
+ await b(M.address, W[$]) && console.log(`Approved infinite allowance for ${M.symbol}`);
4960
4962
  } catch (k) {
4961
- throw new Error(`Failed to approve ${H.symbol}: ${k}`);
4963
+ throw new Error(`Failed to approve ${M.symbol}: ${k}`);
4962
4964
  }
4963
4965
  }
4964
- const G = BigInt(Math.floor(T * La));
4966
+ const ue = BigInt(Math.floor(A * La)), G = y || "0x0000000000000000000000000000000000000000", te = T || "0x";
4965
4967
  return await n({
4966
- address: I.PAYMENT_ROUTER,
4968
+ address: N.PAYMENT_ROUTER,
4967
4969
  abi: Ce,
4968
4970
  functionName: "pay",
4969
4971
  args: [
4970
4972
  g,
4971
- x,
4972
- A,
4973
+ F,
4974
+ W,
4975
+ ue,
4976
+ E,
4973
4977
  G,
4974
- v
4978
+ te
4975
4979
  ],
4976
- value: L
4980
+ value: J
4977
4981
  });
4978
4982
  },
4979
4983
  // Read hooks
@@ -4994,67 +4998,67 @@ function Ie(e) {
4994
4998
  });
4995
4999
  return {
4996
5000
  // Write functions
4997
- transfer: (v, f) => {
5001
+ transfer: (E, y) => {
4998
5002
  n({
4999
5003
  address: e,
5000
5004
  abi: Z,
5001
5005
  functionName: "transfer",
5002
- args: [v, f]
5006
+ args: [E, y]
5003
5007
  });
5004
5008
  },
5005
- approve: (v, f) => {
5009
+ approve: (E, y) => {
5006
5010
  n({
5007
5011
  address: e,
5008
5012
  abi: Z,
5009
5013
  functionName: "approve",
5010
- args: [v, f]
5014
+ args: [E, y]
5011
5015
  });
5012
5016
  },
5013
- transferFrom: (v, f, x) => {
5017
+ transferFrom: (E, y, T) => {
5014
5018
  n({
5015
5019
  address: e,
5016
5020
  abi: Z,
5017
5021
  functionName: "transferFrom",
5018
- args: [v, f, x]
5022
+ args: [E, y, T]
5019
5023
  });
5020
5024
  },
5021
5025
  // Read hooks
5022
- useName: () => D({
5026
+ useName: () => L({
5023
5027
  address: e,
5024
5028
  abi: Z,
5025
5029
  functionName: "name"
5026
5030
  }),
5027
- useSymbol: () => D({
5031
+ useSymbol: () => L({
5028
5032
  address: e,
5029
5033
  abi: Z,
5030
5034
  functionName: "symbol"
5031
5035
  }),
5032
- useDecimals: () => D({
5036
+ useDecimals: () => L({
5033
5037
  address: e,
5034
5038
  abi: Z,
5035
5039
  functionName: "decimals"
5036
5040
  }),
5037
- useTotalSupply: () => D({
5041
+ useTotalSupply: () => L({
5038
5042
  address: e,
5039
5043
  abi: Z,
5040
5044
  functionName: "totalSupply"
5041
5045
  }),
5042
- useBalanceOf: (v) => {
5043
- const f = v || t;
5044
- return D({
5046
+ useBalanceOf: (E) => {
5047
+ const y = E || t;
5048
+ return L({
5045
5049
  address: e,
5046
5050
  abi: Z,
5047
5051
  functionName: "balanceOf",
5048
- args: f ? [f] : void 0,
5049
- query: { enabled: !!f }
5052
+ args: y ? [y] : void 0,
5053
+ query: { enabled: !!y }
5050
5054
  });
5051
5055
  },
5052
- useAllowance: (v, f) => D({
5056
+ useAllowance: (E, y) => L({
5053
5057
  address: e,
5054
5058
  abi: Z,
5055
5059
  functionName: "allowance",
5056
- args: v && f ? [v, f] : void 0,
5057
- query: { enabled: !!(v && f) }
5060
+ args: E && y ? [E, y] : void 0,
5061
+ query: { enabled: !!(E && y) }
5058
5062
  }),
5059
5063
  // Transaction state
5060
5064
  hash: r,
@@ -5067,14 +5071,14 @@ function Ie(e) {
5067
5071
  function ja() {
5068
5072
  const { address: e } = Ue(), { data: t, isLoading: n } = rr({
5069
5073
  address: e
5070
- }), r = Ie(S.USDC), s = Ie(S.USDT), i = Ie(S.DAI), a = Ie(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);
5074
+ }), r = Ie(S.USDC), s = Ie(S.USDT), i = Ie(S.DAI), a = Ie(S.WBTC), { data: o, isLoading: c } = r.useBalanceOf(e), { data: d, isLoading: l } = s.useBalanceOf(e), { data: f, isLoading: b } = i.useBalanceOf(e), { data: m, isLoading: g } = a.useBalanceOf(e);
5071
5075
  return {
5072
5076
  balances: {
5073
- ETH: t ? parseFloat(ve(t.value, 18)) : 0,
5074
- USDC: o ? parseFloat(ve(o, 6)) : 0,
5075
- USDT: d ? parseFloat(ve(d, 6)) : 0,
5076
- DAI: y ? parseFloat(ve(y, 18)) : 0,
5077
- WBTC: m ? parseFloat(ve(m, 8)) : 0
5077
+ ETH: t ? parseFloat(Ee(t.value, 18)) : 0,
5078
+ USDC: o ? parseFloat(Ee(o, 6)) : 0,
5079
+ USDT: d ? parseFloat(Ee(d, 6)) : 0,
5080
+ DAI: f ? parseFloat(Ee(f, 18)) : 0,
5081
+ WBTC: m ? parseFloat(Ee(m, 8)) : 0
5078
5082
  },
5079
5083
  isLoading: !e || n || c || l || b || g
5080
5084
  };
@@ -5094,46 +5098,46 @@ function za() {
5094
5098
  error: d
5095
5099
  } = e.useGetTokenPrice(S.USDT), {
5096
5100
  data: l,
5097
- isLoading: y,
5101
+ isLoading: f,
5098
5102
  error: b
5099
5103
  } = e.useGetTokenPrice(S.DAI), {
5100
5104
  data: m,
5101
5105
  isLoading: g,
5102
- error: E
5103
- } = e.useGetTokenPrice(S.WBTC), T = 1e8, v = (x) => {
5104
- if (!x) return 0;
5106
+ error: v
5107
+ } = e.useGetTokenPrice(S.WBTC), A = 1e8, E = (T) => {
5108
+ if (!T) return 0;
5105
5109
  try {
5106
- if (Array.isArray(x) && x.length >= 1) {
5107
- const A = x[0];
5108
- if (typeof A == "bigint")
5109
- return Number(A) / T;
5110
- if (typeof A == "number")
5111
- return A / T;
5112
- if (typeof A == "string")
5113
- return Number(A) / T;
5110
+ if (Array.isArray(T) && T.length >= 1) {
5111
+ const x = T[0];
5112
+ if (typeof x == "bigint")
5113
+ return Number(x) / A;
5114
+ if (typeof x == "number")
5115
+ return x / A;
5116
+ if (typeof x == "string")
5117
+ return Number(x) / A;
5114
5118
  }
5115
- return typeof x == "bigint" ? Number(x) / T : typeof x == "number" ? x / T : 0;
5116
- } catch (A) {
5117
- return console.error("Error converting price:", A), 0;
5119
+ return typeof T == "bigint" ? Number(T) / A : typeof T == "number" ? T / A : 0;
5120
+ } catch (x) {
5121
+ return console.error("Error converting price:", x), 0;
5118
5122
  }
5119
5123
  };
5120
- r && console.error("ETH price error:", r), a && console.error("USDC price error:", a), d && console.error("USDT price error:", d), b && console.error("DAI price error:", b), E && console.error("WBTC price error:", E);
5121
- const f = {
5122
- ETH: v(t),
5123
- USDC: v(s) || 1,
5124
- USDT: v(o) || 1,
5125
- DAI: v(l) || 1,
5126
- WBTC: v(m)
5124
+ r && console.error("ETH price error:", r), a && console.error("USDC price error:", a), d && console.error("USDT price error:", d), b && console.error("DAI price error:", b), v && console.error("WBTC price error:", v);
5125
+ const y = {
5126
+ ETH: E(t),
5127
+ USDC: E(s) || 1,
5128
+ USDT: E(o) || 1,
5129
+ DAI: E(l) || 1,
5130
+ WBTC: E(m)
5127
5131
  };
5128
- return console.log("Converted prices:", f), {
5129
- prices: f,
5130
- isLoading: n || i || c || y || g,
5132
+ return console.log("Converted prices:", y), {
5133
+ prices: y,
5134
+ isLoading: n || i || c || f || g,
5131
5135
  errors: {
5132
5136
  ETH: r,
5133
5137
  USDC: a,
5134
5138
  USDT: d,
5135
5139
  DAI: b,
5136
- WBTC: E
5140
+ WBTC: v
5137
5141
  }
5138
5142
  };
5139
5143
  }
@@ -5175,149 +5179,153 @@ function lo({
5175
5179
  currency: n = "USD",
5176
5180
  items: r,
5177
5181
  settleInIDR: s = !1,
5178
- onPaymentComplete: i,
5179
- onPaymentError: a,
5180
- className: o = "",
5181
- children: c
5182
+ target: i,
5183
+ callData: a,
5184
+ onPaymentComplete: o,
5185
+ onPaymentError: c,
5186
+ className: d = "",
5187
+ children: l
5182
5188
  }) {
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();
5184
- console.log("Token prices from useMultiTokenPrices:", f);
5185
- const { executePayment: A, isConfirmed: L, hash: Y, error: te, isPending: G, isConfirming: $ } = Fa(), H = ft(), { data: k } = H.useGetTokenPrice(S.IDRX), ne = 1e8, N = (() => {
5186
- if (!k) return 1 / 15600;
5187
- if (Array.isArray(k) && k.length >= 1) {
5188
- const j = k[0];
5189
- if (typeof j == "bigint")
5190
- return Number(j) / ne;
5189
+ const { isConnected: f } = Ue(), { connect: b, connectors: m } = sr(), [g, v] = _(!1), [A, E] = _([]), { balances: y, isLoading: T } = ja(), { prices: x, isLoading: F } = za();
5190
+ console.log("Token prices from useMultiTokenPrices:", x);
5191
+ const { executePayment: W, isConfirmed: J, hash: B, error: K, isPending: ue, isConfirming: G } = Fa(), te = ft(), { data: $ } = te.useGetTokenPrice(S.IDRX), M = 1e8, D = (() => {
5192
+ if (!$) return 1 / 15600;
5193
+ if (Array.isArray($) && $.length >= 1) {
5194
+ const I = $[0];
5195
+ if (typeof I == "bigint")
5196
+ return Number(I) / M;
5191
5197
  }
5192
5198
  return 1 / 15600;
5193
5199
  })();
5194
- me(() => {
5195
- if (!v && !x) {
5196
- const j = [
5200
+ he(() => {
5201
+ if (!T && !F) {
5202
+ const I = [
5197
5203
  {
5198
5204
  id: "eth",
5199
- name: O.ETH.name,
5200
- symbol: O.ETH.symbol,
5201
- amount: T.ETH,
5205
+ name: U.ETH.name,
5206
+ symbol: U.ETH.symbol,
5207
+ amount: y.ETH,
5202
5208
  chain: "Lisk Sepolia",
5203
5209
  percentage: 0,
5204
5210
  address: S.NATIVE,
5205
- decimals: O.ETH.decimals,
5206
- priceUSD: f.ETH
5211
+ decimals: U.ETH.decimals,
5212
+ priceUSD: x.ETH
5207
5213
  },
5208
5214
  {
5209
5215
  id: "usdc",
5210
- name: O.USDC.name,
5211
- symbol: O.USDC.symbol,
5212
- amount: T.USDC,
5216
+ name: U.USDC.name,
5217
+ symbol: U.USDC.symbol,
5218
+ amount: y.USDC,
5213
5219
  chain: "Lisk Sepolia",
5214
5220
  percentage: 0,
5215
5221
  address: S.USDC,
5216
- decimals: O.USDC.decimals,
5217
- priceUSD: f.USDC
5222
+ decimals: U.USDC.decimals,
5223
+ priceUSD: x.USDC
5218
5224
  },
5219
5225
  {
5220
5226
  id: "usdt",
5221
- name: O.USDT.name,
5222
- symbol: O.USDT.symbol,
5223
- amount: T.USDT,
5227
+ name: U.USDT.name,
5228
+ symbol: U.USDT.symbol,
5229
+ amount: y.USDT,
5224
5230
  chain: "Lisk Sepolia",
5225
5231
  percentage: 0,
5226
5232
  address: S.USDT,
5227
- decimals: O.USDT.decimals,
5228
- priceUSD: f.USDT
5233
+ decimals: U.USDT.decimals,
5234
+ priceUSD: x.USDT
5229
5235
  },
5230
5236
  {
5231
5237
  id: "dai",
5232
- name: O.DAI.name,
5233
- symbol: O.DAI.symbol,
5234
- amount: T.DAI,
5238
+ name: U.DAI.name,
5239
+ symbol: U.DAI.symbol,
5240
+ amount: y.DAI,
5235
5241
  chain: "Lisk Sepolia",
5236
5242
  percentage: 0,
5237
5243
  address: S.DAI,
5238
- decimals: O.DAI.decimals,
5239
- priceUSD: f.DAI
5244
+ decimals: U.DAI.decimals,
5245
+ priceUSD: x.DAI
5240
5246
  },
5241
5247
  {
5242
5248
  id: "wbtc",
5243
- name: O.WBTC.name,
5244
- symbol: O.WBTC.symbol,
5245
- amount: T.WBTC,
5249
+ name: U.WBTC.name,
5250
+ symbol: U.WBTC.symbol,
5251
+ amount: y.WBTC,
5246
5252
  chain: "Lisk Sepolia",
5247
5253
  percentage: 0,
5248
5254
  address: S.WBTC,
5249
- decimals: O.WBTC.decimals,
5250
- priceUSD: f.WBTC
5255
+ decimals: U.WBTC.decimals,
5256
+ priceUSD: x.WBTC
5251
5257
  }
5252
5258
  ];
5253
- E(j);
5259
+ E(I);
5254
5260
  }
5255
5261
  }, [
5256
- T.ETH,
5257
- T.USDC,
5258
- T.USDT,
5259
- T.DAI,
5260
- T.WBTC,
5261
- f.ETH,
5262
- f.USDC,
5263
- f.USDT,
5264
- f.DAI,
5265
- f.WBTC,
5266
- v,
5267
- x
5268
- ]), me(() => {
5269
- if (L && Y) {
5270
- const j = {
5262
+ y.ETH,
5263
+ y.USDC,
5264
+ y.USDT,
5265
+ y.DAI,
5266
+ y.WBTC,
5267
+ x.ETH,
5268
+ x.USDC,
5269
+ x.USDT,
5270
+ x.DAI,
5271
+ x.WBTC,
5272
+ T,
5273
+ F
5274
+ ]), he(() => {
5275
+ if (J && B) {
5276
+ const I = {
5271
5277
  success: !0,
5272
- transactionId: Y,
5273
- tokens: g.filter((z) => z.percentage > 0)
5278
+ transactionId: B,
5279
+ tokens: A.filter((de) => de.percentage > 0)
5274
5280
  };
5275
- i?.(j);
5281
+ o?.(I);
5276
5282
  }
5277
- }, [L, Y]), me(() => {
5278
- if (te) {
5279
- const j = _t(te);
5280
- a?.(j);
5283
+ }, [J, B]), he(() => {
5284
+ if (K) {
5285
+ const I = _t(K);
5286
+ c?.(I);
5281
5287
  }
5282
- }, [te]);
5283
- const B = n === "IDR" ? e * N : e, F = () => {
5284
- d ? m(!0) : l({ connector: y[0] });
5285
- }, ye = async (j) => {
5288
+ }, [K]);
5289
+ const ne = n === "IDR" ? e * D : e, Q = () => {
5290
+ f ? v(!0) : b({ connector: m[0] });
5291
+ }, Y = async (I) => {
5286
5292
  try {
5287
- await A({
5293
+ await W({
5288
5294
  merchantAddress: t,
5289
- tokens: j,
5290
- totalAmountUSD: B,
5291
- settleInIDR: s
5295
+ tokens: I,
5296
+ totalAmountUSD: ne,
5297
+ settleInIDR: s,
5298
+ target: i,
5299
+ callData: a
5292
5300
  });
5293
- } catch (z) {
5294
- const Q = _t(z);
5295
- a?.(Q);
5301
+ } catch (de) {
5302
+ const j = _t(de);
5303
+ c?.(j);
5296
5304
  }
5297
5305
  };
5298
5306
  return /* @__PURE__ */ h(Qn, { children: [
5299
5307
  /* @__PURE__ */ u(
5300
5308
  "button",
5301
5309
  {
5302
- onClick: F,
5303
- disabled: v || x,
5304
- className: `bg-secondary hover:bg-secondary/90 text-white font-semibold py-3 px-6 rounded-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed ${o}`,
5305
- children: c || (d ? "Pay with MultiCoyn" : "Connect Wallet to Pay")
5310
+ onClick: Q,
5311
+ disabled: T || F,
5312
+ className: `bg-secondary hover:bg-secondary/90 text-white font-semibold py-3 px-6 rounded-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed ${d}`,
5313
+ children: l || (f ? "Pay with MultiCoyn" : "Connect Wallet to Pay")
5306
5314
  }
5307
5315
  ),
5308
- d && /* @__PURE__ */ u(
5316
+ f && /* @__PURE__ */ u(
5309
5317
  Pr,
5310
5318
  {
5311
- isOpen: b,
5312
- onClose: () => m(!1),
5313
- totalAmount: B,
5319
+ isOpen: g,
5320
+ onClose: () => v(!1),
5321
+ totalAmount: ne,
5314
5322
  currency: n,
5315
5323
  items: r,
5316
- tokens: g,
5317
- onPaymentSubmit: ye,
5318
- transactionHash: Y,
5319
- isProcessing: G || $,
5320
- isSuccess: L
5324
+ tokens: A,
5325
+ onPaymentSubmit: Y,
5326
+ transactionHash: B,
5327
+ isProcessing: ue || G,
5328
+ isSuccess: J
5321
5329
  }
5322
5330
  )
5323
5331
  ] });
@@ -5347,9 +5355,9 @@ const _a = ur({
5347
5355
  projectId: "YOUR_PROJECT_ID_HERE",
5348
5356
  chains: [_a],
5349
5357
  ssr: !1
5350
- }), Ha = new dr();
5358
+ }), Ha = new lr();
5351
5359
  function fo({ children: e }) {
5352
- return /* @__PURE__ */ u(ir, { config: Ga, children: /* @__PURE__ */ u(lr, { client: Ha, children: /* @__PURE__ */ u(pr, { children: e }) }) });
5360
+ return /* @__PURE__ */ u(ir, { config: Ga, children: /* @__PURE__ */ u(dr, { client: Ha, children: /* @__PURE__ */ u(pr, { children: e }) }) });
5353
5361
  }
5354
5362
  const Hn = er(
5355
5363
  void 0
@@ -5372,13 +5380,13 @@ function yo() {
5372
5380
  export {
5373
5381
  no as A,
5374
5382
  p as B,
5375
- I as C,
5383
+ N as C,
5376
5384
  Fa as D,
5377
5385
  ft as E,
5378
5386
  Ie as F,
5379
5387
  ja as G,
5380
5388
  io as H,
5381
- Dr as I,
5389
+ Br as I,
5382
5390
  za as J,
5383
5391
  ao as K,
5384
5392
  oo as L,
@@ -5387,7 +5395,7 @@ export {
5387
5395
  La as O,
5388
5396
  xr as P,
5389
5397
  uo as Q,
5390
- O as R,
5398
+ U as R,
5391
5399
  S as T,
5392
5400
  Ua as U,
5393
5401
  fo as W,
@@ -5396,22 +5404,22 @@ export {
5396
5404
  gt as c,
5397
5405
  yn as d,
5398
5406
  pn as e,
5399
- ge as f,
5407
+ we as f,
5400
5408
  Et as g,
5401
5409
  Ne as h,
5402
5410
  Nr as i,
5403
5411
  qa as j,
5404
5412
  ji as k,
5405
- fe as l,
5413
+ ye as l,
5406
5414
  Me as m,
5407
- Bn as n,
5408
- At as o,
5415
+ Dn as n,
5416
+ $t as o,
5409
5417
  _i as p,
5410
5418
  ka as q,
5411
- we as r,
5419
+ xe as r,
5412
5420
  Oe as s,
5413
5421
  vt as t,
5414
- $e as u,
5422
+ Se as u,
5415
5423
  po as v,
5416
5424
  yo as w,
5417
5425
  Ga as x,