@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.cjs
CHANGED
|
@@ -36,6 +36,7 @@ const reactDom = require("react-dom");
|
|
|
36
36
|
const framerMotion = require("framer-motion");
|
|
37
37
|
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
38
38
|
const wagmi = require("wagmi");
|
|
39
|
+
const tronwalletAdapterReactHooks = require("@tronweb3/tronwallet-adapter-react-hooks");
|
|
39
40
|
const uiReact = require("@tonconnect/ui-react");
|
|
40
41
|
const reactQuery = require("@tanstack/react-query");
|
|
41
42
|
const core = require("@ton/core");
|
|
@@ -47,6 +48,7 @@ const connectkit = require("connectkit");
|
|
|
47
48
|
const i18next = require("i18next");
|
|
48
49
|
const sonner = require("sonner");
|
|
49
50
|
const ethers = require("ethers");
|
|
51
|
+
const tronwalletAdapters = require("@tronweb3/tronwallet-adapters");
|
|
50
52
|
function _interopNamespaceDefault(e) {
|
|
51
53
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
52
54
|
if (e) {
|
|
@@ -1281,144 +1283,11 @@ function Input({ className, type, ...props }) {
|
|
|
1281
1283
|
}
|
|
1282
1284
|
);
|
|
1283
1285
|
}
|
|
1284
|
-
function getDefaultExportFromCjs(x) {
|
|
1285
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1286
|
-
}
|
|
1287
|
-
function getAugmentedNamespace(n) {
|
|
1288
|
-
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
1289
|
-
var f = n.default;
|
|
1290
|
-
if (typeof f == "function") {
|
|
1291
|
-
var a = function a2() {
|
|
1292
|
-
var isInstance = false;
|
|
1293
|
-
try {
|
|
1294
|
-
isInstance = this instanceof a2;
|
|
1295
|
-
} catch {
|
|
1296
|
-
}
|
|
1297
|
-
if (isInstance) {
|
|
1298
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
1299
|
-
}
|
|
1300
|
-
return f.apply(this, arguments);
|
|
1301
|
-
};
|
|
1302
|
-
a.prototype = f.prototype;
|
|
1303
|
-
} else a = {};
|
|
1304
|
-
Object.defineProperty(a, "__esModule", { value: true });
|
|
1305
|
-
Object.keys(n).forEach(function(k) {
|
|
1306
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
1307
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
1308
|
-
enumerable: true,
|
|
1309
|
-
get: function() {
|
|
1310
|
-
return n[k];
|
|
1311
|
-
}
|
|
1312
|
-
});
|
|
1313
|
-
});
|
|
1314
|
-
return a;
|
|
1315
|
-
}
|
|
1316
|
-
var NetworkType;
|
|
1317
|
-
(function(NetworkType2) {
|
|
1318
|
-
NetworkType2["Mainnet"] = "Mainnet";
|
|
1319
|
-
NetworkType2["Shasta"] = "Shasta";
|
|
1320
|
-
NetworkType2["Nile"] = "Nile";
|
|
1321
|
-
NetworkType2["Unknown"] = "Unknown";
|
|
1322
|
-
})(NetworkType || (NetworkType = {}));
|
|
1323
|
-
var ChainNetwork;
|
|
1324
|
-
(function(ChainNetwork2) {
|
|
1325
|
-
ChainNetwork2["Mainnet"] = "Mainnet";
|
|
1326
|
-
ChainNetwork2["Shasta"] = "Shasta";
|
|
1327
|
-
ChainNetwork2["Nile"] = "Nile";
|
|
1328
|
-
})(ChainNetwork || (ChainNetwork = {}));
|
|
1329
|
-
function printError() {
|
|
1330
|
-
console.error(`
|
|
1331
|
-
You are using WalletContext without provide the WalletContext.Provider.
|
|
1332
|
-
Please wrap your sub-components with a WalletProvider and provide required values.
|
|
1333
|
-
`);
|
|
1334
|
-
}
|
|
1335
|
-
const DEFAULT_CONTEXT = {
|
|
1336
|
-
autoConnect: false,
|
|
1337
|
-
connecting: false,
|
|
1338
|
-
connected: false,
|
|
1339
|
-
disconnecting: false,
|
|
1340
|
-
/* eslint-disable */
|
|
1341
|
-
select(_name) {
|
|
1342
|
-
printError();
|
|
1343
|
-
},
|
|
1344
|
-
connect() {
|
|
1345
|
-
printError();
|
|
1346
|
-
return Promise.reject();
|
|
1347
|
-
},
|
|
1348
|
-
disconnect() {
|
|
1349
|
-
printError();
|
|
1350
|
-
return Promise.reject();
|
|
1351
|
-
},
|
|
1352
|
-
signTransaction(_transaction) {
|
|
1353
|
-
printError();
|
|
1354
|
-
return Promise.reject();
|
|
1355
|
-
},
|
|
1356
|
-
signMessage(_message) {
|
|
1357
|
-
printError();
|
|
1358
|
-
return Promise.reject();
|
|
1359
|
-
}
|
|
1360
|
-
/* eslint-enable */
|
|
1361
|
-
};
|
|
1362
|
-
Object.defineProperty(DEFAULT_CONTEXT, "wallets", {
|
|
1363
|
-
get() {
|
|
1364
|
-
printError();
|
|
1365
|
-
return [];
|
|
1366
|
-
}
|
|
1367
|
-
});
|
|
1368
|
-
Object.defineProperty(DEFAULT_CONTEXT, "wallet", {
|
|
1369
|
-
get() {
|
|
1370
|
-
printError();
|
|
1371
|
-
return null;
|
|
1372
|
-
}
|
|
1373
|
-
});
|
|
1374
|
-
Object.defineProperty(DEFAULT_CONTEXT, "address", {
|
|
1375
|
-
get() {
|
|
1376
|
-
printError();
|
|
1377
|
-
return null;
|
|
1378
|
-
}
|
|
1379
|
-
});
|
|
1380
|
-
const WalletContext = require$$0.createContext(DEFAULT_CONTEXT);
|
|
1381
|
-
function useWallet() {
|
|
1382
|
-
return require$$0.useContext(WalletContext);
|
|
1383
|
-
}
|
|
1384
|
-
(function(thisArg, _arguments, P, generator) {
|
|
1385
|
-
function adopt(value) {
|
|
1386
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
1387
|
-
resolve(value);
|
|
1388
|
-
});
|
|
1389
|
-
}
|
|
1390
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1391
|
-
function fulfilled(value) {
|
|
1392
|
-
try {
|
|
1393
|
-
step(generator.next(value));
|
|
1394
|
-
} catch (e) {
|
|
1395
|
-
reject(e);
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
function rejected(value) {
|
|
1399
|
-
try {
|
|
1400
|
-
step(generator["throw"](value));
|
|
1401
|
-
} catch (e) {
|
|
1402
|
-
reject(e);
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
function step(result) {
|
|
1406
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1407
|
-
}
|
|
1408
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1409
|
-
});
|
|
1410
|
-
});
|
|
1411
|
-
({
|
|
1412
|
-
"0x2b6653dc": NetworkType.Mainnet,
|
|
1413
|
-
"0x94a9059e": NetworkType.Shasta,
|
|
1414
|
-
"0xcd8690dc": NetworkType.Nile
|
|
1415
|
-
});
|
|
1416
|
-
const TronLinkAdapterName = "TronLink";
|
|
1417
1286
|
function useAddresses() {
|
|
1418
1287
|
const { fromChain, toChain } = useChainsStore();
|
|
1419
1288
|
const { address: evmAddress } = wagmi.useAccount();
|
|
1420
1289
|
const tonAddress = uiReact.useTonAddress();
|
|
1421
|
-
const { address: tronAddress } = useWallet();
|
|
1290
|
+
const { address: tronAddress } = tronwalletAdapterReactHooks.useWallet();
|
|
1422
1291
|
const srcAddress = require$$0.useMemo(() => {
|
|
1423
1292
|
if (!fromChain?.chainKey) return void 0;
|
|
1424
1293
|
const chainKey = fromChain.chainKey.toLowerCase();
|
|
@@ -1662,8 +1531,12 @@ function useBalances(chainKey, address) {
|
|
|
1662
1531
|
[balanceBySymbol]
|
|
1663
1532
|
);
|
|
1664
1533
|
const isLoading = query.isLoading || query.isFetching;
|
|
1534
|
+
const balances = require$$0.useMemo(
|
|
1535
|
+
() => query.data || {},
|
|
1536
|
+
[query.data]
|
|
1537
|
+
);
|
|
1665
1538
|
return {
|
|
1666
|
-
balances
|
|
1539
|
+
balances,
|
|
1667
1540
|
getBalance,
|
|
1668
1541
|
isLoading,
|
|
1669
1542
|
query
|
|
@@ -1797,7 +1670,7 @@ const TokenRow = ({
|
|
|
1797
1670
|
Button,
|
|
1798
1671
|
{
|
|
1799
1672
|
onClick: onPick,
|
|
1800
|
-
className: `w-full
|
|
1673
|
+
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" : ""}`,
|
|
1801
1674
|
children: [
|
|
1802
1675
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1803
1676
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3499,7 +3372,7 @@ const ReceiveRow = () => {
|
|
|
3499
3372
|
label: t("transaction.route"),
|
|
3500
3373
|
right: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
3501
3374
|
/* @__PURE__ */ jsxRuntime.jsx(StargateIcon, { className: "size-4" }),
|
|
3502
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground font-normal text-sm
|
|
3375
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground font-normal text-sm leading-[100%]", children: routeText }),
|
|
3503
3376
|
hasGasOnDestination && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs bg-settings-active text-settings-active-foreground px-1.5 py-0.5 rounded", children: t(`settings.gasPresets.${gasPreset}`) })
|
|
3504
3377
|
] })
|
|
3505
3378
|
}
|
|
@@ -3894,7 +3767,9 @@ function useBridgeTransaction() {
|
|
|
3894
3767
|
function useGasEstimate(amountNum) {
|
|
3895
3768
|
const { fromChain } = useChainsStore();
|
|
3896
3769
|
const { selectedAssetSymbol, tokens } = useTokensStore();
|
|
3897
|
-
const
|
|
3770
|
+
const getSourceGasReserveHuman = useSettingsStore(
|
|
3771
|
+
(state) => state.getSourceGasReserveHuman
|
|
3772
|
+
);
|
|
3898
3773
|
const { srcAddress } = useAddresses();
|
|
3899
3774
|
const { balances, isLoading: balancesLoading } = useBalances(
|
|
3900
3775
|
fromChain?.chainKey,
|
|
@@ -3902,59 +3777,44 @@ function useGasEstimate(amountNum) {
|
|
|
3902
3777
|
);
|
|
3903
3778
|
const { chainRegistry } = useChainStrategies();
|
|
3904
3779
|
const balancesKnown = !balancesLoading;
|
|
3905
|
-
const
|
|
3906
|
-
null
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
}
|
|
3944
|
-
}
|
|
3945
|
-
estimateGas();
|
|
3946
|
-
return () => {
|
|
3947
|
-
cancelled = true;
|
|
3948
|
-
};
|
|
3949
|
-
}, [
|
|
3950
|
-
fromChain,
|
|
3951
|
-
selectedAssetSymbol,
|
|
3952
|
-
tokens,
|
|
3953
|
-
amountNum,
|
|
3954
|
-
balances,
|
|
3955
|
-
chainRegistry,
|
|
3956
|
-
getSourceGasReserveHuman
|
|
3957
|
-
]);
|
|
3780
|
+
const strategy = require$$0.useMemo(() => {
|
|
3781
|
+
if (!fromChain) return null;
|
|
3782
|
+
return chainRegistry.getStrategy(fromChain.chainKey);
|
|
3783
|
+
}, [fromChain, chainRegistry]);
|
|
3784
|
+
const { data: gasRequirement } = reactQuery.useQuery({
|
|
3785
|
+
queryKey: [
|
|
3786
|
+
"gas-estimate",
|
|
3787
|
+
fromChain?.chainKey,
|
|
3788
|
+
selectedAssetSymbol,
|
|
3789
|
+
amountNum,
|
|
3790
|
+
balances
|
|
3791
|
+
],
|
|
3792
|
+
queryFn: async () => {
|
|
3793
|
+
if (!fromChain || !strategy) {
|
|
3794
|
+
return null;
|
|
3795
|
+
}
|
|
3796
|
+
const selectedToken = tokens?.find(
|
|
3797
|
+
(t) => t.symbol.toUpperCase() === selectedAssetSymbol?.toUpperCase()
|
|
3798
|
+
) || null;
|
|
3799
|
+
const nativeTokenSymbol = fromChain.nativeCurrency?.symbol ?? "";
|
|
3800
|
+
const nativeDecimals = fromChain.nativeCurrency?.decimals || 18;
|
|
3801
|
+
const reserveFallback = getSourceGasReserveHuman(fromChain.chainKey);
|
|
3802
|
+
const result = await strategy.estimateGasRequirement({
|
|
3803
|
+
selectedToken,
|
|
3804
|
+
nativeTokenSymbol,
|
|
3805
|
+
amount: amountNum,
|
|
3806
|
+
balances,
|
|
3807
|
+
nativeDecimals,
|
|
3808
|
+
reserveFallback
|
|
3809
|
+
});
|
|
3810
|
+
return result;
|
|
3811
|
+
},
|
|
3812
|
+
enabled: !!fromChain && !!strategy,
|
|
3813
|
+
staleTime: 3e4,
|
|
3814
|
+
gcTime: 5 * 6e4,
|
|
3815
|
+
refetchOnWindowFocus: false,
|
|
3816
|
+
retry: 1
|
|
3817
|
+
});
|
|
3958
3818
|
return {
|
|
3959
3819
|
nativeSym: gasRequirement?.nativeSym || "",
|
|
3960
3820
|
nativeBalance: gasRequirement?.nativeBalance || 0,
|
|
@@ -4334,7 +4194,7 @@ const WalletSelectModal = ({
|
|
|
4334
4194
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4335
4195
|
Button,
|
|
4336
4196
|
{
|
|
4337
|
-
className: "w-full
|
|
4197
|
+
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]",
|
|
4338
4198
|
children: [
|
|
4339
4199
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
4340
4200
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "size-7.5" }) }),
|
|
@@ -4364,7 +4224,7 @@ const WalletSelectModal = ({
|
|
|
4364
4224
|
type: "button",
|
|
4365
4225
|
onClick: show,
|
|
4366
4226
|
disabled: isConnecting,
|
|
4367
|
-
className: "w-full
|
|
4227
|
+
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",
|
|
4368
4228
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
4369
4229
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "size-7.5" }) }),
|
|
4370
4230
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
@@ -4381,7 +4241,7 @@ const WalletSelectModal = ({
|
|
|
4381
4241
|
{
|
|
4382
4242
|
onClick: () => handleWalletSelect(wallet.id),
|
|
4383
4243
|
disabled: !wallet.enabled,
|
|
4384
|
-
className: "w-full
|
|
4244
|
+
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",
|
|
4385
4245
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
4386
4246
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "size-7.5" }) }),
|
|
4387
4247
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
@@ -5015,6 +4875,38 @@ const TransactionSuccessVector = (props) => {
|
|
|
5015
4875
|
)
|
|
5016
4876
|
] });
|
|
5017
4877
|
};
|
|
4878
|
+
function getDefaultExportFromCjs(x) {
|
|
4879
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4880
|
+
}
|
|
4881
|
+
function getAugmentedNamespace(n) {
|
|
4882
|
+
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
4883
|
+
var f = n.default;
|
|
4884
|
+
if (typeof f == "function") {
|
|
4885
|
+
var a = function a2() {
|
|
4886
|
+
var isInstance = false;
|
|
4887
|
+
try {
|
|
4888
|
+
isInstance = this instanceof a2;
|
|
4889
|
+
} catch {
|
|
4890
|
+
}
|
|
4891
|
+
if (isInstance) {
|
|
4892
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
4893
|
+
}
|
|
4894
|
+
return f.apply(this, arguments);
|
|
4895
|
+
};
|
|
4896
|
+
a.prototype = f.prototype;
|
|
4897
|
+
} else a = {};
|
|
4898
|
+
Object.defineProperty(a, "__esModule", { value: true });
|
|
4899
|
+
Object.keys(n).forEach(function(k) {
|
|
4900
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
4901
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
4902
|
+
enumerable: true,
|
|
4903
|
+
get: function() {
|
|
4904
|
+
return n[k];
|
|
4905
|
+
}
|
|
4906
|
+
});
|
|
4907
|
+
});
|
|
4908
|
+
return a;
|
|
4909
|
+
}
|
|
5018
4910
|
var fireworks$1 = {};
|
|
5019
4911
|
var presets = {};
|
|
5020
4912
|
var dist = {};
|
|
@@ -5022,7 +4914,7 @@ var module$1 = {};
|
|
|
5022
4914
|
(function main(global, module2, isWorker, workerSize) {
|
|
5023
4915
|
var canUseWorker = !!(global.Worker && global.Blob && global.Promise && global.OffscreenCanvas && global.OffscreenCanvasRenderingContext2D && global.HTMLCanvasElement && global.HTMLCanvasElement.prototype.transferControlToOffscreen && global.URL && global.URL.createObjectURL);
|
|
5024
4916
|
var canUsePaths = typeof Path2D === "function" && typeof DOMMatrix === "function";
|
|
5025
|
-
var canDrawBitmap = function() {
|
|
4917
|
+
var canDrawBitmap = (function() {
|
|
5026
4918
|
if (!global.OffscreenCanvas) {
|
|
5027
4919
|
return false;
|
|
5028
4920
|
}
|
|
@@ -5036,7 +4928,7 @@ var module$1 = {};
|
|
|
5036
4928
|
return false;
|
|
5037
4929
|
}
|
|
5038
4930
|
return true;
|
|
5039
|
-
}();
|
|
4931
|
+
})();
|
|
5040
4932
|
function noop() {
|
|
5041
4933
|
}
|
|
5042
4934
|
function promise(func) {
|
|
@@ -5048,7 +4940,7 @@ var module$1 = {};
|
|
|
5048
4940
|
func(noop, noop);
|
|
5049
4941
|
return null;
|
|
5050
4942
|
}
|
|
5051
|
-
var bitmapMapper = /* @__PURE__ */ function(skipTransform, map) {
|
|
4943
|
+
var bitmapMapper = /* @__PURE__ */ (function(skipTransform, map) {
|
|
5052
4944
|
return {
|
|
5053
4945
|
transform: function(bitmap) {
|
|
5054
4946
|
if (skipTransform) {
|
|
@@ -5067,8 +4959,8 @@ var module$1 = {};
|
|
|
5067
4959
|
map.clear();
|
|
5068
4960
|
}
|
|
5069
4961
|
};
|
|
5070
|
-
}(canDrawBitmap, /* @__PURE__ */ new Map());
|
|
5071
|
-
var raf = function() {
|
|
4962
|
+
})(canDrawBitmap, /* @__PURE__ */ new Map());
|
|
4963
|
+
var raf = (function() {
|
|
5072
4964
|
var TIME = Math.floor(1e3 / 60);
|
|
5073
4965
|
var frame, cancel;
|
|
5074
4966
|
var frames = {};
|
|
@@ -5101,8 +4993,8 @@ var module$1 = {};
|
|
|
5101
4993
|
};
|
|
5102
4994
|
}
|
|
5103
4995
|
return { frame, cancel };
|
|
5104
|
-
}();
|
|
5105
|
-
var getWorker = /* @__PURE__ */ function() {
|
|
4996
|
+
})();
|
|
4997
|
+
var getWorker = /* @__PURE__ */ (function() {
|
|
5106
4998
|
var worker;
|
|
5107
4999
|
var prom;
|
|
5108
5000
|
var resolves = {};
|
|
@@ -5183,7 +5075,7 @@ var module$1 = {};
|
|
|
5183
5075
|
}
|
|
5184
5076
|
return worker;
|
|
5185
5077
|
};
|
|
5186
|
-
}();
|
|
5078
|
+
})();
|
|
5187
5079
|
var defaults = {
|
|
5188
5080
|
particleCount: 50,
|
|
5189
5081
|
angle: 90,
|
|
@@ -5703,7 +5595,7 @@ var module$1 = {};
|
|
|
5703
5595
|
module2.exports.create = confettiCannon;
|
|
5704
5596
|
module2.exports.shapeFromPath = shapeFromPath;
|
|
5705
5597
|
module2.exports.shapeFromText = shapeFromText;
|
|
5706
|
-
})(function() {
|
|
5598
|
+
})((function() {
|
|
5707
5599
|
if (typeof window !== "undefined") {
|
|
5708
5600
|
return window;
|
|
5709
5601
|
}
|
|
@@ -5711,7 +5603,7 @@ var module$1 = {};
|
|
|
5711
5603
|
return self;
|
|
5712
5604
|
}
|
|
5713
5605
|
return this || {};
|
|
5714
|
-
}(), module$1, false);
|
|
5606
|
+
})(), module$1, false);
|
|
5715
5607
|
const confetti_module = module$1.exports;
|
|
5716
5608
|
var create = module$1.exports.create;
|
|
5717
5609
|
const confetti_module$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -5735,7 +5627,7 @@ function requireDist() {
|
|
|
5735
5627
|
};
|
|
5736
5628
|
return __assign.apply(this, arguments);
|
|
5737
5629
|
};
|
|
5738
|
-
var __createBinding = dist && dist.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
5630
|
+
var __createBinding = dist && dist.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
5739
5631
|
if (k2 === void 0) k2 = k;
|
|
5740
5632
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5741
5633
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -5744,13 +5636,13 @@ function requireDist() {
|
|
|
5744
5636
|
} };
|
|
5745
5637
|
}
|
|
5746
5638
|
Object.defineProperty(o, k2, desc);
|
|
5747
|
-
} : function(o, m, k, k2) {
|
|
5639
|
+
}) : (function(o, m, k, k2) {
|
|
5748
5640
|
if (k2 === void 0) k2 = k;
|
|
5749
5641
|
o[k2] = m[k];
|
|
5750
|
-
});
|
|
5751
|
-
var __setModuleDefault = dist && dist.__setModuleDefault || (Object.create ? function(o, v) {
|
|
5642
|
+
}));
|
|
5643
|
+
var __setModuleDefault = dist && dist.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
5752
5644
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
5753
|
-
} : function(o, v) {
|
|
5645
|
+
}) : function(o, v) {
|
|
5754
5646
|
o["default"] = v;
|
|
5755
5647
|
});
|
|
5756
5648
|
var __importStar = dist && dist.__importStar || function(mod) {
|
|
@@ -5821,7 +5713,7 @@ function requirePresets() {
|
|
|
5821
5713
|
};
|
|
5822
5714
|
return __assign.apply(this, arguments);
|
|
5823
5715
|
};
|
|
5824
|
-
var __createBinding = presets && presets.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
5716
|
+
var __createBinding = presets && presets.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
5825
5717
|
if (k2 === void 0) k2 = k;
|
|
5826
5718
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5827
5719
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -5830,13 +5722,13 @@ function requirePresets() {
|
|
|
5830
5722
|
} };
|
|
5831
5723
|
}
|
|
5832
5724
|
Object.defineProperty(o, k2, desc);
|
|
5833
|
-
} : function(o, m, k, k2) {
|
|
5725
|
+
}) : (function(o, m, k, k2) {
|
|
5834
5726
|
if (k2 === void 0) k2 = k;
|
|
5835
5727
|
o[k2] = m[k];
|
|
5836
|
-
});
|
|
5837
|
-
var __setModuleDefault = presets && presets.__setModuleDefault || (Object.create ? function(o, v) {
|
|
5728
|
+
}));
|
|
5729
|
+
var __setModuleDefault = presets && presets.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
5838
5730
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
5839
|
-
} : function(o, v) {
|
|
5731
|
+
}) : function(o, v) {
|
|
5840
5732
|
o["default"] = v;
|
|
5841
5733
|
});
|
|
5842
5734
|
var __importStar = presets && presets.__importStar || function(mod) {
|
|
@@ -5920,7 +5812,7 @@ function requireConductor() {
|
|
|
5920
5812
|
if (hasRequiredConductor) return conductor;
|
|
5921
5813
|
hasRequiredConductor = 1;
|
|
5922
5814
|
Object.defineProperty(conductor, "__esModule", { value: true });
|
|
5923
|
-
var Conductor = /* @__PURE__ */ function() {
|
|
5815
|
+
var Conductor = /* @__PURE__ */ (function() {
|
|
5924
5816
|
function Conductor2(_a) {
|
|
5925
5817
|
var confetti = _a.confetti, decorateOptions = _a.decorateOptions;
|
|
5926
5818
|
var _this = this;
|
|
@@ -5953,7 +5845,7 @@ function requireConductor() {
|
|
|
5953
5845
|
this.decorateOptions = decorateOptions;
|
|
5954
5846
|
}
|
|
5955
5847
|
return Conductor2;
|
|
5956
|
-
}();
|
|
5848
|
+
})();
|
|
5957
5849
|
conductor.default = Conductor;
|
|
5958
5850
|
return conductor;
|
|
5959
5851
|
}
|
|
@@ -5973,7 +5865,7 @@ var hasRequiredFireworks$1;
|
|
|
5973
5865
|
function requireFireworks$1() {
|
|
5974
5866
|
if (hasRequiredFireworks$1) return fireworks;
|
|
5975
5867
|
hasRequiredFireworks$1 = 1;
|
|
5976
|
-
var __extends = fireworks && fireworks.__extends || /* @__PURE__ */ function() {
|
|
5868
|
+
var __extends = fireworks && fireworks.__extends || /* @__PURE__ */ (function() {
|
|
5977
5869
|
var extendStatics = function(d, b) {
|
|
5978
5870
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
5979
5871
|
d2.__proto__ = b2;
|
|
@@ -5991,7 +5883,7 @@ function requireFireworks$1() {
|
|
|
5991
5883
|
}
|
|
5992
5884
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5993
5885
|
};
|
|
5994
|
-
}();
|
|
5886
|
+
})();
|
|
5995
5887
|
var __read = fireworks && fireworks.__read || function(o, n) {
|
|
5996
5888
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
5997
5889
|
if (!m) return o;
|
|
@@ -6024,7 +5916,7 @@ function requireFireworks$1() {
|
|
|
6024
5916
|
Object.defineProperty(fireworks, "__esModule", { value: true });
|
|
6025
5917
|
var index_1 = __importDefault(requireConductor());
|
|
6026
5918
|
var randomInRange_1 = __importDefault(requireRandomInRange());
|
|
6027
|
-
var FireworksConductor = function(_super) {
|
|
5919
|
+
var FireworksConductor = (function(_super) {
|
|
6028
5920
|
__extends(FireworksConductor2, _super);
|
|
6029
5921
|
function FireworksConductor2() {
|
|
6030
5922
|
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
@@ -6055,7 +5947,7 @@ function requireFireworks$1() {
|
|
|
6055
5947
|
return _this;
|
|
6056
5948
|
}
|
|
6057
5949
|
return FireworksConductor2;
|
|
6058
|
-
}(index_1.default);
|
|
5950
|
+
})(index_1.default);
|
|
6059
5951
|
fireworks.default = FireworksConductor;
|
|
6060
5952
|
return fireworks;
|
|
6061
5953
|
}
|
|
@@ -6627,7 +6519,6 @@ class EvmChainStrategy {
|
|
|
6627
6519
|
this.provider = new ethers.BrowserProvider(config.walletClient.transport);
|
|
6628
6520
|
}
|
|
6629
6521
|
}
|
|
6630
|
-
// ========== Identity ==========
|
|
6631
6522
|
canHandle(chainKey) {
|
|
6632
6523
|
const key = chainKey.toLowerCase();
|
|
6633
6524
|
return key !== "ton" && key !== "tron";
|
|
@@ -6638,7 +6529,6 @@ class EvmChainStrategy {
|
|
|
6638
6529
|
getName() {
|
|
6639
6530
|
return "EVM Chain Strategy";
|
|
6640
6531
|
}
|
|
6641
|
-
// ========== Wallet Management ==========
|
|
6642
6532
|
async connect() {
|
|
6643
6533
|
}
|
|
6644
6534
|
async disconnect() {
|
|
@@ -6662,7 +6552,6 @@ class EvmChainStrategy {
|
|
|
6662
6552
|
getConnectLabel(t) {
|
|
6663
6553
|
return t("wallets.connectEvmWallet");
|
|
6664
6554
|
}
|
|
6665
|
-
// ========== Balance & Validation ==========
|
|
6666
6555
|
async getBalances(address, tokens) {
|
|
6667
6556
|
return await getEvmBalances(address, tokens);
|
|
6668
6557
|
}
|
|
@@ -6670,7 +6559,6 @@ class EvmChainStrategy {
|
|
|
6670
6559
|
if (!address) return false;
|
|
6671
6560
|
return /^0x[0-9a-fA-F]{40}$/.test(address);
|
|
6672
6561
|
}
|
|
6673
|
-
// ========== Gas Estimation ==========
|
|
6674
6562
|
async estimateGasRequirement(params) {
|
|
6675
6563
|
const provider = this.provider;
|
|
6676
6564
|
const {
|
|
@@ -6717,7 +6605,6 @@ class EvmChainStrategy {
|
|
|
6717
6605
|
isNativeSelected
|
|
6718
6606
|
};
|
|
6719
6607
|
}
|
|
6720
|
-
// ========== Transaction Execution ==========
|
|
6721
6608
|
validateSteps(steps) {
|
|
6722
6609
|
if (!steps || steps.length === 0) {
|
|
6723
6610
|
throw new InvalidStepsError("evm", "No transaction steps provided");
|
|
@@ -6820,7 +6707,6 @@ class EvmChainStrategy {
|
|
|
6820
6707
|
};
|
|
6821
6708
|
}
|
|
6822
6709
|
}
|
|
6823
|
-
// ========== Private Helper Methods ==========
|
|
6824
6710
|
async executeTransaction(step) {
|
|
6825
6711
|
const provider = this.provider;
|
|
6826
6712
|
const signer = await provider?.getSigner();
|
|
@@ -7147,7 +7033,7 @@ class TronChainStrategy {
|
|
|
7147
7033
|
if (!tronWeb && (typeof window === "undefined" || !window.tronLink)) {
|
|
7148
7034
|
throw new WalletNotFoundError("tron", "TronLink");
|
|
7149
7035
|
}
|
|
7150
|
-
this.config.tronSelect(TronLinkAdapterName);
|
|
7036
|
+
this.config.tronSelect(tronwalletAdapters.TronLinkAdapterName);
|
|
7151
7037
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
7152
7038
|
await this.config.tronConnect();
|
|
7153
7039
|
}
|
|
@@ -7675,9 +7561,12 @@ function ChainStrategyProvider({
|
|
|
7675
7561
|
() => new ChainStrategyRegistry([evmStrategy, tonStrategy, tronStrategy]),
|
|
7676
7562
|
[evmStrategy, tonStrategy, tronStrategy]
|
|
7677
7563
|
);
|
|
7678
|
-
const value =
|
|
7679
|
-
|
|
7680
|
-
|
|
7564
|
+
const value = require$$0.useMemo(
|
|
7565
|
+
() => ({
|
|
7566
|
+
chainRegistry
|
|
7567
|
+
}),
|
|
7568
|
+
[chainRegistry]
|
|
7569
|
+
);
|
|
7681
7570
|
return /* @__PURE__ */ jsxRuntime.jsx(ChainStrategyContext.Provider, { value, children });
|
|
7682
7571
|
}
|
|
7683
7572
|
const EvaaBridgeWithProviders = (props) => {
|
|
@@ -7692,7 +7581,7 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
7692
7581
|
select: tronSelect,
|
|
7693
7582
|
connect: tronConnect,
|
|
7694
7583
|
disconnect: tronDisconnect
|
|
7695
|
-
} = useWallet();
|
|
7584
|
+
} = tronwalletAdapterReactHooks.useWallet();
|
|
7696
7585
|
const { setTonConnected, setMetaMaskConnected, setTronConnected } = useConnectedWalletsStore();
|
|
7697
7586
|
require$$0.useEffect(() => {
|
|
7698
7587
|
setTonConnected(!!tonAddress);
|
|
@@ -7830,7 +7719,7 @@ const EvaaBridgeContent = ({
|
|
|
7830
7719
|
"section",
|
|
7831
7720
|
{
|
|
7832
7721
|
className: cn(
|
|
7833
|
-
"p-5 bg-card max-w-md w-full rounded-3xl mx-auto flex flex-col gap-4
|
|
7722
|
+
"p-5 bg-card max-w-md w-full rounded-3xl mx-auto flex flex-col gap-4 relative",
|
|
7834
7723
|
className
|
|
7835
7724
|
),
|
|
7836
7725
|
ref: modalContainerRef,
|