@rash2x/bridge-widget 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evaa-bridge.cjs +121 -232
- package/dist/evaa-bridge.cjs.map +1 -1
- package/dist/evaa-bridge.mjs +119 -230
- package/dist/evaa-bridge.mjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/styles.css +104 -125
- package/package.json +18 -10
package/dist/evaa-bridge.mjs
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import * as require$$0 from "react";
|
|
7
|
-
import require$$0__default, { useState, useCallback, useRef, useEffect,
|
|
7
|
+
import require$$0__default, { useState, useCallback, useRef, useEffect, useMemo, createContext, useContext, memo, forwardRef } from "react";
|
|
8
8
|
import { create as create$1 } from "zustand";
|
|
9
9
|
import { Slot } from "@radix-ui/react-slot";
|
|
10
10
|
import { cva } from "class-variance-authority";
|
|
@@ -14,6 +14,7 @@ import { createPortal } from "react-dom";
|
|
|
14
14
|
import { AnimatePresence, motion } from "framer-motion";
|
|
15
15
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
16
16
|
import { useAccount, useDisconnect, useWalletClient } from "wagmi";
|
|
17
|
+
import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
17
18
|
import { useTonAddress, useTonConnectUI } from "@tonconnect/ui-react";
|
|
18
19
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
19
20
|
import { Address, Cell } from "@ton/core";
|
|
@@ -25,6 +26,7 @@ import { ConnectKitButton } from "connectkit";
|
|
|
25
26
|
import { t } from "i18next";
|
|
26
27
|
import { toast, Toaster } from "sonner";
|
|
27
28
|
import { ethers, BrowserProvider, Contract, parseUnits } from "ethers";
|
|
29
|
+
import { TronLinkAdapterName } from "@tronweb3/tronwallet-adapters";
|
|
28
30
|
const norm = (s) => (s ?? "").toUpperCase().replace(/₮/g, "T").replace(/[^A-Z0-9]/g, "");
|
|
29
31
|
const POPULAR_ORDER = [
|
|
30
32
|
"USDT",
|
|
@@ -1239,139 +1241,6 @@ function Input({ className, type, ...props }) {
|
|
|
1239
1241
|
}
|
|
1240
1242
|
);
|
|
1241
1243
|
}
|
|
1242
|
-
function getDefaultExportFromCjs(x) {
|
|
1243
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1244
|
-
}
|
|
1245
|
-
function getAugmentedNamespace(n) {
|
|
1246
|
-
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
1247
|
-
var f = n.default;
|
|
1248
|
-
if (typeof f == "function") {
|
|
1249
|
-
var a = function a2() {
|
|
1250
|
-
var isInstance = false;
|
|
1251
|
-
try {
|
|
1252
|
-
isInstance = this instanceof a2;
|
|
1253
|
-
} catch {
|
|
1254
|
-
}
|
|
1255
|
-
if (isInstance) {
|
|
1256
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
1257
|
-
}
|
|
1258
|
-
return f.apply(this, arguments);
|
|
1259
|
-
};
|
|
1260
|
-
a.prototype = f.prototype;
|
|
1261
|
-
} else a = {};
|
|
1262
|
-
Object.defineProperty(a, "__esModule", { value: true });
|
|
1263
|
-
Object.keys(n).forEach(function(k) {
|
|
1264
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
1265
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
1266
|
-
enumerable: true,
|
|
1267
|
-
get: function() {
|
|
1268
|
-
return n[k];
|
|
1269
|
-
}
|
|
1270
|
-
});
|
|
1271
|
-
});
|
|
1272
|
-
return a;
|
|
1273
|
-
}
|
|
1274
|
-
var NetworkType;
|
|
1275
|
-
(function(NetworkType2) {
|
|
1276
|
-
NetworkType2["Mainnet"] = "Mainnet";
|
|
1277
|
-
NetworkType2["Shasta"] = "Shasta";
|
|
1278
|
-
NetworkType2["Nile"] = "Nile";
|
|
1279
|
-
NetworkType2["Unknown"] = "Unknown";
|
|
1280
|
-
})(NetworkType || (NetworkType = {}));
|
|
1281
|
-
var ChainNetwork;
|
|
1282
|
-
(function(ChainNetwork2) {
|
|
1283
|
-
ChainNetwork2["Mainnet"] = "Mainnet";
|
|
1284
|
-
ChainNetwork2["Shasta"] = "Shasta";
|
|
1285
|
-
ChainNetwork2["Nile"] = "Nile";
|
|
1286
|
-
})(ChainNetwork || (ChainNetwork = {}));
|
|
1287
|
-
function printError() {
|
|
1288
|
-
console.error(`
|
|
1289
|
-
You are using WalletContext without provide the WalletContext.Provider.
|
|
1290
|
-
Please wrap your sub-components with a WalletProvider and provide required values.
|
|
1291
|
-
`);
|
|
1292
|
-
}
|
|
1293
|
-
const DEFAULT_CONTEXT = {
|
|
1294
|
-
autoConnect: false,
|
|
1295
|
-
connecting: false,
|
|
1296
|
-
connected: false,
|
|
1297
|
-
disconnecting: false,
|
|
1298
|
-
/* eslint-disable */
|
|
1299
|
-
select(_name) {
|
|
1300
|
-
printError();
|
|
1301
|
-
},
|
|
1302
|
-
connect() {
|
|
1303
|
-
printError();
|
|
1304
|
-
return Promise.reject();
|
|
1305
|
-
},
|
|
1306
|
-
disconnect() {
|
|
1307
|
-
printError();
|
|
1308
|
-
return Promise.reject();
|
|
1309
|
-
},
|
|
1310
|
-
signTransaction(_transaction) {
|
|
1311
|
-
printError();
|
|
1312
|
-
return Promise.reject();
|
|
1313
|
-
},
|
|
1314
|
-
signMessage(_message) {
|
|
1315
|
-
printError();
|
|
1316
|
-
return Promise.reject();
|
|
1317
|
-
}
|
|
1318
|
-
/* eslint-enable */
|
|
1319
|
-
};
|
|
1320
|
-
Object.defineProperty(DEFAULT_CONTEXT, "wallets", {
|
|
1321
|
-
get() {
|
|
1322
|
-
printError();
|
|
1323
|
-
return [];
|
|
1324
|
-
}
|
|
1325
|
-
});
|
|
1326
|
-
Object.defineProperty(DEFAULT_CONTEXT, "wallet", {
|
|
1327
|
-
get() {
|
|
1328
|
-
printError();
|
|
1329
|
-
return null;
|
|
1330
|
-
}
|
|
1331
|
-
});
|
|
1332
|
-
Object.defineProperty(DEFAULT_CONTEXT, "address", {
|
|
1333
|
-
get() {
|
|
1334
|
-
printError();
|
|
1335
|
-
return null;
|
|
1336
|
-
}
|
|
1337
|
-
});
|
|
1338
|
-
const WalletContext = createContext(DEFAULT_CONTEXT);
|
|
1339
|
-
function useWallet() {
|
|
1340
|
-
return useContext(WalletContext);
|
|
1341
|
-
}
|
|
1342
|
-
(function(thisArg, _arguments, P, generator) {
|
|
1343
|
-
function adopt(value) {
|
|
1344
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
1345
|
-
resolve(value);
|
|
1346
|
-
});
|
|
1347
|
-
}
|
|
1348
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1349
|
-
function fulfilled(value) {
|
|
1350
|
-
try {
|
|
1351
|
-
step(generator.next(value));
|
|
1352
|
-
} catch (e) {
|
|
1353
|
-
reject(e);
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
function rejected(value) {
|
|
1357
|
-
try {
|
|
1358
|
-
step(generator["throw"](value));
|
|
1359
|
-
} catch (e) {
|
|
1360
|
-
reject(e);
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
function step(result) {
|
|
1364
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1365
|
-
}
|
|
1366
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1367
|
-
});
|
|
1368
|
-
});
|
|
1369
|
-
({
|
|
1370
|
-
"0x2b6653dc": NetworkType.Mainnet,
|
|
1371
|
-
"0x94a9059e": NetworkType.Shasta,
|
|
1372
|
-
"0xcd8690dc": NetworkType.Nile
|
|
1373
|
-
});
|
|
1374
|
-
const TronLinkAdapterName = "TronLink";
|
|
1375
1244
|
function useAddresses() {
|
|
1376
1245
|
const { fromChain, toChain } = useChainsStore();
|
|
1377
1246
|
const { address: evmAddress } = useAccount();
|
|
@@ -1620,8 +1489,12 @@ function useBalances(chainKey, address) {
|
|
|
1620
1489
|
[balanceBySymbol]
|
|
1621
1490
|
);
|
|
1622
1491
|
const isLoading = query.isLoading || query.isFetching;
|
|
1492
|
+
const balances = useMemo(
|
|
1493
|
+
() => query.data || {},
|
|
1494
|
+
[query.data]
|
|
1495
|
+
);
|
|
1623
1496
|
return {
|
|
1624
|
-
balances
|
|
1497
|
+
balances,
|
|
1625
1498
|
getBalance,
|
|
1626
1499
|
isLoading,
|
|
1627
1500
|
query
|
|
@@ -1755,7 +1628,7 @@ const TokenRow = ({
|
|
|
1755
1628
|
Button,
|
|
1756
1629
|
{
|
|
1757
1630
|
onClick: onPick,
|
|
1758
|
-
className: `w-full
|
|
1631
|
+
className: `w-full h-[50px] cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-modal-item-hover rounded-12 transition-[300] ${isSelected ? "border border-ring" : ""}`,
|
|
1759
1632
|
children: [
|
|
1760
1633
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1761
1634
|
/* @__PURE__ */ jsx(
|
|
@@ -3457,7 +3330,7 @@ const ReceiveRow = () => {
|
|
|
3457
3330
|
label: t2("transaction.route"),
|
|
3458
3331
|
right: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
3459
3332
|
/* @__PURE__ */ jsx(StargateIcon, { className: "size-4" }),
|
|
3460
|
-
/* @__PURE__ */ jsx("p", { className: "text-foreground font-normal text-sm
|
|
3333
|
+
/* @__PURE__ */ jsx("p", { className: "text-foreground font-normal text-sm leading-[100%]", children: routeText }),
|
|
3461
3334
|
hasGasOnDestination && /* @__PURE__ */ jsx("span", { className: "text-xs bg-settings-active text-settings-active-foreground px-1.5 py-0.5 rounded", children: t2(`settings.gasPresets.${gasPreset}`) })
|
|
3462
3335
|
] })
|
|
3463
3336
|
}
|
|
@@ -3852,7 +3725,9 @@ function useBridgeTransaction() {
|
|
|
3852
3725
|
function useGasEstimate(amountNum) {
|
|
3853
3726
|
const { fromChain } = useChainsStore();
|
|
3854
3727
|
const { selectedAssetSymbol, tokens } = useTokensStore();
|
|
3855
|
-
const
|
|
3728
|
+
const getSourceGasReserveHuman = useSettingsStore(
|
|
3729
|
+
(state) => state.getSourceGasReserveHuman
|
|
3730
|
+
);
|
|
3856
3731
|
const { srcAddress } = useAddresses();
|
|
3857
3732
|
const { balances, isLoading: balancesLoading } = useBalances(
|
|
3858
3733
|
fromChain?.chainKey,
|
|
@@ -3860,59 +3735,44 @@ function useGasEstimate(amountNum) {
|
|
|
3860
3735
|
);
|
|
3861
3736
|
const { chainRegistry } = useChainStrategies();
|
|
3862
3737
|
const balancesKnown = !balancesLoading;
|
|
3863
|
-
const
|
|
3864
|
-
null
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
}
|
|
3902
|
-
}
|
|
3903
|
-
estimateGas();
|
|
3904
|
-
return () => {
|
|
3905
|
-
cancelled = true;
|
|
3906
|
-
};
|
|
3907
|
-
}, [
|
|
3908
|
-
fromChain,
|
|
3909
|
-
selectedAssetSymbol,
|
|
3910
|
-
tokens,
|
|
3911
|
-
amountNum,
|
|
3912
|
-
balances,
|
|
3913
|
-
chainRegistry,
|
|
3914
|
-
getSourceGasReserveHuman
|
|
3915
|
-
]);
|
|
3738
|
+
const strategy = useMemo(() => {
|
|
3739
|
+
if (!fromChain) return null;
|
|
3740
|
+
return chainRegistry.getStrategy(fromChain.chainKey);
|
|
3741
|
+
}, [fromChain, chainRegistry]);
|
|
3742
|
+
const { data: gasRequirement } = useQuery({
|
|
3743
|
+
queryKey: [
|
|
3744
|
+
"gas-estimate",
|
|
3745
|
+
fromChain?.chainKey,
|
|
3746
|
+
selectedAssetSymbol,
|
|
3747
|
+
amountNum,
|
|
3748
|
+
balances
|
|
3749
|
+
],
|
|
3750
|
+
queryFn: async () => {
|
|
3751
|
+
if (!fromChain || !strategy) {
|
|
3752
|
+
return null;
|
|
3753
|
+
}
|
|
3754
|
+
const selectedToken = tokens?.find(
|
|
3755
|
+
(t2) => t2.symbol.toUpperCase() === selectedAssetSymbol?.toUpperCase()
|
|
3756
|
+
) || null;
|
|
3757
|
+
const nativeTokenSymbol = fromChain.nativeCurrency?.symbol ?? "";
|
|
3758
|
+
const nativeDecimals = fromChain.nativeCurrency?.decimals || 18;
|
|
3759
|
+
const reserveFallback = getSourceGasReserveHuman(fromChain.chainKey);
|
|
3760
|
+
const result = await strategy.estimateGasRequirement({
|
|
3761
|
+
selectedToken,
|
|
3762
|
+
nativeTokenSymbol,
|
|
3763
|
+
amount: amountNum,
|
|
3764
|
+
balances,
|
|
3765
|
+
nativeDecimals,
|
|
3766
|
+
reserveFallback
|
|
3767
|
+
});
|
|
3768
|
+
return result;
|
|
3769
|
+
},
|
|
3770
|
+
enabled: !!fromChain && !!strategy,
|
|
3771
|
+
staleTime: 3e4,
|
|
3772
|
+
gcTime: 5 * 6e4,
|
|
3773
|
+
refetchOnWindowFocus: false,
|
|
3774
|
+
retry: 1
|
|
3775
|
+
});
|
|
3916
3776
|
return {
|
|
3917
3777
|
nativeSym: gasRequirement?.nativeSym || "",
|
|
3918
3778
|
nativeBalance: gasRequirement?.nativeBalance || 0,
|
|
@@ -4292,7 +4152,7 @@ const WalletSelectModal = ({
|
|
|
4292
4152
|
return /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsxs(
|
|
4293
4153
|
Button,
|
|
4294
4154
|
{
|
|
4295
|
-
className: "w-full
|
|
4155
|
+
className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-muted h-auto rounded-12 transition-[300]",
|
|
4296
4156
|
children: [
|
|
4297
4157
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 min-w-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
4298
4158
|
/* @__PURE__ */ jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "size-7.5" }) }),
|
|
@@ -4322,7 +4182,7 @@ const WalletSelectModal = ({
|
|
|
4322
4182
|
type: "button",
|
|
4323
4183
|
onClick: show,
|
|
4324
4184
|
disabled: isConnecting,
|
|
4325
|
-
className: "w-full
|
|
4185
|
+
className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-muted h-auto rounded-12 transition-[300] disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4326
4186
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
4327
4187
|
/* @__PURE__ */ jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "size-7.5" }) }),
|
|
4328
4188
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
@@ -4339,7 +4199,7 @@ const WalletSelectModal = ({
|
|
|
4339
4199
|
{
|
|
4340
4200
|
onClick: () => handleWalletSelect(wallet.id),
|
|
4341
4201
|
disabled: !wallet.enabled,
|
|
4342
|
-
className: "w-full
|
|
4202
|
+
className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-muted h-auto rounded-12 transition-[300] disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4343
4203
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
4344
4204
|
/* @__PURE__ */ jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "size-7.5" }) }),
|
|
4345
4205
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
@@ -4973,6 +4833,38 @@ const TransactionSuccessVector = (props) => {
|
|
|
4973
4833
|
)
|
|
4974
4834
|
] });
|
|
4975
4835
|
};
|
|
4836
|
+
function getDefaultExportFromCjs(x) {
|
|
4837
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4838
|
+
}
|
|
4839
|
+
function getAugmentedNamespace(n) {
|
|
4840
|
+
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
4841
|
+
var f = n.default;
|
|
4842
|
+
if (typeof f == "function") {
|
|
4843
|
+
var a = function a2() {
|
|
4844
|
+
var isInstance = false;
|
|
4845
|
+
try {
|
|
4846
|
+
isInstance = this instanceof a2;
|
|
4847
|
+
} catch {
|
|
4848
|
+
}
|
|
4849
|
+
if (isInstance) {
|
|
4850
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
4851
|
+
}
|
|
4852
|
+
return f.apply(this, arguments);
|
|
4853
|
+
};
|
|
4854
|
+
a.prototype = f.prototype;
|
|
4855
|
+
} else a = {};
|
|
4856
|
+
Object.defineProperty(a, "__esModule", { value: true });
|
|
4857
|
+
Object.keys(n).forEach(function(k) {
|
|
4858
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
4859
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
4860
|
+
enumerable: true,
|
|
4861
|
+
get: function() {
|
|
4862
|
+
return n[k];
|
|
4863
|
+
}
|
|
4864
|
+
});
|
|
4865
|
+
});
|
|
4866
|
+
return a;
|
|
4867
|
+
}
|
|
4976
4868
|
var fireworks$1 = {};
|
|
4977
4869
|
var presets = {};
|
|
4978
4870
|
var dist = {};
|
|
@@ -4980,7 +4872,7 @@ var module = {};
|
|
|
4980
4872
|
(function main(global, module2, isWorker, workerSize) {
|
|
4981
4873
|
var canUseWorker = !!(global.Worker && global.Blob && global.Promise && global.OffscreenCanvas && global.OffscreenCanvasRenderingContext2D && global.HTMLCanvasElement && global.HTMLCanvasElement.prototype.transferControlToOffscreen && global.URL && global.URL.createObjectURL);
|
|
4982
4874
|
var canUsePaths = typeof Path2D === "function" && typeof DOMMatrix === "function";
|
|
4983
|
-
var canDrawBitmap = function() {
|
|
4875
|
+
var canDrawBitmap = (function() {
|
|
4984
4876
|
if (!global.OffscreenCanvas) {
|
|
4985
4877
|
return false;
|
|
4986
4878
|
}
|
|
@@ -4994,7 +4886,7 @@ var module = {};
|
|
|
4994
4886
|
return false;
|
|
4995
4887
|
}
|
|
4996
4888
|
return true;
|
|
4997
|
-
}();
|
|
4889
|
+
})();
|
|
4998
4890
|
function noop() {
|
|
4999
4891
|
}
|
|
5000
4892
|
function promise(func) {
|
|
@@ -5006,7 +4898,7 @@ var module = {};
|
|
|
5006
4898
|
func(noop, noop);
|
|
5007
4899
|
return null;
|
|
5008
4900
|
}
|
|
5009
|
-
var bitmapMapper = /* @__PURE__ */ function(skipTransform, map) {
|
|
4901
|
+
var bitmapMapper = /* @__PURE__ */ (function(skipTransform, map) {
|
|
5010
4902
|
return {
|
|
5011
4903
|
transform: function(bitmap) {
|
|
5012
4904
|
if (skipTransform) {
|
|
@@ -5025,8 +4917,8 @@ var module = {};
|
|
|
5025
4917
|
map.clear();
|
|
5026
4918
|
}
|
|
5027
4919
|
};
|
|
5028
|
-
}(canDrawBitmap, /* @__PURE__ */ new Map());
|
|
5029
|
-
var raf = function() {
|
|
4920
|
+
})(canDrawBitmap, /* @__PURE__ */ new Map());
|
|
4921
|
+
var raf = (function() {
|
|
5030
4922
|
var TIME = Math.floor(1e3 / 60);
|
|
5031
4923
|
var frame, cancel;
|
|
5032
4924
|
var frames = {};
|
|
@@ -5059,8 +4951,8 @@ var module = {};
|
|
|
5059
4951
|
};
|
|
5060
4952
|
}
|
|
5061
4953
|
return { frame, cancel };
|
|
5062
|
-
}();
|
|
5063
|
-
var getWorker = /* @__PURE__ */ function() {
|
|
4954
|
+
})();
|
|
4955
|
+
var getWorker = /* @__PURE__ */ (function() {
|
|
5064
4956
|
var worker;
|
|
5065
4957
|
var prom;
|
|
5066
4958
|
var resolves = {};
|
|
@@ -5141,7 +5033,7 @@ var module = {};
|
|
|
5141
5033
|
}
|
|
5142
5034
|
return worker;
|
|
5143
5035
|
};
|
|
5144
|
-
}();
|
|
5036
|
+
})();
|
|
5145
5037
|
var defaults = {
|
|
5146
5038
|
particleCount: 50,
|
|
5147
5039
|
angle: 90,
|
|
@@ -5661,7 +5553,7 @@ var module = {};
|
|
|
5661
5553
|
module2.exports.create = confettiCannon;
|
|
5662
5554
|
module2.exports.shapeFromPath = shapeFromPath;
|
|
5663
5555
|
module2.exports.shapeFromText = shapeFromText;
|
|
5664
|
-
})(function() {
|
|
5556
|
+
})((function() {
|
|
5665
5557
|
if (typeof window !== "undefined") {
|
|
5666
5558
|
return window;
|
|
5667
5559
|
}
|
|
@@ -5669,7 +5561,7 @@ var module = {};
|
|
|
5669
5561
|
return self;
|
|
5670
5562
|
}
|
|
5671
5563
|
return this || {};
|
|
5672
|
-
}(), module, false);
|
|
5564
|
+
})(), module, false);
|
|
5673
5565
|
const confetti_module = module.exports;
|
|
5674
5566
|
var create = module.exports.create;
|
|
5675
5567
|
const confetti_module$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -5693,7 +5585,7 @@ function requireDist() {
|
|
|
5693
5585
|
};
|
|
5694
5586
|
return __assign.apply(this, arguments);
|
|
5695
5587
|
};
|
|
5696
|
-
var __createBinding = dist && dist.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
5588
|
+
var __createBinding = dist && dist.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
5697
5589
|
if (k2 === void 0) k2 = k;
|
|
5698
5590
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5699
5591
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -5702,13 +5594,13 @@ function requireDist() {
|
|
|
5702
5594
|
} };
|
|
5703
5595
|
}
|
|
5704
5596
|
Object.defineProperty(o, k2, desc);
|
|
5705
|
-
} : function(o, m, k, k2) {
|
|
5597
|
+
}) : (function(o, m, k, k2) {
|
|
5706
5598
|
if (k2 === void 0) k2 = k;
|
|
5707
5599
|
o[k2] = m[k];
|
|
5708
|
-
});
|
|
5709
|
-
var __setModuleDefault = dist && dist.__setModuleDefault || (Object.create ? function(o, v) {
|
|
5600
|
+
}));
|
|
5601
|
+
var __setModuleDefault = dist && dist.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
5710
5602
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
5711
|
-
} : function(o, v) {
|
|
5603
|
+
}) : function(o, v) {
|
|
5712
5604
|
o["default"] = v;
|
|
5713
5605
|
});
|
|
5714
5606
|
var __importStar = dist && dist.__importStar || function(mod) {
|
|
@@ -5779,7 +5671,7 @@ function requirePresets() {
|
|
|
5779
5671
|
};
|
|
5780
5672
|
return __assign.apply(this, arguments);
|
|
5781
5673
|
};
|
|
5782
|
-
var __createBinding = presets && presets.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
5674
|
+
var __createBinding = presets && presets.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
5783
5675
|
if (k2 === void 0) k2 = k;
|
|
5784
5676
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5785
5677
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -5788,13 +5680,13 @@ function requirePresets() {
|
|
|
5788
5680
|
} };
|
|
5789
5681
|
}
|
|
5790
5682
|
Object.defineProperty(o, k2, desc);
|
|
5791
|
-
} : function(o, m, k, k2) {
|
|
5683
|
+
}) : (function(o, m, k, k2) {
|
|
5792
5684
|
if (k2 === void 0) k2 = k;
|
|
5793
5685
|
o[k2] = m[k];
|
|
5794
|
-
});
|
|
5795
|
-
var __setModuleDefault = presets && presets.__setModuleDefault || (Object.create ? function(o, v) {
|
|
5686
|
+
}));
|
|
5687
|
+
var __setModuleDefault = presets && presets.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
5796
5688
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
5797
|
-
} : function(o, v) {
|
|
5689
|
+
}) : function(o, v) {
|
|
5798
5690
|
o["default"] = v;
|
|
5799
5691
|
});
|
|
5800
5692
|
var __importStar = presets && presets.__importStar || function(mod) {
|
|
@@ -5878,7 +5770,7 @@ function requireConductor() {
|
|
|
5878
5770
|
if (hasRequiredConductor) return conductor;
|
|
5879
5771
|
hasRequiredConductor = 1;
|
|
5880
5772
|
Object.defineProperty(conductor, "__esModule", { value: true });
|
|
5881
|
-
var Conductor = /* @__PURE__ */ function() {
|
|
5773
|
+
var Conductor = /* @__PURE__ */ (function() {
|
|
5882
5774
|
function Conductor2(_a) {
|
|
5883
5775
|
var confetti = _a.confetti, decorateOptions = _a.decorateOptions;
|
|
5884
5776
|
var _this = this;
|
|
@@ -5911,7 +5803,7 @@ function requireConductor() {
|
|
|
5911
5803
|
this.decorateOptions = decorateOptions;
|
|
5912
5804
|
}
|
|
5913
5805
|
return Conductor2;
|
|
5914
|
-
}();
|
|
5806
|
+
})();
|
|
5915
5807
|
conductor.default = Conductor;
|
|
5916
5808
|
return conductor;
|
|
5917
5809
|
}
|
|
@@ -5931,7 +5823,7 @@ var hasRequiredFireworks$1;
|
|
|
5931
5823
|
function requireFireworks$1() {
|
|
5932
5824
|
if (hasRequiredFireworks$1) return fireworks;
|
|
5933
5825
|
hasRequiredFireworks$1 = 1;
|
|
5934
|
-
var __extends = fireworks && fireworks.__extends || /* @__PURE__ */ function() {
|
|
5826
|
+
var __extends = fireworks && fireworks.__extends || /* @__PURE__ */ (function() {
|
|
5935
5827
|
var extendStatics = function(d, b) {
|
|
5936
5828
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
5937
5829
|
d2.__proto__ = b2;
|
|
@@ -5949,7 +5841,7 @@ function requireFireworks$1() {
|
|
|
5949
5841
|
}
|
|
5950
5842
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5951
5843
|
};
|
|
5952
|
-
}();
|
|
5844
|
+
})();
|
|
5953
5845
|
var __read = fireworks && fireworks.__read || function(o, n) {
|
|
5954
5846
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
5955
5847
|
if (!m) return o;
|
|
@@ -5982,7 +5874,7 @@ function requireFireworks$1() {
|
|
|
5982
5874
|
Object.defineProperty(fireworks, "__esModule", { value: true });
|
|
5983
5875
|
var index_1 = __importDefault(requireConductor());
|
|
5984
5876
|
var randomInRange_1 = __importDefault(requireRandomInRange());
|
|
5985
|
-
var FireworksConductor = function(_super) {
|
|
5877
|
+
var FireworksConductor = (function(_super) {
|
|
5986
5878
|
__extends(FireworksConductor2, _super);
|
|
5987
5879
|
function FireworksConductor2() {
|
|
5988
5880
|
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
@@ -6013,7 +5905,7 @@ function requireFireworks$1() {
|
|
|
6013
5905
|
return _this;
|
|
6014
5906
|
}
|
|
6015
5907
|
return FireworksConductor2;
|
|
6016
|
-
}(index_1.default);
|
|
5908
|
+
})(index_1.default);
|
|
6017
5909
|
fireworks.default = FireworksConductor;
|
|
6018
5910
|
return fireworks;
|
|
6019
5911
|
}
|
|
@@ -6585,7 +6477,6 @@ class EvmChainStrategy {
|
|
|
6585
6477
|
this.provider = new BrowserProvider(config.walletClient.transport);
|
|
6586
6478
|
}
|
|
6587
6479
|
}
|
|
6588
|
-
// ========== Identity ==========
|
|
6589
6480
|
canHandle(chainKey) {
|
|
6590
6481
|
const key = chainKey.toLowerCase();
|
|
6591
6482
|
return key !== "ton" && key !== "tron";
|
|
@@ -6596,7 +6487,6 @@ class EvmChainStrategy {
|
|
|
6596
6487
|
getName() {
|
|
6597
6488
|
return "EVM Chain Strategy";
|
|
6598
6489
|
}
|
|
6599
|
-
// ========== Wallet Management ==========
|
|
6600
6490
|
async connect() {
|
|
6601
6491
|
}
|
|
6602
6492
|
async disconnect() {
|
|
@@ -6620,7 +6510,6 @@ class EvmChainStrategy {
|
|
|
6620
6510
|
getConnectLabel(t2) {
|
|
6621
6511
|
return t2("wallets.connectEvmWallet");
|
|
6622
6512
|
}
|
|
6623
|
-
// ========== Balance & Validation ==========
|
|
6624
6513
|
async getBalances(address, tokens) {
|
|
6625
6514
|
return await getEvmBalances(address, tokens);
|
|
6626
6515
|
}
|
|
@@ -6628,7 +6517,6 @@ class EvmChainStrategy {
|
|
|
6628
6517
|
if (!address) return false;
|
|
6629
6518
|
return /^0x[0-9a-fA-F]{40}$/.test(address);
|
|
6630
6519
|
}
|
|
6631
|
-
// ========== Gas Estimation ==========
|
|
6632
6520
|
async estimateGasRequirement(params) {
|
|
6633
6521
|
const provider = this.provider;
|
|
6634
6522
|
const {
|
|
@@ -6675,7 +6563,6 @@ class EvmChainStrategy {
|
|
|
6675
6563
|
isNativeSelected
|
|
6676
6564
|
};
|
|
6677
6565
|
}
|
|
6678
|
-
// ========== Transaction Execution ==========
|
|
6679
6566
|
validateSteps(steps) {
|
|
6680
6567
|
if (!steps || steps.length === 0) {
|
|
6681
6568
|
throw new InvalidStepsError("evm", "No transaction steps provided");
|
|
@@ -6778,7 +6665,6 @@ class EvmChainStrategy {
|
|
|
6778
6665
|
};
|
|
6779
6666
|
}
|
|
6780
6667
|
}
|
|
6781
|
-
// ========== Private Helper Methods ==========
|
|
6782
6668
|
async executeTransaction(step) {
|
|
6783
6669
|
const provider = this.provider;
|
|
6784
6670
|
const signer = await provider?.getSigner();
|
|
@@ -7633,9 +7519,12 @@ function ChainStrategyProvider({
|
|
|
7633
7519
|
() => new ChainStrategyRegistry([evmStrategy, tonStrategy, tronStrategy]),
|
|
7634
7520
|
[evmStrategy, tonStrategy, tronStrategy]
|
|
7635
7521
|
);
|
|
7636
|
-
const value =
|
|
7637
|
-
|
|
7638
|
-
|
|
7522
|
+
const value = useMemo(
|
|
7523
|
+
() => ({
|
|
7524
|
+
chainRegistry
|
|
7525
|
+
}),
|
|
7526
|
+
[chainRegistry]
|
|
7527
|
+
);
|
|
7639
7528
|
return /* @__PURE__ */ jsx(ChainStrategyContext.Provider, { value, children });
|
|
7640
7529
|
}
|
|
7641
7530
|
const EvaaBridgeWithProviders = (props) => {
|
|
@@ -7788,7 +7677,7 @@ const EvaaBridgeContent = ({
|
|
|
7788
7677
|
"section",
|
|
7789
7678
|
{
|
|
7790
7679
|
className: cn(
|
|
7791
|
-
"p-5 bg-card max-w-md w-full rounded-3xl mx-auto flex flex-col gap-4
|
|
7680
|
+
"p-5 bg-card max-w-md w-full rounded-3xl mx-auto flex flex-col gap-4 relative",
|
|
7792
7681
|
className
|
|
7793
7682
|
),
|
|
7794
7683
|
ref: modalContainerRef,
|