@kimafinance/kima-transaction-widget 1.4.7 → 1.4.8
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/index.cjs +530 -426
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +378 -274
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/KimaProvider.tsx
|
|
4
|
-
import * as
|
|
4
|
+
import * as React49 from "react";
|
|
5
5
|
import { createContext, useContext, useMemo as useMemo7 } from "react";
|
|
6
6
|
import { Provider, useSelector as useSelector16 } from "react-redux";
|
|
7
7
|
|
|
@@ -1392,6 +1392,50 @@ var CFX = ({ width = 30, height = 30, ...rest }) => {
|
|
|
1392
1392
|
};
|
|
1393
1393
|
var CFX_default = CFX;
|
|
1394
1394
|
|
|
1395
|
+
// src/assets/icons/EURC.tsx
|
|
1396
|
+
import React41 from "react";
|
|
1397
|
+
var EURC = ({ width = 100, height = 100, ...rest }) => {
|
|
1398
|
+
return /* @__PURE__ */ React41.createElement(
|
|
1399
|
+
"svg",
|
|
1400
|
+
{
|
|
1401
|
+
width,
|
|
1402
|
+
height,
|
|
1403
|
+
viewBox: "0 0 100 100",
|
|
1404
|
+
fill: "none",
|
|
1405
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1406
|
+
xlinkHref: "http://www.w3.org/1999/xlink"
|
|
1407
|
+
},
|
|
1408
|
+
/* @__PURE__ */ React41.createElement(
|
|
1409
|
+
"path",
|
|
1410
|
+
{
|
|
1411
|
+
d: "M50 100C77.7085 100 100 77.7085 100 50C100 22.2915 77.7085 0 50 0C22.2915 0 0 22.2915 0 50C0 77.7085 22.2915 100 50 100Z",
|
|
1412
|
+
fill: "#2775CA"
|
|
1413
|
+
}
|
|
1414
|
+
),
|
|
1415
|
+
/* @__PURE__ */ React41.createElement("rect", { width: "100", height: "100", fill: "url(#pattern0_1506_393)" }),
|
|
1416
|
+
/* @__PURE__ */ React41.createElement("defs", null, /* @__PURE__ */ React41.createElement(
|
|
1417
|
+
"pattern",
|
|
1418
|
+
{
|
|
1419
|
+
id: "pattern0_1506_393",
|
|
1420
|
+
patternContentUnits: "objectBoundingBox",
|
|
1421
|
+
width: "1",
|
|
1422
|
+
height: "1"
|
|
1423
|
+
},
|
|
1424
|
+
/* @__PURE__ */ React41.createElement("use", { xlinkHref: "#image0_1506_393", transform: "scale(0.005)" })
|
|
1425
|
+
), /* @__PURE__ */ React41.createElement(
|
|
1426
|
+
"image",
|
|
1427
|
+
{
|
|
1428
|
+
id: "image0_1506_393",
|
|
1429
|
+
width: "200",
|
|
1430
|
+
height: "200",
|
|
1431
|
+
preserveAspectRatio: "none",
|
|
1432
|
+
xlinkHref: "data:image/png;base64,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"
|
|
1433
|
+
}
|
|
1434
|
+
))
|
|
1435
|
+
);
|
|
1436
|
+
};
|
|
1437
|
+
var EURC_default = EURC;
|
|
1438
|
+
|
|
1395
1439
|
// src/utils/constants.tsx
|
|
1396
1440
|
import {
|
|
1397
1441
|
arbitrum,
|
|
@@ -2128,7 +2172,7 @@ var useGetEnvOptions = ({
|
|
|
2128
2172
|
};
|
|
2129
2173
|
|
|
2130
2174
|
// plugins/evm/index.tsx
|
|
2131
|
-
import
|
|
2175
|
+
import React43 from "react";
|
|
2132
2176
|
|
|
2133
2177
|
// plugins/PluginBase.ts
|
|
2134
2178
|
var PluginBase = class {
|
|
@@ -2165,7 +2209,7 @@ var PluginBase = class {
|
|
|
2165
2209
|
};
|
|
2166
2210
|
|
|
2167
2211
|
// plugins/evm/features/walletConnect/WalletProvider.tsx
|
|
2168
|
-
import
|
|
2212
|
+
import React42, { useEffect, useState } from "react";
|
|
2169
2213
|
|
|
2170
2214
|
// plugins/evm/config/modalConfig.ts
|
|
2171
2215
|
import { createAppKit } from "@reown/appkit/react";
|
|
@@ -2257,9 +2301,9 @@ var WalletProvider = ({
|
|
|
2257
2301
|
}
|
|
2258
2302
|
}, [networkOption, isLoading, walletConnectProjectId]);
|
|
2259
2303
|
if (!isReady) {
|
|
2260
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null);
|
|
2261
2305
|
}
|
|
2262
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, children);
|
|
2263
2307
|
};
|
|
2264
2308
|
var WalletProvider_default = WalletProvider;
|
|
2265
2309
|
|
|
@@ -2736,23 +2780,22 @@ function useIsWalletReady() {
|
|
|
2736
2780
|
const [statusMessage, setStatusMessage] = useState2("Wallet not connected");
|
|
2737
2781
|
const [connectedAddress, setConnectedAddress] = useState2("");
|
|
2738
2782
|
const switchNetwork = useCallback(async () => {
|
|
2783
|
+
if (!sourceChain || !appKitModel) return;
|
|
2784
|
+
if (sourceChain.compatibility !== "EVM" /* EVM */) return;
|
|
2739
2785
|
logger_default.debug("useIsWalletReady:EVM:Attempting to switch network...", {
|
|
2740
2786
|
hasProvider: !!appkitProvider,
|
|
2741
2787
|
sourceChain,
|
|
2742
2788
|
modalExists: appKitModel !== null,
|
|
2743
2789
|
modal: appKitModel
|
|
2744
2790
|
});
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
} catch (e) {
|
|
2754
|
-
logger_default.error("useIsWalletReady:EVM:Network switch failed:", e);
|
|
2755
|
-
}
|
|
2791
|
+
try {
|
|
2792
|
+
appKitModel.switchNetwork(sourceChain);
|
|
2793
|
+
logger_default.debug(
|
|
2794
|
+
"useIsWalletReady:EVM:Network switch successful to:",
|
|
2795
|
+
sourceChain.name
|
|
2796
|
+
);
|
|
2797
|
+
} catch (e) {
|
|
2798
|
+
logger_default.warn("useIsWalletReady:EVM:Network switch failed:", e);
|
|
2756
2799
|
}
|
|
2757
2800
|
}, [appkitProvider, sourceChain]);
|
|
2758
2801
|
useEffect2(() => {
|
|
@@ -2984,7 +3027,7 @@ var EvmPlugin = class extends PluginBase {
|
|
|
2984
3027
|
walletConnectProjectId,
|
|
2985
3028
|
isLoading
|
|
2986
3029
|
}) => {
|
|
2987
|
-
return /* @__PURE__ */
|
|
3030
|
+
return /* @__PURE__ */ React43.createElement(
|
|
2988
3031
|
WalletProvider_default,
|
|
2989
3032
|
{
|
|
2990
3033
|
children,
|
|
@@ -3000,10 +3043,10 @@ var evmPlugin = new EvmPlugin(store);
|
|
|
3000
3043
|
var evm_default = evmPlugin;
|
|
3001
3044
|
|
|
3002
3045
|
// plugins/solana/index.tsx
|
|
3003
|
-
import
|
|
3046
|
+
import React45 from "react";
|
|
3004
3047
|
|
|
3005
3048
|
// plugins/solana/features/walletConnect/WalletProvider.tsx
|
|
3006
|
-
import
|
|
3049
|
+
import React44 from "react";
|
|
3007
3050
|
import {
|
|
3008
3051
|
ConnectionProvider,
|
|
3009
3052
|
WalletProvider as SolanaWalletProvider
|
|
@@ -3041,7 +3084,7 @@ var WalletProvider2 = ({
|
|
|
3041
3084
|
logger_default.debug(
|
|
3042
3085
|
`WalletProvider initialized with projectId: ${walletConnectProjectId}`
|
|
3043
3086
|
);
|
|
3044
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ React44.createElement(ConnectionProvider, { endpoint }, /* @__PURE__ */ React44.createElement(
|
|
3045
3088
|
SolanaWalletProvider,
|
|
3046
3089
|
{
|
|
3047
3090
|
autoConnect: false,
|
|
@@ -3129,6 +3172,16 @@ var getTokenAllowance2 = async ({
|
|
|
3129
3172
|
);
|
|
3130
3173
|
const accountInfo = await connection.getParsedAccountInfo(tokenAccountAddress);
|
|
3131
3174
|
const parsedAccountInfo = accountInfo?.value?.data;
|
|
3175
|
+
if (!parsedAccountInfo) {
|
|
3176
|
+
logger_default.warn(
|
|
3177
|
+
`Sol:getTokenAllowance: No token ${selectedCoin} account info found for ${userPublicKey.toBase58()}`
|
|
3178
|
+
);
|
|
3179
|
+
return {
|
|
3180
|
+
allowance: BigInt(0),
|
|
3181
|
+
balance: BigInt(0),
|
|
3182
|
+
decimals: 0
|
|
3183
|
+
};
|
|
3184
|
+
}
|
|
3132
3185
|
return {
|
|
3133
3186
|
allowance: parsedAccountInfo.parsed?.info?.delegate === poolAddress ? BigInt(parsedAccountInfo.parsed?.info?.delegatedAmount?.amount ?? 0) : BigInt(0),
|
|
3134
3187
|
balance: BigInt(parsedAccountInfo.parsed?.info?.tokenAmount?.amount ?? 0),
|
|
@@ -3388,7 +3441,7 @@ var SolanaPlugin = class extends PluginBase {
|
|
|
3388
3441
|
networkOption,
|
|
3389
3442
|
walletConnectProjectId
|
|
3390
3443
|
}) => {
|
|
3391
|
-
return /* @__PURE__ */
|
|
3444
|
+
return /* @__PURE__ */ React45.createElement(
|
|
3392
3445
|
WalletProvider_default2,
|
|
3393
3446
|
{
|
|
3394
3447
|
networkOption,
|
|
@@ -3402,10 +3455,10 @@ var solanaPlugin = new SolanaPlugin(store);
|
|
|
3402
3455
|
var solana_default = solanaPlugin;
|
|
3403
3456
|
|
|
3404
3457
|
// plugins/tron/index.tsx
|
|
3405
|
-
import
|
|
3458
|
+
import React47 from "react";
|
|
3406
3459
|
|
|
3407
3460
|
// plugins/tron/features/walletConnect/WalletProvider.tsx
|
|
3408
|
-
import
|
|
3461
|
+
import React46, { useMemo as useMemo3 } from "react";
|
|
3409
3462
|
import { WalletProvider as TronWalletProviderBase } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
3410
3463
|
import { LedgerAdapter } from "@tronweb3/tronwallet-adapter-ledger";
|
|
3411
3464
|
import { TronLinkAdapter } from "@tronweb3/tronwallet-adapter-tronlink";
|
|
@@ -3447,7 +3500,7 @@ var WalletProvider3 = ({ children, networkOption }) => {
|
|
|
3447
3500
|
adapters[0].switchChain("0x2b6653dc");
|
|
3448
3501
|
}
|
|
3449
3502
|
};
|
|
3450
|
-
return /* @__PURE__ */
|
|
3503
|
+
return /* @__PURE__ */ React46.createElement(
|
|
3451
3504
|
TronWalletProviderBase,
|
|
3452
3505
|
{
|
|
3453
3506
|
adapters,
|
|
@@ -4005,7 +4058,7 @@ var TronPlugin = class extends PluginBase {
|
|
|
4005
4058
|
networkOption,
|
|
4006
4059
|
walletConnectProjectId
|
|
4007
4060
|
}) => {
|
|
4008
|
-
return /* @__PURE__ */
|
|
4061
|
+
return /* @__PURE__ */ React47.createElement(
|
|
4009
4062
|
WalletProvider_default3,
|
|
4010
4063
|
{
|
|
4011
4064
|
networkOption,
|
|
@@ -4019,7 +4072,7 @@ var tronPlugin = new TronPlugin(store);
|
|
|
4019
4072
|
var tron_default = tronPlugin;
|
|
4020
4073
|
|
|
4021
4074
|
// plugins/credit-card/index.tsx
|
|
4022
|
-
import
|
|
4075
|
+
import React48 from "react";
|
|
4023
4076
|
|
|
4024
4077
|
// plugins/credit-card/core/hooks/useIsProviderReady.tsx
|
|
4025
4078
|
import { useDispatch as useDispatch5, useSelector as useSelector15 } from "react-redux";
|
|
@@ -4029,12 +4082,10 @@ var useIsProviderReady = () => {
|
|
|
4029
4082
|
const dispatch = useDispatch5();
|
|
4030
4083
|
const sourceChain = useSelector15(selectSourceChain);
|
|
4031
4084
|
useEffect5(() => {
|
|
4032
|
-
if (sourceChain.
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
setIsReady(true);
|
|
4037
|
-
}
|
|
4085
|
+
if (!sourceChain || sourceChain.shortName !== "CC") return;
|
|
4086
|
+
logger_default.debug("CC:useIsProviderReady: dispatching changes from fiat...");
|
|
4087
|
+
dispatch(setSourceAddress(""));
|
|
4088
|
+
setIsReady(true);
|
|
4038
4089
|
}, [sourceChain]);
|
|
4039
4090
|
return { isReady, statusMessage: "", walletAddres: "" };
|
|
4040
4091
|
};
|
|
@@ -4077,7 +4128,7 @@ var CreditCardPlugin = class extends PluginBase {
|
|
|
4077
4128
|
return chain.compatibility === "CC";
|
|
4078
4129
|
};
|
|
4079
4130
|
Provider = ({ children }) => {
|
|
4080
|
-
return /* @__PURE__ */
|
|
4131
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, children);
|
|
4081
4132
|
};
|
|
4082
4133
|
};
|
|
4083
4134
|
var creditCardPlugin = new CreditCardPlugin(store);
|
|
@@ -4098,7 +4149,7 @@ var useKimaContext = () => {
|
|
|
4098
4149
|
}
|
|
4099
4150
|
return context;
|
|
4100
4151
|
};
|
|
4101
|
-
var InternalKimaProvider =
|
|
4152
|
+
var InternalKimaProvider = React49.memo(
|
|
4102
4153
|
({ kimaBackendUrl, walletConnectProjectId, children, logLevel }) => {
|
|
4103
4154
|
const { data: envOptions, isLoading } = useGetEnvOptions({
|
|
4104
4155
|
kimaBackendUrl
|
|
@@ -4112,7 +4163,7 @@ var InternalKimaProvider = React48.memo(
|
|
|
4112
4163
|
const plugin = getPluginProvider(pluginData.id);
|
|
4113
4164
|
if (plugin) {
|
|
4114
4165
|
const { Provider: Provider3 } = plugin;
|
|
4115
|
-
return /* @__PURE__ */
|
|
4166
|
+
return /* @__PURE__ */ React49.createElement(
|
|
4116
4167
|
Provider3,
|
|
4117
4168
|
{
|
|
4118
4169
|
key: plugin.data.id,
|
|
@@ -4126,12 +4177,12 @@ var InternalKimaProvider = React48.memo(
|
|
|
4126
4177
|
return acc;
|
|
4127
4178
|
}, children);
|
|
4128
4179
|
}, [plugins, walletConnectProjectId, envOptions, isLoading]);
|
|
4129
|
-
return /* @__PURE__ */
|
|
4180
|
+
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, WrappedProviders);
|
|
4130
4181
|
}
|
|
4131
4182
|
);
|
|
4132
4183
|
var KimaProvider = ({
|
|
4133
4184
|
walletConnectProjectId,
|
|
4134
|
-
children = /* @__PURE__ */
|
|
4185
|
+
children = /* @__PURE__ */ React49.createElement(React49.Fragment, null),
|
|
4135
4186
|
externalProvider,
|
|
4136
4187
|
kimaBackendUrl = "http://localhost:3001",
|
|
4137
4188
|
logLevel,
|
|
@@ -4166,7 +4217,7 @@ var KimaProvider = ({
|
|
|
4166
4217
|
errorHandler,
|
|
4167
4218
|
switchChainHandler
|
|
4168
4219
|
};
|
|
4169
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ React49.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React49.createElement(Provider, { store }, /* @__PURE__ */ React49.createElement(KimaContext.Provider, { value: kimaContext }, /* @__PURE__ */ React49.createElement(
|
|
4170
4221
|
InternalKimaProvider,
|
|
4171
4222
|
{
|
|
4172
4223
|
kimaBackendUrl,
|
|
@@ -4178,17 +4229,17 @@ var KimaProvider = ({
|
|
|
4178
4229
|
var KimaProvider_default = KimaProvider;
|
|
4179
4230
|
|
|
4180
4231
|
// src/components/KimaTransactionWidget.tsx
|
|
4181
|
-
import
|
|
4232
|
+
import React88, { useEffect as useEffect24, useState as useState18 } from "react";
|
|
4182
4233
|
|
|
4183
4234
|
// src/components/KimaWidgetWrapper.tsx
|
|
4184
|
-
import
|
|
4235
|
+
import React86, { useEffect as useEffect23 } from "react";
|
|
4185
4236
|
import { useDispatch as useDispatch27, useSelector as useSelector47 } from "react-redux";
|
|
4186
4237
|
|
|
4187
4238
|
// src/components/TransactionWidget.tsx
|
|
4188
|
-
import
|
|
4239
|
+
import React73, { useEffect as useEffect15, useMemo as useMemo12, useState as useState11 } from "react";
|
|
4189
4240
|
|
|
4190
4241
|
// src/components/reusable/Progressbar.tsx
|
|
4191
|
-
import
|
|
4242
|
+
import React50 from "react";
|
|
4192
4243
|
import { useSelector as useSelector17 } from "react-redux";
|
|
4193
4244
|
var stepInfo = [
|
|
4194
4245
|
{
|
|
@@ -4209,12 +4260,12 @@ var stepInfo = [
|
|
|
4209
4260
|
];
|
|
4210
4261
|
var Progressbar = ({ step, errorStep, setFocus, loadingStep }) => {
|
|
4211
4262
|
const theme = useSelector17(selectTheme);
|
|
4212
|
-
return /* @__PURE__ */
|
|
4263
|
+
return /* @__PURE__ */ React50.createElement("div", { className: "kima-progressbar" }, /* @__PURE__ */ React50.createElement(
|
|
4213
4264
|
"div",
|
|
4214
4265
|
{
|
|
4215
4266
|
className: `value step-${step * 100 / 4}`
|
|
4216
4267
|
}
|
|
4217
|
-
), /* @__PURE__ */
|
|
4268
|
+
), /* @__PURE__ */ React50.createElement("div", { className: "step-indicators" }, stepInfo.map((item, index) => /* @__PURE__ */ React50.createElement(
|
|
4218
4269
|
"div",
|
|
4219
4270
|
{
|
|
4220
4271
|
key: item.title,
|
|
@@ -4225,14 +4276,14 @@ var Progressbar = ({ step, errorStep, setFocus, loadingStep }) => {
|
|
|
4225
4276
|
if (index < 4) setFocus(index);
|
|
4226
4277
|
}
|
|
4227
4278
|
},
|
|
4228
|
-
/* @__PURE__ */
|
|
4279
|
+
/* @__PURE__ */ React50.createElement("div", { className: "step-info" }, step < index && /* @__PURE__ */ React50.createElement(Lock_default, null), step >= index ? index === loadingStep ? /* @__PURE__ */ React50.createElement(Loader_default, { className: "loader" }) : index === errorStep ? /* @__PURE__ */ React50.createElement(Warning_default, null) : /* @__PURE__ */ React50.createElement(Check_default, null) : null, /* @__PURE__ */ React50.createElement("span", null, item.title))
|
|
4229
4280
|
))));
|
|
4230
4281
|
};
|
|
4231
4282
|
var Progressbar_default = Progressbar;
|
|
4232
4283
|
|
|
4233
4284
|
// src/components/reusable/ExternalLink.tsx
|
|
4234
|
-
import
|
|
4235
|
-
var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */
|
|
4285
|
+
import React51 from "react";
|
|
4286
|
+
var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */ React51.createElement(
|
|
4236
4287
|
"a",
|
|
4237
4288
|
{
|
|
4238
4289
|
className,
|
|
@@ -4246,20 +4297,20 @@ var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */ React5
|
|
|
4246
4297
|
var ExternalLink_default = ExternalLink;
|
|
4247
4298
|
|
|
4248
4299
|
// src/components/reusable/NetworkLabel.tsx
|
|
4249
|
-
import
|
|
4300
|
+
import React52 from "react";
|
|
4250
4301
|
import { useSelector as useSelector18 } from "react-redux";
|
|
4251
4302
|
|
|
4252
4303
|
// src/components/reusable/PrimaryButton.tsx
|
|
4253
|
-
import
|
|
4304
|
+
import React55 from "react";
|
|
4254
4305
|
|
|
4255
4306
|
// src/assets/loading/180-ring.tsx
|
|
4256
|
-
import
|
|
4307
|
+
import React53 from "react";
|
|
4257
4308
|
var Loading180Ring = ({
|
|
4258
4309
|
width = 24,
|
|
4259
4310
|
height = 24,
|
|
4260
4311
|
fill = "white"
|
|
4261
4312
|
}) => {
|
|
4262
|
-
return /* @__PURE__ */
|
|
4313
|
+
return /* @__PURE__ */ React53.createElement(
|
|
4263
4314
|
"svg",
|
|
4264
4315
|
{
|
|
4265
4316
|
width,
|
|
@@ -4268,7 +4319,7 @@ var Loading180Ring = ({
|
|
|
4268
4319
|
viewBox: "0 0 24 24",
|
|
4269
4320
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4270
4321
|
},
|
|
4271
|
-
/* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ React53.createElement("path", { d: "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" }, /* @__PURE__ */ React53.createElement(
|
|
4272
4323
|
"animateTransform",
|
|
4273
4324
|
{
|
|
4274
4325
|
attributeName: "transform",
|
|
@@ -4283,7 +4334,7 @@ var Loading180Ring = ({
|
|
|
4283
4334
|
var ring_default = Loading180Ring;
|
|
4284
4335
|
|
|
4285
4336
|
// src/assets/loading/6-dots-scale.tsx
|
|
4286
|
-
import
|
|
4337
|
+
import React54 from "react";
|
|
4287
4338
|
|
|
4288
4339
|
// src/components/reusable/PrimaryButton.tsx
|
|
4289
4340
|
var PrimaryButton = ({
|
|
@@ -4294,7 +4345,7 @@ var PrimaryButton = ({
|
|
|
4294
4345
|
disabled = false,
|
|
4295
4346
|
ref
|
|
4296
4347
|
}) => {
|
|
4297
|
-
return /* @__PURE__ */
|
|
4348
|
+
return /* @__PURE__ */ React55.createElement("div", { className: "primary-button-wrapper" }, /* @__PURE__ */ React55.createElement(
|
|
4298
4349
|
"button",
|
|
4299
4350
|
{
|
|
4300
4351
|
className: `primary-button ${className}`,
|
|
@@ -4302,14 +4353,14 @@ var PrimaryButton = ({
|
|
|
4302
4353
|
ref,
|
|
4303
4354
|
disabled
|
|
4304
4355
|
},
|
|
4305
|
-
isLoading && /* @__PURE__ */
|
|
4356
|
+
isLoading && /* @__PURE__ */ React55.createElement("div", { className: "loading-indicator" }, /* @__PURE__ */ React55.createElement(ring_default, { width: 24, height: 24, fill: "white" })),
|
|
4306
4357
|
children
|
|
4307
4358
|
));
|
|
4308
4359
|
};
|
|
4309
4360
|
var PrimaryButton_default = PrimaryButton;
|
|
4310
4361
|
|
|
4311
4362
|
// src/components/reusable/SecondaryButton.tsx
|
|
4312
|
-
import
|
|
4363
|
+
import React56 from "react";
|
|
4313
4364
|
var SecondaryButton = ({
|
|
4314
4365
|
className,
|
|
4315
4366
|
clickHandler,
|
|
@@ -4318,7 +4369,7 @@ var SecondaryButton = ({
|
|
|
4318
4369
|
style,
|
|
4319
4370
|
disabled = false,
|
|
4320
4371
|
isLoading
|
|
4321
|
-
}) => /* @__PURE__ */
|
|
4372
|
+
}) => /* @__PURE__ */ React56.createElement(
|
|
4322
4373
|
"button",
|
|
4323
4374
|
{
|
|
4324
4375
|
className: `secondary-button ${className} ${theme}`,
|
|
@@ -4326,18 +4377,18 @@ var SecondaryButton = ({
|
|
|
4326
4377
|
...style,
|
|
4327
4378
|
disabled
|
|
4328
4379
|
},
|
|
4329
|
-
isLoading && /* @__PURE__ */
|
|
4380
|
+
isLoading && /* @__PURE__ */ React56.createElement("div", { className: "loading-indicator" }, /* @__PURE__ */ React56.createElement(ring_default, { width: 24, height: 24, fill: "black" })),
|
|
4330
4381
|
children
|
|
4331
4382
|
);
|
|
4332
4383
|
var SecondaryButton_default = SecondaryButton;
|
|
4333
4384
|
|
|
4334
4385
|
// src/components/reusable/Dropdown.tsx
|
|
4335
|
-
import
|
|
4386
|
+
import React57 from "react";
|
|
4336
4387
|
import { useDispatch as useDispatch6 } from "react-redux";
|
|
4337
4388
|
import { useSelector as useSelector19 } from "react-redux";
|
|
4338
4389
|
|
|
4339
4390
|
// src/components/reusable/WalletButton.tsx
|
|
4340
|
-
import
|
|
4391
|
+
import React60, { useEffect as useEffect10, useMemo as useMemo8 } from "react";
|
|
4341
4392
|
import { useDispatch as useDispatch7, useSelector as useSelector21 } from "react-redux";
|
|
4342
4393
|
|
|
4343
4394
|
// src/hooks/useGetCurrentPlugin.tsx
|
|
@@ -4345,7 +4396,7 @@ import { useEffect as useEffect6, useState as useState5 } from "react";
|
|
|
4345
4396
|
import { useSelector as useSelector20 } from "react-redux";
|
|
4346
4397
|
|
|
4347
4398
|
// plugins/default/index.tsx
|
|
4348
|
-
import
|
|
4399
|
+
import React58 from "react";
|
|
4349
4400
|
var DefaultPlugin = class extends PluginBase {
|
|
4350
4401
|
constructor(store2) {
|
|
4351
4402
|
super({
|
|
@@ -4380,7 +4431,7 @@ var DefaultPlugin = class extends PluginBase {
|
|
|
4380
4431
|
networkOption,
|
|
4381
4432
|
walletConnectProjectId
|
|
4382
4433
|
}) => {
|
|
4383
|
-
return /* @__PURE__ */
|
|
4434
|
+
return /* @__PURE__ */ React58.createElement("div", null, children);
|
|
4384
4435
|
};
|
|
4385
4436
|
};
|
|
4386
4437
|
var defaultPlugin = new DefaultPlugin(store);
|
|
@@ -4473,7 +4524,7 @@ import { useWallet as useTronWallet2 } from "@tronweb3/tronwallet-adapter-react-
|
|
|
4473
4524
|
import { useAppKit, useAppKitState } from "@reown/appkit/react";
|
|
4474
4525
|
|
|
4475
4526
|
// src/components/reusable/CopyButton.tsx
|
|
4476
|
-
import
|
|
4527
|
+
import React59, { useEffect as useEffect8, useState as useState7 } from "react";
|
|
4477
4528
|
var CopyButton = ({ text }) => {
|
|
4478
4529
|
const [copyClicked, setCopyClicked] = useState7(false);
|
|
4479
4530
|
useEffect8(() => {
|
|
@@ -4482,7 +4533,7 @@ var CopyButton = ({ text }) => {
|
|
|
4482
4533
|
setCopyClicked(false);
|
|
4483
4534
|
}, 2e3);
|
|
4484
4535
|
}, [copyClicked]);
|
|
4485
|
-
return /* @__PURE__ */
|
|
4536
|
+
return /* @__PURE__ */ React59.createElement(
|
|
4486
4537
|
"span",
|
|
4487
4538
|
{
|
|
4488
4539
|
className: "copy-btn",
|
|
@@ -4491,7 +4542,7 @@ var CopyButton = ({ text }) => {
|
|
|
4491
4542
|
navigator.clipboard.writeText(text);
|
|
4492
4543
|
}
|
|
4493
4544
|
},
|
|
4494
|
-
copyClicked ? /* @__PURE__ */
|
|
4545
|
+
copyClicked ? /* @__PURE__ */ React59.createElement(Check_default, null) : /* @__PURE__ */ React59.createElement(Copy_default, null)
|
|
4495
4546
|
);
|
|
4496
4547
|
};
|
|
4497
4548
|
var CopyButton_default = CopyButton;
|
|
@@ -4717,13 +4768,13 @@ var WalletButton = ({
|
|
|
4717
4768
|
}
|
|
4718
4769
|
dispatch(setSourceAddress(connectedAddress));
|
|
4719
4770
|
}, [isReady]);
|
|
4720
|
-
return /* @__PURE__ */
|
|
4771
|
+
return /* @__PURE__ */ React60.createElement(
|
|
4721
4772
|
"div",
|
|
4722
4773
|
{
|
|
4723
4774
|
className: `wallet-button ${isConnected ? "connected" : "disconnected"} ${theme.colorMode} ${errorBelow ? "error-below" : ""}`,
|
|
4724
4775
|
"data-testid": "connect-wallet-btn"
|
|
4725
4776
|
},
|
|
4726
|
-
/* @__PURE__ */
|
|
4777
|
+
/* @__PURE__ */ React60.createElement("div", { className: "info-wrapper" }, /* @__PURE__ */ React60.createElement(
|
|
4727
4778
|
"button",
|
|
4728
4779
|
{
|
|
4729
4780
|
className: `${isConnected ? "connected" : "disconnected"} ${width < 640 && "shortened"} ${theme.colorMode}`,
|
|
@@ -4733,16 +4784,16 @@ var WalletButton = ({
|
|
|
4733
4784
|
isConnected && !placeholder ? width >= 640 ? `${connectedAddress || ""}` : getShortenedAddress(connectedAddress || "") : "",
|
|
4734
4785
|
!isConnected && mode === "light" /* light */ && "Select Network to Load Account",
|
|
4735
4786
|
!isConnected && mode !== "light" /* light */ && initialSelection && "Select Network to Connect",
|
|
4736
|
-
!isConnected && mode !== "light" /* light */ && !initialSelection && /* @__PURE__ */
|
|
4787
|
+
!isConnected && mode !== "light" /* light */ && !initialSelection && /* @__PURE__ */ React60.createElement(Wallet_default, null),
|
|
4737
4788
|
!isConnected && mode !== "light" /* light */ && !initialSelection && "Connect Wallet"
|
|
4738
|
-
), isConnected && !placeholder && /* @__PURE__ */
|
|
4739
|
-
isConnected && !placeholder && balance !== void 0 && decimals !== void 0 ? /* @__PURE__ */
|
|
4789
|
+
), isConnected && !placeholder && /* @__PURE__ */ React60.createElement(CopyButton_default, { text: connectedAddress })),
|
|
4790
|
+
isConnected && !placeholder && balance !== void 0 && decimals !== void 0 ? /* @__PURE__ */ React60.createElement("p", { className: "balance-info" }, formatUSD(bigIntToNumber({ value: balance, decimals })), " ", selectedCoin, " available") : null
|
|
4740
4791
|
);
|
|
4741
4792
|
};
|
|
4742
4793
|
var WalletButton_default = WalletButton;
|
|
4743
4794
|
|
|
4744
4795
|
// src/components/reusable/CoinDropdown.tsx
|
|
4745
|
-
import
|
|
4796
|
+
import React62, { useEffect as useEffect12, useRef, useState as useState8 } from "react";
|
|
4746
4797
|
import { useSelector as useSelector23 } from "react-redux";
|
|
4747
4798
|
import { useDispatch as useDispatch9 } from "react-redux";
|
|
4748
4799
|
|
|
@@ -4750,25 +4801,61 @@ import { useDispatch as useDispatch9 } from "react-redux";
|
|
|
4750
4801
|
import { useEffect as useEffect11, useMemo as useMemo9 } from "react";
|
|
4751
4802
|
import { useSelector as useSelector22 } from "react-redux";
|
|
4752
4803
|
import { useDispatch as useDispatch8 } from "react-redux";
|
|
4804
|
+
var emptyTokenList = { tokenList: [] };
|
|
4753
4805
|
function useCurrencyOptions(isSourceChain) {
|
|
4754
4806
|
const dispatch = useDispatch8();
|
|
4755
4807
|
const mode = useSelector22(selectMode);
|
|
4756
4808
|
const sourceChain = useSelector22(selectSourceChain);
|
|
4809
|
+
const sourceSymbol = useSelector22(selectSourceCurrency);
|
|
4757
4810
|
const targetChain = useSelector22(selectTargetChain);
|
|
4758
|
-
const chain = isSourceChain ? sourceChain : targetChain;
|
|
4759
4811
|
const transactionOption = useSelector22(selectTransactionOption);
|
|
4760
|
-
const networks = useSelector22(selectNetworks);
|
|
4761
4812
|
const output = useMemo9(() => {
|
|
4762
|
-
|
|
4763
|
-
const
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4813
|
+
const chain = isSourceChain ? sourceChain : targetChain;
|
|
4814
|
+
const location = isSourceChain ? "origin" : "target";
|
|
4815
|
+
if (!chain) {
|
|
4816
|
+
logger_default.debug(`useCurrencyOptions(${location}): no chain selected`, {
|
|
4817
|
+
chain,
|
|
4818
|
+
sourceSymbol
|
|
4819
|
+
});
|
|
4820
|
+
return emptyTokenList;
|
|
4821
|
+
}
|
|
4822
|
+
if (isSourceChain) return { tokenList: chain.supportedTokens };
|
|
4823
|
+
if (!sourceSymbol) {
|
|
4824
|
+
logger_default.debug(`useCurrencyOptions(${location}): no sourceSymbol selected`, {
|
|
4825
|
+
chain,
|
|
4826
|
+
sourceSymbol
|
|
4827
|
+
});
|
|
4828
|
+
return { tokenList: chain.supportedTokens };
|
|
4829
|
+
}
|
|
4830
|
+
const sourceToken = sourceChain.supportedTokens.find(
|
|
4831
|
+
(t) => t.symbol === sourceSymbol
|
|
4832
|
+
);
|
|
4833
|
+
if (!sourceToken) {
|
|
4834
|
+
logger_default.debug(
|
|
4835
|
+
`useCurrencyOptions(${location}): source token ${sourceSymbol ?? "undefined"} not found`,
|
|
4836
|
+
{ sourceChain, sourceSymbol }
|
|
4837
|
+
);
|
|
4838
|
+
return { tokenList: chain.supportedTokens };
|
|
4839
|
+
}
|
|
4840
|
+
const tokenList2 = chain.supportedTokens.filter(
|
|
4841
|
+
(token) => token.peggedTo === sourceToken.peggedTo
|
|
4842
|
+
);
|
|
4843
|
+
logger_default.debug(`useCurrencyOptions(${location}): updated token list `, {
|
|
4844
|
+
tokenList: tokenList2,
|
|
4845
|
+
sourceSymbol,
|
|
4846
|
+
sourceToken,
|
|
4847
|
+
chain
|
|
4848
|
+
});
|
|
4849
|
+
return { tokenList: tokenList2 };
|
|
4850
|
+
}, [sourceChain, sourceSymbol, targetChain, isSourceChain]);
|
|
4767
4851
|
const { tokenList } = output;
|
|
4768
4852
|
useEffect11(() => {
|
|
4769
4853
|
if (!tokenList.length) return;
|
|
4770
4854
|
if (mode === "payment" /* payment */ && !isSourceChain) return;
|
|
4771
4855
|
const [firstToken] = tokenList;
|
|
4856
|
+
logger_default.debug(
|
|
4857
|
+
`useCurrencyOptions: seting default currency to ${firstToken.symbol}`
|
|
4858
|
+
);
|
|
4772
4859
|
if (isSourceChain) {
|
|
4773
4860
|
dispatch(setSourceCurrency(firstToken.symbol));
|
|
4774
4861
|
} else {
|
|
@@ -4779,16 +4866,19 @@ function useCurrencyOptions(isSourceChain) {
|
|
|
4779
4866
|
}
|
|
4780
4867
|
|
|
4781
4868
|
// src/components/reusable/TokenIcon.tsx
|
|
4782
|
-
import
|
|
4869
|
+
import React61 from "react";
|
|
4783
4870
|
var COIN_LIST = {
|
|
4871
|
+
EUR: KEUR_default,
|
|
4872
|
+
EURC: EURC_default,
|
|
4873
|
+
EURK: KEUR_default,
|
|
4874
|
+
HONEY: Honey_default,
|
|
4784
4875
|
KEUR: KEUR_default,
|
|
4785
4876
|
KIMAUSD: USDK_default,
|
|
4786
4877
|
USDC: USDC_default,
|
|
4787
4878
|
USDK: USDK_default,
|
|
4788
|
-
USDT: USDT_default,
|
|
4789
|
-
WBTC: BTC_default,
|
|
4790
4879
|
USD: USD_default,
|
|
4791
|
-
|
|
4880
|
+
USDT: USDT_default,
|
|
4881
|
+
WBTC: BTC_default
|
|
4792
4882
|
};
|
|
4793
4883
|
function TokenIcon({
|
|
4794
4884
|
symbol,
|
|
@@ -4801,7 +4891,7 @@ function TokenIcon({
|
|
|
4801
4891
|
logger_default.warn(`Token icon not found for symbol: ${symbol}`);
|
|
4802
4892
|
return null;
|
|
4803
4893
|
}
|
|
4804
|
-
return /* @__PURE__ */
|
|
4894
|
+
return /* @__PURE__ */ React61.createElement("div", { className: "icon-wrapper" }, /* @__PURE__ */ React61.createElement(Icon, { width, height }));
|
|
4805
4895
|
}
|
|
4806
4896
|
|
|
4807
4897
|
// src/components/reusable/CoinDropdown.tsx
|
|
@@ -4834,68 +4924,69 @@ var CoinDropdown = ({
|
|
|
4834
4924
|
dispatch(setTargetCurrency(symbol));
|
|
4835
4925
|
}
|
|
4836
4926
|
};
|
|
4837
|
-
return /* @__PURE__ */
|
|
4927
|
+
return /* @__PURE__ */ React62.createElement(
|
|
4838
4928
|
"div",
|
|
4839
4929
|
{
|
|
4840
4930
|
className: `coin-dropdown ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"}`,
|
|
4841
4931
|
onClick: () => setCollapsed((prev) => !prev),
|
|
4842
4932
|
ref
|
|
4843
4933
|
},
|
|
4844
|
-
/* @__PURE__ */
|
|
4845
|
-
/* @__PURE__ */
|
|
4934
|
+
/* @__PURE__ */ React62.createElement("div", { className: "coin-wrapper" }, /* @__PURE__ */ React62.createElement(TokenIcon, { symbol: tokenSymbol, width: 24, height: 24 }), /* @__PURE__ */ React62.createElement("span", { className: "coin" }, tokenSymbol)),
|
|
4935
|
+
/* @__PURE__ */ React62.createElement(
|
|
4846
4936
|
"div",
|
|
4847
4937
|
{
|
|
4848
4938
|
className: `coin-menu ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"}`
|
|
4849
4939
|
},
|
|
4850
|
-
tokenList.map((token) => /* @__PURE__ */
|
|
4940
|
+
tokenList.map((token) => /* @__PURE__ */ React62.createElement(
|
|
4851
4941
|
"div",
|
|
4852
4942
|
{
|
|
4853
4943
|
className: `coin-item ${theme.colorMode}`,
|
|
4854
4944
|
key: token.symbol,
|
|
4855
4945
|
onClick: () => handleDropdownItemClick(token.symbol)
|
|
4856
4946
|
},
|
|
4857
|
-
/* @__PURE__ */
|
|
4858
|
-
/* @__PURE__ */
|
|
4947
|
+
/* @__PURE__ */ React62.createElement(TokenIcon, { symbol: token.symbol, width: 24, height: 24 }),
|
|
4948
|
+
/* @__PURE__ */ React62.createElement("p", null, token.symbol)
|
|
4859
4949
|
))
|
|
4860
4950
|
),
|
|
4861
|
-
/* @__PURE__ */
|
|
4951
|
+
/* @__PURE__ */ React62.createElement("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}` }, /* @__PURE__ */ React62.createElement(Arrow_default, { fill: "none" }))
|
|
4862
4952
|
);
|
|
4863
4953
|
};
|
|
4864
4954
|
var CoinDropdown_default = CoinDropdown;
|
|
4865
4955
|
|
|
4866
4956
|
// src/components/reusable/ConfirmDetails.tsx
|
|
4867
|
-
import
|
|
4957
|
+
import React65, { useEffect as useEffect13, useMemo as useMemo10, useState as useState9 } from "react";
|
|
4868
4958
|
import { useSelector as useSelector25 } from "react-redux";
|
|
4869
4959
|
|
|
4870
4960
|
// src/components/reusable/ChainIcon.tsx
|
|
4871
|
-
import
|
|
4961
|
+
import React63 from "react";
|
|
4872
4962
|
var chainIcons = {
|
|
4873
|
-
|
|
4874
|
-
POL: Polygon_default,
|
|
4963
|
+
ARB: Arbitrum_default,
|
|
4875
4964
|
AVX: Avalanche_default,
|
|
4965
|
+
BANK: Bank_default,
|
|
4876
4966
|
BASE: Base_default,
|
|
4967
|
+
BERA: Bera_default,
|
|
4877
4968
|
BSC: BSC_default,
|
|
4878
4969
|
BTC: BTC_default,
|
|
4879
|
-
|
|
4970
|
+
CC: CreditCard_default,
|
|
4971
|
+
CFX: CFX_default,
|
|
4972
|
+
ETH: Ethereum_default,
|
|
4973
|
+
FIAT: Bank_default,
|
|
4974
|
+
POL: Polygon_default,
|
|
4880
4975
|
OPT: Optimism_default,
|
|
4881
|
-
TRX: Tron_default,
|
|
4882
4976
|
SOL: Solana_default,
|
|
4883
|
-
|
|
4884
|
-
BERA: Bera_default,
|
|
4885
|
-
CFX: CFX_default,
|
|
4886
|
-
CC: CreditCard_default
|
|
4977
|
+
TRX: Tron_default
|
|
4887
4978
|
};
|
|
4888
4979
|
function ChainIcon({ symbol }) {
|
|
4889
4980
|
const Icon = symbol === "FIAT" ? chainIcons["CC"] : chainIcons[symbol];
|
|
4890
4981
|
if (!Icon) {
|
|
4891
|
-
logger_default.warn(`Chain icon not found for symbol: ${symbol}`);
|
|
4892
|
-
return /* @__PURE__ */
|
|
4982
|
+
if (symbol) logger_default.warn(`Chain icon not found for symbol: ${symbol}`);
|
|
4983
|
+
return /* @__PURE__ */ React63.createElement("div", null);
|
|
4893
4984
|
}
|
|
4894
|
-
return /* @__PURE__ */
|
|
4985
|
+
return /* @__PURE__ */ React63.createElement("div", { className: "icon" }, /* @__PURE__ */ React63.createElement(Icon, null));
|
|
4895
4986
|
}
|
|
4896
4987
|
|
|
4897
4988
|
// src/components/reusable/FeeDeductionRadioButtons.tsx
|
|
4898
|
-
import
|
|
4989
|
+
import React64 from "react";
|
|
4899
4990
|
import { useDispatch as useDispatch10, useSelector as useSelector24 } from "react-redux";
|
|
4900
4991
|
var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
4901
4992
|
const dispatch = useDispatch10();
|
|
@@ -4912,7 +5003,7 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
4912
5003
|
const handleChange = (value) => {
|
|
4913
5004
|
dispatch(setFeeDeduct(value));
|
|
4914
5005
|
};
|
|
4915
|
-
return /* @__PURE__ */
|
|
5006
|
+
return /* @__PURE__ */ React64.createElement("div", { className: `fee-deduction-radio-container ${theme.colorMode}` }, /* @__PURE__ */ React64.createElement("div", { className: "fee-options" }, Number(amount) - totalFee > 0 && /* @__PURE__ */ React64.createElement("label", { className: `fee-option ${disabled ? "disabled" : ""}` }, /* @__PURE__ */ React64.createElement(
|
|
4916
5007
|
"input",
|
|
4917
5008
|
{
|
|
4918
5009
|
type: "radio",
|
|
@@ -4921,11 +5012,11 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
4921
5012
|
disabled,
|
|
4922
5013
|
onChange: () => handleChange(true)
|
|
4923
5014
|
}
|
|
4924
|
-
), /* @__PURE__ */
|
|
5015
|
+
), /* @__PURE__ */ React64.createElement("span", { className: `radio-label ${theme.colorMode}` }, `Pay $${formatterFloat.format(
|
|
4925
5016
|
Number(amount)
|
|
4926
5017
|
)} ${sourceCurrency} in ${sourceNetwork.name} to receive $${formatterFloat.format(
|
|
4927
5018
|
Number(amount) - totalFee
|
|
4928
|
-
)} ${targetCurrency} in ${targetNetwork.name}`)), /* @__PURE__ */
|
|
5019
|
+
)} ${targetCurrency} in ${targetNetwork.name}`)), /* @__PURE__ */ React64.createElement("label", { className: `fee-option ${disabled ? "disabled" : ""}` }, /* @__PURE__ */ React64.createElement(
|
|
4929
5020
|
"input",
|
|
4930
5021
|
{
|
|
4931
5022
|
type: "radio",
|
|
@@ -4934,7 +5025,7 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
4934
5025
|
disabled,
|
|
4935
5026
|
onChange: () => handleChange(false)
|
|
4936
5027
|
}
|
|
4937
|
-
), /* @__PURE__ */
|
|
5028
|
+
), /* @__PURE__ */ React64.createElement("span", { className: `radio-label ${theme.colorMode}` }, `Pay $${formatterFloat.format(
|
|
4938
5029
|
Number(amount) + totalFee
|
|
4939
5030
|
)} ${sourceCurrency} in ${sourceNetwork.name} to receive $${formatterFloat.format(
|
|
4940
5031
|
Number(amount)
|
|
@@ -4963,10 +5054,6 @@ var ConfirmDetails = ({
|
|
|
4963
5054
|
const [feeCollapsed, setFeeCollapsed] = useState9(true);
|
|
4964
5055
|
const transactionOption = useSelector25(selectTransactionOption);
|
|
4965
5056
|
const { connectedAddress } = useIsWalletReady4();
|
|
4966
|
-
const originNetworkOption = useMemo10(
|
|
4967
|
-
() => networkOptions3.filter((network) => network.id === originNetwork.id)[0],
|
|
4968
|
-
[networkOptions3, originNetwork]
|
|
4969
|
-
);
|
|
4970
5057
|
const targetNetworkOption = useMemo10(
|
|
4971
5058
|
() => networkOptions3.filter(
|
|
4972
5059
|
(network) => network.shortName === (mode === "payment" /* payment */ ? transactionOption?.targetChain : targetNetwork.shortName)
|
|
@@ -4979,13 +5066,13 @@ var ConfirmDetails = ({
|
|
|
4979
5066
|
useEffect13(() => {
|
|
4980
5067
|
width === 0 && updateWidth(window.innerWidth);
|
|
4981
5068
|
}, []);
|
|
4982
|
-
return /* @__PURE__ */
|
|
5069
|
+
return /* @__PURE__ */ React65.createElement("div", { className: `confirm-details ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement("p", null, "Step ", isApproved ? "2" : "1", "\xA0of 2\xA0\xA0\xA0", isApproved ? "Submit transaction" : originNetwork.shortName === "FIAT" /* FIAT */ ? "Bank Details" : "Approval"), originNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */ React65.createElement("div", null, /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React65.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement(ChainIcon, { symbol: originNetwork?.shortName }), "FIAT"), /* @__PURE__ */ React65.createElement("p", null, "ES6621000418401234567891")), /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React65.createElement("p", null, "Kima Sandbox")), /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "BIC:"), /* @__PURE__ */ React65.createElement("p", null, "CAIXESBBXXX")), /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Description:"), /* @__PURE__ */ React65.createElement("p", { className: "signature" }, signature))) : /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Source ", originNetwork.shortName !== "CC" && "wallet", ":"), /* @__PURE__ */ React65.createElement("div", { className: "network-details" }, /* @__PURE__ */ React65.createElement("div", { className: "kima-card-network-container" }, /* @__PURE__ */ React65.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement(ChainIcon, { symbol: originNetwork?.shortName }), originNetwork.name)), originNetwork.shortName !== "CC" && /* @__PURE__ */ React65.createElement("p", { className: theme.colorMode }, dAppOption === "LPDrain" /* LPDrain */ ? targetAddress : connectedAddress))), /* @__PURE__ */ React65.createElement("div", { className: "detail-item amount" }, /* @__PURE__ */ React65.createElement("span", { className: "amount-container" }, /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "Amount to Transfer "), /* @__PURE__ */ React65.createElement("div", { className: "coin-details" }, /* @__PURE__ */ React65.createElement("p", null, formatBigInt(txValues.allowanceAmount), " ", sourceCurrency))), /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "Total Fees"), /* @__PURE__ */ React65.createElement(
|
|
4983
5070
|
"div",
|
|
4984
5071
|
{
|
|
4985
5072
|
className: "fee-collapse",
|
|
4986
5073
|
onClick: () => setFeeCollapsed(!feeCollapsed)
|
|
4987
5074
|
},
|
|
4988
|
-
/* @__PURE__ */
|
|
5075
|
+
/* @__PURE__ */ React65.createElement(
|
|
4989
5076
|
MiniArrow_default,
|
|
4990
5077
|
{
|
|
4991
5078
|
width: 15,
|
|
@@ -4996,16 +5083,16 @@ var ConfirmDetails = ({
|
|
|
4996
5083
|
}
|
|
4997
5084
|
}
|
|
4998
5085
|
),
|
|
4999
|
-
/* @__PURE__ */
|
|
5000
|
-
)), /* @__PURE__ */
|
|
5086
|
+
/* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(totalFee), " ", sourceCurrency)
|
|
5087
|
+
)), /* @__PURE__ */ React65.createElement("div", { className: `fee-breakdown ${feeCollapsed ? "collapsed" : ""}` }, /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, originNetwork.shortName === "CC" ? "Credit Card Processing Fee" : `Source Network Fee (${originNetwork.shortName})`), /* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(sourceFee), " ", sourceCurrency)), /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "Target Network Fee (", targetNetwork.shortName, ")"), /* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(targetFee), " ", targetCurrency)), /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "KIMA Service Fee"), /* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(kimaFee), " ", sourceCurrency))), /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "Target Transfer Amount"), /* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(txValues.submitAmount), " ", targetCurrency)))), targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */ React65.createElement("div", null, /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React65.createElement("p", null, bankDetails.iban), /* @__PURE__ */ React65.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement(ChainIcon, { symbol: targetNetworkOption?.shortName }), "FIAT")), /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React65.createElement("p", null, bankDetails.recipient))) : /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Target wallet:"), /* @__PURE__ */ React65.createElement("div", { className: "network-details" }, /* @__PURE__ */ React65.createElement("div", { className: "kima-card-network-container" }, /* @__PURE__ */ React65.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement(ChainIcon, { symbol: targetNetworkOption?.shortName }), targetNetworkOption?.name)), /* @__PURE__ */ React65.createElement("p", { className: theme.colorMode }, mode === "light" /* light */ ? targetNetwork.shortName === "SOL" ? lightDemoAccounts.SOL : targetNetwork.shortName === "TRX" ? lightDemoAccounts.TRX : lightDemoAccounts.EVM : dAppOption === "LPDrain" /* LPDrain */ ? connectedAddress : targetAddress))), mode === "bridge" /* bridge */ && BigInt(totalFee.value) > BigInt(0) ? (
|
|
5001
5088
|
// <FeeDeductionSlider />
|
|
5002
|
-
/* @__PURE__ */
|
|
5089
|
+
/* @__PURE__ */ React65.createElement(FeeDeductionRadioButtons_default, { disabled: feeOptionDisabled })
|
|
5003
5090
|
) : null);
|
|
5004
5091
|
};
|
|
5005
5092
|
var ConfirmDetails_default = ConfirmDetails;
|
|
5006
5093
|
|
|
5007
5094
|
// src/components/reusable/AddressInput.tsx
|
|
5008
|
-
import
|
|
5095
|
+
import React66, { useEffect as useEffect14 } from "react";
|
|
5009
5096
|
import { useDispatch as useDispatch11, useSelector as useSelector26 } from "react-redux";
|
|
5010
5097
|
var AddressInput = ({
|
|
5011
5098
|
theme,
|
|
@@ -5044,7 +5131,7 @@ var AddressInput = ({
|
|
|
5044
5131
|
mode,
|
|
5045
5132
|
dispatch
|
|
5046
5133
|
]);
|
|
5047
|
-
return /* @__PURE__ */
|
|
5134
|
+
return /* @__PURE__ */ React66.createElement(
|
|
5048
5135
|
"input",
|
|
5049
5136
|
{
|
|
5050
5137
|
className: `kima-address-input ${theme}`,
|
|
@@ -5059,11 +5146,11 @@ var AddressInput = ({
|
|
|
5059
5146
|
var AddressInput_default = AddressInput;
|
|
5060
5147
|
|
|
5061
5148
|
// src/components/reusable/CustomCheckbox.tsx
|
|
5062
|
-
import
|
|
5149
|
+
import React67 from "react";
|
|
5063
5150
|
import { useSelector as useSelector27 } from "react-redux";
|
|
5064
5151
|
|
|
5065
5152
|
// src/components/reusable/StepBox.tsx
|
|
5066
|
-
import
|
|
5153
|
+
import React68, { useMemo as useMemo11 } from "react";
|
|
5067
5154
|
import { useSelector as useSelector28 } from "react-redux";
|
|
5068
5155
|
var stepInfo2 = [
|
|
5069
5156
|
{
|
|
@@ -5095,61 +5182,61 @@ var StepBox = ({ step, errorStep, loadingStep, data }) => {
|
|
|
5095
5182
|
() => networks.find((network) => network.shortName === data?.targetChain),
|
|
5096
5183
|
[data, networks]
|
|
5097
5184
|
);
|
|
5098
|
-
return /* @__PURE__ */
|
|
5185
|
+
return /* @__PURE__ */ React68.createElement("div", { className: "kima-stepbox" }, /* @__PURE__ */ React68.createElement("div", { className: `content-wrapper ${theme.colorMode}` }, stepInfo2.map((item, index) => /* @__PURE__ */ React68.createElement("div", { key: item.title, className: "step-item" }, /* @__PURE__ */ React68.createElement(
|
|
5099
5186
|
"div",
|
|
5100
5187
|
{
|
|
5101
5188
|
className: `info-item
|
|
5102
5189
|
${step >= index ? index === loadingStep ? "active" : index === errorStep ? "error" : "completed" : ""}
|
|
5103
5190
|
${step < index && "locked"} ${theme.colorMode}`
|
|
5104
5191
|
},
|
|
5105
|
-
step < index && /* @__PURE__ */
|
|
5106
|
-
step >= index ? index === loadingStep ? /* @__PURE__ */
|
|
5107
|
-
/* @__PURE__ */
|
|
5108
|
-
), index === 0 && data?.kimaTxHash ? /* @__PURE__ */
|
|
5192
|
+
step < index && /* @__PURE__ */ React68.createElement(Lock_default, null),
|
|
5193
|
+
step >= index ? index === loadingStep ? /* @__PURE__ */ React68.createElement(Loader_default, { className: "loader" }) : index === errorStep ? /* @__PURE__ */ React68.createElement(Warning_default, null) : /* @__PURE__ */ React68.createElement(Check_default, null) : null,
|
|
5194
|
+
/* @__PURE__ */ React68.createElement("p", null, item.title)
|
|
5195
|
+
), index === 0 && data?.kimaTxHash ? /* @__PURE__ */ React68.createElement("div", { className: `info-item ${theme.colorMode}` }, /* @__PURE__ */ React68.createElement("div", { className: "icon" }, /* @__PURE__ */ React68.createElement(USDK_default, { width: 30, height: 30 })), /* @__PURE__ */ React68.createElement("p", { className: "chain-name" }, "Kima TX Hash:"), /* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(
|
|
5109
5196
|
ExternalLink_default,
|
|
5110
5197
|
{
|
|
5111
5198
|
to: `${explorerUrl}/transactions/?tx=${data?.kimaTxHash}`
|
|
5112
5199
|
},
|
|
5113
5200
|
getShortenedAddress(data?.kimaTxHash || "")
|
|
5114
|
-
), /* @__PURE__ */
|
|
5201
|
+
), /* @__PURE__ */ React68.createElement(CopyButton_default, { text: data?.kimaTxHash }))) : null, index === 1 && data?.tssPullHash && sourceChain?.shortName !== "CC" ? /* @__PURE__ */ React68.createElement(
|
|
5115
5202
|
"div",
|
|
5116
5203
|
{
|
|
5117
5204
|
className: `info-item ${theme.colorMode} source-chain ${step >= 3 ? "paid" : ""}`
|
|
5118
5205
|
},
|
|
5119
|
-
/* @__PURE__ */
|
|
5120
|
-
/* @__PURE__ */
|
|
5121
|
-
/* @__PURE__ */
|
|
5206
|
+
/* @__PURE__ */ React68.createElement(ChainIcon, { symbol: data.sourceChain }),
|
|
5207
|
+
/* @__PURE__ */ React68.createElement("p", { className: "chain-name" }, sourceChain?.name, " TX Hash:"),
|
|
5208
|
+
/* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(
|
|
5122
5209
|
ExternalLink_default,
|
|
5123
5210
|
{
|
|
5124
5211
|
to: `${sourceChain?.blockExplorers?.default.url}/${data?.sourceChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssPullHash}${data?.sourceChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5125
5212
|
},
|
|
5126
5213
|
getShortenedAddress(data?.tssPullHash || "")
|
|
5127
|
-
), /* @__PURE__ */
|
|
5128
|
-
) : null, index === 3 && data?.tssRefundHash ? /* @__PURE__ */
|
|
5214
|
+
), /* @__PURE__ */ React68.createElement(CopyButton_default, { text: data?.tssPullHash || "" }))
|
|
5215
|
+
) : null, index === 3 && data?.tssRefundHash ? /* @__PURE__ */ React68.createElement("div", { className: `info-item ${theme.colorMode} target-chain` }, /* @__PURE__ */ React68.createElement(ChainIcon, { symbol: data.sourceChain }), /* @__PURE__ */ React68.createElement("p", { className: "chain-name" }, sourceChain?.name, " TX Hash:"), /* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(
|
|
5129
5216
|
ExternalLink_default,
|
|
5130
5217
|
{
|
|
5131
5218
|
to: `${sourceChain?.blockExplorers?.default.url}/${data?.sourceChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssRefundHash}${data?.sourceChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5132
5219
|
},
|
|
5133
5220
|
getShortenedAddress(data?.tssRefundHash || "")
|
|
5134
|
-
), /* @__PURE__ */
|
|
5221
|
+
), /* @__PURE__ */ React68.createElement(CopyButton_default, { text: data?.tssRefundHash || "" }))) : null, index === 3 && data?.tssReleaseHash ? /* @__PURE__ */ React68.createElement("div", { className: `info-item ${theme.colorMode} target-chain` }, /* @__PURE__ */ React68.createElement(ChainIcon, { symbol: data.targetChain }), /* @__PURE__ */ React68.createElement("p", { className: "chain-name" }, targetChain?.name, " TX Hash:"), /* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(
|
|
5135
5222
|
ExternalLink_default,
|
|
5136
5223
|
{
|
|
5137
5224
|
to: `${targetChain?.blockExplorers?.default.url}/${data?.targetChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssReleaseHash}${data?.targetChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5138
5225
|
},
|
|
5139
5226
|
getShortenedAddress(data?.tssReleaseHash || "")
|
|
5140
|
-
), /* @__PURE__ */
|
|
5227
|
+
), /* @__PURE__ */ React68.createElement(CopyButton_default, { text: data?.tssReleaseHash || "" }))) : null))));
|
|
5141
5228
|
};
|
|
5142
5229
|
var StepBox_default = StepBox;
|
|
5143
5230
|
|
|
5144
5231
|
// src/components/reusable/BankInput.tsx
|
|
5145
|
-
import
|
|
5232
|
+
import React69 from "react";
|
|
5146
5233
|
import { useDispatch as useDispatch12 } from "react-redux";
|
|
5147
5234
|
import { useSelector as useSelector29 } from "react-redux";
|
|
5148
5235
|
var BankInput = () => {
|
|
5149
5236
|
const dispatch = useDispatch12();
|
|
5150
5237
|
const theme = useSelector29(selectTheme);
|
|
5151
5238
|
const bankDetails = useSelector29(selectBankDetails);
|
|
5152
|
-
return /* @__PURE__ */
|
|
5239
|
+
return /* @__PURE__ */ React69.createElement("div", { className: "bank-input" }, /* @__PURE__ */ React69.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React69.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React69.createElement(
|
|
5153
5240
|
"input",
|
|
5154
5241
|
{
|
|
5155
5242
|
className: "kima-address-input",
|
|
@@ -5157,7 +5244,7 @@ var BankInput = () => {
|
|
|
5157
5244
|
value: bankDetails.iban,
|
|
5158
5245
|
onChange: (e) => dispatch(setBankDetails({ ...bankDetails, iban: e.target.value }))
|
|
5159
5246
|
}
|
|
5160
|
-
)), /* @__PURE__ */
|
|
5247
|
+
)), /* @__PURE__ */ React69.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React69.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React69.createElement(
|
|
5161
5248
|
"input",
|
|
5162
5249
|
{
|
|
5163
5250
|
className: "kima-address-input",
|
|
@@ -5172,7 +5259,7 @@ var BankInput = () => {
|
|
|
5172
5259
|
var BankInput_default = BankInput;
|
|
5173
5260
|
|
|
5174
5261
|
// src/components/reusable/TxButton.tsx
|
|
5175
|
-
import
|
|
5262
|
+
import React70 from "react";
|
|
5176
5263
|
import { useDispatch as useDispatch13 } from "react-redux";
|
|
5177
5264
|
import { useSelector as useSelector30 } from "react-redux";
|
|
5178
5265
|
var TxButton = ({ theme }) => {
|
|
@@ -5181,14 +5268,14 @@ var TxButton = ({ theme }) => {
|
|
|
5181
5268
|
dispatch(setPendingTxPopup(true));
|
|
5182
5269
|
};
|
|
5183
5270
|
const txCount = useSelector30(selectPendingTxs);
|
|
5184
|
-
return /* @__PURE__ */
|
|
5271
|
+
return /* @__PURE__ */ React70.createElement(
|
|
5185
5272
|
"button",
|
|
5186
5273
|
{
|
|
5187
5274
|
className: `secondary-button tx-button ${theme.colorMode}`,
|
|
5188
5275
|
onClick: handleClick
|
|
5189
5276
|
},
|
|
5190
5277
|
txCount,
|
|
5191
|
-
/* @__PURE__ */
|
|
5278
|
+
/* @__PURE__ */ React70.createElement(
|
|
5192
5279
|
ring_default,
|
|
5193
5280
|
{
|
|
5194
5281
|
height: 16,
|
|
@@ -5315,17 +5402,17 @@ var useGetTxData = (txId, dAppOption, backendUrl) => {
|
|
|
5315
5402
|
var useGetTxData_default = useGetTxData;
|
|
5316
5403
|
|
|
5317
5404
|
// src/components/reusable/TransactionStatusMessage.tsx
|
|
5318
|
-
import
|
|
5405
|
+
import React71 from "react";
|
|
5319
5406
|
var TransactionStatusMessage = ({
|
|
5320
5407
|
isCompleted,
|
|
5321
5408
|
transactionId
|
|
5322
5409
|
}) => {
|
|
5323
|
-
return /* @__PURE__ */
|
|
5410
|
+
return /* @__PURE__ */ React71.createElement("div", { className: "transaction-status-message" }, /* @__PURE__ */ React71.createElement("h2", null, isCompleted !== "Completed" /* COMPLETED */ && "Your transaction is currently being processed.", " ", "Please copy the Transaction ID below for future reference. You can use this ID to track the transaction status or resolve any issues if needed."), /* @__PURE__ */ React71.createElement("span", { className: "transaction-copy" }, /* @__PURE__ */ React71.createElement("h3", null, transactionId), /* @__PURE__ */ React71.createElement(CopyButton_default, { text: transactionId })));
|
|
5324
5411
|
};
|
|
5325
5412
|
var TransactionStatusMessage_default = TransactionStatusMessage;
|
|
5326
5413
|
|
|
5327
5414
|
// src/components/reusable/TransactionSearch.tsx
|
|
5328
|
-
import
|
|
5415
|
+
import React72, { useRef as useRef3, useState as useState10 } from "react";
|
|
5329
5416
|
import { useSelector as useSelector31 } from "react-redux";
|
|
5330
5417
|
import { useDispatch as useDispatch14 } from "react-redux";
|
|
5331
5418
|
import toast2 from "react-hot-toast";
|
|
@@ -5338,7 +5425,7 @@ var TransactionSearch = () => {
|
|
|
5338
5425
|
const handleSearch = async () => {
|
|
5339
5426
|
if (transactionId.length <= 0)
|
|
5340
5427
|
return toast2.error("You must provide a valid transaction id", {
|
|
5341
|
-
icon: /* @__PURE__ */
|
|
5428
|
+
icon: /* @__PURE__ */ React72.createElement(Error_default, null)
|
|
5342
5429
|
});
|
|
5343
5430
|
try {
|
|
5344
5431
|
const data = await getTxData({
|
|
@@ -5355,11 +5442,11 @@ var TransactionSearch = () => {
|
|
|
5355
5442
|
logger_default.error("Error searching transaction: ", error);
|
|
5356
5443
|
return toast2.error(
|
|
5357
5444
|
"Transaction not found. Please check for the proper transaction id.",
|
|
5358
|
-
{ icon: /* @__PURE__ */
|
|
5445
|
+
{ icon: /* @__PURE__ */ React72.createElement(Error_default, null) }
|
|
5359
5446
|
);
|
|
5360
5447
|
}
|
|
5361
5448
|
};
|
|
5362
|
-
return /* @__PURE__ */
|
|
5449
|
+
return /* @__PURE__ */ React72.createElement("div", { className: "form-item transaction-search" }, /* @__PURE__ */ React72.createElement("div", { className: "transaction-input" }, /* @__PURE__ */ React72.createElement("span", { className: "label" }, "Search Transaction:"), /* @__PURE__ */ React72.createElement(
|
|
5363
5450
|
"input",
|
|
5364
5451
|
{
|
|
5365
5452
|
className: `${theme.colorMode}`,
|
|
@@ -5369,7 +5456,7 @@ var TransactionSearch = () => {
|
|
|
5369
5456
|
onChange: (e) => setTransactionId(e.target.value),
|
|
5370
5457
|
spellCheck: false
|
|
5371
5458
|
}
|
|
5372
|
-
)), /* @__PURE__ */
|
|
5459
|
+
)), /* @__PURE__ */ React72.createElement(SecondaryButton_default, { clickHandler: handleSearch }, "Search"));
|
|
5373
5460
|
};
|
|
5374
5461
|
var TransactionSearch_default = TransactionSearch;
|
|
5375
5462
|
|
|
@@ -5429,7 +5516,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5429
5516
|
toast3.error(
|
|
5430
5517
|
"The provided transaction id is not valid, please use a different one or contact support for further assistance",
|
|
5431
5518
|
{
|
|
5432
|
-
icon: /* @__PURE__ */
|
|
5519
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5433
5520
|
}
|
|
5434
5521
|
);
|
|
5435
5522
|
}, [error]);
|
|
@@ -5453,7 +5540,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5453
5540
|
setErrorStep(1);
|
|
5454
5541
|
setLoadingStep(-1);
|
|
5455
5542
|
logger_default.error("transaction failed:", data.failReason);
|
|
5456
|
-
toast3.error("Unavailable", { icon: /* @__PURE__ */
|
|
5543
|
+
toast3.error("Unavailable", { icon: /* @__PURE__ */ React73.createElement(Error_default, null) });
|
|
5457
5544
|
setErrorMessage("Unavailable");
|
|
5458
5545
|
} else if (status === "Paid" /* PAID */) {
|
|
5459
5546
|
setStep(3);
|
|
@@ -5464,7 +5551,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5464
5551
|
toast3.error(
|
|
5465
5552
|
"Failed to release tokens to target! Starting refund process.",
|
|
5466
5553
|
{
|
|
5467
|
-
icon: /* @__PURE__ */
|
|
5554
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5468
5555
|
}
|
|
5469
5556
|
);
|
|
5470
5557
|
setErrorMessage(
|
|
@@ -5475,7 +5562,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5475
5562
|
setErrorStep(3);
|
|
5476
5563
|
setLoadingStep(-1);
|
|
5477
5564
|
toast3.error("Failed to refund tokens to source!", {
|
|
5478
|
-
icon: /* @__PURE__ */
|
|
5565
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5479
5566
|
});
|
|
5480
5567
|
setErrorMessage("Failed to refund tokens to source!");
|
|
5481
5568
|
} else if (status === "RefundCompleted" /* REFUNDCOMPLETED */) {
|
|
@@ -5483,7 +5570,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5483
5570
|
setErrorStep(3);
|
|
5484
5571
|
setLoadingStep(-1);
|
|
5485
5572
|
toast3.success("Refund completed!", {
|
|
5486
|
-
icon: /* @__PURE__ */
|
|
5573
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5487
5574
|
});
|
|
5488
5575
|
setErrorMessage("Refund completed!");
|
|
5489
5576
|
} else if (status === "FailedToPay" /* FAILEDTOPAY */) {
|
|
@@ -5492,7 +5579,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5492
5579
|
setLoadingStep(-1);
|
|
5493
5580
|
logger_default.error("transaction failed:", data.failReason);
|
|
5494
5581
|
toast3.error("Failed to release tokens to target!", {
|
|
5495
|
-
icon: /* @__PURE__ */
|
|
5582
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5496
5583
|
});
|
|
5497
5584
|
setErrorMessage("Failed to release tokens to target!");
|
|
5498
5585
|
} else if (status === "FailedToPull" /* FAILEDTOPULL */) {
|
|
@@ -5500,7 +5587,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5500
5587
|
setErrorStep(1);
|
|
5501
5588
|
setLoadingStep(-1);
|
|
5502
5589
|
logger_default.error("transaction failed:", data.failReason);
|
|
5503
|
-
toast3.error("Failed to pull tokens from source!", { icon: /* @__PURE__ */
|
|
5590
|
+
toast3.error("Failed to pull tokens from source!", { icon: /* @__PURE__ */ React73.createElement(Error_default, null) });
|
|
5504
5591
|
setErrorMessage("Failed to pull tokens from source!");
|
|
5505
5592
|
} else if (status === "Completed" /* COMPLETED */) {
|
|
5506
5593
|
setStep(4);
|
|
@@ -5561,7 +5648,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5561
5648
|
dispatch(setTxId(-1));
|
|
5562
5649
|
dispatch(setSubmitted(false));
|
|
5563
5650
|
};
|
|
5564
|
-
return /* @__PURE__ */
|
|
5651
|
+
return /* @__PURE__ */ React73.createElement(Provider2, { store }, /* @__PURE__ */ React73.createElement(
|
|
5565
5652
|
"div",
|
|
5566
5653
|
{
|
|
5567
5654
|
className: `kima-card transaction-card ${theme.colorMode} ${minimized ? "minimized" : ""}`,
|
|
@@ -5569,17 +5656,17 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5569
5656
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
5570
5657
|
}
|
|
5571
5658
|
},
|
|
5572
|
-
/* @__PURE__ */
|
|
5659
|
+
/* @__PURE__ */ React73.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React73.createElement("div", { className: "topbar" }, /* @__PURE__ */ React73.createElement("div", { className: "title" }, isValidTxId && !error ? /* @__PURE__ */ React73.createElement("div", { className: "transaction-title" }, mode !== "status" /* status */ ? data?.status === "Completed" /* COMPLETED */ ? "Transferred " : "Transfering " : isEmptyStatus ? "Fetching transaction status " : data?.status === "Completed" /* COMPLETED */ ? "Transfered " : "Transfering ", mode !== "status" /* status */ ? Number(amount) !== 0 ? transactionSourceChain?.shortName === "CC" ? bigIntToNumber(txValues.allowanceAmount).toFixed(2) : formatBigInt(txValues.allowanceAmount) : "" : data?.amount || "", " ", mode !== "status" /* status */ ? `${sourceSymbol} ` : isEmptyStatus ? "" : `(${data?.sourceSymbol})`, /* @__PURE__ */ React73.createElement("div", { className: "title-icon" }, /* @__PURE__ */ React73.createElement(
|
|
5573
5660
|
ChainIcon,
|
|
5574
5661
|
{
|
|
5575
5662
|
symbol: transactionSourceChain?.shortName
|
|
5576
5663
|
}
|
|
5577
|
-
)), " ", mode !== "status" /* status */ ? `${transactionSourceChain?.name}` : isEmptyStatus ? "" : `${data?.sourceChain === "FIAT" ? "CC" : data?.sourceChain}`, " ", mode !== "status" /* status */ ? `\u2192 ` : isEmptyStatus ? "" : `\u2192 `, mode !== "status" /* status */ ? Number(amount) !== 0 ? transactionSourceChain?.shortName === "CC" ? bigIntToNumber(txValues.submitAmount).toFixed(2) : formatBigInt(txValues.submitAmount) : "" : data?.amount || "", " ", mode !== "status" /* status */ ? `${targetSymbol}${" "}` : isEmptyStatus ? "" : `${data?.targetSymbol}${" "}`, /* @__PURE__ */
|
|
5664
|
+
)), " ", mode !== "status" /* status */ ? `${transactionSourceChain?.name}` : isEmptyStatus ? "" : `${data?.sourceChain === "FIAT" ? "CC" : data?.sourceChain}`, " ", mode !== "status" /* status */ ? `\u2192 ` : isEmptyStatus ? "" : `\u2192 `, mode !== "status" /* status */ ? Number(amount) !== 0 ? transactionSourceChain?.shortName === "CC" ? bigIntToNumber(txValues.submitAmount).toFixed(2) : formatBigInt(txValues.submitAmount) : "" : data?.amount || "", " ", mode !== "status" /* status */ ? `${targetSymbol}${" "}` : isEmptyStatus ? "" : `${data?.targetSymbol}${" "}`, /* @__PURE__ */ React73.createElement("div", { className: "title-icon" }, /* @__PURE__ */ React73.createElement(
|
|
5578
5665
|
ChainIcon,
|
|
5579
5666
|
{
|
|
5580
5667
|
symbol: transactionTargetChain?.shortName
|
|
5581
5668
|
}
|
|
5582
|
-
)), " ", mode !== "status" /* status */ ? `${transactionTargetChain?.name}${" "}` : isEmptyStatus ? "" : `${data?.targetChain} ${" "}`) : /* @__PURE__ */
|
|
5669
|
+
)), " ", mode !== "status" /* status */ ? `${transactionTargetChain?.name}${" "}` : isEmptyStatus ? "" : `${data?.targetChain} ${" "}`) : /* @__PURE__ */ React73.createElement("div", null, /* @__PURE__ */ React73.createElement("h3", { className: "transaction" }, "Transaction Status"))), !minimized ? /* @__PURE__ */ React73.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React73.createElement(
|
|
5583
5670
|
"button",
|
|
5584
5671
|
{
|
|
5585
5672
|
className: "icon-button minimize",
|
|
@@ -5587,9 +5674,9 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5587
5674
|
setMinimized(true);
|
|
5588
5675
|
}
|
|
5589
5676
|
},
|
|
5590
|
-
/* @__PURE__ */
|
|
5591
|
-
), !isValidTxId || loadingStep < 0 || error ? /* @__PURE__ */
|
|
5592
|
-
isValidTxId && !error ? /* @__PURE__ */
|
|
5677
|
+
/* @__PURE__ */ React73.createElement(Minimize_default, null)
|
|
5678
|
+
), !isValidTxId || loadingStep < 0 || error ? /* @__PURE__ */ React73.createElement("button", { className: "reset-button", onClick: resetForm }, "Reset") : null) : /* @__PURE__ */ React73.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React73.createElement("div", { className: "maximize", onClick: () => setMinimized(false) }, "View")))),
|
|
5679
|
+
isValidTxId && !error ? /* @__PURE__ */ React73.createElement("div", { className: "kima-card-content" }, /* @__PURE__ */ React73.createElement("div", { className: "transaction-content" }, /* @__PURE__ */ React73.createElement(
|
|
5593
5680
|
Progressbar_default,
|
|
5594
5681
|
{
|
|
5595
5682
|
step,
|
|
@@ -5598,7 +5685,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5598
5685
|
setFocus,
|
|
5599
5686
|
loadingStep
|
|
5600
5687
|
}
|
|
5601
|
-
), /* @__PURE__ */
|
|
5688
|
+
), /* @__PURE__ */ React73.createElement(
|
|
5602
5689
|
StepBox_default,
|
|
5603
5690
|
{
|
|
5604
5691
|
step,
|
|
@@ -5606,14 +5693,14 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5606
5693
|
loadingStep,
|
|
5607
5694
|
data
|
|
5608
5695
|
}
|
|
5609
|
-
)), !error && !isEmptyStatus && /* @__PURE__ */
|
|
5696
|
+
)), !error && !isEmptyStatus && /* @__PURE__ */ React73.createElement(
|
|
5610
5697
|
TransactionStatusMessage_default,
|
|
5611
5698
|
{
|
|
5612
5699
|
isCompleted: data?.status,
|
|
5613
5700
|
transactionId: txId.toString()
|
|
5614
5701
|
}
|
|
5615
|
-
)) : /* @__PURE__ */
|
|
5616
|
-
/* @__PURE__ */
|
|
5702
|
+
)) : /* @__PURE__ */ React73.createElement("div", { className: "kima-card-content" }, /* @__PURE__ */ React73.createElement("h4", { className: "subtitle" }, "You can follow the status of a previous submitted transaction by entering the provided transaction id"), /* @__PURE__ */ React73.createElement("div", { className: "single-form" }, /* @__PURE__ */ React73.createElement(TransactionSearch_default, null))),
|
|
5703
|
+
/* @__PURE__ */ React73.createElement(
|
|
5617
5704
|
Toaster,
|
|
5618
5705
|
{
|
|
5619
5706
|
position: "top-right",
|
|
@@ -5640,21 +5727,21 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5640
5727
|
}
|
|
5641
5728
|
}
|
|
5642
5729
|
),
|
|
5643
|
-
/* @__PURE__ */
|
|
5730
|
+
/* @__PURE__ */ React73.createElement("div", { className: "floating-footer status" }, /* @__PURE__ */ React73.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React73.createElement("span", null, "Powered by"), /* @__PURE__ */ React73.createElement(KimaNetwork_default, null)))
|
|
5644
5731
|
));
|
|
5645
5732
|
};
|
|
5646
5733
|
|
|
5647
5734
|
// src/components/TransferWidget.tsx
|
|
5648
|
-
import
|
|
5735
|
+
import React84, { useEffect as useEffect21, useState as useState16, useRef as useRef8, useMemo as useMemo21, useCallback as useCallback3 } from "react";
|
|
5649
5736
|
import { useDispatch as useDispatch26, useSelector as useSelector45 } from "react-redux";
|
|
5650
5737
|
|
|
5651
5738
|
// src/components/reusable/SingleForm.tsx
|
|
5652
|
-
import
|
|
5739
|
+
import React75, { useEffect as useEffect17, useMemo as useMemo14, useState as useState13 } from "react";
|
|
5653
5740
|
import { toast as toast4 } from "react-hot-toast";
|
|
5654
5741
|
import { useDispatch as useDispatch17, useSelector as useSelector35 } from "react-redux";
|
|
5655
5742
|
|
|
5656
5743
|
// src/components/primary/NetworkSelector.tsx
|
|
5657
|
-
import
|
|
5744
|
+
import React74, { useState as useState12, useMemo as useMemo13, useRef as useRef4, useEffect as useEffect16 } from "react";
|
|
5658
5745
|
import { useSelector as useSelector33, useDispatch as useDispatch16 } from "react-redux";
|
|
5659
5746
|
var NetworkSelector = ({
|
|
5660
5747
|
type,
|
|
@@ -5668,6 +5755,7 @@ var NetworkSelector = ({
|
|
|
5668
5755
|
const networkOptions3 = useSelector33(selectNetworks);
|
|
5669
5756
|
const mode = useSelector33(selectMode);
|
|
5670
5757
|
const sourceNetwork = useSelector33(selectSourceChain);
|
|
5758
|
+
const sourceSymbol = useSelector33(selectSourceCurrency);
|
|
5671
5759
|
const targetNetwork = useSelector33(selectTargetChain);
|
|
5672
5760
|
const { switchChainHandler } = useKimaContext();
|
|
5673
5761
|
const isOriginSelector = type === "origin";
|
|
@@ -5675,9 +5763,18 @@ var NetworkSelector = ({
|
|
|
5675
5763
|
return networkOptions3.filter((network) => {
|
|
5676
5764
|
const isSameAsSource = isOriginSelector ? false : network.shortName === sourceNetwork.shortName;
|
|
5677
5765
|
const isAllowedInLightMode = mode !== "light" /* light */ || lightDemoNetworks.includes(network.shortName);
|
|
5678
|
-
|
|
5766
|
+
const sourceToken = sourceNetwork.supportedTokens.find(
|
|
5767
|
+
(t) => t.symbol === sourceSymbol
|
|
5768
|
+
);
|
|
5769
|
+
let supportsSourceCurrency = true;
|
|
5770
|
+
if (!isOriginSelector && !!sourceToken) {
|
|
5771
|
+
supportsSourceCurrency = network.supportedTokens.some(
|
|
5772
|
+
(token) => token.peggedTo === sourceToken?.peggedTo
|
|
5773
|
+
);
|
|
5774
|
+
}
|
|
5775
|
+
return network.supportedLocations.includes(type) && !isSameAsSource && supportsSourceCurrency && isAllowedInLightMode;
|
|
5679
5776
|
});
|
|
5680
|
-
}, [networkOptions3, sourceNetwork, type, mode]);
|
|
5777
|
+
}, [networkOptions3, sourceNetwork, sourceSymbol, type, mode]);
|
|
5681
5778
|
const selectedNetwork = useMemo13(() => {
|
|
5682
5779
|
if (initialSelection) {
|
|
5683
5780
|
return {
|
|
@@ -5750,20 +5847,20 @@ var NetworkSelector = ({
|
|
|
5750
5847
|
dispatch(setTargetAddress(lightDemoAccounts.TRX));
|
|
5751
5848
|
}
|
|
5752
5849
|
}, [sourceNetwork, targetNetwork, mode]);
|
|
5753
|
-
return /* @__PURE__ */
|
|
5850
|
+
return /* @__PURE__ */ React74.createElement(
|
|
5754
5851
|
"div",
|
|
5755
5852
|
{
|
|
5756
5853
|
className: `network-dropdown ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"}`,
|
|
5757
5854
|
onClick: () => setCollapsed((prev) => !prev),
|
|
5758
5855
|
ref
|
|
5759
5856
|
},
|
|
5760
|
-
/* @__PURE__ */
|
|
5761
|
-
/* @__PURE__ */
|
|
5857
|
+
/* @__PURE__ */ React74.createElement("div", { className: "network-wrapper" }, /* @__PURE__ */ React74.createElement(ChainIcon, { symbol: selectedNetwork.shortName }), /* @__PURE__ */ React74.createElement("span", null, selectedNetwork.name)),
|
|
5858
|
+
/* @__PURE__ */ React74.createElement(
|
|
5762
5859
|
"div",
|
|
5763
5860
|
{
|
|
5764
5861
|
className: `network-menu custom-scrollbar ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"}`
|
|
5765
5862
|
},
|
|
5766
|
-
networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */
|
|
5863
|
+
networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */ React74.createElement(
|
|
5767
5864
|
"div",
|
|
5768
5865
|
{
|
|
5769
5866
|
key: network.id,
|
|
@@ -5775,15 +5872,15 @@ var NetworkSelector = ({
|
|
|
5775
5872
|
}
|
|
5776
5873
|
}
|
|
5777
5874
|
},
|
|
5778
|
-
network.disabled ? /* @__PURE__ */
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
network.disabled && /* @__PURE__ */
|
|
5875
|
+
network.disabled ? /* @__PURE__ */ React74.createElement(Warning_default, { width: 25, height: 25 }) : /* @__PURE__ */ React74.createElement(ChainIcon, { symbol: network.shortName }),
|
|
5876
|
+
/* @__PURE__ */ React74.createElement("p", null, network.name),
|
|
5877
|
+
network.disabled && /* @__PURE__ */ React74.createElement("span", { className: "tooltip" }, "Temporarily unavailable")
|
|
5781
5878
|
))
|
|
5782
5879
|
),
|
|
5783
|
-
/* @__PURE__ */
|
|
5880
|
+
/* @__PURE__ */ React74.createElement("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}` }, /* @__PURE__ */ React74.createElement(Arrow_default, { fill: "none" }))
|
|
5784
5881
|
);
|
|
5785
5882
|
};
|
|
5786
|
-
var NetworkSelector_default =
|
|
5883
|
+
var NetworkSelector_default = React74.memo(NetworkSelector);
|
|
5787
5884
|
|
|
5788
5885
|
// src/components/reusable/SingleForm.tsx
|
|
5789
5886
|
import { parseUnits as parseUnits2 } from "viem";
|
|
@@ -5951,6 +6048,12 @@ var SingleForm = ({
|
|
|
5951
6048
|
const intAmount = parseUnits2(amount, totalFee.decimals);
|
|
5952
6049
|
return balance - intAmount;
|
|
5953
6050
|
}, [balance, totalFee, feeDeduct]);
|
|
6051
|
+
const feeCurrency = useMemo14(() => {
|
|
6052
|
+
const sourceToken = sourceNetwork.supportedTokens.find(
|
|
6053
|
+
(t) => t.symbol === sourceCurrency
|
|
6054
|
+
);
|
|
6055
|
+
return sourceToken?.peggedTo ?? "USD";
|
|
6056
|
+
}, [sourceNetwork, sourceCurrency]);
|
|
5954
6057
|
useEffect17(() => {
|
|
5955
6058
|
if (!errorMessage) return;
|
|
5956
6059
|
toast4.error(errorMessage);
|
|
@@ -5986,7 +6089,7 @@ var SingleForm = ({
|
|
|
5986
6089
|
const isConnected = useMemo14(() => {
|
|
5987
6090
|
return isReady && !initialSelection.sourceSelection;
|
|
5988
6091
|
}, [isReady, initialSelection]);
|
|
5989
|
-
return /* @__PURE__ */
|
|
6092
|
+
return /* @__PURE__ */ React75.createElement("div", { className: "single-form" }, /* @__PURE__ */ React75.createElement("div", { className: "form-item" }, /* @__PURE__ */ React75.createElement("span", { className: "label" }, "Source Network:"), /* @__PURE__ */ React75.createElement("div", { className: "items" }, /* @__PURE__ */ React75.createElement(
|
|
5990
6093
|
NetworkSelector_default,
|
|
5991
6094
|
{
|
|
5992
6095
|
type: "origin",
|
|
@@ -5995,20 +6098,20 @@ var SingleForm = ({
|
|
|
5995
6098
|
setInitialSelection
|
|
5996
6099
|
}
|
|
5997
6100
|
}
|
|
5998
|
-
), /* @__PURE__ */
|
|
6101
|
+
), /* @__PURE__ */ React75.createElement(CoinDropdown_default, null))), /* @__PURE__ */ React75.createElement(
|
|
5999
6102
|
"div",
|
|
6000
6103
|
{
|
|
6001
6104
|
className: `dynamic-area ${sourceNetwork.shortName === "FIAT" /* FIAT */ ? "reverse" : "1"}`
|
|
6002
6105
|
},
|
|
6003
|
-
sourceNetwork.compatibility !== "CC" /* CC */ && /* @__PURE__ */
|
|
6106
|
+
sourceNetwork.compatibility !== "CC" /* CC */ && /* @__PURE__ */ React75.createElement(
|
|
6004
6107
|
"div",
|
|
6005
6108
|
{
|
|
6006
6109
|
className: `form-item wallet-button-item ${isConnected && "connected"}`
|
|
6007
6110
|
},
|
|
6008
|
-
/* @__PURE__ */
|
|
6009
|
-
/* @__PURE__ */
|
|
6111
|
+
/* @__PURE__ */ React75.createElement("span", { className: "label" }, "Wallet:"),
|
|
6112
|
+
/* @__PURE__ */ React75.createElement(WalletButton_default, { initialSelection: initialSelection.sourceSelection })
|
|
6010
6113
|
),
|
|
6011
|
-
mode !== "payment" /* payment */ && /* @__PURE__ */
|
|
6114
|
+
mode !== "payment" /* payment */ && /* @__PURE__ */ React75.createElement("div", { className: "form-item" }, /* @__PURE__ */ React75.createElement("span", { className: "label" }, "Target Network:"), /* @__PURE__ */ React75.createElement("div", { className: "items" }, /* @__PURE__ */ React75.createElement(
|
|
6012
6115
|
NetworkSelector_default,
|
|
6013
6116
|
{
|
|
6014
6117
|
type: "target",
|
|
@@ -6017,29 +6120,29 @@ var SingleForm = ({
|
|
|
6017
6120
|
setInitialSelection
|
|
6018
6121
|
}
|
|
6019
6122
|
}
|
|
6020
|
-
), /* @__PURE__ */
|
|
6021
|
-
), mode === "bridge" /* bridge */ && sourceNetwork.shortName !== "FIAT" /* FIAT */ ? targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */
|
|
6123
|
+
), /* @__PURE__ */ React75.createElement(CoinDropdown_default, { isSourceChain: false })))
|
|
6124
|
+
), mode === "bridge" /* bridge */ && sourceNetwork.shortName !== "FIAT" /* FIAT */ ? targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */ React75.createElement(BankInput_default, null) : /* @__PURE__ */ React75.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React75.createElement("span", { className: "label" }, "Target Address:"), /* @__PURE__ */ React75.createElement(
|
|
6022
6125
|
AddressInput_default,
|
|
6023
6126
|
{
|
|
6024
6127
|
theme: theme.colorMode,
|
|
6025
6128
|
placeholder: "Target address",
|
|
6026
6129
|
initialSelection
|
|
6027
6130
|
}
|
|
6028
|
-
)) : null, mode === "light" /* light */ && /* @__PURE__ */
|
|
6131
|
+
)) : null, mode === "light" /* light */ && /* @__PURE__ */ React75.createElement(
|
|
6029
6132
|
"div",
|
|
6030
6133
|
{
|
|
6031
6134
|
className: `form-item wallet-button-item ${!initialSelection.targetSelection && "connected"}`,
|
|
6032
6135
|
style: { display: "flex", alignItems: "center" }
|
|
6033
6136
|
},
|
|
6034
|
-
/* @__PURE__ */
|
|
6035
|
-
/* @__PURE__ */
|
|
6137
|
+
/* @__PURE__ */ React75.createElement("span", { className: "label" }, "Target Wallet:"),
|
|
6138
|
+
/* @__PURE__ */ React75.createElement(
|
|
6036
6139
|
WalletButton_default,
|
|
6037
6140
|
{
|
|
6038
6141
|
initialSelection: initialSelection.targetSelection,
|
|
6039
6142
|
placeholder: true
|
|
6040
6143
|
}
|
|
6041
6144
|
)
|
|
6042
|
-
), mode === "bridge" /* bridge */ && /* @__PURE__ */
|
|
6145
|
+
), mode === "bridge" /* bridge */ && /* @__PURE__ */ React75.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React75.createElement("span", { className: "label" }, "Amount:"), /* @__PURE__ */ React75.createElement("div", { className: `amount-label-container items ${theme.colorMode}` }, /* @__PURE__ */ React75.createElement(
|
|
6043
6146
|
"input",
|
|
6044
6147
|
{
|
|
6045
6148
|
className: `${theme.colorMode}`,
|
|
@@ -6048,7 +6151,7 @@ var SingleForm = ({
|
|
|
6048
6151
|
value: amountValue || "",
|
|
6049
6152
|
onChange: (e) => onAmountChange(e.target.value)
|
|
6050
6153
|
}
|
|
6051
|
-
), /* @__PURE__ */
|
|
6154
|
+
), /* @__PURE__ */ React75.createElement("div", { className: "max-disclaimer" }, sourceNetwork.shortName !== "CC" && /* @__PURE__ */ React75.createElement("span", { className: "max-button", onClick: onMaxClick }, "Max"), +totalFee !== -1 && /* @__PURE__ */ React75.createElement("p", { className: "fee-amount" }, "Est fees:", " ", /* @__PURE__ */ React75.createElement("span", { className: `${isLoadingFees ? "loading" : ""}` }, " ", isLoadingFees ? "" : `$ ${formatBigInt(totalFee)} ${feeCurrency}`))))));
|
|
6052
6155
|
};
|
|
6053
6156
|
var SingleForm_default = SingleForm;
|
|
6054
6157
|
|
|
@@ -6097,11 +6200,11 @@ function useAllowance2({
|
|
|
6097
6200
|
import { toast as toast5, Toaster as Toaster2 } from "react-hot-toast";
|
|
6098
6201
|
|
|
6099
6202
|
// plugins/solana/components/SolanaWalletConnectModal.tsx
|
|
6100
|
-
import
|
|
6203
|
+
import React78 from "react";
|
|
6101
6204
|
import { useDispatch as useDispatch20, useSelector as useSelector38 } from "react-redux";
|
|
6102
6205
|
|
|
6103
6206
|
// plugins/solana/components/SolanaWalletSelect.tsx
|
|
6104
|
-
import
|
|
6207
|
+
import React76, { useCallback as useCallback2, useEffect as useEffect18, useMemo as useMemo15, useRef as useRef5 } from "react";
|
|
6105
6208
|
import { useDispatch as useDispatch18, useSelector as useSelector36 } from "react-redux";
|
|
6106
6209
|
import { useWallet as useWallet7 } from "@solana/wallet-adapter-react";
|
|
6107
6210
|
import { WalletReadyState } from "@solana/wallet-adapter-base";
|
|
@@ -6175,28 +6278,28 @@ var SolanaWalletSelect = () => {
|
|
|
6175
6278
|
}
|
|
6176
6279
|
dispatch(setSolanaConnectModal(false));
|
|
6177
6280
|
}, [wallet, sourceChain]);
|
|
6178
|
-
return /* @__PURE__ */
|
|
6281
|
+
return /* @__PURE__ */ React76.createElement("div", { className: `wallet-select` }, /* @__PURE__ */ React76.createElement("div", { className: "slide-area hide-scrollbar", ref: sliderRef }, /* @__PURE__ */ React76.createElement("div", { className: "wallet-container" }, detected.map((wallet2, index) => /* @__PURE__ */ React76.createElement(
|
|
6179
6282
|
"div",
|
|
6180
6283
|
{
|
|
6181
6284
|
className: `card-item ${theme.colorMode}`,
|
|
6182
6285
|
onClick: () => handleWalletClick(wallet2.adapter.name),
|
|
6183
6286
|
key: `${wallet2.adapter.name}-${index}`
|
|
6184
6287
|
},
|
|
6185
|
-
/* @__PURE__ */
|
|
6186
|
-
)), undetected.map((wallet2, index) => /* @__PURE__ */
|
|
6288
|
+
/* @__PURE__ */ React76.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React76.createElement("img", { src: wallet2.adapter.icon, alt: wallet2.adapter.name }), /* @__PURE__ */ React76.createElement("span", null, wallet2.adapter.name))
|
|
6289
|
+
)), undetected.map((wallet2, index) => /* @__PURE__ */ React76.createElement(
|
|
6187
6290
|
ExternalLink_default,
|
|
6188
6291
|
{
|
|
6189
6292
|
to: wallet2.adapter.url,
|
|
6190
6293
|
className: `card-item ${theme.colorMode}`,
|
|
6191
6294
|
key: `${wallet2.adapter.name}-${index}`
|
|
6192
6295
|
},
|
|
6193
|
-
/* @__PURE__ */
|
|
6296
|
+
/* @__PURE__ */ React76.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React76.createElement("img", { src: wallet2.adapter.icon, alt: wallet2.adapter.name }), /* @__PURE__ */ React76.createElement("span", null, "Install ", wallet2.adapter.name))
|
|
6194
6297
|
)))));
|
|
6195
6298
|
};
|
|
6196
6299
|
var SolanaWalletSelect_default = SolanaWalletSelect;
|
|
6197
6300
|
|
|
6198
6301
|
// plugins/solana/components/AccountDetailsModal.tsx
|
|
6199
|
-
import
|
|
6302
|
+
import React77, { useMemo as useMemo16 } from "react";
|
|
6200
6303
|
import { useDispatch as useDispatch19, useSelector as useSelector37 } from "react-redux";
|
|
6201
6304
|
import { useWallet as useSolanaWallet3 } from "@solana/wallet-adapter-react";
|
|
6202
6305
|
var AccountDetailsModal = () => {
|
|
@@ -6217,25 +6320,25 @@ var AccountDetailsModal = () => {
|
|
|
6217
6320
|
dispatch(setAccountDetailsModal(false));
|
|
6218
6321
|
};
|
|
6219
6322
|
if (sourceChain.shortName !== "SOL") return;
|
|
6220
|
-
return /* @__PURE__ */
|
|
6323
|
+
return /* @__PURE__ */ React77.createElement(
|
|
6221
6324
|
"div",
|
|
6222
6325
|
{
|
|
6223
6326
|
className: `kima-modal ${theme.colorMode} ${accountDetailsModal && "open"}`
|
|
6224
6327
|
},
|
|
6225
|
-
/* @__PURE__ */
|
|
6226
|
-
/* @__PURE__ */
|
|
6328
|
+
/* @__PURE__ */ React77.createElement("div", { className: "modal-overlay" }),
|
|
6329
|
+
/* @__PURE__ */ React77.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React77.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React77.createElement("div", { className: "topbar" }, /* @__PURE__ */ React77.createElement("div", { className: "title" }, /* @__PURE__ */ React77.createElement("h3", null, "Account Details")), /* @__PURE__ */ React77.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React77.createElement(
|
|
6227
6330
|
"button",
|
|
6228
6331
|
{
|
|
6229
6332
|
className: "cross-icon-button",
|
|
6230
6333
|
onClick: () => dispatch(setAccountDetailsModal(false))
|
|
6231
6334
|
},
|
|
6232
|
-
/* @__PURE__ */
|
|
6335
|
+
/* @__PURE__ */ React77.createElement(
|
|
6233
6336
|
Cross_default,
|
|
6234
6337
|
{
|
|
6235
6338
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6236
6339
|
}
|
|
6237
6340
|
)
|
|
6238
|
-
)))), /* @__PURE__ */
|
|
6341
|
+
)))), /* @__PURE__ */ React77.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React77.createElement("div", { className: "summary" }, networkDetails && /* @__PURE__ */ React77.createElement(networkDetails.icon, { width: 60, height: 60 }), /* @__PURE__ */ React77.createElement("div", { className: "address" }, /* @__PURE__ */ React77.createElement("h2", null, getShortenedAddress(walletAddress || "")), /* @__PURE__ */ React77.createElement(CopyButton_default, { text: walletAddress })), /* @__PURE__ */ React77.createElement("h3", null, formatterFloat.format(Number(solBalance)), " $SOL")), /* @__PURE__ */ React77.createElement(SecondaryButton_default, { className: "block-explorer" }, /* @__PURE__ */ React77.createElement(ExternalLink_default, { className: "link", to: explorerUrl }, /* @__PURE__ */ React77.createElement(Explorer_default, { fill: "#778DA3" }), /* @__PURE__ */ React77.createElement("p", null, "Block explorer"), /* @__PURE__ */ React77.createElement(ExternalUrl_default, { fill: "#778DA3" }))), /* @__PURE__ */ React77.createElement(PrimaryButton_default, { clickHandler: handleDisconnect }, "Discconect")))
|
|
6239
6342
|
);
|
|
6240
6343
|
};
|
|
6241
6344
|
var AccountDetailsModal_default = AccountDetailsModal;
|
|
@@ -6245,18 +6348,18 @@ var SolanaWalletConnectModal = () => {
|
|
|
6245
6348
|
const dispatch = useDispatch20();
|
|
6246
6349
|
const theme = useSelector38(selectTheme);
|
|
6247
6350
|
const connectModal = useSelector38(selectSolanaConnectModal);
|
|
6248
|
-
return /* @__PURE__ */
|
|
6351
|
+
return /* @__PURE__ */ React78.createElement("div", null, /* @__PURE__ */ React78.createElement(AccountDetailsModal_default, null), /* @__PURE__ */ React78.createElement(
|
|
6249
6352
|
"div",
|
|
6250
6353
|
{
|
|
6251
6354
|
className: `kima-modal wallet-connect ${connectModal ? "open" : ""}`
|
|
6252
6355
|
},
|
|
6253
|
-
/* @__PURE__ */
|
|
6356
|
+
/* @__PURE__ */ React78.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React78.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React78.createElement("div", { className: "topbar" }, /* @__PURE__ */ React78.createElement("div", { className: "title" }, /* @__PURE__ */ React78.createElement("h3", null, "Connect Wallet")), /* @__PURE__ */ React78.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React78.createElement(
|
|
6254
6357
|
"button",
|
|
6255
6358
|
{
|
|
6256
6359
|
className: "cross-icon-button",
|
|
6257
6360
|
onClick: () => dispatch(setSolanaConnectModal(false))
|
|
6258
6361
|
},
|
|
6259
|
-
/* @__PURE__ */
|
|
6362
|
+
/* @__PURE__ */ React78.createElement(
|
|
6260
6363
|
Cross_default,
|
|
6261
6364
|
{
|
|
6262
6365
|
width: 30,
|
|
@@ -6264,17 +6367,17 @@ var SolanaWalletConnectModal = () => {
|
|
|
6264
6367
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6265
6368
|
}
|
|
6266
6369
|
)
|
|
6267
|
-
)))), /* @__PURE__ */
|
|
6370
|
+
)))), /* @__PURE__ */ React78.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React78.createElement(SolanaWalletSelect_default, null)))
|
|
6268
6371
|
));
|
|
6269
6372
|
};
|
|
6270
6373
|
var SolanaWalletConnectModal_default = SolanaWalletConnectModal;
|
|
6271
6374
|
|
|
6272
6375
|
// plugins/tron/components/TronWalletConnectModal.tsx
|
|
6273
|
-
import
|
|
6376
|
+
import React81 from "react";
|
|
6274
6377
|
import { useDispatch as useDispatch23, useSelector as useSelector41 } from "react-redux";
|
|
6275
6378
|
|
|
6276
6379
|
// plugins/tron/components/AccountDetailsModal.tsx
|
|
6277
|
-
import
|
|
6380
|
+
import React79, { useMemo as useMemo17 } from "react";
|
|
6278
6381
|
import { useDispatch as useDispatch21, useSelector as useSelector39 } from "react-redux";
|
|
6279
6382
|
import { useWallet as useTronWallet3 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
6280
6383
|
var AccountDetailsModal2 = () => {
|
|
@@ -6299,31 +6402,31 @@ var AccountDetailsModal2 = () => {
|
|
|
6299
6402
|
dispatch(setAccountDetailsModal(false));
|
|
6300
6403
|
};
|
|
6301
6404
|
if (sourcheChain.shortName !== "TRX") return;
|
|
6302
|
-
return /* @__PURE__ */
|
|
6405
|
+
return /* @__PURE__ */ React79.createElement(
|
|
6303
6406
|
"div",
|
|
6304
6407
|
{
|
|
6305
6408
|
className: `kima-modal ${theme.colorMode} ${accountDetailsModal && "open"}`
|
|
6306
6409
|
},
|
|
6307
|
-
/* @__PURE__ */
|
|
6308
|
-
/* @__PURE__ */
|
|
6410
|
+
/* @__PURE__ */ React79.createElement("div", { className: "modal-overlay" }),
|
|
6411
|
+
/* @__PURE__ */ React79.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React79.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React79.createElement("div", { className: "topbar" }, /* @__PURE__ */ React79.createElement("div", { className: "title" }, /* @__PURE__ */ React79.createElement("h3", null, "Account Details")), /* @__PURE__ */ React79.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React79.createElement(
|
|
6309
6412
|
"button",
|
|
6310
6413
|
{
|
|
6311
6414
|
className: "cross-icon-button",
|
|
6312
6415
|
onClick: () => dispatch(setAccountDetailsModal(false))
|
|
6313
6416
|
},
|
|
6314
|
-
/* @__PURE__ */
|
|
6417
|
+
/* @__PURE__ */ React79.createElement(
|
|
6315
6418
|
Cross_default,
|
|
6316
6419
|
{
|
|
6317
6420
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6318
6421
|
}
|
|
6319
6422
|
)
|
|
6320
|
-
)))), /* @__PURE__ */
|
|
6423
|
+
)))), /* @__PURE__ */ React79.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React79.createElement("div", { className: "summary" }, networkDetails && /* @__PURE__ */ React79.createElement(networkDetails.icon, { width: 60, height: 60 }), /* @__PURE__ */ React79.createElement("div", { className: "address" }, /* @__PURE__ */ React79.createElement("h2", null, getShortenedAddress(connectedAddress || "")), /* @__PURE__ */ React79.createElement(CopyButton_default, { text: connectedAddress })), /* @__PURE__ */ React79.createElement("h3", null, formatterFloat.format(Number(tronBalance)), " ", selectedNetwork.shortName)), /* @__PURE__ */ React79.createElement(SecondaryButton_default, { className: "block-explorer" }, /* @__PURE__ */ React79.createElement(ExternalLink_default, { className: "link", to: explorerUrl }, /* @__PURE__ */ React79.createElement(Explorer_default, { fill: "#778DA3" }), /* @__PURE__ */ React79.createElement("p", null, "Block explorer"), /* @__PURE__ */ React79.createElement(ExternalUrl_default, { fill: "#778DA3" }))), /* @__PURE__ */ React79.createElement(PrimaryButton_default, { clickHandler: handleDisconnect }, "Disconnect")))
|
|
6321
6424
|
);
|
|
6322
6425
|
};
|
|
6323
6426
|
var AccountDetailsModal_default2 = AccountDetailsModal2;
|
|
6324
6427
|
|
|
6325
6428
|
// plugins/tron/components/TronWalletSelect.tsx
|
|
6326
|
-
import
|
|
6429
|
+
import React80, { useEffect as useEffect19, useMemo as useMemo18, useRef as useRef6 } from "react";
|
|
6327
6430
|
import { useDispatch as useDispatch22, useSelector as useSelector40 } from "react-redux";
|
|
6328
6431
|
import { useWallet as useWallet8 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
6329
6432
|
import { AdapterState } from "@tronweb3/tronwallet-abstract-adapter";
|
|
@@ -6382,22 +6485,22 @@ var TronWalletSelect = () => {
|
|
|
6382
6485
|
const connectWallet = async (walletName) => {
|
|
6383
6486
|
currentWallet?.adapter.name === walletName ? await connect() : select(walletName);
|
|
6384
6487
|
};
|
|
6385
|
-
return /* @__PURE__ */
|
|
6488
|
+
return /* @__PURE__ */ React80.createElement("div", { className: `wallet-select` }, /* @__PURE__ */ React80.createElement("div", { className: "slide-area hide-scrollbar", ref: sliderRef }, /* @__PURE__ */ React80.createElement("div", { className: "wallet-container" }, detected.map((wallet, index) => /* @__PURE__ */ React80.createElement(
|
|
6386
6489
|
"div",
|
|
6387
6490
|
{
|
|
6388
6491
|
className: `card-item ${theme.colorMode}`,
|
|
6389
6492
|
onClick: () => connectWallet(wallet.adapter.name),
|
|
6390
6493
|
key: `${wallet.adapter.name}-${index}`
|
|
6391
6494
|
},
|
|
6392
|
-
/* @__PURE__ */
|
|
6393
|
-
)), undetected.map((wallet, index) => /* @__PURE__ */
|
|
6495
|
+
/* @__PURE__ */ React80.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React80.createElement("img", { src: wallet.adapter.icon, alt: wallet.adapter.name }), /* @__PURE__ */ React80.createElement("span", null, wallet.adapter.name))
|
|
6496
|
+
)), undetected.map((wallet, index) => /* @__PURE__ */ React80.createElement(
|
|
6394
6497
|
ExternalLink_default,
|
|
6395
6498
|
{
|
|
6396
6499
|
to: wallet.adapter.url,
|
|
6397
6500
|
className: `card-item ${theme.colorMode}`,
|
|
6398
6501
|
key: `${wallet.adapter.name}-${index}`
|
|
6399
6502
|
},
|
|
6400
|
-
/* @__PURE__ */
|
|
6503
|
+
/* @__PURE__ */ React80.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React80.createElement("img", { src: wallet.adapter.icon, alt: wallet.adapter.name }), /* @__PURE__ */ React80.createElement("span", null, "Install ", wallet.adapter.name))
|
|
6401
6504
|
)))));
|
|
6402
6505
|
};
|
|
6403
6506
|
var TronWalletSelect_default = TronWalletSelect;
|
|
@@ -6407,25 +6510,25 @@ var TronWalletConnectModal = () => {
|
|
|
6407
6510
|
const dispatch = useDispatch23();
|
|
6408
6511
|
const theme = useSelector41(selectTheme);
|
|
6409
6512
|
const connectModal = useSelector41(selectTronConnectModal);
|
|
6410
|
-
return /* @__PURE__ */
|
|
6513
|
+
return /* @__PURE__ */ React81.createElement("div", null, /* @__PURE__ */ React81.createElement(AccountDetailsModal_default2, null), /* @__PURE__ */ React81.createElement(
|
|
6411
6514
|
"div",
|
|
6412
6515
|
{
|
|
6413
6516
|
className: `kima-modal wallet-connect ${theme.colorMode} ${connectModal ? "open" : ""}`
|
|
6414
6517
|
},
|
|
6415
|
-
/* @__PURE__ */
|
|
6416
|
-
/* @__PURE__ */
|
|
6518
|
+
/* @__PURE__ */ React81.createElement("div", { className: "modal-overlay" }),
|
|
6519
|
+
/* @__PURE__ */ React81.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React81.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React81.createElement("div", { className: "topbar" }, /* @__PURE__ */ React81.createElement("div", { className: "title" }, /* @__PURE__ */ React81.createElement("h3", null, "Connect Wallet")), /* @__PURE__ */ React81.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React81.createElement(
|
|
6417
6520
|
"button",
|
|
6418
6521
|
{
|
|
6419
6522
|
className: "icon-button",
|
|
6420
6523
|
onClick: () => dispatch(setTronConnectModal(false))
|
|
6421
6524
|
},
|
|
6422
|
-
/* @__PURE__ */
|
|
6525
|
+
/* @__PURE__ */ React81.createElement(
|
|
6423
6526
|
Cross_default,
|
|
6424
6527
|
{
|
|
6425
6528
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6426
6529
|
}
|
|
6427
6530
|
)
|
|
6428
|
-
)))), /* @__PURE__ */
|
|
6531
|
+
)))), /* @__PURE__ */ React81.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React81.createElement(TronWalletSelect_default, null)))
|
|
6429
6532
|
));
|
|
6430
6533
|
};
|
|
6431
6534
|
var TronWalletConnectModal_default = TronWalletConnectModal;
|
|
@@ -6742,7 +6845,7 @@ function useDisconnectWallet5() {
|
|
|
6742
6845
|
}
|
|
6743
6846
|
|
|
6744
6847
|
// src/components/reusable/WarningModal.tsx
|
|
6745
|
-
import
|
|
6848
|
+
import React82 from "react";
|
|
6746
6849
|
var WarningModal = ({
|
|
6747
6850
|
message,
|
|
6748
6851
|
cancelButtonText = "Cancel",
|
|
@@ -6750,14 +6853,14 @@ var WarningModal = ({
|
|
|
6750
6853
|
onAcknowledge,
|
|
6751
6854
|
onCancel
|
|
6752
6855
|
}) => {
|
|
6753
|
-
return /* @__PURE__ */
|
|
6856
|
+
return /* @__PURE__ */ React82.createElement("div", { className: "warning-modal-overlay" }, /* @__PURE__ */ React82.createElement("div", { className: "warning-modal" }, /* @__PURE__ */ React82.createElement("h3", null, "Warning"), /* @__PURE__ */ React82.createElement("p", null, message), /* @__PURE__ */ React82.createElement("div", { className: "warning-modal-buttons" }, /* @__PURE__ */ React82.createElement(
|
|
6754
6857
|
SecondaryButton_default,
|
|
6755
6858
|
{
|
|
6756
6859
|
className: "warning-modal-cancel",
|
|
6757
6860
|
clickHandler: onCancel
|
|
6758
6861
|
},
|
|
6759
6862
|
cancelButtonText
|
|
6760
|
-
), /* @__PURE__ */
|
|
6863
|
+
), /* @__PURE__ */ React82.createElement(
|
|
6761
6864
|
PrimaryButton_default,
|
|
6762
6865
|
{
|
|
6763
6866
|
className: "warning-modal-acknowledge",
|
|
@@ -6769,7 +6872,7 @@ var WarningModal = ({
|
|
|
6769
6872
|
var WarningModal_default = WarningModal;
|
|
6770
6873
|
|
|
6771
6874
|
// src/components/reusable/CCWidget.tsx
|
|
6772
|
-
import
|
|
6875
|
+
import React83, { useEffect as useEffect20, useMemo as useMemo20, useRef as useRef7, useState as useState15 } from "react";
|
|
6773
6876
|
import { useSelector as useSelector44, useDispatch as useDispatch25 } from "react-redux";
|
|
6774
6877
|
import { v4 as uuidv4 } from "uuid";
|
|
6775
6878
|
|
|
@@ -6803,6 +6906,7 @@ var CCWidget = ({ submitCallback }) => {
|
|
|
6803
6906
|
const backendUrl = useSelector44(selectBackendUrl);
|
|
6804
6907
|
const ccTransactionStatus = useSelector44(selectCCTransactionStatus);
|
|
6805
6908
|
const networkOption = useSelector44(selectNetworkOption);
|
|
6909
|
+
const sourceCurrency = useSelector44(selectSourceCurrency);
|
|
6806
6910
|
const { transactionValues } = useSelector44(selectServiceFee);
|
|
6807
6911
|
const randomUserIdRef = useRef7(uuidv4());
|
|
6808
6912
|
const ccTransactionIdSeedRef = useRef7(uuidv4());
|
|
@@ -6854,12 +6958,12 @@ var CCWidget = ({ submitCallback }) => {
|
|
|
6854
6958
|
useEffect20(() => {
|
|
6855
6959
|
if (error) dispatch(setCCTransactionStatus("error-id"));
|
|
6856
6960
|
}, [dispatch, error]);
|
|
6857
|
-
return /* @__PURE__ */
|
|
6961
|
+
return /* @__PURE__ */ React83.createElement("div", { className: `cc-widget ${isLoading ? "loading" : ""}` }, (isLoading || isTransactionIdLoading || isEnvLoading || ccTransactionStatus === "success") && /* @__PURE__ */ React83.createElement("div", { className: "cc-widget-loader" }, /* @__PURE__ */ React83.createElement(ring_default, { width: 50, height: 50, fill: "#86b8ce" })), /* @__PURE__ */ React83.createElement(
|
|
6858
6962
|
"iframe",
|
|
6859
6963
|
{
|
|
6860
6964
|
width: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
|
|
6861
6965
|
height: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
|
|
6862
|
-
src: `${baseUrl}/widgets/kyc?partner=${partnerId}&user_uuid=${randomUserIdRef.current}&amount=${allowanceAmount}¤cy
|
|
6966
|
+
src: `${baseUrl}/widgets/kyc?partner=${partnerId}&user_uuid=${randomUserIdRef.current}&amount=${allowanceAmount}¤cy=${sourceCurrency}&trx_uuid=${data?.transactionId}&postmessage=true`,
|
|
6863
6967
|
loading: "lazy",
|
|
6864
6968
|
title: "Credit Card Widget",
|
|
6865
6969
|
allow: "camera; clipboard-write",
|
|
@@ -7004,14 +7108,14 @@ var TransferWidget = ({
|
|
|
7004
7108
|
try {
|
|
7005
7109
|
await submitTransaction(signature);
|
|
7006
7110
|
} catch (err) {
|
|
7007
|
-
toast5.error("Failed to submit transaction", { icon: /* @__PURE__ */
|
|
7111
|
+
toast5.error("Failed to submit transaction", { icon: /* @__PURE__ */ React84.createElement(Error_default, null) });
|
|
7008
7112
|
dispatch(setCCTransactionStatus("error-generic"));
|
|
7009
7113
|
}
|
|
7010
7114
|
}, [signature, submitTransaction]);
|
|
7011
7115
|
const handleSubmit = async () => {
|
|
7012
7116
|
const { error: error2, message: validationMessage } = validate(true);
|
|
7013
7117
|
if (error2 === "ValidationError" /* Error */) {
|
|
7014
|
-
return toast5.error(validationMessage, { icon: /* @__PURE__ */
|
|
7118
|
+
return toast5.error(validationMessage, { icon: /* @__PURE__ */ React84.createElement(Error_default, null) });
|
|
7015
7119
|
}
|
|
7016
7120
|
if (sourceChain.shortName === "CC") {
|
|
7017
7121
|
dispatch(setCCTransactionStatus("initialized"));
|
|
@@ -7060,7 +7164,7 @@ var TransferWidget = ({
|
|
|
7060
7164
|
if (error2 !== "ValidationError" /* Error */ && formStep > 0) {
|
|
7061
7165
|
return handleSubmit();
|
|
7062
7166
|
}
|
|
7063
|
-
toast5.error(validationMessage, { icon: /* @__PURE__ */
|
|
7167
|
+
toast5.error(validationMessage, { icon: /* @__PURE__ */ React84.createElement(Error_default, null) });
|
|
7064
7168
|
mainRef.current?.click();
|
|
7065
7169
|
};
|
|
7066
7170
|
const onBack = () => {
|
|
@@ -7135,7 +7239,7 @@ var TransferWidget = ({
|
|
|
7135
7239
|
}
|
|
7136
7240
|
await disconnectWallet();
|
|
7137
7241
|
};
|
|
7138
|
-
return /* @__PURE__ */
|
|
7242
|
+
return /* @__PURE__ */ React84.createElement(
|
|
7139
7243
|
"div",
|
|
7140
7244
|
{
|
|
7141
7245
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7143,7 +7247,7 @@ var TransferWidget = ({
|
|
|
7143
7247
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7144
7248
|
}
|
|
7145
7249
|
},
|
|
7146
|
-
resetModalOpen && /* @__PURE__ */
|
|
7250
|
+
resetModalOpen && /* @__PURE__ */ React84.createElement(
|
|
7147
7251
|
WarningModal_default,
|
|
7148
7252
|
{
|
|
7149
7253
|
message: "Are you sure you want to reset the widget?",
|
|
@@ -7155,7 +7259,7 @@ var TransferWidget = ({
|
|
|
7155
7259
|
onCancel: () => setResetModalOpen(false)
|
|
7156
7260
|
}
|
|
7157
7261
|
),
|
|
7158
|
-
warningModalOpen && /* @__PURE__ */
|
|
7262
|
+
warningModalOpen && /* @__PURE__ */ React84.createElement(
|
|
7159
7263
|
WarningModal_default,
|
|
7160
7264
|
{
|
|
7161
7265
|
message: warningModalOpen.message,
|
|
@@ -7169,14 +7273,14 @@ var TransferWidget = ({
|
|
|
7169
7273
|
}
|
|
7170
7274
|
}
|
|
7171
7275
|
),
|
|
7172
|
-
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */
|
|
7173
|
-
/* @__PURE__ */
|
|
7276
|
+
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */ React84.createElement("h2", { className: "invalid-option-banner" }, "We're unable to process your payment. Please ensure the necessary transaction details are provided. Contact support if the issue persists."),
|
|
7277
|
+
/* @__PURE__ */ React84.createElement("div", { className: "transfer-card" }, /* @__PURE__ */ React84.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React84.createElement("div", { className: "topbar" }, /* @__PURE__ */ React84.createElement("div", { className: "title" }, /* @__PURE__ */ React84.createElement("h3", { style: { marginRight: "5px" } }, formStep === 0 ? titleOption?.initialTitle ? titleOption.initialTitle : mode === "payment" /* payment */ ? "New Purchase" : "New Transfer" : titleOption?.confirmTitle ? titleOption.confirmTitle : mode === "payment" /* payment */ ? "Confirm Purchase" : "Transfer Details")), /* @__PURE__ */ React84.createElement("div", { className: "control-buttons" }, pendingTxs > 0 ? /* @__PURE__ */ React84.createElement(TxButton_default, { theme }) : null, /* @__PURE__ */ React84.createElement(
|
|
7174
7278
|
ExternalLink_default,
|
|
7175
7279
|
{
|
|
7176
7280
|
to: helpURL ? helpURL : networkOption === "testnet" /* testnet */ ? "https://docs.kima.network/kima-network/try-kima-with-the-demo-app" : "https://support.kima.network"
|
|
7177
7281
|
},
|
|
7178
|
-
/* @__PURE__ */
|
|
7179
|
-
), sourceChain.shortName === "CC" && formStep > 0 && /* @__PURE__ */
|
|
7282
|
+
/* @__PURE__ */ React84.createElement("div", { className: "menu-button" }, "I need help")
|
|
7283
|
+
), sourceChain.shortName === "CC" && formStep > 0 && /* @__PURE__ */ React84.createElement(ExternalLink_default, { to: "https://docs.kima.network/kima-network/supported-fiat#unsupported-countries-credit-cards" }, /* @__PURE__ */ React84.createElement("div", { className: "menu-button" }, "Unsupported Countries")), formStep === 0 && mode !== "payment" /* payment */ && /* @__PURE__ */ React84.createElement(
|
|
7180
7284
|
"button",
|
|
7181
7285
|
{
|
|
7182
7286
|
className: "reset-button",
|
|
@@ -7184,7 +7288,7 @@ var TransferWidget = ({
|
|
|
7184
7288
|
disabled: isApproving || isSubmitting || isSigning
|
|
7185
7289
|
},
|
|
7186
7290
|
"Reset"
|
|
7187
|
-
))), mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */
|
|
7291
|
+
))), mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */ React84.createElement("h4", { className: "subtitle" }, paymentTitleOption.title)), /* @__PURE__ */ React84.createElement("div", { className: "kima-card-content", ref: mainRef }, formStep === 0 ? /* @__PURE__ */ React84.createElement(
|
|
7188
7292
|
SingleForm_default,
|
|
7189
7293
|
{
|
|
7190
7294
|
...{
|
|
@@ -7197,7 +7301,7 @@ var TransferWidget = ({
|
|
|
7197
7301
|
setInitialSelection
|
|
7198
7302
|
}
|
|
7199
7303
|
}
|
|
7200
|
-
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */
|
|
7304
|
+
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */ React84.createElement(CCWidget_default, { submitCallback: submit }) : /* @__PURE__ */ React84.createElement(
|
|
7201
7305
|
ConfirmDetails_default,
|
|
7202
7306
|
{
|
|
7203
7307
|
...{
|
|
@@ -7205,12 +7309,12 @@ var TransferWidget = ({
|
|
|
7205
7309
|
feeOptionDisabled
|
|
7206
7310
|
}
|
|
7207
7311
|
}
|
|
7208
|
-
)), /* @__PURE__ */
|
|
7312
|
+
)), /* @__PURE__ */ React84.createElement(
|
|
7209
7313
|
"div",
|
|
7210
7314
|
{
|
|
7211
7315
|
className: `kima-card-footer ${mode === "bridge" /* bridge */ && formStep !== 0 && "confirm"}`
|
|
7212
7316
|
},
|
|
7213
|
-
/* @__PURE__ */
|
|
7317
|
+
/* @__PURE__ */ React84.createElement("div", { className: `button-group` }, isBackButtonEnabled && /* @__PURE__ */ React84.createElement(
|
|
7214
7318
|
SecondaryButton_default,
|
|
7215
7319
|
{
|
|
7216
7320
|
clickHandler: onBack,
|
|
@@ -7218,7 +7322,7 @@ var TransferWidget = ({
|
|
|
7218
7322
|
disabled: isApproving || isSubmitting || isSigning
|
|
7219
7323
|
},
|
|
7220
7324
|
formStep > 0 && ccTransactionStatus !== "initialized" ? "Back" : "Cancel"
|
|
7221
|
-
), !!allowance && allowance > 0 && formStep !== 0 && sourceChain.shortName !== "CC" && mode !== "light" /* light */ ? /* @__PURE__ */
|
|
7325
|
+
), !!allowance && allowance > 0 && formStep !== 0 && sourceChain.shortName !== "CC" && mode !== "light" /* light */ ? /* @__PURE__ */ React84.createElement(
|
|
7222
7326
|
SecondaryButton_default,
|
|
7223
7327
|
{
|
|
7224
7328
|
clickHandler: onCancelApprove,
|
|
@@ -7227,7 +7331,7 @@ var TransferWidget = ({
|
|
|
7227
7331
|
disabled: isCancellingApprove || isApproving || isSubmitting || isSigning
|
|
7228
7332
|
},
|
|
7229
7333
|
isCancellingApprove ? "Cancelling Approval" : "Cancel Approve"
|
|
7230
|
-
) : null, isSubmitButtonEnabled && /* @__PURE__ */
|
|
7334
|
+
) : null, isSubmitButtonEnabled && /* @__PURE__ */ React84.createElement(
|
|
7231
7335
|
PrimaryButton_default,
|
|
7232
7336
|
{
|
|
7233
7337
|
clickHandler: onNext,
|
|
@@ -7236,7 +7340,7 @@ var TransferWidget = ({
|
|
|
7236
7340
|
},
|
|
7237
7341
|
getButtonLabel()
|
|
7238
7342
|
))
|
|
7239
|
-
), /* @__PURE__ */
|
|
7343
|
+
), /* @__PURE__ */ React84.createElement(SolanaWalletConnectModal_default, null), /* @__PURE__ */ React84.createElement(TronWalletConnectModal_default, null), /* @__PURE__ */ React84.createElement(
|
|
7240
7344
|
Toaster2,
|
|
7241
7345
|
{
|
|
7242
7346
|
position: "top-right",
|
|
@@ -7261,7 +7365,7 @@ var TransferWidget = ({
|
|
|
7261
7365
|
}
|
|
7262
7366
|
}
|
|
7263
7367
|
}
|
|
7264
|
-
), /* @__PURE__ */
|
|
7368
|
+
), /* @__PURE__ */ React84.createElement("div", { className: "floating-footer" }, /* @__PURE__ */ React84.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React84.createElement("span", null, "Powered by"), /* @__PURE__ */ React84.createElement(KimaNetwork_default, null))))
|
|
7265
7369
|
);
|
|
7266
7370
|
};
|
|
7267
7371
|
|
|
@@ -7300,7 +7404,7 @@ var useDebugCode = (sequence = ["D", "E", "B", "U", "G"]) => {
|
|
|
7300
7404
|
};
|
|
7301
7405
|
|
|
7302
7406
|
// src/components/ErrorWidget.tsx
|
|
7303
|
-
import
|
|
7407
|
+
import React85 from "react";
|
|
7304
7408
|
import { useSelector as useSelector46 } from "react-redux";
|
|
7305
7409
|
var ErrorWidget = ({
|
|
7306
7410
|
theme,
|
|
@@ -7313,7 +7417,7 @@ var ErrorWidget = ({
|
|
|
7313
7417
|
const ccTransactionId = useSelector46(selectCCTransactionId);
|
|
7314
7418
|
const isCreditCardSource = sourceChain.shortName === "CC";
|
|
7315
7419
|
const isRetrying = useSelector46(selectCCTransactionRetrying);
|
|
7316
|
-
return /* @__PURE__ */
|
|
7420
|
+
return /* @__PURE__ */ React85.createElement(
|
|
7317
7421
|
"div",
|
|
7318
7422
|
{
|
|
7319
7423
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7321,7 +7425,7 @@ var ErrorWidget = ({
|
|
|
7321
7425
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7322
7426
|
}
|
|
7323
7427
|
},
|
|
7324
|
-
/* @__PURE__ */
|
|
7428
|
+
/* @__PURE__ */ React85.createElement("div", { className: "transfer-card" }, /* @__PURE__ */ React85.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React85.createElement("div", { className: "topbar" }, /* @__PURE__ */ React85.createElement("div", { className: "title" }, /* @__PURE__ */ React85.createElement("h3", null, title))), /* @__PURE__ */ React85.createElement("h4", { className: "subtitle" })), /* @__PURE__ */ React85.createElement("div", { className: "kima-card-content error" }, isCreditCardSource && !isRetrying && /* @__PURE__ */ React85.createElement(Error_default, { width: 40, height: 40 }), message && message !== "" && /* @__PURE__ */ React85.createElement("h2", null, message), isCreditCardSource && /* @__PURE__ */ React85.createElement(
|
|
7325
7429
|
"div",
|
|
7326
7430
|
{
|
|
7327
7431
|
style: {
|
|
@@ -7330,8 +7434,8 @@ var ErrorWidget = ({
|
|
|
7330
7434
|
flexDirection: "column"
|
|
7331
7435
|
}
|
|
7332
7436
|
},
|
|
7333
|
-
isRetrying ? /* @__PURE__ */
|
|
7334
|
-
ccTransactionId && /* @__PURE__ */
|
|
7437
|
+
isRetrying ? /* @__PURE__ */ React85.createElement("p", null, "The transaction is being retried in the background. This may take a few moments. If the issue persists, please contact support and provide the transaction ID below for reference.") : /* @__PURE__ */ React85.createElement("p", null, "This credit card transaction has failed. Please check the details and try again. If the issue persists, please contact support and provide the transaction ID below for reference."),
|
|
7438
|
+
ccTransactionId && /* @__PURE__ */ React85.createElement(
|
|
7335
7439
|
"div",
|
|
7336
7440
|
{
|
|
7337
7441
|
style: {
|
|
@@ -7341,7 +7445,7 @@ var ErrorWidget = ({
|
|
|
7341
7445
|
justifyContent: "center"
|
|
7342
7446
|
}
|
|
7343
7447
|
},
|
|
7344
|
-
/* @__PURE__ */
|
|
7448
|
+
/* @__PURE__ */ React85.createElement(
|
|
7345
7449
|
"code",
|
|
7346
7450
|
{
|
|
7347
7451
|
style: {
|
|
@@ -7352,10 +7456,10 @@ var ErrorWidget = ({
|
|
|
7352
7456
|
},
|
|
7353
7457
|
ccTransactionId
|
|
7354
7458
|
),
|
|
7355
|
-
/* @__PURE__ */
|
|
7459
|
+
/* @__PURE__ */ React85.createElement(CopyButton_default, { text: ccTransactionId })
|
|
7356
7460
|
),
|
|
7357
|
-
isRetrying && /* @__PURE__ */
|
|
7358
|
-
)), backButtonEnabled && /* @__PURE__ */
|
|
7461
|
+
isRetrying && /* @__PURE__ */ React85.createElement(ring_default, { width: 30, height: 30, fill: "#86b8ce" })
|
|
7462
|
+
)), backButtonEnabled && /* @__PURE__ */ React85.createElement(
|
|
7359
7463
|
"div",
|
|
7360
7464
|
{
|
|
7361
7465
|
style: {
|
|
@@ -7364,8 +7468,8 @@ var ErrorWidget = ({
|
|
|
7364
7468
|
marginTop: 16
|
|
7365
7469
|
}
|
|
7366
7470
|
},
|
|
7367
|
-
/* @__PURE__ */
|
|
7368
|
-
), /* @__PURE__ */
|
|
7471
|
+
/* @__PURE__ */ React85.createElement(PrimaryButton_default, { clickHandler: backButtonFunction }, "Back")
|
|
7472
|
+
), /* @__PURE__ */ React85.createElement("div", { className: "kima-card-footer" }), /* @__PURE__ */ React85.createElement("div", { className: "floating-footer" }, /* @__PURE__ */ React85.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React85.createElement("span", null, "Powered by"), /* @__PURE__ */ React85.createElement(FooterLogo_default, { width: 50, fill: "black" }), /* @__PURE__ */ React85.createElement("strong", null, "Network"))))
|
|
7369
7473
|
);
|
|
7370
7474
|
};
|
|
7371
7475
|
var ErrorWidget_default = ErrorWidget;
|
|
@@ -7443,9 +7547,9 @@ var KimaWidgetWrapper = ({
|
|
|
7443
7547
|
console.log("widget wrapper", submitted, ccTransactionStatus);
|
|
7444
7548
|
if (submitted) {
|
|
7445
7549
|
logger_default.debug("will return transaction widget on cc success");
|
|
7446
|
-
return /* @__PURE__ */
|
|
7550
|
+
return /* @__PURE__ */ React86.createElement(TransactionWidget, { theme });
|
|
7447
7551
|
} else if (ccTransactionStatus === "error-id") {
|
|
7448
|
-
return /* @__PURE__ */
|
|
7552
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7449
7553
|
ErrorWidget_default,
|
|
7450
7554
|
{
|
|
7451
7555
|
theme,
|
|
@@ -7459,7 +7563,7 @@ var KimaWidgetWrapper = ({
|
|
|
7459
7563
|
}
|
|
7460
7564
|
);
|
|
7461
7565
|
} else if (ccTransactionStatus === "error-generic") {
|
|
7462
|
-
return /* @__PURE__ */
|
|
7566
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7463
7567
|
ErrorWidget_default,
|
|
7464
7568
|
{
|
|
7465
7569
|
theme,
|
|
@@ -7473,7 +7577,7 @@ var KimaWidgetWrapper = ({
|
|
|
7473
7577
|
}
|
|
7474
7578
|
);
|
|
7475
7579
|
}
|
|
7476
|
-
return /* @__PURE__ */
|
|
7580
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7477
7581
|
TransferWidget,
|
|
7478
7582
|
{
|
|
7479
7583
|
theme,
|
|
@@ -7483,7 +7587,7 @@ var KimaWidgetWrapper = ({
|
|
|
7483
7587
|
}
|
|
7484
7588
|
);
|
|
7485
7589
|
}
|
|
7486
|
-
return submitted ? /* @__PURE__ */
|
|
7590
|
+
return submitted ? /* @__PURE__ */ React86.createElement(TransactionWidget, { theme }) : /* @__PURE__ */ React86.createElement(
|
|
7487
7591
|
TransferWidget,
|
|
7488
7592
|
{
|
|
7489
7593
|
theme,
|
|
@@ -7499,9 +7603,9 @@ var KimaWidgetWrapper_default = KimaWidgetWrapper;
|
|
|
7499
7603
|
import { useDispatch as useDispatch28 } from "react-redux";
|
|
7500
7604
|
|
|
7501
7605
|
// src/SkeletonLoader.tsx
|
|
7502
|
-
import
|
|
7606
|
+
import React87 from "react";
|
|
7503
7607
|
var SkeletonLoader = ({ theme }) => {
|
|
7504
|
-
return /* @__PURE__ */
|
|
7608
|
+
return /* @__PURE__ */ React87.createElement(
|
|
7505
7609
|
"div",
|
|
7506
7610
|
{
|
|
7507
7611
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7509,7 +7613,7 @@ var SkeletonLoader = ({ theme }) => {
|
|
|
7509
7613
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7510
7614
|
}
|
|
7511
7615
|
},
|
|
7512
|
-
/* @__PURE__ */
|
|
7616
|
+
/* @__PURE__ */ React87.createElement("div", { className: "transfer-card" }, /* @__PURE__ */ React87.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React87.createElement("div", { className: "topbar" }, /* @__PURE__ */ React87.createElement("div", { className: "title skeleton" }, /* @__PURE__ */ React87.createElement("h3", null))), /* @__PURE__ */ React87.createElement("h4", { className: "subtitle" })), /* @__PURE__ */ React87.createElement("div", { className: "kima-card-content skeleton" }, /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React87.createElement("div", { className: "skeleton" })), /* @__PURE__ */ React87.createElement("div", { className: `kima-card-footer` }, /* @__PURE__ */ React87.createElement("div", { className: `button-group skeleton` }, /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }))), /* @__PURE__ */ React87.createElement("div", { className: "floating-footer" }, /* @__PURE__ */ React87.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React87.createElement("span", null, "Powered by"), /* @__PURE__ */ React87.createElement(FooterLogo_default, { width: 50, fill: "black" }), /* @__PURE__ */ React87.createElement("strong", null, "Network"))))
|
|
7513
7617
|
);
|
|
7514
7618
|
};
|
|
7515
7619
|
var SkeletonLoader_default = SkeletonLoader;
|
|
@@ -7554,11 +7658,11 @@ var KimaTransactionWidget = ({
|
|
|
7554
7658
|
}
|
|
7555
7659
|
}, [theme?.colorMode]);
|
|
7556
7660
|
if (!hydrated || !theme?.colorMode)
|
|
7557
|
-
return /* @__PURE__ */
|
|
7661
|
+
return /* @__PURE__ */ React88.createElement(ring_default, { width: 20, height: 20, fill: "#86b8ce" });
|
|
7558
7662
|
if (isLoadingEnvs || isLoadingChainData)
|
|
7559
|
-
return /* @__PURE__ */
|
|
7663
|
+
return /* @__PURE__ */ React88.createElement(SkeletonLoader_default, { theme });
|
|
7560
7664
|
if (envOptionsError || !envOptions)
|
|
7561
|
-
return /* @__PURE__ */
|
|
7665
|
+
return /* @__PURE__ */ React88.createElement(
|
|
7562
7666
|
ErrorWidget_default,
|
|
7563
7667
|
{
|
|
7564
7668
|
theme,
|
|
@@ -7567,7 +7671,7 @@ var KimaTransactionWidget = ({
|
|
|
7567
7671
|
}
|
|
7568
7672
|
);
|
|
7569
7673
|
if (chainDataError || !chainData)
|
|
7570
|
-
return /* @__PURE__ */
|
|
7674
|
+
return /* @__PURE__ */ React88.createElement(
|
|
7571
7675
|
ErrorWidget_default,
|
|
7572
7676
|
{
|
|
7573
7677
|
theme,
|
|
@@ -7575,7 +7679,7 @@ var KimaTransactionWidget = ({
|
|
|
7575
7679
|
message: "There was an error loading the chain data from the backend. Please check that the backend is running properly and the widget points to the corresponding url." /* ChainLoadingError */
|
|
7576
7680
|
}
|
|
7577
7681
|
);
|
|
7578
|
-
return /* @__PURE__ */
|
|
7682
|
+
return /* @__PURE__ */ React88.createElement(
|
|
7579
7683
|
KimaWidgetWrapper_default,
|
|
7580
7684
|
{
|
|
7581
7685
|
...{
|