0xtrails
Version:
SDK for Trails
1,066 lines • 3.17 MB
JavaScript
var SJ = Object.defineProperty;
var IJ = (e, t, n) => t in e ? SJ(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var te = (e, t, n) => IJ(e, typeof t != "symbol" ? t + "" : t, n);
import { jsx as f, Fragment as Jt, jsxs as R } from "react/jsx-runtime";
import { useConfig as Z8, SequenceHooksContext as AJ, SequenceHooksProvider as qI } from "@0xsequence/hooks";
import { useQuery as Ls, useQueries as CJ, QueryClient as xb, QueryClientProvider as GI } from "@tanstack/react-query";
import * as H from "react";
import yr, { useState as ie, useEffect as ve, useMemo as We, createContext as Ar, useRef as zt, useLayoutEffect as J8, useId as Eb, useContext as An, useInsertionEffect as eO, useCallback as At, Children as NJ, isValidElement as OJ, createElement as mg, Fragment as tO, forwardRef as pr, Component as PJ, memo as H6, StrictMode as MJ, useImperativeHandle as RJ } from "react";
import * as kb from "react-dom";
import BJ, { createPortal as nO } from "react-dom";
import { parseSignature as $J, encodeFunctionData as Wr, custom as yd, hexToBigInt as xc, createPublicClient as jr, fallback as zI, http as Cn, createWalletClient as Df, zeroAddress as _t, isAddressEqual as rO, getAddress as Ka, erc20Abi as zc, maxUint256 as Tb, decodeEventLog as Du, parseAbiItem as Lu, formatUnits as Fo, parseAbi as sO, keccak256 as Ih, encodeAbiParameters as KI, concat as cp, pad as gu, toHex as sl, encodeDeployData as DJ, decodeAbiParameters as LJ, decodeFunctionData as QI, parseGwei as _J, hexToBytes as q6, bytesToHex as UJ, parseUnits as Jl, UserRejectedRequestError as YI, isAddress as Fc } from "viem";
import * as G6 from "viem/chains";
import { sepolia as Za, baseGoerli as FJ, mainnet as un, base as dr, zora as N2, optimism as nr, arbitrum as Wn, arbitrumNova as Ja, katana as eo, zksync as gg, zircuit as XI, zeroG as ZI, xai as zo, worldchain as to, unichain as no, tron as JI, taiko as yg, swellchain as bg, superseed as eA, superposition as wg, story as tA, sonic as vg, soneium as ma, shape as nA, sei as xg, scroll as Eg, sanko as rA, redstone as sA, ronin as iA, polygonZkEvm as kg, polygon as Hn, plume as Tg, morph as aA, mode as oA, mint as cA, metis as Sg, mantle as Ig, manta as lA, lisk as Ag, linea as ro, ink as Cg, hychain as uA, hemi as dA, gravity as Ng, gnosis as ga, funkiMainnet as fA, forma as hA, flowMainnet as pA, degen as mA, cyber as gA, cronos as Og, corn as Pg, celo as Mg, boba as Rg, bob as Bg, opBNB as $g, blast as so, berachain as Dg, b3 as Ko, avalanche as Sr, arenaz as yA, apeChain as Xi, ancient8 as bA, abstract as Lg, etherlink as Kn, kaia as wA, xdc as vA, rootstock as xA, lens as EA, flare as kA, immutableZkEvm as TA, aurora as SA, fuse as IA, moonbeam as AA, fantom as CA, moonriver as NA, bsc as Qo, arbitrumSepolia as io, avalancheFuji as il, b3Sepolia as _g, baseSepolia as ao, blastSepolia as Ug, bscTestnet as Fg, gnosisChiado as Vg, polygonAmoy as al, optimismSepolia as ol, soneiumMinato as jg, xaiTestnet as Wg, etherlinkTestnet as Hg, worldchainSepolia as Sb, lineaSepolia as Ib, unichainSepolia as Ab } from "viem/chains";
import { useReadContracts as VJ, createConnector as jJ, useConnect as z6, useAccount as yl, useConnections as iO, useSwitchAccount as WJ, useEnsName as HJ, useEnsAddress as qJ, useDisconnect as aO, WagmiContext as GJ, createStorage as zJ, createConfig as KJ, WagmiProvider as G1 } from "wagmi";
import { injected as K6, baseAccount as QJ, gemini as YJ, walletConnect as oO, safe as XJ } from "wagmi/connectors";
import { ethers as D, MessagePrefix as cO } from "ethers";
const ZJ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
get claimAppFees() {
return Ere;
},
get execute() {
return gre;
},
get getAppFees() {
return xre;
},
get getPrice() {
return wre;
},
get getQuote() {
return bre;
},
get getSolverCapacity() {
return vre;
}
}, Symbol.toStringTag, { value: "Module" })), JJ = "Webrpc", eee = "webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-api@v0.4.0";
var OA;
(function(e) {
e.DESC = "DESC", e.ASC = "ASC";
})(OA || (OA = {}));
var PA;
(function(e) {
e.ach = "ach", e.debit = "debit", e.credit = "credit", e.us_debit = "us_debit", e.international_debit = "international_debit", e.international_credit = "international_credit";
})(PA || (PA = {}));
var MA;
(function(e) {
e.buy = "buy", e.sell = "sell";
})(MA || (MA = {}));
var RA;
(function(e) {
e.to = "to", e.from = "from";
})(RA || (RA = {}));
var BA;
(function(e) {
e.ERC20 = "ERC20", e.ERC721 = "ERC721", e.ERC1155 = "ERC1155";
})(BA || (BA = {}));
var $A;
(function(e) {
e.UNKNOWN = "UNKNOWN", e.BUY = "BUY", e.SELL = "SELL";
})($A || ($A = {}));
var DA;
(function(e) {
e.EXACT_INPUT = "EXACT_INPUT", e.EXACT_OUTPUT = "EXACT_OUTPUT";
})(DA || (DA = {}));
var LA;
(function(e) {
e.none = "none", e.partially = "partially", e.all = "all";
})(LA || (LA = {}));
var _A;
(function(e) {
e.unknown = "unknown", e.sardine = "sardine", e.transak = "transak";
})(_A || (_A = {}));
var UA;
(function(e) {
e.unknown = "unknown", e.sardine = "sardine", e.transak = "transak";
})(UA || (UA = {}));
var FA;
(function(e) {
e.unknown = "unknown", e.lifi = "lifi";
})(FA || (FA = {}));
let tee = class {
constructor(t, n) {
te(this, "hostname");
te(this, "fetch");
te(this, "path", "/rpc/API/");
te(this, "ping", (t, n) => this.fetch(this.url("Ping"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
status: s.status
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "version", (t, n) => this.fetch(this.url("Version"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
version: s.version
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "runtimeStatus", (t, n) => this.fetch(this.url("RuntimeStatus"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
status: s.status
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "clock", (t, n) => this.fetch(this.url("Clock"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
serverTime: s.serverTime
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "getSequenceContext", (t, n) => this.fetch(this.url("GetSequenceContext"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
data: s.data
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "getAuthToken", (t, n, r) => this.fetch(this.url("GetAuthToken"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status,
jwtToken: i.jwtToken,
address: i.address,
user: i.user
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getAuthToken2", (t, n, r) => this.fetch(this.url("GetAuthToken2"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status,
jwtToken: i.jwtToken,
address: i.address,
user: i.user
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "sendPasswordlessLink", (t, n, r) => this.fetch(this.url("SendPasswordlessLink"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "registerPublicKey", (t, n, r) => this.fetch(this.url("RegisterPublicKey"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getPublicKey", (t, n, r) => this.fetch(this.url("GetPublicKey"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
publicKey: i.publicKey
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "friendList", (t, n, r) => this.fetch(this.url("FriendList"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
page: i.page,
friends: i.friends
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getFriendByAddress", (t, n, r) => this.fetch(this.url("GetFriendByAddress"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status,
friend: i.friend
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "searchFriends", (t, n, r) => this.fetch(this.url("SearchFriends"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
friends: i.friends
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "addFriend", (t, n, r) => this.fetch(this.url("AddFriend"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status,
friend: i.friend
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "updateFriendNickname", (t, n, r) => this.fetch(this.url("UpdateFriendNickname"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status,
friend: i.friend
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "removeFriend", (t, n, r) => this.fetch(this.url("RemoveFriend"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "contractCall", (t, n, r) => this.fetch(this.url("ContractCall"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
returns: i.returns
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "decodeContractCall", (t, n, r) => this.fetch(this.url("DecodeContractCall"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
call: i.call
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "lookupContractCallSelectors", (t, n, r) => this.fetch(this.url("LookupContractCallSelectors"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
signatures: i.signatures
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "userStorageFetch", (t, n, r) => this.fetch(this.url("UserStorageFetch"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
object: i.object
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "userStorageSave", (t, n, r) => this.fetch(this.url("UserStorageSave"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
ok: i.ok
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "userStorageDelete", (t, n, r) => this.fetch(this.url("UserStorageDelete"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
ok: i.ok
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "userStorageFetchAll", (t, n, r) => this.fetch(this.url("UserStorageFetchAll"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
objects: i.objects
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getMoonpayLink", (t, n, r) => this.fetch(this.url("GetMoonpayLink"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
signedUrl: i.signedUrl
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "resolveENSAddress", (t, n, r) => this.fetch(this.url("ResolveENSAddress"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
address: i.address,
ok: i.ok
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "isValidSignature", (t, n, r) => this.fetch(this.url("IsValidSignature"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
isValid: i.isValid
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "isValidMessageSignature", (t, n, r) => this.fetch(this.url("IsValidMessageSignature"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
isValid: i.isValid
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "isValidTypedDataSignature", (t, n, r) => this.fetch(this.url("IsValidTypedDataSignature"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
isValid: i.isValid
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "isValidETHAuthProof", (t, n, r) => this.fetch(this.url("IsValidETHAuthProof"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
isValid: i.isValid
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getOnRampURL", (t, n, r) => this.fetch(this.url("GetOnRampURL"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
url: i.url
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "sardineGetClientToken", (t, n) => this.fetch(this.url("SardineGetClientToken"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
token: s.token
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "sardineGetNFTCheckoutToken", (t, n, r) => this.fetch(this.url("SardineGetNFTCheckoutToken"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
resp: i.resp
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "sardineGetNFTCheckoutOrderStatus", (t, n, r) => this.fetch(this.url("SardineGetNFTCheckoutOrderStatus"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
resp: i.resp
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "sardineGetSupportedRegions", (t, n) => this.fetch(this.url("SardineGetSupportedRegions"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
regions: s.regions
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "sardineGetSupportedFiatCurrencies", (t, n) => this.fetch(this.url("SardineGetSupportedFiatCurrencies"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
tokens: s.tokens
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "sardineGetSupportedTokens", (t, n) => this.fetch(this.url("SardineGetSupportedTokens"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
tokens: s.tokens
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "sardineGetSupportedTokenForSwap", (t, n, r) => this.fetch(this.url("SardineGetSupportedTokenForSwap"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
token: i.token
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "sardineGetEnabledTokens", (t, n) => this.fetch(this.url("SardineGetEnabledTokens"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
tokens: s.tokens
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "sardineGetQuote", (t, n, r) => this.fetch(this.url("SardineGetQuote"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
quote: i.quote
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getSardineClientToken", (t, n) => this.fetch(this.url("GetSardineClientToken"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
token: s.token
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "getSardineNFTCheckoutToken", (t, n, r) => this.fetch(this.url("GetSardineNFTCheckoutToken"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
resp: i.resp
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getSardineNFTCheckoutOrderStatus", (t, n, r) => this.fetch(this.url("GetSardineNFTCheckoutOrderStatus"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
resp: i.resp
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "transakGetCountries", (t, n) => this.fetch(this.url("TransakGetCountries"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
regions: s.regions
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "transakGetCryptoCurrencies", (t, n) => this.fetch(this.url("TransakGetCryptoCurrencies"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
currencies: s.currencies
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "transakGetFiatCurrencies", (t, n) => this.fetch(this.url("TransakGetFiatCurrencies"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
currencies: s.currencies
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "transakGetPrice", (t, n, r) => this.fetch(this.url("TransakGetPrice"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
price: i.price
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "transakGetSupportedNFTCheckoutChains", (t, n) => this.fetch(this.url("TransakGetSupportedNFTCheckoutChains"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
chains: s.chains
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "getCoinPrices", (t, n, r) => this.fetch(this.url("GetCoinPrices"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
tokenPrices: i.tokenPrices
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getCollectiblePrices", (t, n, r) => this.fetch(this.url("GetCollectiblePrices"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
tokenPrices: i.tokenPrices
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getExchangeRate", (t, n, r) => this.fetch(this.url("GetExchangeRate"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
exchangeRate: i.exchangeRate
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "memoryStore", (t, n, r) => this.fetch(this.url("MemoryStore"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
ok: i.ok
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "memoryLoad", (t, n, r) => this.fetch(this.url("MemoryLoad"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
value: i.value
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getInviteInfo", (t, n) => this.fetch(this.url("GetInviteInfo"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
inviteInfo: s.inviteInfo
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "isValidAccessCode", (t, n, r) => this.fetch(this.url("IsValidAccessCode"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "internalClaimAccessCode", (t, n, r) => this.fetch(this.url("InternalClaimAccessCode"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "blockNumberAtTime", (t, n, r) => this.fetch(this.url("BlockNumberAtTime"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
blocks: i.blocks
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "paperSessionSecret", (t, n, r) => this.fetch(this.url("PaperSessionSecret"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
secret: i.secret
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "paperSessionSecret2", (t, n, r) => this.fetch(this.url("PaperSessionSecret2"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
secret: i.secret
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "linkWallet", (t, n, r) => this.fetch(this.url("LinkWallet"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getLinkedWallets", (t, n, r) => this.fetch(this.url("GetLinkedWallets"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
linkedWallets: i.linkedWallets
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "removeLinkedWallet", (t, n, r) => this.fetch(this.url("RemoveLinkedWallet"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "generateWaaSVerificationURL", (t, n, r) => this.fetch(this.url("GenerateWaaSVerificationURL"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
nonce: i.nonce,
verificationURL: i.verificationURL
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "validateWaaSVerificationNonce", (t, n, r) => this.fetch(this.url("ValidateWaaSVerificationNonce"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
walletAddress: i.walletAddress
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "listAdoptedWallets", (t, n, r) => this.fetch(this.url("ListAdoptedWallets"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
page: i.page,
wallets: i.wallets
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getLifiChains", (t, n) => this.fetch(this.url("GetLifiChains"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
chains: s.chains
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "getLifiTokens", (t, n, r) => this.fetch(this.url("GetLifiTokens"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
tokens: i.tokens
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getLifiSwapRoutes", (t, n, r) => this.fetch(this.url("GetLifiSwapRoutes"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
routes: i.routes
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getLifiSwapQuote", (t, n, r) => this.fetch(this.url("GetLifiSwapQuote"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
quote: i.quote
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getIntentCallsPayloads", (t, n, r) => this.fetch(this.url("GetIntentCallsPayloads"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
calls: i.calls,
preconditions: i.preconditions,
metaTxns: i.metaTxns,
trailsFee: i.trailsFee,
quote: i.quote,
feeQuotes: i.feeQuotes,
originIntentAddress: i.originIntentAddress,
destinationIntentAddress: i.destinationIntentAddress
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "commitIntentConfig", (t, n, r) => this.fetch(this.url("CommitIntentConfig"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
config: i.config
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getIntentConfig", (t, n, r) => this.fetch(this.url("GetIntentConfig"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
config: i.config
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "listCurrencyGroups", (t, n) => this.fetch(this.url("ListCurrencyGroups"), Ae({}, t, n)).then((r) => Ce(r).then((s) => ({
currencyGroups: s.currencyGroups
})), (r) => {
throw Ie.new({ cause: `fetch(): ${r.message || ""}` });
}));
te(this, "addOffchainInventory", (t, n, r) => this.fetch(this.url("AddOffchainInventory"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
inventoryId: i.inventoryId
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getOffchainInventory", (t, n, r) => this.fetch(this.url("GetOffchainInventory"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
inventory: i.inventory
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "listOffchainInventories", (t, n, r) => this.fetch(this.url("ListOffchainInventories"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
inventory: i.inventory
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "updateOffchainInventory", (t, n, r) => this.fetch(this.url("UpdateOffchainInventory"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "deleteOffchainInventory", (t, n, r) => this.fetch(this.url("DeleteOffchainInventory"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
ok: i.ok
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "requestOffchainPayment", (t, n, r) => this.fetch(this.url("RequestOffchainPayment"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
payment: i.payment
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "listOffchainPayments", (t, n, r) => this.fetch(this.url("ListOffchainPayments"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
page: i.page,
payments: i.payments
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "savePack", (t, n, r) => this.fetch(this.url("SavePack"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
merkleRoot: i.merkleRoot
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getPack", (t, n, r) => this.fetch(this.url("GetPack"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
pack: i.pack
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getPackIds", (t, n, r) => this.fetch(this.url("GetPackIds"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
packIds: i.packIds
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "deletePack", (t, n, r) => this.fetch(this.url("DeletePack"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "updatePackContent", (t, n, r) => this.fetch(this.url("UpdatePackContent"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
merkleRoot: i.merkleRoot
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getRevealTxData", (t, n, r) => this.fetch(this.url("GetRevealTxData"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
txData: i.txData
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "checkoutOptionsPrimary", (t, n, r) => this.fetch(this.url("CheckoutOptionsPrimary"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
options: i.options
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "checkoutOptionsSecondary", (t, n, r) => this.fetch(this.url("CheckoutOptionsSecondary"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
options: i.options
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "checkoutOptionsGetTransakContractID", (t, n, r) => this.fetch(this.url("CheckoutOptionsGetTransakContractID"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
contractId: i.contractId
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "fortePayCreateIntent", (t, n, r) => this.fetch(this.url("FortePayCreateIntent"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
resp: i.resp
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "fortePayGetPaymentStatuses", (t, n, r) => this.fetch(this.url("FortePayGetPaymentStatuses"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
statuses: i.statuses
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getCCTPTransfer", (t, n, r) => this.fetch(this.url("GetCCTPTransfer"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
transfer: i.transfer
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "queueCCTPTransfer", (t, n, r) => this.fetch(this.url("QueueCCTPTransfer"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
transfer: i.transfer
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "queueIntentConfigExecution", (t, n, r) => this.fetch(this.url("QueueIntentConfigExecution"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "getIntentConfigExecutionStatus", (t, n, r) => this.fetch(this.url("GetIntentConfigExecutionStatus"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
executionStatus: i.executionStatus
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "listIntentConfigs", (t, n, r) => this.fetch(this.url("ListIntentConfigs"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
page: i.page,
intentConfigs: i.intentConfigs
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
te(this, "queueMetaTxnReceipt", (t, n, r) => this.fetch(this.url("QueueMetaTxnReceipt"), Ae(t, n, r)).then((s) => Ce(s).then((i) => ({
status: i.status
})), (s) => {
throw Ie.new({ cause: `fetch(): ${s.message || ""}` });
}));
this.hostname = t.replace(/\/*$/, ""), this.fetch = (r, s) => n(r, s);
}
url(t) {
return this.hostname + this.path + t;
}
};
const Ae = (e = {}, t = {}, n = null) => {
const r = { ...t, "Content-Type": "application/json" };
return r[JJ] = eee, {
method: "POST",
headers: r,
body: JSON.stringify(e || {}),
signal: n
};
}, Ce = (e) => e.text().then((t) => {
let n;
try {
n = JSON.parse(t);
} catch (r) {
let s = "";
throw r instanceof Error && (s = r.message), mO.new({
status: e.status,
cause: `JSON.parse(): ${s}: response text: ${t}`
});
}
if (!e.ok) {
const r = typeof n.code == "number" ? n.code : 0;
throw (Dee[r] || Kt).new(n);
}
return n;
});
let Kt = class lO extends Error {
constructor(n, r, s, i, a) {
super(s);
te(this, "name");
te(this, "code");
te(this, "message");
te(this, "status");
te(this, "cause");
/** @deprecated Use message instead of msg. Deprecated in webrpc v0.11.0. */
te(this, "msg");
this.name = n || "WebrpcError", this.code = typeof r == "number" ? r : 0, this.message = s || `endpoint error ${this.code}`, this.msg = this.message, this.status = typeof i == "number" ? i : 0, this.cause = a, Object.setPrototypeOf(this, lO.prototype);
}
static new(n) {
return new this(n.error, n.code, n.message || n.msg, n.status, n.cause);
}
}, nee = class uO extends Kt {
constructor(t = "WebrpcEndpoint", n = 0, r = "endpoint error", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, uO.prototype);
}
}, Ie = class dO extends Kt {
constructor(t = "WebrpcRequestFailed", n = -1, r = "request failed", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, dO.prototype);
}
}, ree = class fO extends Kt {
constructor(t = "WebrpcBadRoute", n = -2, r = "bad route", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, fO.prototype);
}
}, see = class hO extends Kt {
constructor(t = "WebrpcBadMethod", n = -3, r = "bad method", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, hO.prototype);
}
}, iee = class pO extends Kt {
constructor(t = "WebrpcBadRequest", n = -4, r = "bad request", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, pO.prototype);
}
}, mO = class gO extends Kt {
constructor(t = "WebrpcBadResponse", n = -5, r = "bad response", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, gO.prototype);
}
}, aee = class yO extends Kt {
constructor(t = "WebrpcServerPanic", n = -6, r = "server panic", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, yO.prototype);
}
}, oee = class bO extends Kt {
constructor(t = "WebrpcInternalError", n = -7, r = "internal error", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, bO.prototype);
}
}, cee = class wO extends Kt {
constructor(t = "WebrpcClientDisconnected", n = -8, r = "client disconnected", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, wO.prototype);
}
}, lee = class vO extends Kt {
constructor(t = "WebrpcStreamLost", n = -9, r = "stream lost", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, vO.prototype);
}
}, uee = class xO extends Kt {
constructor(t = "WebrpcStreamFinished", n = -10, r = "stream finished", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, xO.prototype);
}
}, dee = class EO extends Kt {
constructor(t = "Unauthorized", n = 1e3, r = "Unauthorized access", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, EO.prototype);
}
}, fee = class kO extends Kt {
constructor(t = "PermissionDenied", n = 1001, r = "Permission denied", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, kO.prototype);
}
}, hee = class TO extends Kt {
constructor(t = "SessionExpired", n = 1002, r = "Session expired", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, TO.prototype);
}
}, pee = class SO extends Kt {
constructor(t = "MethodNotFound", n = 1003, r = "Method not found", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, SO.prototype);
}
}, mee = class IO extends Kt {
constructor(t = "RequestConflict", n = 1004, r = "Conflict with target resource", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, IO.prototype);
}
}, gee = class AO extends Kt {
constructor(t = "Aborted", n = 1005, r = "Request aborted", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, AO.prototype);
}
}, yee = class CO extends Kt {
constructor(t = "Geoblocked", n = 1006, r = "Geoblocked region", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, CO.prototype);
}
}, bee = class NO extends Kt {
constructor(t = "RateLimited", n = 1007, r = "Rate-limited. Please slow down.", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, NO.prototype);
}
}, wee = class OO extends Kt {
constructor(t = "ProjectNotFound", n = 1008, r = "Project not found", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, OO.prototype);
}
}, vee = class PO extends Kt {
constructor(t = "AccessKeyNotFound", n = 1101, r = "Access key not found", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, PO.prototype);
}
}, xee = class MO extends Kt {
constructor(t = "AccessKeyMismatch", n = 1102, r = "Access key mismatch", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, MO.prototype);
}
}, Eee = class RO extends Kt {
constructor(t = "InvalidOrigin", n = 1103, r = "Invalid origin for Access Key", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, RO.prototype);
}
}, kee = class BO extends Kt {
constructor(t = "InvalidService", n = 1104, r = "Service not enabled for Access key", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, BO.prototype);
}
}, Tee = class $O extends Kt {
constructor(t = "UnauthorizedUser", n = 1105, r = "Unauthorized user", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, $O.prototype);
}
}, See = class DO extends Kt {
constructor(t = "QuotaExceeded", n = 1200, r = "Quota request exceeded", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, DO.prototype);
}
}, Iee = class LO extends Kt {
constructor(t = "QuotaRateLimit", n = 1201, r = "Quota rate limit exceeded", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, LO.prototype);
}
}, Aee = class _O extends Kt {
constructor(t = "NoDefaultKey", n = 1300, r = "No default access key found", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, _O.prototype);
}
}, Cee = class UO extends Kt {
constructor(t = "MaxAccessKeys", n = 1301, r = "Access keys limit reached", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, UO.prototype);
}
}, Nee = class FO extends Kt {
constructor(t = "AtLeastOneKey", n = 1302, r = "You need at least one Access Key", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, FO.prototype);
}
}, Oee = class VO extends Kt {
constructor(t = "Timeout", n = 1900, r = "Request timed out", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, VO.prototype);
}
}, Pee = class jO extends Kt {
constructor(t = "InvalidArgument", n = 2e3, r = "Invalid argument", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, jO.prototype);
}
}, Mee = class WO extends Kt {
constructor(t = "Unavailable", n = 2002, r = "Unavailable resource", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, WO.prototype);
}
}, Ree = class HO extends Kt {
constructor(t = "QueryFailed", n = 2003, r = "Query failed", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, HO.prototype);
}
}, Bee = class qO extends Kt {
constructor(t = "NotFound", n = 3e3, r = "Resource not found", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, qO.prototype);
}
}, $ee = class GO extends Kt {
constructor(t = "UnsupportedNetwork", n = 3008, r = "Unsupported network", s = 0, i) {
super(t, n, r, s, i), Object.setPrototypeOf(this, GO.prototype);
}
};
var VA;
(function(e) {
e.WebrpcEndpoint = "WebrpcEndpoint", e.WebrpcRequestFailed = "WebrpcRequestFailed", e.WebrpcBadRoute = "WebrpcBadRoute", e.WebrpcBadMethod = "WebrpcBadMethod", e.WebrpcBadRequest = "WebrpcBadRequest", e.WebrpcBadResponse = "WebrpcBadResponse", e.WebrpcServerPanic = "WebrpcServerPanic", e.WebrpcInternalError = "WebrpcInternalError", e.WebrpcClientDisconnected = "WebrpcClientDisconnected", e.WebrpcStreamLost = "WebrpcStreamLost", e.WebrpcStreamFinished = "WebrpcStreamFinished", e.Unauthorized = "Unauthorized", e.PermissionDenied = "PermissionDenied", e.SessionExpired = "SessionExpired", e.MethodNotFound = "MethodNotFound", e.RequestConflict = "RequestConflict", e.Aborted = "Aborted", e.Geoblocked = "Geoblocked", e.RateLimited = "RateLimited", e.ProjectNotFound = "ProjectNotFound", e.AccessKeyNotFound = "AccessKeyNotFound", e.AccessKeyMismatch = "AccessKeyMismatch", e.InvalidOrigin = "InvalidOrigin", e.InvalidService = "InvalidService", e.UnauthorizedUser = "UnauthorizedUser", e.QuotaExceeded = "QuotaExceeded", e.QuotaRateLimit = "QuotaRateLimit", e.NoDefaultKey = "NoDefaultKey", e.MaxAccessKeys = "MaxAccessKeys", e.AtLeastOneKey = "AtLeastOneKey", e.Timeout = "Timeout", e.InvalidArgument = "InvalidArgument", e.Unavailable = "Unavailable", e.QueryFailed = "QueryFailed", e.NotFound = "NotFound", e.UnsupportedNetwork = "UnsupportedNetwork";
})(VA || (VA = {}));
var jA;
(function(e) {
e[e.WebrpcEndpoint = 0] = "WebrpcEndpoint", e[e.WebrpcRequestFailed = -1] = "WebrpcRequestFailed", e[e.WebrpcBadRoute = -2] = "WebrpcBadRoute", e[e.WebrpcBadMethod = -3] = "WebrpcBadMethod", e[e.WebrpcBadRequest = -4] = "WebrpcBadRequest", e[e.WebrpcBadResponse = -5] = "WebrpcBadResponse", e[e.WebrpcServerPanic = -6] = "WebrpcServerPanic", e[e.WebrpcInternalError = -7] = "WebrpcInternalError", e[e.WebrpcClientDisconnected = -8] = "WebrpcClientDisconnected", e[e.WebrpcStreamLost = -9] = "WebrpcStreamLost", e[e.WebrpcStreamFinished = -10] = "WebrpcStreamFinished", e[e.Unauthorized = 1e3] = "Unauthorized", e[e.PermissionDenied = 1001] = "PermissionDenied", e[e.SessionExpired = 1002] = "SessionExpired", e[e.MethodNotFound = 1003] = "MethodNotFound", e[e.RequestConflict = 1004] = "RequestConflict", e[e.Aborted = 1005] = "Aborted", e[e.Geoblocked = 1006] = "Geoblocked", e[e.RateLimited = 1007] = "RateLimited", e[e.ProjectNotFound = 1008] = "ProjectNotFound", e[e.AccessKeyNotFound = 1101] = "AccessKeyNotFound", e[e.AccessKeyMismatch = 1102] = "AccessKeyMismatch", e[e.InvalidOrigin = 1103] = "InvalidOrigin", e[e.InvalidService = 1104] = "InvalidService", e[e.UnauthorizedUser = 1105] = "UnauthorizedUser", e[e.QuotaExceeded = 1200] = "QuotaExceeded", e[e.QuotaRateLimit = 1201] = "QuotaRateLimit", e[e.NoDefaultKey = 1300] = "NoDefaultKey", e[e.MaxAccessKeys = 1301] = "MaxAccessKeys", e[e.AtLeastOneKey = 1302] = "AtLeastOneKey", e[e.Timeout = 1900] = "Timeout", e[e.InvalidArgument = 2e3] = "InvalidArgument", e[e.Unavailable = 2002] = "Unavailable", e[e.QueryFailed = 2003] = "QueryFailed", e[e.NotFound = 3e3] = "NotFound", e[e.UnsupportedNetwork = 3008] = "UnsupportedNetwork";
})(jA || (jA = {}));
const Dee = {
0: nee,
[-1]: Ie,
[-2]: ree,
[-3]: see,
[-4]: iee,
[-5]: mO,
[-6]: aee,
[-7]: oee,
[-8]: cee,
[-9]: lee,
[-10]: uee,
1e3: dee,
1001: fee,
1002: hee,
1003: pee,
1004: mee,
1005: gee,
1006: yee,
1007: bee,
1008: wee,
1101: vee,
1102: xee,
1103: Eee,
1104: kee,
1105: Tee,
1200: See,
1201: Iee,
1300: Aee,
1301: Cee,
1302: Nee,
1900: Oee,
2e3: Pee,
2002: Mee,
2003: Ree,
3e3: Bee,
3008: $ee
};
let Lee = class extends tee {
constructor(n, r, s) {
super(n.endsWith("/") ? n.slice(0, -1) : n, fetch);
te(this, "projectAccessKey");
te(this, "jwtAuth");
te(this, "_fetch", (n, r) => {
const s = {}, i = this.jwtAuth, a = this.projectAccessKey;
return i && i.length > 0 && (s.Authorization = `BEARER ${i}`), a && a.length > 0 && (s["X-Access-Key"] = a), r.headers = { ...r.headers, ...s }, fetch(n, r);
});
this.projectAccessKey = r, this.jwtAuth = s, this.fetch = this._fetch;
}
};
const _ee = {
factory: "0x00000000000018A77519fcCCa060c2537c9D6d3F",
stage1: "0x00000000000084fA81809Dd337311297C5594d62",
creationCode: "0x6041600e3d396021805130553df33d3d36153402601f57363d3d373d363d30545af43d82803e903d91601f57fd5bf3"
}, Uee = "0x9eCA6CEf73799402a1afe4779f588f03034c5D0f", Fee = "0xd7571bd1e3af468c3a49966c9a92a2e907cdfa52", Vee = "0x9a013e7d186611af36a918ef23d81886e8c256f8", jee = "0xc1A9B197eBb31Fc2B613C59dAC3f3E5698A429D0", Wee = "prod", zO = "https://nodes.sequence.app", KO = "https://indexer.sequence.app", QO = "https://api.sequence.app", YO = "https://dev-nodes.sequence.app", XO = "https://dev-indexer.sequence.app", O2 = "https://dev-api.sequence.app", Hee = {
8453: "0x2bf4c63199eD7D8A737E8DB2cC19E0C0103F6bE3",
84532: "0xdcd9160492C6D43ABbd28D4d06F68ad77f1A0F2b",
421614: "0xf18A16E1C778baCA5d6f7F48cC4c9bb913e5e579",
42161: "0x674827B6BE8780DBdb96DC02c735275e3a982c90",
137: "0x4dBb20eA3A969F1A44d7653D4Dc8632B853E36DE"
}, qee = "AQAAAAAAAKhGHJc3N5V2AWqfJ1v9xZ2u0nA", Gee = "AQAAAAAAAAaq1E41OU0QxifQgrVBMgfqg7k", zee = "https://databeat.sequence.app", Kee = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHAiOiJzZXEtdHJhaWxzIiwiZXhwIjoyMDI4MTIwOTg4fQ.KZIjEziul_nZ4kjEXudvfqeWmVekc5ftXKx_EqDrmZU", Qee = "10c5ac56159da00924d110c07c3f6e3a", Yee = "https://trails.build/", Xee = "0.05", Cb = "0.15";
function cl(e) {
try {
return typeof window > "u" ? null : new URLSearchParams(window.location.search).get(e);
} catch (t) {
return console.error("Error getting query param", t), null;
}
}
function Zee() {
const [e, t] = ie(
typeof window < "u" ? new URLSearchParams(window.location.search) : new URLSearchParams()
);
return ve(() => {
if (typeof window > "u")
return;
const a = () => {
t(new URLSearchParams(window.location.search));
};
window.addEventListener("popstate", a);
const o = window.history.pushState, c = window.history.replaceState;
return window.history.pushState = function() {
o.apply(this, arguments), a();
}, window.history.replaceState = function() {
c.apply(this, arguments), a();
}, () => {
window.removeEventListener("popstate", a), window.history.pushState = o, window.history.replaceState = c;
};
}, []), {
queryParams: e,
getParam: (a) => e.get(a),
hasParam: (a, o) => o ? e.get(a) === o : e.has(a),
setParam: (a, o) => {
if (typeof window > "u")
return;
const c = new URLSearchParams(e);
c.set(a, o);
const l = new URL(window.location.href);
l.search = c.toString(), window.history.pushState({}, "", l.toString()), t(c);
},
removeParam: (a) => {
if (typeof window > "u")
return;
const o = new URLSearchParams(e);
o.delete(a);
const c = new URL(window.location.href);
c.search = o.toString(), window.history.pushState({}, "", c.toString()), t(o);
}
};
}
const sm = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, Hr = {
commitHash: rte(),
sequenceProjectAccessKey: nte(),
sequenceIndexerUrl: Jee(),
sequenceNodeGatewayUrl: tte(),
sequenceApiUrl: ete(),
sequenceEnv: nf(),
walletConnectProjectId: Qee,
slippageTolerance: Xee,
debug: !1
};
function nf() {
if (typeof process < "u") {
if (li("ENV") === "local")
return "local";
if (li("ENV") === "development" || li("ENV") === "dev")
return "dev";
if (li("CF_PAGES_BRANCH") === "master" || li("CF_PAGES_BRANCH") === "main" || li("ENV") === "production" || li("ENV") === "prod")
return "prod";
}
return Wee;
}
function Jee() {
return nf() === "prod" ? KO : XO;
}
function ete() {
return nf() === "prod" ? QO : nf() === "local" && li("TEST_API_URL") || O2;
}
function tte() {
return nf() === "prod" ? zO : YO;
}
function nte() {
return nf() === "prod" ? qee : Gee;
}
function rte() {
const e = li("CF_PAGES_COMMIT_SHA"), t = li("VITE_COMMIT_SHA");
return e && console.log(`Commit hash from CF_PAGES_COMMIT_SHA: ${e}`), t && console.log(`Commit hash from VITE_COMMIT_SHA: ${t}`), e || t;
}
function fs() {
return Hr.sequenceProjectAccessKey;
}
function WA(e) {
Hr.sequenceProjectAccessKey = e;
}
function P2(e) {
Hr.sequenceIndexerUrl = e;
}
function rf() {
return Hr.sequenceIndexerUrl;
}
function M2(e) {
Hr.sequenceNodeGatewayUrl = e;
}
function ZO() {
return Hr.sequenceNodeGatewayUrl;
}
function Dm(e) {
Hr.sequenceApiUrl = e;
}
function yu() {
return Hr.sequenceApiUrl;
}
function ste(e) {
Hr.sequenceEnv = e, e === "prod" && (P2(KO), Dm(QO), M2(zO)), e === "local" && li("API_URL") && Dm(li("API_URL")), e === "dev" && (P2(XO), Dm(O2), M2(YO));
}
function fa() {
return Hr.sequenceEnv;
}
function ite(e) {
Hr.walletConnectProjectId = e;
}
function I0() {
return Hr.walletConnectProjectId;
}
function R2(e) {
Hr.slippageTolerance = e;
}
function Md() {
return Hr.slippageTolerance;
}
function ate(e) {
Hr.debug = e;
}
function A0() {
return Hr.debug || cl("debug") === "true";
}
function ote() {
return Hr.commitHash;
}
const cte = {
accountIntentTransactionHistory: !1
};
function li(e) {
if (typeof process < "u")
return process?.env?.[e];
if (sm)
return sm[e];
if (sm[`VITE_${e}`])
return sm[`VITE_${e}`];
}
function JO({
apiUrl: e = yu(),
projectAccessKey: t = fs(),
jwt: n
}) {
return new Lee(e, t, n);
}
const ic = (e) => {
const { projectAccessKey: t, jwt: n, env: r } = Z8();
return We(() => JO({
apiUrl: yu() ?? e?.apiUrl ?? r.apiUrl,
projectAccessKey: fs() ?? e?.projectAccessKey ?? t,
jwt: e?.jwt ?? n
}), [t, n, r.apiUrl, e]);
}, lte = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
getAPIClient: JO,
useAPIClient: ic
}, Symbol.toStringTag, { value: "Module" }));
var ht;
(function(e) {
e[e.Verbose = 4] = "Verbose", e[e.Info = 3] = "Info", e[e.Warn = 2] = "Warn", e[e.Error = 1] = "Error", e[e.None = 0] = "None";
})(ht || (ht = {}));
const B2 = (e, t, n) => {
if (n >= t) {
const r = e.reduce((s, i, a) => ((a + 1) % 2 && s.push(`
`), s.push(i), s), []);
switch (t) {
case ht.Info:
console.info(...r);
break;
case ht.Error:
console.error(...r);
break;
case ht.Warn:
console.warn(...r);
break;
default:
console.log(...r);
break;
}
}
};
function ute(e) {
const t = e[0], n = e[1], r = t?.items?.some((i) => i.status === "incomplete"), s = n?.items?.some((i) => i.status === "incomplete");
return t?.id === "approve" && (n?.id === "deposit" || n?.id === "swap") && r && s;
}
function dte(e) {
const t = e[1]?.id;
return {
id: `approve-and-${t}`,
action: "Confirm transaction in your wallet",
description: `Batching approval and ${t} transactions`,
kind: "transaction",
items: [
...e[0].items || [],
...(e[1].items || []).map((r) => (r.status = "complete", r.progressState = "complete", r))
],
requestId: e[1].requestId ?? e[0].requestId
};
}
function eP(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: fte } = Object.prototype, { getPrototypeOf: Q6 } = Object, { iterator: Nb, toStringTag: tP } = Symbol, Ob = /* @__PURE__ */ ((e) => (t) => {
const n = fte.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), Ta = (e) => (e = e.toLowerCase(), (t) => Ob(t) === e), Pb = (e) => (t) => typeof t === e, { isArray: Lf } = Array, sf = Pb("undefined");
function lp(e) {
return e !== nu