@kimafinance/kima-transaction-widget 1.5.31 → 1.5.32
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 +694 -480
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +139 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +617 -403
- 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.cjs
CHANGED
|
@@ -3809,7 +3809,8 @@ var getEnvOptions = async ({
|
|
|
3809
3809
|
env: "testnet" /* testnet */,
|
|
3810
3810
|
kimaExplorer: "https://explorer.sardis.kima.network",
|
|
3811
3811
|
paymentPartnerId: "KimaTest",
|
|
3812
|
-
transferLimitMaxUSDT: null
|
|
3812
|
+
transferLimitMaxUSDT: null,
|
|
3813
|
+
backendVersion: null
|
|
3813
3814
|
};
|
|
3814
3815
|
return response;
|
|
3815
3816
|
};
|
|
@@ -8166,7 +8167,7 @@ var KimaProvider = ({
|
|
|
8166
8167
|
var KimaProvider_default = KimaProvider;
|
|
8167
8168
|
|
|
8168
8169
|
// src/widgets/common/KimaTransactionWidget.tsx
|
|
8169
|
-
var
|
|
8170
|
+
var import_react83 = require("react");
|
|
8170
8171
|
var import_react_redux68 = require("react-redux");
|
|
8171
8172
|
|
|
8172
8173
|
// src/assets/loading/180-ring.tsx
|
|
@@ -9705,9 +9706,220 @@ var StepBox = ({ step, errorStep, loadingStep, data, steps }) => {
|
|
|
9705
9706
|
};
|
|
9706
9707
|
var StepBox_default = StepBox;
|
|
9707
9708
|
|
|
9709
|
+
// src/components/reusable/VersionInfo.tsx
|
|
9710
|
+
var import_react58 = require("react");
|
|
9711
|
+
|
|
9712
|
+
// package.json
|
|
9713
|
+
var package_default = {
|
|
9714
|
+
name: "@kimafinance/kima-transaction-widget",
|
|
9715
|
+
version: "1.5.32",
|
|
9716
|
+
description: "Kima Transaction Widget",
|
|
9717
|
+
author: "",
|
|
9718
|
+
license: "MIT",
|
|
9719
|
+
repository: "https://github.com/kima-finance/kima-transaction-widget",
|
|
9720
|
+
main: "dist/index.cjs",
|
|
9721
|
+
module: "dist/index.js",
|
|
9722
|
+
types: "dist/index.d.ts",
|
|
9723
|
+
type: "module",
|
|
9724
|
+
source: "src/index.tsx",
|
|
9725
|
+
exports: {
|
|
9726
|
+
".": {
|
|
9727
|
+
types: "./dist/index.d.ts",
|
|
9728
|
+
import: "./dist/index.js",
|
|
9729
|
+
require: "./dist/index.cjs"
|
|
9730
|
+
},
|
|
9731
|
+
"./index.css": {
|
|
9732
|
+
default: "./dist/index.css"
|
|
9733
|
+
}
|
|
9734
|
+
},
|
|
9735
|
+
scripts: {
|
|
9736
|
+
build: "npm run build:tsup && npm run build:sass && npm run move:fonts",
|
|
9737
|
+
"build:sass": "sass src/styles/main.scss dist/index.css",
|
|
9738
|
+
"build:tsup": "tsup",
|
|
9739
|
+
"move:fonts": "mkdir -p dist/fonts && find dist -maxdepth 1 -type f \\( -iname '*.woff' -o -iname '*.woff2' -o -iname '*.eot' -o -iname '*.ttf' -o -iname '*.otf' \\) -exec mv {} dist/fonts/ \\;",
|
|
9740
|
+
prepare: "npm run build",
|
|
9741
|
+
dev: "tsup --watch",
|
|
9742
|
+
sass: "sass src/styles/main.scss src/index.css -w",
|
|
9743
|
+
test: "jest --runInBand",
|
|
9744
|
+
docs: "typedoc --options typedoc.json"
|
|
9745
|
+
},
|
|
9746
|
+
peerDependencies: {
|
|
9747
|
+
react: ">=17.0.0",
|
|
9748
|
+
"react-dom": ">=17.0.1",
|
|
9749
|
+
"react-redux": ">=7.2.2",
|
|
9750
|
+
redux: ">=4.1.2"
|
|
9751
|
+
},
|
|
9752
|
+
devDependencies: {
|
|
9753
|
+
"@babel/plugin-proposal-unicode-property-regex": "^7.18.6",
|
|
9754
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
9755
|
+
"@testing-library/react": "^13.4.0",
|
|
9756
|
+
"@testing-library/react-hooks": "^7.0.2",
|
|
9757
|
+
"@types/bn.js": "^5.1.6",
|
|
9758
|
+
"@types/crypto-js": "^4.2.2",
|
|
9759
|
+
"@types/jest": "^29.5.14",
|
|
9760
|
+
"@types/mocha": "^10.0.10",
|
|
9761
|
+
"@types/node": "^20.17.10",
|
|
9762
|
+
"@types/react": "^18.3.1",
|
|
9763
|
+
"@types/react-dom": "^18.3.1",
|
|
9764
|
+
"@types/react-redux": "^7.1.34",
|
|
9765
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
9766
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
9767
|
+
"cross-env": "^7.0.3",
|
|
9768
|
+
eslint: "^8.57.1",
|
|
9769
|
+
"eslint-config-prettier": "^9.1.0",
|
|
9770
|
+
"eslint-plugin-react": "^7.37.2",
|
|
9771
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
9772
|
+
jest: "^29.7.0",
|
|
9773
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
9774
|
+
"npm-run-all": "^4.1.5",
|
|
9775
|
+
prettier: "^3.4.2",
|
|
9776
|
+
react: "^18.3.1",
|
|
9777
|
+
"react-dom": "^18.3.1",
|
|
9778
|
+
serve: "^14.2.4",
|
|
9779
|
+
"ts-jest": "^29.2.5",
|
|
9780
|
+
"ts-node": "^10.9.2",
|
|
9781
|
+
typedoc: "^0.27.7",
|
|
9782
|
+
"typedoc-plugin-markdown": "^4.2.10",
|
|
9783
|
+
typescript: "^5.7.3"
|
|
9784
|
+
},
|
|
9785
|
+
dependencies: {
|
|
9786
|
+
"@kimafinance/btc-signer": "^1.3.4",
|
|
9787
|
+
"@metamask/detect-provider": "^2.0.0",
|
|
9788
|
+
"@noble/secp256k1": "^2.1.0",
|
|
9789
|
+
"@reduxjs/toolkit": "^2.5.0",
|
|
9790
|
+
"@reown/appkit": "^1.7.1",
|
|
9791
|
+
"@reown/appkit-adapter-ethers": "^1.7.1",
|
|
9792
|
+
"@scure/base": "^1.2.1",
|
|
9793
|
+
"@solana/spl-token": "^0.3.5",
|
|
9794
|
+
"@solana/wallet-adapter-base": "^0.9.18",
|
|
9795
|
+
"@solana/wallet-adapter-react": "^0.15.20",
|
|
9796
|
+
"@solana/wallet-adapter-wallets": "^0.19.3",
|
|
9797
|
+
"@solana/web3.js": "^1.98.0",
|
|
9798
|
+
"@tanstack/react-query": "^5.62.8",
|
|
9799
|
+
"@tronweb3/tronwallet-abstract-adapter": "^1.1.8",
|
|
9800
|
+
"@tronweb3/tronwallet-adapter-ledger": "^1.1.10",
|
|
9801
|
+
"@tronweb3/tronwallet-adapter-okxwallet": "^1.0.5",
|
|
9802
|
+
"@tronweb3/tronwallet-adapter-react-hooks": "^1.1.9",
|
|
9803
|
+
"@tronweb3/tronwallet-adapter-tokenpocket": "^1.0.5",
|
|
9804
|
+
"@tronweb3/tronwallet-adapter-tronlink": "^1.1.11",
|
|
9805
|
+
"@tronweb3/tronwallet-adapter-walletconnect": "^2.0.2",
|
|
9806
|
+
"bitcoinjs-lib": "^6.1.7",
|
|
9807
|
+
"browserify-zlib": "^0.2.0",
|
|
9808
|
+
buffer: "^6.0.3",
|
|
9809
|
+
"buffer-layout": "^1.2.2",
|
|
9810
|
+
"crypto-browserify": "^3.12.1",
|
|
9811
|
+
"crypto-js": "^4.2.0",
|
|
9812
|
+
ethers: "^6.13.5",
|
|
9813
|
+
hex64: "^0.4.0",
|
|
9814
|
+
"https-browserify": "^1.0.0",
|
|
9815
|
+
"json-bigint": "^1.0.0",
|
|
9816
|
+
loglevel: "^1.9.2",
|
|
9817
|
+
"os-browserify": "^0.3.0",
|
|
9818
|
+
"path-browserify": "^1.0.1",
|
|
9819
|
+
"pino-pretty": "^13.0.0",
|
|
9820
|
+
"react-hot-toast": "^2.4.1",
|
|
9821
|
+
"react-redux": ">=7.2.2",
|
|
9822
|
+
"react-tooltip": "^5.28.0",
|
|
9823
|
+
redux: ">=4.1.2",
|
|
9824
|
+
sass: "^1.83.0",
|
|
9825
|
+
"sats-connect": "2.8.3",
|
|
9826
|
+
"stream-browserify": "^3.0.0",
|
|
9827
|
+
"stream-http": "^3.2.0",
|
|
9828
|
+
tronweb: "^6.0.0",
|
|
9829
|
+
tsup: "^8.3.5",
|
|
9830
|
+
url: "^0.11.0",
|
|
9831
|
+
uuid: "^11.1.0",
|
|
9832
|
+
viem: "^2.23.2",
|
|
9833
|
+
"vm-browserify": "^1.1.2"
|
|
9834
|
+
},
|
|
9835
|
+
files: [
|
|
9836
|
+
"dist"
|
|
9837
|
+
]
|
|
9838
|
+
};
|
|
9839
|
+
|
|
9840
|
+
// src/shared/config/version.ts
|
|
9841
|
+
var WIDGET_VERSION = package_default.version;
|
|
9842
|
+
|
|
9843
|
+
// src/components/reusable/VersionInfo.tsx
|
|
9844
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
9845
|
+
var VersionInfo = ({ theme }) => {
|
|
9846
|
+
const [isOpen, setIsOpen] = (0, import_react58.useState)(false);
|
|
9847
|
+
const { kimaBackendUrl } = useKimaContext();
|
|
9848
|
+
const { data: envOptions } = useGetEnvOptions({ kimaBackendUrl });
|
|
9849
|
+
(0, import_react58.useEffect)(() => {
|
|
9850
|
+
if (!isOpen) return;
|
|
9851
|
+
const handleKeyDown = (event) => {
|
|
9852
|
+
if (event.key === "Escape") {
|
|
9853
|
+
setIsOpen(false);
|
|
9854
|
+
}
|
|
9855
|
+
};
|
|
9856
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
9857
|
+
return () => {
|
|
9858
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
9859
|
+
};
|
|
9860
|
+
}, [isOpen]);
|
|
9861
|
+
const backendVersion = envOptions?.backendVersion ?? "Unavailable";
|
|
9862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
9863
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "version-info", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9864
|
+
"button",
|
|
9865
|
+
{
|
|
9866
|
+
type: "button",
|
|
9867
|
+
className: "version-info-trigger",
|
|
9868
|
+
"aria-label": "Open version information",
|
|
9869
|
+
onClick: () => setIsOpen(true),
|
|
9870
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "version-info-glyph", "aria-hidden": "true", children: "i" })
|
|
9871
|
+
}
|
|
9872
|
+
) }),
|
|
9873
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9874
|
+
"div",
|
|
9875
|
+
{
|
|
9876
|
+
className: "version-info-overlay",
|
|
9877
|
+
role: "presentation",
|
|
9878
|
+
onClick: () => setIsOpen(false),
|
|
9879
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
9880
|
+
"div",
|
|
9881
|
+
{
|
|
9882
|
+
className: `version-info-modal ${theme.colorMode}`,
|
|
9883
|
+
role: "dialog",
|
|
9884
|
+
"aria-modal": "true",
|
|
9885
|
+
"aria-label": "Version information",
|
|
9886
|
+
onClick: (event) => event.stopPropagation(),
|
|
9887
|
+
children: [
|
|
9888
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "version-info-modal-header", children: [
|
|
9889
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("h3", { children: "Version Information" }),
|
|
9890
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9891
|
+
"button",
|
|
9892
|
+
{
|
|
9893
|
+
type: "button",
|
|
9894
|
+
className: "version-info-close",
|
|
9895
|
+
"aria-label": "Close version information",
|
|
9896
|
+
onClick: () => setIsOpen(false),
|
|
9897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Cross_default, {})
|
|
9898
|
+
}
|
|
9899
|
+
)
|
|
9900
|
+
] }),
|
|
9901
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "version-info-list", children: [
|
|
9902
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "version-info-row", children: [
|
|
9903
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: "Current widget version" }),
|
|
9904
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("strong", { children: WIDGET_VERSION })
|
|
9905
|
+
] }),
|
|
9906
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "version-info-row", children: [
|
|
9907
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: "Current backend version" }),
|
|
9908
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("strong", { children: backendVersion })
|
|
9909
|
+
] })
|
|
9910
|
+
] })
|
|
9911
|
+
]
|
|
9912
|
+
}
|
|
9913
|
+
)
|
|
9914
|
+
}
|
|
9915
|
+
)
|
|
9916
|
+
] });
|
|
9917
|
+
};
|
|
9918
|
+
var VersionInfo_default = VersionInfo;
|
|
9919
|
+
|
|
9708
9920
|
// src/widgets/common/ErrorWidget.tsx
|
|
9709
9921
|
var import_react_redux41 = require("react-redux");
|
|
9710
|
-
var
|
|
9922
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
9711
9923
|
var ErrorWidget = ({
|
|
9712
9924
|
theme,
|
|
9713
9925
|
title,
|
|
@@ -9719,22 +9931,22 @@ var ErrorWidget = ({
|
|
|
9719
9931
|
const ccTransactionId = (0, import_react_redux41.useSelector)(selectCCTransactionId);
|
|
9720
9932
|
const isCreditCardSource = sourceChain.shortName === "CC";
|
|
9721
9933
|
const isRetrying = (0, import_react_redux41.useSelector)(selectCCTransactionRetrying);
|
|
9722
|
-
return /* @__PURE__ */ (0,
|
|
9934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9723
9935
|
"div",
|
|
9724
9936
|
{
|
|
9725
9937
|
className: `kima-card ${theme.colorMode}`,
|
|
9726
9938
|
style: {
|
|
9727
9939
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
9728
9940
|
},
|
|
9729
|
-
children: /* @__PURE__ */ (0,
|
|
9730
|
-
/* @__PURE__ */ (0,
|
|
9731
|
-
/* @__PURE__ */ (0,
|
|
9732
|
-
/* @__PURE__ */ (0,
|
|
9941
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "transfer-card", children: [
|
|
9942
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "kima-card-header", children: [
|
|
9943
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "topbar", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "title", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("h3", { children: title }) }) }),
|
|
9944
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("h4", { className: "subtitle" })
|
|
9733
9945
|
] }),
|
|
9734
|
-
/* @__PURE__ */ (0,
|
|
9735
|
-
isCreditCardSource && !isRetrying && /* @__PURE__ */ (0,
|
|
9736
|
-
message && message !== "" && /* @__PURE__ */ (0,
|
|
9737
|
-
isCreditCardSource && /* @__PURE__ */ (0,
|
|
9946
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "kima-card-content error", children: [
|
|
9947
|
+
isCreditCardSource && !isRetrying && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Error_default, { width: 40, height: 40 }),
|
|
9948
|
+
message && message !== "" && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("h2", { children: message }),
|
|
9949
|
+
isCreditCardSource && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
9738
9950
|
"div",
|
|
9739
9951
|
{
|
|
9740
9952
|
style: {
|
|
@@ -9743,8 +9955,8 @@ var ErrorWidget = ({
|
|
|
9743
9955
|
flexDirection: "column"
|
|
9744
9956
|
},
|
|
9745
9957
|
children: [
|
|
9746
|
-
isRetrying ? /* @__PURE__ */ (0,
|
|
9747
|
-
ccTransactionId && /* @__PURE__ */ (0,
|
|
9958
|
+
isRetrying ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { children: "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__ */ (0, import_jsx_runtime78.jsx)("p", { children: "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." }),
|
|
9959
|
+
ccTransactionId && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
9748
9960
|
"div",
|
|
9749
9961
|
{
|
|
9750
9962
|
style: {
|
|
@@ -9754,7 +9966,7 @@ var ErrorWidget = ({
|
|
|
9754
9966
|
justifyContent: "center"
|
|
9755
9967
|
},
|
|
9756
9968
|
children: [
|
|
9757
|
-
/* @__PURE__ */ (0,
|
|
9969
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9758
9970
|
"code",
|
|
9759
9971
|
{
|
|
9760
9972
|
style: {
|
|
@@ -9765,16 +9977,16 @@ var ErrorWidget = ({
|
|
|
9765
9977
|
children: ccTransactionId
|
|
9766
9978
|
}
|
|
9767
9979
|
),
|
|
9768
|
-
/* @__PURE__ */ (0,
|
|
9980
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(CopyButton_default, { text: ccTransactionId })
|
|
9769
9981
|
]
|
|
9770
9982
|
}
|
|
9771
9983
|
),
|
|
9772
|
-
isRetrying && /* @__PURE__ */ (0,
|
|
9984
|
+
isRetrying && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ring_default, { width: 30, height: 30, fill: "#86b8ce" })
|
|
9773
9985
|
]
|
|
9774
9986
|
}
|
|
9775
9987
|
)
|
|
9776
9988
|
] }),
|
|
9777
|
-
backButtonEnabled && /* @__PURE__ */ (0,
|
|
9989
|
+
backButtonEnabled && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9778
9990
|
"div",
|
|
9779
9991
|
{
|
|
9780
9992
|
style: {
|
|
@@ -9782,14 +9994,14 @@ var ErrorWidget = ({
|
|
|
9782
9994
|
justifyContent: "flex-end",
|
|
9783
9995
|
marginTop: 16
|
|
9784
9996
|
},
|
|
9785
|
-
children: /* @__PURE__ */ (0,
|
|
9997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(PrimaryButton_default, { clickHandler: backButtonFunction, children: "Back" })
|
|
9786
9998
|
}
|
|
9787
9999
|
),
|
|
9788
|
-
/* @__PURE__ */ (0,
|
|
9789
|
-
/* @__PURE__ */ (0,
|
|
9790
|
-
/* @__PURE__ */ (0,
|
|
9791
|
-
/* @__PURE__ */ (0,
|
|
9792
|
-
/* @__PURE__ */ (0,
|
|
10000
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "kima-card-footer" }),
|
|
10001
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "floating-footer", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `items ${theme.colorMode}`, children: [
|
|
10002
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { children: "Powered by" }),
|
|
10003
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(FooterLogo_default, { width: 50, fill: "black" }),
|
|
10004
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("strong", { children: "Network" })
|
|
9793
10005
|
] }) })
|
|
9794
10006
|
] })
|
|
9795
10007
|
}
|
|
@@ -9798,11 +10010,11 @@ var ErrorWidget = ({
|
|
|
9798
10010
|
var ErrorWidget_default = ErrorWidget;
|
|
9799
10011
|
|
|
9800
10012
|
// src/hooks/useDebugMode.ts
|
|
9801
|
-
var
|
|
10013
|
+
var import_react59 = require("react");
|
|
9802
10014
|
var useDebugCode = (sequence = ["D", "E", "B", "U", "G"]) => {
|
|
9803
|
-
const [debugMode, setDebugMode] = (0,
|
|
9804
|
-
const [, setInputSequence] = (0,
|
|
9805
|
-
(0,
|
|
10015
|
+
const [debugMode, setDebugMode] = (0, import_react59.useState)(false);
|
|
10016
|
+
const [, setInputSequence] = (0, import_react59.useState)([]);
|
|
10017
|
+
(0, import_react59.useEffect)(() => {
|
|
9806
10018
|
const onKeyDown = (e) => {
|
|
9807
10019
|
setInputSequence((prev) => {
|
|
9808
10020
|
const next = [...prev, e.key].slice(-sequence.length);
|
|
@@ -9829,17 +10041,17 @@ var useDebugCode = (sequence = ["D", "E", "B", "U", "G"]) => {
|
|
|
9829
10041
|
};
|
|
9830
10042
|
|
|
9831
10043
|
// src/widgets/common/KimaWidgetWrapper.tsx
|
|
9832
|
-
var
|
|
9833
|
-
var
|
|
10044
|
+
var import_react81 = require("@reown/appkit/react");
|
|
10045
|
+
var import_react82 = require("react");
|
|
9834
10046
|
var import_react_redux67 = require("react-redux");
|
|
9835
10047
|
|
|
9836
10048
|
// src/widgets/transaction/components/TransactionWidget.tsx
|
|
9837
|
-
var
|
|
10049
|
+
var import_react63 = require("react");
|
|
9838
10050
|
|
|
9839
10051
|
// src/components/reusable/Progressbar.tsx
|
|
9840
|
-
var
|
|
10052
|
+
var import_react60 = require("react");
|
|
9841
10053
|
var import_react_redux42 = require("react-redux");
|
|
9842
|
-
var
|
|
10054
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
9843
10055
|
var DEFAULT_STEPS2 = [
|
|
9844
10056
|
{ title: "Initialize" },
|
|
9845
10057
|
{ title: "Source Transfer" },
|
|
@@ -9857,14 +10069,14 @@ var Progressbar = ({
|
|
|
9857
10069
|
const theme = (0, import_react_redux42.useSelector)(selectTheme);
|
|
9858
10070
|
const stepInfo = steps ?? DEFAULT_STEPS2;
|
|
9859
10071
|
const lastIndex = stepInfo.length - 1;
|
|
9860
|
-
const pct = (0,
|
|
10072
|
+
const pct = (0, import_react60.useMemo)(() => {
|
|
9861
10073
|
if (lastIndex <= 0) return 0;
|
|
9862
10074
|
const clamped = Math.max(0, Math.min(step, lastIndex));
|
|
9863
10075
|
return clamped * 100 / lastIndex;
|
|
9864
10076
|
}, [step, lastIndex]);
|
|
9865
|
-
return /* @__PURE__ */ (0,
|
|
9866
|
-
/* @__PURE__ */ (0,
|
|
9867
|
-
/* @__PURE__ */ (0,
|
|
10077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "kima-progressbar", children: [
|
|
10078
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "value", style: { width: `${pct}%` } }),
|
|
10079
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "step-indicators", children: stepInfo.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
9868
10080
|
"div",
|
|
9869
10081
|
{
|
|
9870
10082
|
className: `step ${step === index && "active"}
|
|
@@ -9873,10 +10085,10 @@ var Progressbar = ({
|
|
|
9873
10085
|
onClick: () => {
|
|
9874
10086
|
if (index < lastIndex) setFocus(index);
|
|
9875
10087
|
},
|
|
9876
|
-
children: /* @__PURE__ */ (0,
|
|
9877
|
-
step < index && /* @__PURE__ */ (0,
|
|
9878
|
-
step >= index ? index === loadingStep ? /* @__PURE__ */ (0,
|
|
9879
|
-
/* @__PURE__ */ (0,
|
|
10088
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "step-info", children: [
|
|
10089
|
+
step < index && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Lock_default, {}),
|
|
10090
|
+
step >= index ? index === loadingStep ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Loader_default, { className: "loader" }) : index === errorStep ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Warning_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Check_default, {}) : null,
|
|
10091
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { children: item.title })
|
|
9880
10092
|
] })
|
|
9881
10093
|
},
|
|
9882
10094
|
`${item.title}-${index}`
|
|
@@ -9892,7 +10104,7 @@ var import_react_redux47 = require("react-redux");
|
|
|
9892
10104
|
var import_react_hot_toast4 = require("react-hot-toast");
|
|
9893
10105
|
|
|
9894
10106
|
// src/widgets/transaction/hooks/useTxData.ts
|
|
9895
|
-
var
|
|
10107
|
+
var import_react61 = require("react");
|
|
9896
10108
|
var import_react_query18 = require("@tanstack/react-query");
|
|
9897
10109
|
|
|
9898
10110
|
// src/services/transactionApi.ts
|
|
@@ -10031,7 +10243,7 @@ var getTxData = async ({
|
|
|
10031
10243
|
// src/widgets/transaction/hooks/useTxData.ts
|
|
10032
10244
|
var POLLING_INTERVAL_MS = 1e3 * 10;
|
|
10033
10245
|
var useTxData = (txId, dAppOption, backendUrl, isSwap) => {
|
|
10034
|
-
const refPollForUpdates = (0,
|
|
10246
|
+
const refPollForUpdates = (0, import_react61.useRef)(false);
|
|
10035
10247
|
const isLP = dAppOption === "LPAdd" /* LPAdd */ || dAppOption === "LPDrain" /* LPDrain */;
|
|
10036
10248
|
const validTxId = typeof txId === "number" ? txId > 0 : txId.toString().length > 0;
|
|
10037
10249
|
return (0, import_react_query18.useQuery)({
|
|
@@ -10052,31 +10264,31 @@ var useTxData = (txId, dAppOption, backendUrl, isSwap) => {
|
|
|
10052
10264
|
var useTxData_default = useTxData;
|
|
10053
10265
|
|
|
10054
10266
|
// src/components/reusable/TransactionStatusMessage.tsx
|
|
10055
|
-
var
|
|
10267
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
10056
10268
|
var TransactionStatusMessage = ({
|
|
10057
10269
|
isCompleted,
|
|
10058
10270
|
transactionId
|
|
10059
10271
|
}) => {
|
|
10060
|
-
return /* @__PURE__ */ (0,
|
|
10061
|
-
/* @__PURE__ */ (0,
|
|
10272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "transaction-status-message", children: [
|
|
10273
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("h2", { children: [
|
|
10062
10274
|
isCompleted !== "Completed" /* COMPLETED */ && "Your transaction is currently being processed.",
|
|
10063
10275
|
" ",
|
|
10064
10276
|
"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."
|
|
10065
10277
|
] }),
|
|
10066
|
-
/* @__PURE__ */ (0,
|
|
10067
|
-
/* @__PURE__ */ (0,
|
|
10068
|
-
/* @__PURE__ */ (0,
|
|
10278
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("span", { className: "transaction-copy", children: [
|
|
10279
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("h3", { children: transactionId }),
|
|
10280
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CopyButton_default, { text: transactionId })
|
|
10069
10281
|
] })
|
|
10070
10282
|
] });
|
|
10071
10283
|
};
|
|
10072
10284
|
var TransactionStatusMessage_default = TransactionStatusMessage;
|
|
10073
10285
|
|
|
10074
10286
|
// src/components/reusable/TransactionSearch.tsx
|
|
10075
|
-
var
|
|
10287
|
+
var import_react62 = require("react");
|
|
10076
10288
|
var import_react_redux43 = require("react-redux");
|
|
10077
10289
|
var import_react_redux44 = require("react-redux");
|
|
10078
10290
|
var import_react_hot_toast3 = __toESM(require("react-hot-toast"), 1);
|
|
10079
|
-
var
|
|
10291
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
10080
10292
|
var TransactionSearch = ({
|
|
10081
10293
|
isSwap,
|
|
10082
10294
|
onTypeChange
|
|
@@ -10084,12 +10296,12 @@ var TransactionSearch = ({
|
|
|
10084
10296
|
const theme = (0, import_react_redux43.useSelector)(selectTheme);
|
|
10085
10297
|
const backendUrl = (0, import_react_redux43.useSelector)(selectBackendUrl);
|
|
10086
10298
|
const dispatch = (0, import_react_redux44.useDispatch)();
|
|
10087
|
-
const [transactionId, setTransactionId] = (0,
|
|
10088
|
-
const refPollForUpdates = (0,
|
|
10299
|
+
const [transactionId, setTransactionId] = (0, import_react62.useState)("");
|
|
10300
|
+
const refPollForUpdates = (0, import_react62.useRef)(false);
|
|
10089
10301
|
const handleSearch = async () => {
|
|
10090
10302
|
if (transactionId.length <= 0)
|
|
10091
10303
|
return import_react_hot_toast3.default.error("You must provide a valid transaction id", {
|
|
10092
|
-
icon: /* @__PURE__ */ (0,
|
|
10304
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Error_default, {})
|
|
10093
10305
|
});
|
|
10094
10306
|
try {
|
|
10095
10307
|
const data = await getTxData({
|
|
@@ -10107,14 +10319,14 @@ var TransactionSearch = ({
|
|
|
10107
10319
|
logger_default.error("Error searching transaction: ", error);
|
|
10108
10320
|
return import_react_hot_toast3.default.error(
|
|
10109
10321
|
"Transaction not found. Please check for the proper transaction id.",
|
|
10110
|
-
{ icon: /* @__PURE__ */ (0,
|
|
10322
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Error_default, {}) }
|
|
10111
10323
|
);
|
|
10112
10324
|
}
|
|
10113
10325
|
};
|
|
10114
|
-
return /* @__PURE__ */ (0,
|
|
10115
|
-
/* @__PURE__ */ (0,
|
|
10116
|
-
/* @__PURE__ */ (0,
|
|
10117
|
-
/* @__PURE__ */ (0,
|
|
10326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "form-item transaction-search", children: [
|
|
10327
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "transaction-input", children: [
|
|
10328
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "label", children: "Search Transaction:" }),
|
|
10329
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10118
10330
|
"input",
|
|
10119
10331
|
{
|
|
10120
10332
|
className: `${theme.colorMode}`,
|
|
@@ -10126,10 +10338,10 @@ var TransactionSearch = ({
|
|
|
10126
10338
|
}
|
|
10127
10339
|
)
|
|
10128
10340
|
] }),
|
|
10129
|
-
/* @__PURE__ */ (0,
|
|
10130
|
-
/* @__PURE__ */ (0,
|
|
10131
|
-
/* @__PURE__ */ (0,
|
|
10132
|
-
/* @__PURE__ */ (0,
|
|
10341
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "tx-type-toggle", children: [
|
|
10342
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "label", children: "Type:" }),
|
|
10343
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "toggle-buttons", children: [
|
|
10344
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10133
10345
|
"button",
|
|
10134
10346
|
{
|
|
10135
10347
|
type: "button",
|
|
@@ -10138,7 +10350,7 @@ var TransactionSearch = ({
|
|
|
10138
10350
|
children: "Transfer"
|
|
10139
10351
|
}
|
|
10140
10352
|
),
|
|
10141
|
-
/* @__PURE__ */ (0,
|
|
10353
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10142
10354
|
"button",
|
|
10143
10355
|
{
|
|
10144
10356
|
type: "button",
|
|
@@ -10149,7 +10361,7 @@ var TransactionSearch = ({
|
|
|
10149
10361
|
)
|
|
10150
10362
|
] })
|
|
10151
10363
|
] }),
|
|
10152
|
-
/* @__PURE__ */ (0,
|
|
10364
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SecondaryButton_default, { clickHandler: handleSearch, children: "Search" })
|
|
10153
10365
|
] });
|
|
10154
10366
|
};
|
|
10155
10367
|
var TransactionSearch_default = TransactionSearch;
|
|
@@ -10209,20 +10421,20 @@ var resolveTransactionResetTarget = ({
|
|
|
10209
10421
|
};
|
|
10210
10422
|
|
|
10211
10423
|
// src/widgets/transaction/components/TransactionWidget.tsx
|
|
10212
|
-
var
|
|
10424
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
10213
10425
|
var TransactionWidget = ({ theme }) => {
|
|
10214
|
-
const [step, setStep] = (0,
|
|
10215
|
-
const [focus, setFocus] = (0,
|
|
10216
|
-
const [errorStep, setErrorStep] = (0,
|
|
10217
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
10218
|
-
const [loadingStep, setLoadingStep] = (0,
|
|
10219
|
-
const [minimized, setMinimized] = (0,
|
|
10220
|
-
const [isComplete, setIsComplete] = (0,
|
|
10221
|
-
const [statusTxType, setStatusTxType] = (0,
|
|
10426
|
+
const [step, setStep] = (0, import_react63.useState)(0);
|
|
10427
|
+
const [focus, setFocus] = (0, import_react63.useState)(-1);
|
|
10428
|
+
const [errorStep, setErrorStep] = (0, import_react63.useState)(-1);
|
|
10429
|
+
const [errorMessage, setErrorMessage] = (0, import_react63.useState)("");
|
|
10430
|
+
const [loadingStep, setLoadingStep] = (0, import_react63.useState)(-1);
|
|
10431
|
+
const [minimized, setMinimized] = (0, import_react63.useState)(false);
|
|
10432
|
+
const [isComplete, setIsComplete] = (0, import_react63.useState)(false);
|
|
10433
|
+
const [statusTxType, setStatusTxType] = (0, import_react63.useState)(
|
|
10222
10434
|
"transfer"
|
|
10223
10435
|
);
|
|
10224
|
-
const previousStatusRef = (0,
|
|
10225
|
-
const previousErrorRef = (0,
|
|
10436
|
+
const previousStatusRef = (0, import_react63.useRef)(null);
|
|
10437
|
+
const previousErrorRef = (0, import_react63.useRef)(null);
|
|
10226
10438
|
const dispatch = (0, import_react_redux47.useDispatch)();
|
|
10227
10439
|
const explorerUrl = (0, import_react_redux46.useSelector)(selectKimaExplorer);
|
|
10228
10440
|
const mode = (0, import_react_redux46.useSelector)(selectMode);
|
|
@@ -10242,7 +10454,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10242
10454
|
const backendUrl = (0, import_react_redux46.useSelector)(selectBackendUrl);
|
|
10243
10455
|
const isSwapByPegged = sourceSymbol !== targetSymbol && !isSamePeggedToken(sourceChain, sourceSymbol, targetChain, targetSymbol);
|
|
10244
10456
|
const widgetIsSwap = mode === "status" /* status */ ? statusTxType === "swap" : isSwapByPegged;
|
|
10245
|
-
const steps = (0,
|
|
10457
|
+
const steps = (0, import_react63.useMemo)(
|
|
10246
10458
|
() => widgetIsSwap ? SWAP_STEPS : TRANSFER_STEPS,
|
|
10247
10459
|
[widgetIsSwap]
|
|
10248
10460
|
);
|
|
@@ -10254,7 +10466,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10254
10466
|
panelRef,
|
|
10255
10467
|
formatTime: formatToastTime
|
|
10256
10468
|
} = useToastHistory();
|
|
10257
|
-
(0,
|
|
10469
|
+
(0, import_react63.useEffect)(() => {
|
|
10258
10470
|
windowWidth === 0 && updateWidth(window.innerWidth);
|
|
10259
10471
|
}, [windowWidth, updateWidth]);
|
|
10260
10472
|
const safeTxId = typeof txId === "string" || typeof txId === "number" ? txId : -1;
|
|
@@ -10264,49 +10476,49 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10264
10476
|
backendUrl,
|
|
10265
10477
|
widgetIsSwap
|
|
10266
10478
|
);
|
|
10267
|
-
const transactionSourceChain = (0,
|
|
10479
|
+
const transactionSourceChain = (0, import_react63.useMemo)(
|
|
10268
10480
|
() => networks.find(
|
|
10269
10481
|
(network) => network.shortName === (mode === "status" /* status */ ? data?.sourceChain : sourceChain.shortName)
|
|
10270
10482
|
),
|
|
10271
10483
|
[data, mode, sourceChain, networks]
|
|
10272
10484
|
);
|
|
10273
|
-
const transactionTargetChain = (0,
|
|
10485
|
+
const transactionTargetChain = (0, import_react63.useMemo)(
|
|
10274
10486
|
() => networks.find(
|
|
10275
10487
|
(network) => network.shortName === (mode === "status" /* status */ ? data?.targetChain : targetChain.shortName)
|
|
10276
10488
|
),
|
|
10277
10489
|
[data, mode, targetChain, networks]
|
|
10278
10490
|
);
|
|
10279
|
-
const isValidTxId = (0,
|
|
10491
|
+
const isValidTxId = (0, import_react63.useMemo)(() => {
|
|
10280
10492
|
return !(safeTxId === -1 || typeof safeTxId === "string" && safeTxId.length === 0);
|
|
10281
10493
|
}, [safeTxId]);
|
|
10282
|
-
const isEmptyStatus = (0,
|
|
10494
|
+
const isEmptyStatus = (0, import_react63.useMemo)(() => {
|
|
10283
10495
|
if (!data) return true;
|
|
10284
10496
|
return data?.amount === "";
|
|
10285
10497
|
}, [data]);
|
|
10286
10498
|
const showFetchingTitle = isValidTxId && isEmptyStatus;
|
|
10287
|
-
(0,
|
|
10499
|
+
(0, import_react63.useEffect)(() => {
|
|
10288
10500
|
if (!data || data.status !== "Completed" /* COMPLETED */) return;
|
|
10289
10501
|
successHandler && successHandler({
|
|
10290
10502
|
txId: safeTxId
|
|
10291
10503
|
});
|
|
10292
10504
|
}, [data, successHandler, safeTxId]);
|
|
10293
|
-
(0,
|
|
10505
|
+
(0, import_react63.useEffect)(() => {
|
|
10294
10506
|
if (!data) return;
|
|
10295
10507
|
if (data.status === "Completed" /* COMPLETED */) {
|
|
10296
10508
|
setIsComplete(true);
|
|
10297
10509
|
}
|
|
10298
10510
|
}, [data]);
|
|
10299
|
-
(0,
|
|
10511
|
+
(0, import_react63.useEffect)(() => {
|
|
10300
10512
|
const nextError = error ? String(error) : null;
|
|
10301
10513
|
if (!nextError || previousErrorRef.current === nextError) return;
|
|
10302
10514
|
previousErrorRef.current = nextError;
|
|
10303
10515
|
if (error)
|
|
10304
10516
|
import_react_hot_toast4.toast.error(
|
|
10305
10517
|
"The provided transaction id is not valid, please use a different one or contact support for further assistance",
|
|
10306
|
-
{ icon: /* @__PURE__ */ (0,
|
|
10518
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Error_default, {}) }
|
|
10307
10519
|
);
|
|
10308
10520
|
}, [error]);
|
|
10309
|
-
(0,
|
|
10521
|
+
(0, import_react63.useEffect)(() => {
|
|
10310
10522
|
const raw = normalizeStatus(data?.status);
|
|
10311
10523
|
const s = compactStatus(raw);
|
|
10312
10524
|
const statusChanged = didStatusChange(previousStatusRef.current, raw);
|
|
@@ -10334,7 +10546,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10334
10546
|
setStep(1);
|
|
10335
10547
|
setErrorStep(1);
|
|
10336
10548
|
setLoadingStep(-1);
|
|
10337
|
-
if (statusChanged) import_react_hot_toast4.toast.error("Unavailable", { icon: /* @__PURE__ */ (0,
|
|
10549
|
+
if (statusChanged) import_react_hot_toast4.toast.error("Unavailable", { icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Error_default, {}) });
|
|
10338
10550
|
setErrorMessage("Unavailable");
|
|
10339
10551
|
previousStatusRef.current = raw;
|
|
10340
10552
|
return;
|
|
@@ -10345,7 +10557,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10345
10557
|
setLoadingStep(-1);
|
|
10346
10558
|
if (statusChanged) {
|
|
10347
10559
|
import_react_hot_toast4.toast.error("Failed to pull tokens from source!", {
|
|
10348
|
-
icon: /* @__PURE__ */ (0,
|
|
10560
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Error_default, {})
|
|
10349
10561
|
});
|
|
10350
10562
|
}
|
|
10351
10563
|
setErrorMessage("Failed to pull tokens from source!");
|
|
@@ -10358,7 +10570,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10358
10570
|
setLoadingStep(-1);
|
|
10359
10571
|
if (statusChanged) {
|
|
10360
10572
|
import_react_hot_toast4.toast.error("Failed to release tokens to target!", {
|
|
10361
|
-
icon: /* @__PURE__ */ (0,
|
|
10573
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Error_default, {})
|
|
10362
10574
|
});
|
|
10363
10575
|
}
|
|
10364
10576
|
setErrorMessage("Failed to release tokens to target!");
|
|
@@ -10371,7 +10583,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10371
10583
|
if (statusChanged) {
|
|
10372
10584
|
import_react_hot_toast4.toast.error(
|
|
10373
10585
|
"Failed to release tokens to target! Starting refund process.",
|
|
10374
|
-
{ icon: /* @__PURE__ */ (0,
|
|
10586
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Error_default, {}) }
|
|
10375
10587
|
);
|
|
10376
10588
|
}
|
|
10377
10589
|
setErrorMessage(
|
|
@@ -10386,7 +10598,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10386
10598
|
setLoadingStep(-1);
|
|
10387
10599
|
if (statusChanged) {
|
|
10388
10600
|
import_react_hot_toast4.toast.error("Failed to refund tokens to source!", {
|
|
10389
|
-
icon: /* @__PURE__ */ (0,
|
|
10601
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Error_default, {})
|
|
10390
10602
|
});
|
|
10391
10603
|
}
|
|
10392
10604
|
setErrorMessage("Failed to refund tokens to source!");
|
|
@@ -10398,7 +10610,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10398
10610
|
setErrorStep(3);
|
|
10399
10611
|
setLoadingStep(-1);
|
|
10400
10612
|
if (statusChanged) {
|
|
10401
|
-
import_react_hot_toast4.toast.success("Refund completed!", { icon: /* @__PURE__ */ (0,
|
|
10613
|
+
import_react_hot_toast4.toast.success("Refund completed!", { icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Error_default, {}) });
|
|
10402
10614
|
}
|
|
10403
10615
|
setErrorMessage("Refund completed!");
|
|
10404
10616
|
previousStatusRef.current = raw;
|
|
@@ -10453,14 +10665,14 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10453
10665
|
}
|
|
10454
10666
|
previousStatusRef.current = raw;
|
|
10455
10667
|
}, [data?.status, widgetIsSwap]);
|
|
10456
|
-
const verb = (0,
|
|
10668
|
+
const verb = (0, import_react63.useMemo)(() => {
|
|
10457
10669
|
if (mode === "status" /* status */) {
|
|
10458
10670
|
if (isEmptyStatus) return "Fetching transaction status ";
|
|
10459
10671
|
return data?.status?.toUpperCase?.() === "Completed" /* COMPLETED */ ? widgetIsSwap ? "Swapped " : "Transferred " : widgetIsSwap ? "Swapping " : "Transfering ";
|
|
10460
10672
|
}
|
|
10461
10673
|
return data?.status?.toUpperCase?.() === "Completed" /* COMPLETED */ ? widgetIsSwap ? "Swapped " : "Transferred " : widgetIsSwap ? "Swapping " : "Transfering ";
|
|
10462
10674
|
}, [mode, data?.status, isEmptyStatus, widgetIsSwap]);
|
|
10463
|
-
const originChargeAmount = (0,
|
|
10675
|
+
const originChargeAmount = (0, import_react63.useMemo)(() => {
|
|
10464
10676
|
const submit = txValues.submitAmount;
|
|
10465
10677
|
const feeInSubmitDec = bigIntChangeDecimals({
|
|
10466
10678
|
...totalFee,
|
|
@@ -10469,7 +10681,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10469
10681
|
const val = feeDeduct ? submit.value : submit.value + feeInSubmitDec.value;
|
|
10470
10682
|
return { value: val, decimals: submit.decimals };
|
|
10471
10683
|
}, [txValues.submitAmount, totalFee, feeDeduct]);
|
|
10472
|
-
const { leftAmt, rightAmt, leftSym, rightSym } = (0,
|
|
10684
|
+
const { leftAmt, rightAmt, leftSym, rightSym } = (0, import_react63.useMemo)(() => {
|
|
10473
10685
|
if (mode === "status" /* status */) {
|
|
10474
10686
|
if (widgetIsSwap) {
|
|
10475
10687
|
const amountIn = data?.amountIn;
|
|
@@ -10567,7 +10779,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10567
10779
|
logger_default.debug("[TransactionWidget] reset failed", e);
|
|
10568
10780
|
import_react_hot_toast4.toast.error(
|
|
10569
10781
|
"Unable to reset the transaction view. Please contact support for assistance.",
|
|
10570
|
-
{ icon: /* @__PURE__ */ (0,
|
|
10782
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Error_default, {}) }
|
|
10571
10783
|
);
|
|
10572
10784
|
}
|
|
10573
10785
|
};
|
|
@@ -10577,7 +10789,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10577
10789
|
const swapDstAmtLabel = formatTruncMaxDecimals(swapDstAmt, 4);
|
|
10578
10790
|
const swapSrcSymLabel = displaySymbol(data?.sourceSymbol ?? sourceSymbol);
|
|
10579
10791
|
const swapDstSymLabel = displaySymbol(data?.targetSymbol ?? targetSymbol);
|
|
10580
|
-
return /* @__PURE__ */ (0,
|
|
10792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react_redux45.Provider, { store: store_default, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10581
10793
|
"div",
|
|
10582
10794
|
{
|
|
10583
10795
|
className: `kima-card transaction-card ${isComplete ? "transaction-complete" : ""} ${theme.colorMode} ${minimized ? "minimized" : ""}`,
|
|
@@ -10585,9 +10797,10 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10585
10797
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
10586
10798
|
},
|
|
10587
10799
|
children: [
|
|
10588
|
-
/* @__PURE__ */ (0,
|
|
10589
|
-
|
|
10590
|
-
|
|
10800
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(VersionInfo_default, { theme }),
|
|
10801
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "kima-card-header", children: [
|
|
10802
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "topbar", children: [
|
|
10803
|
+
!isComplete && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "title", children: isValidTxId && !error ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "transaction-title", children: showFetchingTitle ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_jsx_runtime82.Fragment, { children: "Getting transaction details\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
10591
10804
|
verb,
|
|
10592
10805
|
leftAmt,
|
|
10593
10806
|
" ",
|
|
@@ -10596,13 +10809,13 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10596
10809
|
rightAmt,
|
|
10597
10810
|
" ",
|
|
10598
10811
|
rightSym
|
|
10599
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
10600
|
-
!minimized ? /* @__PURE__ */ (0,
|
|
10812
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h3", { className: "transaction", children: "Transaction Status" }) }) }),
|
|
10813
|
+
!minimized ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10601
10814
|
"div",
|
|
10602
10815
|
{
|
|
10603
10816
|
className: `control-buttons ${isComplete ? "complete" : ""}`,
|
|
10604
10817
|
children: [
|
|
10605
|
-
isComplete && /* @__PURE__ */ (0,
|
|
10818
|
+
isComplete && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10606
10819
|
"button",
|
|
10607
10820
|
{
|
|
10608
10821
|
className: "menu-button",
|
|
@@ -10611,41 +10824,41 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10611
10824
|
children: "< Back"
|
|
10612
10825
|
}
|
|
10613
10826
|
),
|
|
10614
|
-
/* @__PURE__ */ (0,
|
|
10827
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10615
10828
|
"button",
|
|
10616
10829
|
{
|
|
10617
10830
|
className: "icon-button minimize",
|
|
10618
10831
|
onClick: () => setMinimized(true),
|
|
10619
|
-
children: /* @__PURE__ */ (0,
|
|
10832
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Minimize_default, {})
|
|
10620
10833
|
}
|
|
10621
10834
|
),
|
|
10622
|
-
!isComplete && (!isValidTxId || loadingStep < 0 || error && dAppOption !== "none" /* None */) ? /* @__PURE__ */ (0,
|
|
10623
|
-
toastHistory.length > 0 && /* @__PURE__ */ (0,
|
|
10835
|
+
!isComplete && (!isValidTxId || loadingStep < 0 || error && dAppOption !== "none" /* None */) ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("button", { className: "reset-button", onClick: resetForm, children: "Reset" }) : null,
|
|
10836
|
+
toastHistory.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10624
10837
|
"div",
|
|
10625
10838
|
{
|
|
10626
10839
|
ref: panelRef,
|
|
10627
10840
|
className: `toast-history ${theme.colorMode}`,
|
|
10628
10841
|
children: [
|
|
10629
|
-
/* @__PURE__ */ (0,
|
|
10842
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10630
10843
|
"button",
|
|
10631
10844
|
{
|
|
10632
10845
|
className: "toast-history-button",
|
|
10633
10846
|
onClick: () => setToastPanelOpen(true),
|
|
10634
10847
|
"aria-label": "Notifications",
|
|
10635
|
-
children: /* @__PURE__ */ (0,
|
|
10848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Notification_default, {})
|
|
10636
10849
|
}
|
|
10637
10850
|
),
|
|
10638
|
-
toastPanelOpen && /* @__PURE__ */ (0,
|
|
10639
|
-
/* @__PURE__ */ (0,
|
|
10640
|
-
/* @__PURE__ */ (0,
|
|
10641
|
-
/* @__PURE__ */ (0,
|
|
10642
|
-
/* @__PURE__ */ (0,
|
|
10851
|
+
toastPanelOpen && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: `toast-history-panel ${theme.colorMode}`, children: [
|
|
10852
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "toast-history-header", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: "Notifications" }) }),
|
|
10853
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "toast-history-list", children: toastHistory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "toast-history-item", children: [
|
|
10854
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "toast-history-message", children: item.message }),
|
|
10855
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "toast-history-time", children: formatToastTime(item.time) })
|
|
10643
10856
|
] }, item.id)) })
|
|
10644
10857
|
] })
|
|
10645
10858
|
]
|
|
10646
10859
|
}
|
|
10647
10860
|
),
|
|
10648
|
-
closeHandler && /* @__PURE__ */ (0,
|
|
10861
|
+
closeHandler && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10649
10862
|
"button",
|
|
10650
10863
|
{
|
|
10651
10864
|
className: "cross-icon-button",
|
|
@@ -10653,44 +10866,44 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10653
10866
|
resetForm();
|
|
10654
10867
|
closeHandler(0);
|
|
10655
10868
|
},
|
|
10656
|
-
children: /* @__PURE__ */ (0,
|
|
10869
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Cross_default, {})
|
|
10657
10870
|
}
|
|
10658
10871
|
)
|
|
10659
10872
|
]
|
|
10660
10873
|
}
|
|
10661
|
-
) : /* @__PURE__ */ (0,
|
|
10874
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "control-buttons", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "maximize", onClick: () => setMinimized(false), children: "View" }) })
|
|
10662
10875
|
] }),
|
|
10663
|
-
data && !isComplete && /* @__PURE__ */ (0,
|
|
10664
|
-
/* @__PURE__ */ (0,
|
|
10665
|
-
/* @__PURE__ */ (0,
|
|
10876
|
+
data && !isComplete && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "header-network-labels", children: [
|
|
10877
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: `kima-card-network-label ${theme.colorMode}`, children: [
|
|
10878
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10666
10879
|
ChainIcon,
|
|
10667
10880
|
{
|
|
10668
10881
|
symbol: transactionSourceChain?.shortName
|
|
10669
10882
|
}
|
|
10670
10883
|
),
|
|
10671
|
-
windowWidth > 450 && /* @__PURE__ */ (0,
|
|
10884
|
+
windowWidth > 450 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h3", { children: transactionSourceChain?.name })
|
|
10672
10885
|
] }),
|
|
10673
|
-
/* @__PURE__ */ (0,
|
|
10886
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10674
10887
|
"div",
|
|
10675
10888
|
{
|
|
10676
10889
|
style: { display: "inline-block", transform: "rotate(-90deg)" },
|
|
10677
|
-
children: /* @__PURE__ */ (0,
|
|
10890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Arrow_default, { width: 25, height: 25 })
|
|
10678
10891
|
}
|
|
10679
10892
|
),
|
|
10680
|
-
/* @__PURE__ */ (0,
|
|
10681
|
-
/* @__PURE__ */ (0,
|
|
10893
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: `kima-card-network-label ${theme.colorMode}`, children: [
|
|
10894
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10682
10895
|
ChainIcon,
|
|
10683
10896
|
{
|
|
10684
10897
|
symbol: transactionTargetChain?.shortName
|
|
10685
10898
|
}
|
|
10686
10899
|
),
|
|
10687
|
-
windowWidth > 450 && /* @__PURE__ */ (0,
|
|
10900
|
+
windowWidth > 450 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h3", { children: transactionTargetChain?.name })
|
|
10688
10901
|
] })
|
|
10689
10902
|
] })
|
|
10690
10903
|
] }),
|
|
10691
|
-
isValidTxId && (mode !== "status" /* status */ || !error) ? /* @__PURE__ */ (0,
|
|
10692
|
-
!isComplete ? /* @__PURE__ */ (0,
|
|
10693
|
-
/* @__PURE__ */ (0,
|
|
10904
|
+
isValidTxId && (mode !== "status" /* status */ || !error) ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "kima-card-content", children: [
|
|
10905
|
+
!isComplete ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "transaction-content", children: [
|
|
10906
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10694
10907
|
Progressbar_default,
|
|
10695
10908
|
{
|
|
10696
10909
|
step,
|
|
@@ -10701,7 +10914,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10701
10914
|
steps
|
|
10702
10915
|
}
|
|
10703
10916
|
),
|
|
10704
|
-
/* @__PURE__ */ (0,
|
|
10917
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10705
10918
|
StepBox_default,
|
|
10706
10919
|
{
|
|
10707
10920
|
step,
|
|
@@ -10711,15 +10924,15 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10711
10924
|
steps
|
|
10712
10925
|
}
|
|
10713
10926
|
)
|
|
10714
|
-
] }) : /* @__PURE__ */ (0,
|
|
10715
|
-
/* @__PURE__ */ (0,
|
|
10716
|
-
/* @__PURE__ */ (0,
|
|
10717
|
-
/* @__PURE__ */ (0,
|
|
10927
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "transaction-content transaction-complete", children: [
|
|
10928
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TransactionComplete_default, {}),
|
|
10929
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h2", { children: widgetIsSwap ? "Swap Complete" : "Transaction Complete" }),
|
|
10930
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "kima-stepbox", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10718
10931
|
"div",
|
|
10719
10932
|
{
|
|
10720
10933
|
className: `content-wrapper transaction-complete ${theme.colorMode}`,
|
|
10721
10934
|
children: [
|
|
10722
|
-
/* @__PURE__ */ (0,
|
|
10935
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { children: widgetIsSwap ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
10723
10936
|
"You just swapped ",
|
|
10724
10937
|
swapSrcAmtLabel,
|
|
10725
10938
|
" ",
|
|
@@ -10729,50 +10942,50 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10729
10942
|
swapDstAmtLabel,
|
|
10730
10943
|
" ",
|
|
10731
10944
|
swapDstSymLabel
|
|
10732
|
-
] }) : /* @__PURE__ */ (0,
|
|
10945
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
10733
10946
|
"You just transferred ",
|
|
10734
10947
|
data?.amount,
|
|
10735
10948
|
" ",
|
|
10736
10949
|
displaySymbol(data?.sourceSymbol)
|
|
10737
10950
|
] }) }),
|
|
10738
|
-
/* @__PURE__ */ (0,
|
|
10739
|
-
/* @__PURE__ */ (0,
|
|
10951
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "header-network-labels", children: [
|
|
10952
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10740
10953
|
"div",
|
|
10741
10954
|
{
|
|
10742
10955
|
className: `kima-card-network-label ${theme.colorMode}`,
|
|
10743
10956
|
children: [
|
|
10744
|
-
/* @__PURE__ */ (0,
|
|
10957
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10745
10958
|
ChainIcon,
|
|
10746
10959
|
{
|
|
10747
10960
|
symbol: transactionSourceChain?.shortName
|
|
10748
10961
|
}
|
|
10749
10962
|
),
|
|
10750
|
-
windowWidth > 450 && /* @__PURE__ */ (0,
|
|
10963
|
+
windowWidth > 450 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h3", { children: transactionSourceChain?.name })
|
|
10751
10964
|
]
|
|
10752
10965
|
}
|
|
10753
10966
|
),
|
|
10754
|
-
/* @__PURE__ */ (0,
|
|
10967
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10755
10968
|
"div",
|
|
10756
10969
|
{
|
|
10757
10970
|
style: {
|
|
10758
10971
|
display: "inline-block",
|
|
10759
10972
|
transform: "rotate(-90deg)"
|
|
10760
10973
|
},
|
|
10761
|
-
children: /* @__PURE__ */ (0,
|
|
10974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Arrow_default, { width: 25, height: 25 })
|
|
10762
10975
|
}
|
|
10763
10976
|
),
|
|
10764
|
-
/* @__PURE__ */ (0,
|
|
10977
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10765
10978
|
"div",
|
|
10766
10979
|
{
|
|
10767
10980
|
className: `kima-card-network-label ${theme.colorMode}`,
|
|
10768
10981
|
children: [
|
|
10769
|
-
/* @__PURE__ */ (0,
|
|
10982
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10770
10983
|
ChainIcon,
|
|
10771
10984
|
{
|
|
10772
10985
|
symbol: transactionTargetChain?.shortName
|
|
10773
10986
|
}
|
|
10774
10987
|
),
|
|
10775
|
-
windowWidth > 450 && /* @__PURE__ */ (0,
|
|
10988
|
+
windowWidth > 450 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h3", { children: transactionTargetChain?.name })
|
|
10776
10989
|
]
|
|
10777
10990
|
}
|
|
10778
10991
|
)
|
|
@@ -10780,8 +10993,8 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10780
10993
|
]
|
|
10781
10994
|
}
|
|
10782
10995
|
) }),
|
|
10783
|
-
/* @__PURE__ */ (0,
|
|
10784
|
-
/* @__PURE__ */ (0,
|
|
10996
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "transaction-buttons", children: [
|
|
10997
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10785
10998
|
SecondaryButton_default,
|
|
10786
10999
|
{
|
|
10787
11000
|
clickHandler: resetForm,
|
|
@@ -10789,25 +11002,25 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10789
11002
|
children: "New Transaction"
|
|
10790
11003
|
}
|
|
10791
11004
|
),
|
|
10792
|
-
/* @__PURE__ */ (0,
|
|
11005
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10793
11006
|
ExternalLink_default,
|
|
10794
11007
|
{
|
|
10795
11008
|
to: `${explorerUrl}/transactions/?tx=${data?.kimaTxHash}`,
|
|
10796
|
-
children: /* @__PURE__ */ (0,
|
|
11009
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(PrimaryButton_default, { children: "View Details" })
|
|
10797
11010
|
}
|
|
10798
11011
|
)
|
|
10799
11012
|
] })
|
|
10800
11013
|
] }),
|
|
10801
|
-
!error && !isEmptyStatus && !isComplete && /* @__PURE__ */ (0,
|
|
11014
|
+
!error && !isEmptyStatus && !isComplete && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10802
11015
|
TransactionStatusMessage_default,
|
|
10803
11016
|
{
|
|
10804
11017
|
isCompleted: data?.status,
|
|
10805
11018
|
transactionId: String(safeTxId)
|
|
10806
11019
|
}
|
|
10807
11020
|
)
|
|
10808
|
-
] }) : /* @__PURE__ */ (0,
|
|
10809
|
-
/* @__PURE__ */ (0,
|
|
10810
|
-
/* @__PURE__ */ (0,
|
|
11021
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "kima-card-content", children: [
|
|
11022
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h4", { className: "subtitle", children: "You can follow the status of a previous submitted transaction by entering the provided transaction id" }),
|
|
11023
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "single-form", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10811
11024
|
TransactionSearch_default,
|
|
10812
11025
|
{
|
|
10813
11026
|
isSwap: statusTxType === "swap",
|
|
@@ -10815,7 +11028,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10815
11028
|
}
|
|
10816
11029
|
) })
|
|
10817
11030
|
] }),
|
|
10818
|
-
/* @__PURE__ */ (0,
|
|
11031
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10819
11032
|
import_react_hot_toast4.Toaster,
|
|
10820
11033
|
{
|
|
10821
11034
|
position: "top-right",
|
|
@@ -10840,13 +11053,13 @@ var TransactionWidget = ({ theme }) => {
|
|
|
10840
11053
|
}
|
|
10841
11054
|
}
|
|
10842
11055
|
),
|
|
10843
|
-
/* @__PURE__ */ (0,
|
|
11056
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10844
11057
|
"div",
|
|
10845
11058
|
{
|
|
10846
11059
|
className: `floating-footer ${isComplete ? "complete" : "status"}`,
|
|
10847
|
-
children: /* @__PURE__ */ (0,
|
|
10848
|
-
/* @__PURE__ */ (0,
|
|
10849
|
-
/* @__PURE__ */ (0,
|
|
11060
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: `items ${theme.colorMode}`, children: [
|
|
11061
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: "Powered by" }),
|
|
11062
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(KimaNetwork_default, {})
|
|
10850
11063
|
] })
|
|
10851
11064
|
}
|
|
10852
11065
|
)
|
|
@@ -11332,7 +11545,7 @@ var useSubmitTransaction = (isSubmitting, setIsSubmitting) => {
|
|
|
11332
11545
|
var useSubmitTransaction_default = useSubmitTransaction;
|
|
11333
11546
|
|
|
11334
11547
|
// src/widgets/transfer/hooks/useValidateTransaction.tsx
|
|
11335
|
-
var
|
|
11548
|
+
var import_react64 = require("react");
|
|
11336
11549
|
var import_react_redux50 = require("react-redux");
|
|
11337
11550
|
|
|
11338
11551
|
// src/widgets/transfer/lib/validation.ts
|
|
@@ -11517,11 +11730,11 @@ var useValidateTransaction = (inputs) => {
|
|
|
11517
11730
|
const tgtNet = (0, import_react_redux50.useSelector)(selectTargetChain);
|
|
11518
11731
|
const srcCur = (0, import_react_redux50.useSelector)(selectSourceCurrency);
|
|
11519
11732
|
const tgtCur = (0, import_react_redux50.useSelector)(selectTargetCurrency);
|
|
11520
|
-
const isSwap = (0,
|
|
11733
|
+
const isSwap = (0, import_react64.useMemo)(
|
|
11521
11734
|
() => srcCur !== tgtCur && !isSamePeggedToken(srcNet, srcCur, tgtNet, tgtCur),
|
|
11522
11735
|
[srcNet, srcCur, tgtNet, tgtCur]
|
|
11523
11736
|
);
|
|
11524
|
-
const sourceToken = (0,
|
|
11737
|
+
const sourceToken = (0, import_react64.useMemo)(
|
|
11525
11738
|
() => srcNet.supportedTokens?.find((token) => token.symbol === srcCur),
|
|
11526
11739
|
[srcNet, srcCur]
|
|
11527
11740
|
);
|
|
@@ -11560,13 +11773,13 @@ var useValidateTransaction = (inputs) => {
|
|
|
11560
11773
|
var useValidateTransaction_default = useValidateTransaction;
|
|
11561
11774
|
|
|
11562
11775
|
// src/widgets/transfer/components/TransferWidget.tsx
|
|
11563
|
-
var
|
|
11776
|
+
var import_react80 = require("react");
|
|
11564
11777
|
var import_react_hot_toast12 = __toESM(require("react-hot-toast"), 1);
|
|
11565
11778
|
var import_react_redux66 = require("react-redux");
|
|
11566
11779
|
var import_viem13 = require("viem");
|
|
11567
11780
|
|
|
11568
11781
|
// src/components/reusable/WarningModal.tsx
|
|
11569
|
-
var
|
|
11782
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
11570
11783
|
var WarningModal = ({
|
|
11571
11784
|
message,
|
|
11572
11785
|
cancelButtonText = "Cancel",
|
|
@@ -11574,11 +11787,11 @@ var WarningModal = ({
|
|
|
11574
11787
|
onAcknowledge,
|
|
11575
11788
|
onCancel
|
|
11576
11789
|
}) => {
|
|
11577
|
-
return /* @__PURE__ */ (0,
|
|
11578
|
-
/* @__PURE__ */ (0,
|
|
11579
|
-
/* @__PURE__ */ (0,
|
|
11580
|
-
/* @__PURE__ */ (0,
|
|
11581
|
-
/* @__PURE__ */ (0,
|
|
11790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "warning-modal-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "warning-modal", children: [
|
|
11791
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("h3", { children: "Warning" }),
|
|
11792
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("p", { children: message }),
|
|
11793
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "warning-modal-buttons", children: [
|
|
11794
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
11582
11795
|
SecondaryButton_default,
|
|
11583
11796
|
{
|
|
11584
11797
|
className: "warning-modal-cancel",
|
|
@@ -11586,7 +11799,7 @@ var WarningModal = ({
|
|
|
11586
11799
|
children: cancelButtonText
|
|
11587
11800
|
}
|
|
11588
11801
|
),
|
|
11589
|
-
/* @__PURE__ */ (0,
|
|
11802
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
11590
11803
|
PrimaryButton_default,
|
|
11591
11804
|
{
|
|
11592
11805
|
className: "warning-modal-acknowledge",
|
|
@@ -11601,21 +11814,21 @@ var WarningModal_default = WarningModal;
|
|
|
11601
11814
|
|
|
11602
11815
|
// src/components/reusable/SingleForm.tsx
|
|
11603
11816
|
var import_viem12 = require("viem");
|
|
11604
|
-
var
|
|
11817
|
+
var import_react66 = require("react");
|
|
11605
11818
|
var import_react_hot_toast5 = require("react-hot-toast");
|
|
11606
11819
|
var import_react_redux52 = require("react-redux");
|
|
11607
11820
|
|
|
11608
11821
|
// src/components/primary/NetworkSelector.tsx
|
|
11609
|
-
var
|
|
11822
|
+
var import_react65 = __toESM(require("react"), 1);
|
|
11610
11823
|
var import_react_redux51 = require("react-redux");
|
|
11611
|
-
var
|
|
11824
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
11612
11825
|
var NetworkSelector = ({
|
|
11613
11826
|
type,
|
|
11614
11827
|
initialSelection,
|
|
11615
11828
|
setInitialSelection
|
|
11616
11829
|
}) => {
|
|
11617
|
-
const [collapsed, setCollapsed] = (0,
|
|
11618
|
-
const ref = (0,
|
|
11830
|
+
const [collapsed, setCollapsed] = (0, import_react65.useState)(true);
|
|
11831
|
+
const ref = (0, import_react65.useRef)(null);
|
|
11619
11832
|
const dispatch = (0, import_react_redux51.useDispatch)();
|
|
11620
11833
|
const theme = (0, import_react_redux51.useSelector)(selectTheme);
|
|
11621
11834
|
const networkOptions = (0, import_react_redux51.useSelector)(selectNetworks);
|
|
@@ -11631,7 +11844,7 @@ var NetworkSelector = ({
|
|
|
11631
11844
|
const currentTargetAddr = (0, import_react_redux51.useSelector)(selectTargetAddress);
|
|
11632
11845
|
const { switchChainHandler } = useKimaContext();
|
|
11633
11846
|
const isOriginSelector = type === "origin";
|
|
11634
|
-
(0,
|
|
11847
|
+
(0, import_react65.useEffect)(() => {
|
|
11635
11848
|
logger_default.info("[NetworkSelector] mount", {
|
|
11636
11849
|
type,
|
|
11637
11850
|
mode,
|
|
@@ -11640,7 +11853,7 @@ var NetworkSelector = ({
|
|
|
11640
11853
|
targetShort: targetNetwork?.shortName
|
|
11641
11854
|
});
|
|
11642
11855
|
}, []);
|
|
11643
|
-
const networks = (0,
|
|
11856
|
+
const networks = (0, import_react65.useMemo)(() => {
|
|
11644
11857
|
const result = networkOptions.filter((network) => {
|
|
11645
11858
|
if (dAppOption !== "none" /* None */ && network.shortName === "CC")
|
|
11646
11859
|
return false;
|
|
@@ -11668,7 +11881,7 @@ var NetworkSelector = ({
|
|
|
11668
11881
|
isOriginSelector
|
|
11669
11882
|
]);
|
|
11670
11883
|
const shouldLockSourceNetwork = isOriginSelector && mode === "payment" /* payment */ && dAppOption !== "none" /* None */ && !!transactionOption?.targetChain;
|
|
11671
|
-
const selectedNetwork = (0,
|
|
11884
|
+
const selectedNetwork = (0, import_react65.useMemo)(() => {
|
|
11672
11885
|
if (shouldLockSourceNetwork) {
|
|
11673
11886
|
const forced = networks.find(
|
|
11674
11887
|
(n) => n.shortName === transactionOption.targetChain
|
|
@@ -11707,8 +11920,8 @@ var NetworkSelector = ({
|
|
|
11707
11920
|
shouldLockSourceNetwork,
|
|
11708
11921
|
transactionOption?.targetChain
|
|
11709
11922
|
]);
|
|
11710
|
-
const lastForcedShort = (0,
|
|
11711
|
-
(0,
|
|
11923
|
+
const lastForcedShort = (0, import_react65.useRef)();
|
|
11924
|
+
(0, import_react65.useEffect)(() => {
|
|
11712
11925
|
if (!shouldLockSourceNetwork || !isOriginSelector || !transactionOption?.targetChain)
|
|
11713
11926
|
return;
|
|
11714
11927
|
const forcedNetwork = networks.find(
|
|
@@ -11823,7 +12036,7 @@ var NetworkSelector = ({
|
|
|
11823
12036
|
}
|
|
11824
12037
|
setCollapsed(true);
|
|
11825
12038
|
};
|
|
11826
|
-
(0,
|
|
12039
|
+
(0, import_react65.useEffect)(() => {
|
|
11827
12040
|
const handleOutsideClick = (e) => {
|
|
11828
12041
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
11829
12042
|
setCollapsed(true);
|
|
@@ -11832,7 +12045,7 @@ var NetworkSelector = ({
|
|
|
11832
12045
|
document.addEventListener("mousedown", handleOutsideClick);
|
|
11833
12046
|
return () => document.removeEventListener("mousedown", handleOutsideClick);
|
|
11834
12047
|
}, []);
|
|
11835
|
-
(0,
|
|
12048
|
+
(0, import_react65.useEffect)(() => {
|
|
11836
12049
|
if (mode !== "light" /* light */) return;
|
|
11837
12050
|
let srcDemo = "";
|
|
11838
12051
|
if (isEVMChain(sourceNetwork.shortName)) srcDemo = lightDemoAccounts.EVM;
|
|
@@ -11864,7 +12077,7 @@ var NetworkSelector = ({
|
|
|
11864
12077
|
currentTargetAddr,
|
|
11865
12078
|
dispatch
|
|
11866
12079
|
]);
|
|
11867
|
-
return /* @__PURE__ */ (0,
|
|
12080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
11868
12081
|
"div",
|
|
11869
12082
|
{
|
|
11870
12083
|
className: `network-dropdown ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"} ${shouldLockSourceNetwork ? "disabled" : ""}`,
|
|
@@ -11873,15 +12086,15 @@ var NetworkSelector = ({
|
|
|
11873
12086
|
},
|
|
11874
12087
|
ref,
|
|
11875
12088
|
children: [
|
|
11876
|
-
/* @__PURE__ */ (0,
|
|
11877
|
-
/* @__PURE__ */ (0,
|
|
11878
|
-
/* @__PURE__ */ (0,
|
|
12089
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "network-wrapper", children: [
|
|
12090
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(ChainIcon, { symbol: selectedNetwork.shortName }),
|
|
12091
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: selectedNetwork.name })
|
|
11879
12092
|
] }),
|
|
11880
|
-
/* @__PURE__ */ (0,
|
|
12093
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
11881
12094
|
"div",
|
|
11882
12095
|
{
|
|
11883
12096
|
className: `network-menu custom-scrollbar ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"}`,
|
|
11884
|
-
children: networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */ (0,
|
|
12097
|
+
children: networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
11885
12098
|
"div",
|
|
11886
12099
|
{
|
|
11887
12100
|
className: `network-menu-item ${theme?.colorMode ?? ""} ${network.disabled ? "disabled has-tooltip" : "enabled"}`,
|
|
@@ -11890,24 +12103,24 @@ var NetworkSelector = ({
|
|
|
11890
12103
|
if (!network.disabled) handleNetworkChange(network);
|
|
11891
12104
|
},
|
|
11892
12105
|
children: [
|
|
11893
|
-
network.disabled ? /* @__PURE__ */ (0,
|
|
11894
|
-
/* @__PURE__ */ (0,
|
|
11895
|
-
network.disabled && /* @__PURE__ */ (0,
|
|
12106
|
+
network.disabled ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Warning_default, { width: 25, height: 25 }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(ChainIcon, { symbol: network.shortName }),
|
|
12107
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { children: network.name }),
|
|
12108
|
+
network.disabled && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "tooltip", children: "Temporarily unavailable" })
|
|
11896
12109
|
]
|
|
11897
12110
|
},
|
|
11898
12111
|
`${network.shortName}-${network.name}`
|
|
11899
12112
|
))
|
|
11900
12113
|
}
|
|
11901
12114
|
),
|
|
11902
|
-
!shouldLockSourceNetwork && /* @__PURE__ */ (0,
|
|
12115
|
+
!shouldLockSourceNetwork && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}`, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Arrow_default, { fill: "none" }) })
|
|
11903
12116
|
]
|
|
11904
12117
|
}
|
|
11905
12118
|
);
|
|
11906
12119
|
};
|
|
11907
|
-
var NetworkSelector_default =
|
|
12120
|
+
var NetworkSelector_default = import_react65.default.memo(NetworkSelector);
|
|
11908
12121
|
|
|
11909
12122
|
// src/components/reusable/SingleForm.tsx
|
|
11910
|
-
var
|
|
12123
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
11911
12124
|
var SingleForm = ({
|
|
11912
12125
|
isLoadingFees,
|
|
11913
12126
|
feeError,
|
|
@@ -11927,7 +12140,7 @@ var SingleForm = ({
|
|
|
11927
12140
|
const targetNetwork = (0, import_react_redux52.useSelector)(selectTargetChain);
|
|
11928
12141
|
const targetAddress = (0, import_react_redux52.useSelector)(selectTargetAddress);
|
|
11929
12142
|
const { isReady } = useIsWalletReady_default();
|
|
11930
|
-
const [amountValue, setAmountValue] = (0,
|
|
12143
|
+
const [amountValue, setAmountValue] = (0, import_react66.useState)("");
|
|
11931
12144
|
const amount = (0, import_react_redux52.useSelector)(selectAmount);
|
|
11932
12145
|
const sourceCurrency = (0, import_react_redux52.useSelector)(selectSourceCurrency);
|
|
11933
12146
|
const targetCurrency = (0, import_react_redux52.useSelector)(selectTargetCurrency);
|
|
@@ -11935,11 +12148,11 @@ var SingleForm = ({
|
|
|
11935
12148
|
const { balance, decimals } = useBalance_default();
|
|
11936
12149
|
const { kimaBackendUrl } = useKimaContext();
|
|
11937
12150
|
const { data: envOptions } = useGetEnvOptions({ kimaBackendUrl });
|
|
11938
|
-
const errorMessage = (0,
|
|
12151
|
+
const errorMessage = (0, import_react66.useMemo)(
|
|
11939
12152
|
() => compliantOption && targetCompliant !== null && !targetCompliant?.isCompliant ? `Target address has ${targetCompliant.results?.[0].result.risk_score} risk` : "",
|
|
11940
12153
|
[compliantOption, targetCompliant]
|
|
11941
12154
|
);
|
|
11942
|
-
const maxValue = (0,
|
|
12155
|
+
const maxValue = (0, import_react66.useMemo)(() => {
|
|
11943
12156
|
if (mode === "light" /* light */) {
|
|
11944
12157
|
const limit = envOptions?.transferLimitMaxUSDT ? parseFloat(envOptions.transferLimitMaxUSDT) : 1e3;
|
|
11945
12158
|
return BigInt(limit);
|
|
@@ -11949,11 +12162,11 @@ var SingleForm = ({
|
|
|
11949
12162
|
const intAmount = (0, import_viem12.parseUnits)(amount || "0", totalFee.decimals);
|
|
11950
12163
|
return balance - intAmount;
|
|
11951
12164
|
}, [mode, envOptions?.transferLimitMaxUSDT, balance, totalFee, amount]);
|
|
11952
|
-
const feeTokenSymbol = (0,
|
|
12165
|
+
const feeTokenSymbol = (0, import_react66.useMemo)(() => {
|
|
11953
12166
|
if (!sourceCurrency) return "USD";
|
|
11954
12167
|
return uiTokenSymbol(sourceCurrency);
|
|
11955
12168
|
}, [sourceCurrency]);
|
|
11956
|
-
const canQuoteFees = (0,
|
|
12169
|
+
const canQuoteFees = (0, import_react66.useMemo)(() => {
|
|
11957
12170
|
const haveBasics = !!backendUrl && !!amount && !!sourceNetwork?.shortName && !!sourceCurrency && !!targetNetwork?.shortName && !!targetCurrency;
|
|
11958
12171
|
if (!haveBasics) return false;
|
|
11959
12172
|
const requiresSourceAddress = !["BANK", "CC"].includes(
|
|
@@ -11972,11 +12185,11 @@ var SingleForm = ({
|
|
|
11972
12185
|
sourceAddress,
|
|
11973
12186
|
targetAddress
|
|
11974
12187
|
]);
|
|
11975
|
-
(0,
|
|
12188
|
+
(0, import_react66.useEffect)(() => {
|
|
11976
12189
|
if (!errorMessage) return;
|
|
11977
12190
|
import_react_hot_toast5.toast.error(errorMessage);
|
|
11978
12191
|
}, [errorMessage]);
|
|
11979
|
-
(0,
|
|
12192
|
+
(0, import_react66.useEffect)(() => {
|
|
11980
12193
|
if (amountValue && amount !== "") return;
|
|
11981
12194
|
setAmountValue(amount);
|
|
11982
12195
|
}, [amount, amountValue]);
|
|
@@ -12015,7 +12228,7 @@ var SingleForm = ({
|
|
|
12015
12228
|
);
|
|
12016
12229
|
}
|
|
12017
12230
|
};
|
|
12018
|
-
const demoSourceAddress = (0,
|
|
12231
|
+
const demoSourceAddress = (0, import_react66.useMemo)(() => {
|
|
12019
12232
|
if (mode !== "light" /* light */) return "";
|
|
12020
12233
|
const short = sourceNetwork?.shortName;
|
|
12021
12234
|
if (!short) return "";
|
|
@@ -12024,7 +12237,7 @@ var SingleForm = ({
|
|
|
12024
12237
|
if (lightDemoNetworks.includes(short)) return lightDemoAccounts.EVM;
|
|
12025
12238
|
return "";
|
|
12026
12239
|
}, [mode, sourceNetwork?.shortName]);
|
|
12027
|
-
const isConnectedSourceWrapper = (0,
|
|
12240
|
+
const isConnectedSourceWrapper = (0, import_react66.useMemo)(() => {
|
|
12028
12241
|
if (mode === "light" /* light */) {
|
|
12029
12242
|
const on2 = !!demoSourceAddress;
|
|
12030
12243
|
logger_default.debug("[SingleForm] source wrapper connected (LIGHT)?", {
|
|
@@ -12057,7 +12270,7 @@ var SingleForm = ({
|
|
|
12057
12270
|
demoSourceAddress,
|
|
12058
12271
|
sourceNetwork?.shortName
|
|
12059
12272
|
]);
|
|
12060
|
-
const isConnectedTargetWrapper = (0,
|
|
12273
|
+
const isConnectedTargetWrapper = (0, import_react66.useMemo)(() => {
|
|
12061
12274
|
if (mode !== "light" /* light */) return false;
|
|
12062
12275
|
const on = !!targetAddress;
|
|
12063
12276
|
logger_default.debug("[SingleForm] target wrapper connected (LIGHT)?", {
|
|
@@ -12067,13 +12280,13 @@ var SingleForm = ({
|
|
|
12067
12280
|
});
|
|
12068
12281
|
return on;
|
|
12069
12282
|
}, [mode, targetAddress, targetNetwork?.shortName]);
|
|
12070
|
-
const isConnected = (0,
|
|
12283
|
+
const isConnected = (0, import_react66.useMemo)(() => {
|
|
12071
12284
|
if (mode === "payment" /* payment */ && dAppOption !== "none" /* None */) {
|
|
12072
12285
|
return isReady;
|
|
12073
12286
|
}
|
|
12074
12287
|
return isReady && !initialSelection.sourceSelection;
|
|
12075
12288
|
}, [isReady, initialSelection, mode, dAppOption]);
|
|
12076
|
-
(0,
|
|
12289
|
+
(0, import_react66.useEffect)(() => {
|
|
12077
12290
|
logger_default.debug("[SingleForm] snapshot", {
|
|
12078
12291
|
mode,
|
|
12079
12292
|
srcShort: sourceNetwork?.shortName,
|
|
@@ -12100,14 +12313,14 @@ var SingleForm = ({
|
|
|
12100
12313
|
demoSourceAddress,
|
|
12101
12314
|
feeDeduct
|
|
12102
12315
|
]);
|
|
12103
|
-
return /* @__PURE__ */ (0,
|
|
12104
|
-
/* @__PURE__ */ (0,
|
|
12105
|
-
/* @__PURE__ */ (0,
|
|
12316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "single-form", children: [
|
|
12317
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "form-item", children: [
|
|
12318
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "label", children: [
|
|
12106
12319
|
dAppOption === "none" /* None */ && "Source",
|
|
12107
12320
|
" Network:"
|
|
12108
12321
|
] }),
|
|
12109
|
-
/* @__PURE__ */ (0,
|
|
12110
|
-
/* @__PURE__ */ (0,
|
|
12322
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "items", children: [
|
|
12323
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
12111
12324
|
NetworkSelector_default,
|
|
12112
12325
|
{
|
|
12113
12326
|
type: "origin",
|
|
@@ -12117,10 +12330,10 @@ var SingleForm = ({
|
|
|
12117
12330
|
}
|
|
12118
12331
|
}
|
|
12119
12332
|
),
|
|
12120
|
-
/* @__PURE__ */ (0,
|
|
12333
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CoinDropdown_default, { isSourceChain: true })
|
|
12121
12334
|
] })
|
|
12122
12335
|
] }),
|
|
12123
|
-
/* @__PURE__ */ (0,
|
|
12336
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
12124
12337
|
"div",
|
|
12125
12338
|
{
|
|
12126
12339
|
className: `dynamic-area ${["CC" /* CC */, "BANK" /* BANK */].includes(
|
|
@@ -12129,20 +12342,20 @@ var SingleForm = ({
|
|
|
12129
12342
|
children: [
|
|
12130
12343
|
!["CC" /* CC */, "BANK" /* BANK */].includes(
|
|
12131
12344
|
sourceNetwork.compatibility
|
|
12132
|
-
) && /* @__PURE__ */ (0,
|
|
12345
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
12133
12346
|
"div",
|
|
12134
12347
|
{
|
|
12135
12348
|
className: `form-item wallet-button-item ${isConnectedSourceWrapper ? "connected" : ""}`,
|
|
12136
12349
|
children: [
|
|
12137
|
-
/* @__PURE__ */ (0,
|
|
12138
|
-
/* @__PURE__ */ (0,
|
|
12350
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "label", children: "Wallet:" }),
|
|
12351
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(WalletButton_default, { initialSelection: initialSelection.sourceSelection })
|
|
12139
12352
|
]
|
|
12140
12353
|
}
|
|
12141
12354
|
),
|
|
12142
|
-
mode !== "payment" /* payment */ && /* @__PURE__ */ (0,
|
|
12143
|
-
/* @__PURE__ */ (0,
|
|
12144
|
-
/* @__PURE__ */ (0,
|
|
12145
|
-
/* @__PURE__ */ (0,
|
|
12355
|
+
mode !== "payment" /* payment */ && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "form-item", children: [
|
|
12356
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "label", children: "Target Network:" }),
|
|
12357
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "items", children: [
|
|
12358
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
12146
12359
|
NetworkSelector_default,
|
|
12147
12360
|
{
|
|
12148
12361
|
type: "target",
|
|
@@ -12152,15 +12365,15 @@ var SingleForm = ({
|
|
|
12152
12365
|
}
|
|
12153
12366
|
}
|
|
12154
12367
|
),
|
|
12155
|
-
/* @__PURE__ */ (0,
|
|
12368
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CoinDropdown_default, { isSourceChain: false })
|
|
12156
12369
|
] })
|
|
12157
12370
|
] })
|
|
12158
12371
|
]
|
|
12159
12372
|
}
|
|
12160
12373
|
),
|
|
12161
|
-
mode === "bridge" /* bridge */ && /* @__PURE__ */ (0,
|
|
12162
|
-
/* @__PURE__ */ (0,
|
|
12163
|
-
/* @__PURE__ */ (0,
|
|
12374
|
+
mode === "bridge" /* bridge */ && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `form-item ${theme.colorMode}`, children: [
|
|
12375
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "label", children: "Target Address:" }),
|
|
12376
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
12164
12377
|
AddressInput_default,
|
|
12165
12378
|
{
|
|
12166
12379
|
theme: theme.colorMode,
|
|
@@ -12168,14 +12381,14 @@ var SingleForm = ({
|
|
|
12168
12381
|
}
|
|
12169
12382
|
)
|
|
12170
12383
|
] }),
|
|
12171
|
-
mode === "light" /* light */ && /* @__PURE__ */ (0,
|
|
12384
|
+
mode === "light" /* light */ && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
12172
12385
|
"div",
|
|
12173
12386
|
{
|
|
12174
12387
|
className: `form-item wallet-button-item ${isConnectedTargetWrapper ? "connected" : ""}`,
|
|
12175
12388
|
style: { display: "flex", alignItems: "center" },
|
|
12176
12389
|
children: [
|
|
12177
|
-
/* @__PURE__ */ (0,
|
|
12178
|
-
/* @__PURE__ */ (0,
|
|
12390
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "label", children: "Target Wallet:" }),
|
|
12391
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
12179
12392
|
WalletButton_default,
|
|
12180
12393
|
{
|
|
12181
12394
|
initialSelection: initialSelection.targetSelection,
|
|
@@ -12185,10 +12398,10 @@ var SingleForm = ({
|
|
|
12185
12398
|
]
|
|
12186
12399
|
}
|
|
12187
12400
|
),
|
|
12188
|
-
/* @__PURE__ */ (0,
|
|
12189
|
-
/* @__PURE__ */ (0,
|
|
12190
|
-
/* @__PURE__ */ (0,
|
|
12191
|
-
/* @__PURE__ */ (0,
|
|
12401
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `form-item ${theme.colorMode}`, children: [
|
|
12402
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "label", children: "Amount:" }),
|
|
12403
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `amount-label-container items ${theme.colorMode}`, children: [
|
|
12404
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
12192
12405
|
"input",
|
|
12193
12406
|
{
|
|
12194
12407
|
className: `${theme.colorMode}`,
|
|
@@ -12199,20 +12412,20 @@ var SingleForm = ({
|
|
|
12199
12412
|
disabled: mode === "payment" /* payment */
|
|
12200
12413
|
}
|
|
12201
12414
|
),
|
|
12202
|
-
/* @__PURE__ */ (0,
|
|
12203
|
-
sourceNetwork.shortName !== "CC" && mode !== "payment" /* payment */ && /* @__PURE__ */ (0,
|
|
12204
|
-
dAppOption === "none" /* None */ && canQuoteFees && /* @__PURE__ */ (0,
|
|
12415
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "max-disclaimer", children: [
|
|
12416
|
+
sourceNetwork.shortName !== "CC" && mode !== "payment" /* payment */ && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "max-button", onClick: onMaxClick, children: "Max" }),
|
|
12417
|
+
dAppOption === "none" /* None */ && canQuoteFees && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("p", { className: "fee-amount", children: [
|
|
12205
12418
|
"Est fees:",
|
|
12206
12419
|
" ",
|
|
12207
|
-
isLoadingFees ? /* @__PURE__ */ (0,
|
|
12208
|
-
/* @__PURE__ */ (0,
|
|
12209
|
-
/* @__PURE__ */ (0,
|
|
12210
|
-
/* @__PURE__ */ (0,
|
|
12211
|
-
] }) : feeError ? /* @__PURE__ */ (0,
|
|
12420
|
+
isLoadingFees ? /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "inline-spinner loading", "aria-live": "polite", children: [
|
|
12421
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "dot" }),
|
|
12422
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "dot" }),
|
|
12423
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "dot" })
|
|
12424
|
+
] }) : feeError ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "fee-value fee-error", children: "Fee unavailable" }) : totalFee.value >= 0n ? /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "fee-value", children: [
|
|
12212
12425
|
formatBigInt(totalFee),
|
|
12213
12426
|
" ",
|
|
12214
12427
|
feeTokenSymbol
|
|
12215
|
-
] }) : /* @__PURE__ */ (0,
|
|
12428
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "fee-value", children: "\u2014" })
|
|
12216
12429
|
] })
|
|
12217
12430
|
] })
|
|
12218
12431
|
] })
|
|
@@ -12222,7 +12435,7 @@ var SingleForm = ({
|
|
|
12222
12435
|
var SingleForm_default = SingleForm;
|
|
12223
12436
|
|
|
12224
12437
|
// src/components/reusable/FiatWidget.tsx
|
|
12225
|
-
var
|
|
12438
|
+
var import_react67 = require("react");
|
|
12226
12439
|
var import_react_redux53 = require("react-redux");
|
|
12227
12440
|
var import_uuid = require("uuid");
|
|
12228
12441
|
|
|
@@ -12250,7 +12463,7 @@ var useCCTransactionId = (backendUrl, transactionIdSeed) => {
|
|
|
12250
12463
|
};
|
|
12251
12464
|
|
|
12252
12465
|
// src/components/reusable/FiatWidget.tsx
|
|
12253
|
-
var
|
|
12466
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
12254
12467
|
var FiatWidget = ({ submitCallback }) => {
|
|
12255
12468
|
const dispatch = (0, import_react_redux53.useDispatch)();
|
|
12256
12469
|
const feeDeduct = (0, import_react_redux53.useSelector)(selectFeeDeduct);
|
|
@@ -12260,9 +12473,9 @@ var FiatWidget = ({ submitCallback }) => {
|
|
|
12260
12473
|
const sourceCurrency = (0, import_react_redux53.useSelector)(selectSourceCurrency);
|
|
12261
12474
|
const sourceChain = (0, import_react_redux53.useSelector)(selectSourceChain);
|
|
12262
12475
|
const { transactionValues } = (0, import_react_redux53.useSelector)(selectServiceFee);
|
|
12263
|
-
const ccTransactionIdSeedRef = (0,
|
|
12264
|
-
const identificationUuidRef = (0,
|
|
12265
|
-
const ccTransactionSubmittedRef = (0,
|
|
12476
|
+
const ccTransactionIdSeedRef = (0, import_react67.useRef)((0, import_uuid.v4)());
|
|
12477
|
+
const identificationUuidRef = (0, import_react67.useRef)((0, import_uuid.v4)());
|
|
12478
|
+
const ccTransactionSubmittedRef = (0, import_react67.useRef)(false);
|
|
12266
12479
|
const { data: envOptions, isLoading: isEnvLoading } = useGetEnvOptions({
|
|
12267
12480
|
kimaBackendUrl: backendUrl
|
|
12268
12481
|
});
|
|
@@ -12272,25 +12485,25 @@ var FiatWidget = ({ submitCallback }) => {
|
|
|
12272
12485
|
isLoading: isTransactionIdLoading,
|
|
12273
12486
|
error
|
|
12274
12487
|
} = useCCTransactionId(backendUrl, ccTransactionIdSeedRef.current);
|
|
12275
|
-
(0,
|
|
12488
|
+
(0, import_react67.useEffect)(() => {
|
|
12276
12489
|
dispatch(setCCTransactionIdSeed(ccTransactionIdSeedRef.current));
|
|
12277
12490
|
dispatch(setCCTransactionId(data?.transactionId));
|
|
12278
12491
|
}, [dispatch, data, isTransactionIdLoading]);
|
|
12279
12492
|
const txValues = feeDeduct ? transactionValues.feeFromTarget : transactionValues.feeFromOrigin;
|
|
12280
|
-
const allowanceAmount = (0,
|
|
12493
|
+
const allowanceAmount = (0, import_react67.useMemo)(
|
|
12281
12494
|
() => formatBigInt(txValues.allowanceAmount),
|
|
12282
12495
|
[txValues]
|
|
12283
12496
|
);
|
|
12284
|
-
const [isLoading, setIsLoading] = (0,
|
|
12285
|
-
const baseUrl = (0,
|
|
12497
|
+
const [isLoading, setIsLoading] = (0, import_react67.useState)(true);
|
|
12498
|
+
const baseUrl = (0, import_react67.useMemo)(
|
|
12286
12499
|
() => networkOption === "testnet" /* testnet */ ? "https://widget2-sandbox.depa.wtf" : "https://widget.depa.finance",
|
|
12287
12500
|
[networkOption]
|
|
12288
12501
|
);
|
|
12289
|
-
const scenario = (0,
|
|
12502
|
+
const scenario = (0, import_react67.useMemo)(
|
|
12290
12503
|
() => sourceChain.shortName === "CC" ? "direct_card_payment" : "direct_bank_payment",
|
|
12291
12504
|
[sourceChain]
|
|
12292
12505
|
);
|
|
12293
|
-
const iframeSrc = (0,
|
|
12506
|
+
const iframeSrc = (0, import_react67.useMemo)(() => {
|
|
12294
12507
|
const searchParams = new URLSearchParams({
|
|
12295
12508
|
partner: partnerId ?? "",
|
|
12296
12509
|
amount: allowanceAmount,
|
|
@@ -12309,7 +12522,7 @@ var FiatWidget = ({ submitCallback }) => {
|
|
|
12309
12522
|
scenario,
|
|
12310
12523
|
sourceCurrency
|
|
12311
12524
|
]);
|
|
12312
|
-
(0,
|
|
12525
|
+
(0, import_react67.useEffect)(() => {
|
|
12313
12526
|
const handleMessage = (event) => {
|
|
12314
12527
|
if (event.origin !== baseUrl) {
|
|
12315
12528
|
return;
|
|
@@ -12338,12 +12551,12 @@ var FiatWidget = ({ submitCallback }) => {
|
|
|
12338
12551
|
window.addEventListener("message", handleMessage);
|
|
12339
12552
|
return () => window.removeEventListener("message", handleMessage);
|
|
12340
12553
|
}, []);
|
|
12341
|
-
(0,
|
|
12554
|
+
(0, import_react67.useEffect)(() => {
|
|
12342
12555
|
if (error) dispatch(setCCTransactionStatus("error-id"));
|
|
12343
12556
|
}, [dispatch, error]);
|
|
12344
|
-
return /* @__PURE__ */ (0,
|
|
12345
|
-
(isLoading || isTransactionIdLoading || isEnvLoading || ccTransactionStatus === "success") && /* @__PURE__ */ (0,
|
|
12346
|
-
/* @__PURE__ */ (0,
|
|
12557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: `cc-widget ${isLoading ? "loading" : ""}`, children: [
|
|
12558
|
+
(isLoading || isTransactionIdLoading || isEnvLoading || ccTransactionStatus === "success") && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "cc-widget-loader", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ring_default, { width: 50, height: 50, fill: "#86b8ce" }) }),
|
|
12559
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
12347
12560
|
"iframe",
|
|
12348
12561
|
{
|
|
12349
12562
|
width: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
|
|
@@ -12438,12 +12651,12 @@ var useDisconnectWallet7 = () => {
|
|
|
12438
12651
|
var useDisconnectWallet_default = useDisconnectWallet7;
|
|
12439
12652
|
|
|
12440
12653
|
// src/widgets/transfer/components/solana/SolanaConnectModal.tsx
|
|
12441
|
-
var
|
|
12654
|
+
var import_react72 = __toESM(require("react"), 1);
|
|
12442
12655
|
var import_react_redux59 = require("react-redux");
|
|
12443
12656
|
var import_wallet_adapter_react8 = require("@solana/wallet-adapter-react");
|
|
12444
12657
|
|
|
12445
12658
|
// src/widgets/transfer/components/solana/SolanaWalletSelect.tsx
|
|
12446
|
-
var
|
|
12659
|
+
var import_react70 = require("react");
|
|
12447
12660
|
var import_react_redux55 = require("react-redux");
|
|
12448
12661
|
var import_wallet_adapter_react6 = require("@solana/wallet-adapter-react");
|
|
12449
12662
|
var import_wallet_adapter_base = require("@solana/wallet-adapter-base");
|
|
@@ -12459,13 +12672,13 @@ var isUserRejected2 = (err) => {
|
|
|
12459
12672
|
};
|
|
12460
12673
|
|
|
12461
12674
|
// src/widgets/transfer/components/WalletOptionList.tsx
|
|
12462
|
-
var
|
|
12675
|
+
var import_react69 = require("react");
|
|
12463
12676
|
var import_react_redux54 = require("react-redux");
|
|
12464
12677
|
|
|
12465
12678
|
// src/shared/lib/hooks/useHorizontalDragScroll.ts
|
|
12466
|
-
var
|
|
12679
|
+
var import_react68 = require("react");
|
|
12467
12680
|
var useHorizontalDragScroll = (ref) => {
|
|
12468
|
-
(0,
|
|
12681
|
+
(0, import_react68.useEffect)(() => {
|
|
12469
12682
|
const el = ref.current;
|
|
12470
12683
|
if (!el) return;
|
|
12471
12684
|
let isDown = false;
|
|
@@ -12506,7 +12719,7 @@ var useHorizontalDragScroll = (ref) => {
|
|
|
12506
12719
|
};
|
|
12507
12720
|
|
|
12508
12721
|
// src/widgets/transfer/components/WalletOptionList.tsx
|
|
12509
|
-
var
|
|
12722
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
12510
12723
|
var WalletOptionList = ({
|
|
12511
12724
|
options,
|
|
12512
12725
|
onSelect,
|
|
@@ -12514,13 +12727,13 @@ var WalletOptionList = ({
|
|
|
12514
12727
|
disabled = false
|
|
12515
12728
|
}) => {
|
|
12516
12729
|
const theme = (0, import_react_redux54.useSelector)(selectTheme);
|
|
12517
|
-
const sliderRef = (0,
|
|
12730
|
+
const sliderRef = (0, import_react69.useRef)(null);
|
|
12518
12731
|
useHorizontalDragScroll(sliderRef);
|
|
12519
12732
|
const detected = options.filter((wallet) => wallet.installed);
|
|
12520
12733
|
const undetected = options.filter((wallet) => !wallet.installed);
|
|
12521
|
-
const renderIcon = (icon, alt) => typeof icon === "string" ? /* @__PURE__ */ (0,
|
|
12522
|
-
return /* @__PURE__ */ (0,
|
|
12523
|
-
detected.map((wallet) => /* @__PURE__ */ (0,
|
|
12734
|
+
const renderIcon = (icon, alt) => typeof icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("img", { src: icon, alt }) : icon;
|
|
12735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "wallet-select", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "slide-area hide-scrollbar", ref: sliderRef, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "wallet-container", children: [
|
|
12736
|
+
detected.map((wallet) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
12524
12737
|
"div",
|
|
12525
12738
|
{
|
|
12526
12739
|
className: `card-item ${theme.colorMode} ${selectedWallet === wallet.id ? "selected" : ""}`,
|
|
@@ -12528,21 +12741,21 @@ var WalletOptionList = ({
|
|
|
12528
12741
|
if (disabled) return;
|
|
12529
12742
|
onSelect(wallet.id);
|
|
12530
12743
|
},
|
|
12531
|
-
children: /* @__PURE__ */ (0,
|
|
12744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "wallet-item", children: [
|
|
12532
12745
|
renderIcon(wallet.icon, wallet.name),
|
|
12533
|
-
/* @__PURE__ */ (0,
|
|
12746
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: wallet.name })
|
|
12534
12747
|
] })
|
|
12535
12748
|
},
|
|
12536
12749
|
wallet.id
|
|
12537
12750
|
)),
|
|
12538
|
-
undetected.map((wallet) => /* @__PURE__ */ (0,
|
|
12751
|
+
undetected.map((wallet) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
12539
12752
|
ExternalLink_default,
|
|
12540
12753
|
{
|
|
12541
12754
|
to: wallet.installUrl || "#",
|
|
12542
12755
|
className: `card-item ${theme.colorMode}`,
|
|
12543
|
-
children: /* @__PURE__ */ (0,
|
|
12756
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "wallet-item", children: [
|
|
12544
12757
|
renderIcon(wallet.icon, wallet.name),
|
|
12545
|
-
/* @__PURE__ */ (0,
|
|
12758
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { children: [
|
|
12546
12759
|
"Install ",
|
|
12547
12760
|
wallet.name
|
|
12548
12761
|
] })
|
|
@@ -12555,12 +12768,12 @@ var WalletOptionList = ({
|
|
|
12555
12768
|
var WalletOptionList_default = WalletOptionList;
|
|
12556
12769
|
|
|
12557
12770
|
// src/widgets/transfer/components/solana/SolanaWalletSelect.tsx
|
|
12558
|
-
var
|
|
12771
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
12559
12772
|
var SolanaWalletSelect = () => {
|
|
12560
12773
|
const sourceChain = (0, import_react_redux55.useSelector)(selectSourceChain);
|
|
12561
12774
|
const dispatch = (0, import_react_redux55.useDispatch)();
|
|
12562
12775
|
const { wallet, wallets, select, connect, connected } = (0, import_wallet_adapter_react6.useWallet)();
|
|
12563
|
-
const options = (0,
|
|
12776
|
+
const options = (0, import_react70.useMemo)(() => {
|
|
12564
12777
|
return wallets.map((candidate) => ({
|
|
12565
12778
|
id: candidate.adapter.name,
|
|
12566
12779
|
name: candidate.adapter.name,
|
|
@@ -12569,13 +12782,13 @@ var SolanaWalletSelect = () => {
|
|
|
12569
12782
|
installed: candidate.readyState === import_wallet_adapter_base.WalletReadyState.Installed || candidate.readyState === import_wallet_adapter_base.WalletReadyState.Loadable
|
|
12570
12783
|
}));
|
|
12571
12784
|
}, [wallets]);
|
|
12572
|
-
const handleWalletClick = (0,
|
|
12785
|
+
const handleWalletClick = (0, import_react70.useCallback)(
|
|
12573
12786
|
(walletName) => {
|
|
12574
12787
|
select(walletName);
|
|
12575
12788
|
},
|
|
12576
12789
|
[select]
|
|
12577
12790
|
);
|
|
12578
|
-
(0,
|
|
12791
|
+
(0, import_react70.useEffect)(() => {
|
|
12579
12792
|
if (!wallet) return;
|
|
12580
12793
|
if (sourceChain.shortName !== "SOL") {
|
|
12581
12794
|
return;
|
|
@@ -12597,12 +12810,12 @@ var SolanaWalletSelect = () => {
|
|
|
12597
12810
|
});
|
|
12598
12811
|
}
|
|
12599
12812
|
}, [wallet, sourceChain]);
|
|
12600
|
-
return /* @__PURE__ */ (0,
|
|
12813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(WalletOptionList_default, { options, onSelect: handleWalletClick });
|
|
12601
12814
|
};
|
|
12602
12815
|
var SolanaWalletSelect_default = SolanaWalletSelect;
|
|
12603
12816
|
|
|
12604
12817
|
// src/widgets/transfer/components/solana/AccountDetailsModal.tsx
|
|
12605
|
-
var
|
|
12818
|
+
var import_react71 = require("react");
|
|
12606
12819
|
var import_react_redux57 = require("react-redux");
|
|
12607
12820
|
var import_wallet_adapter_react7 = require("@solana/wallet-adapter-react");
|
|
12608
12821
|
|
|
@@ -12622,7 +12835,7 @@ var getBtcAccountExplorerUrl = (address, networkOption) => {
|
|
|
12622
12835
|
|
|
12623
12836
|
// src/widgets/transfer/components/WalletModalShell.tsx
|
|
12624
12837
|
var import_react_redux56 = require("react-redux");
|
|
12625
|
-
var
|
|
12838
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
12626
12839
|
var WalletModalShell = ({
|
|
12627
12840
|
isOpen,
|
|
12628
12841
|
title,
|
|
@@ -12633,18 +12846,18 @@ var WalletModalShell = ({
|
|
|
12633
12846
|
}) => {
|
|
12634
12847
|
const theme = (0, import_react_redux56.useSelector)(selectTheme);
|
|
12635
12848
|
if (!isOpen) return null;
|
|
12636
|
-
return /* @__PURE__ */ (0,
|
|
12849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
12637
12850
|
"div",
|
|
12638
12851
|
{
|
|
12639
12852
|
className: `kima-modal ${theme.colorMode} ${isOpen ? "open" : ""} ${className}`,
|
|
12640
12853
|
children: [
|
|
12641
|
-
/* @__PURE__ */ (0,
|
|
12642
|
-
/* @__PURE__ */ (0,
|
|
12643
|
-
/* @__PURE__ */ (0,
|
|
12644
|
-
/* @__PURE__ */ (0,
|
|
12645
|
-
/* @__PURE__ */ (0,
|
|
12854
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "modal-overlay", onClick: onClose }),
|
|
12855
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: `modal-content-container ${theme.colorMode}`, children: [
|
|
12856
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "kima-card-header", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "topbar", children: [
|
|
12857
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "title", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("h3", { children: title }) }),
|
|
12858
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "control-buttons", children: rightHeader })
|
|
12646
12859
|
] }) }),
|
|
12647
|
-
/* @__PURE__ */ (0,
|
|
12860
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "modal-content", children })
|
|
12648
12861
|
] })
|
|
12649
12862
|
]
|
|
12650
12863
|
}
|
|
@@ -12653,7 +12866,7 @@ var WalletModalShell = ({
|
|
|
12653
12866
|
var WalletModalShell_default = WalletModalShell;
|
|
12654
12867
|
|
|
12655
12868
|
// src/widgets/transfer/components/AccountDetailsModalBase.tsx
|
|
12656
|
-
var
|
|
12869
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
12657
12870
|
var AccountDetailsModalBase = ({
|
|
12658
12871
|
isOpen,
|
|
12659
12872
|
onClose,
|
|
@@ -12670,32 +12883,32 @@ var AccountDetailsModalBase = ({
|
|
|
12670
12883
|
closeButtonClassName = "cross-icon-button"
|
|
12671
12884
|
}) => {
|
|
12672
12885
|
const isLight = themeMode ? themeMode === "light" : true;
|
|
12673
|
-
return /* @__PURE__ */ (0,
|
|
12886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12674
12887
|
WalletModalShell_default,
|
|
12675
12888
|
{
|
|
12676
12889
|
isOpen: !!isOpen,
|
|
12677
12890
|
title: "Account Details",
|
|
12678
12891
|
onClose,
|
|
12679
|
-
rightHeader: /* @__PURE__ */ (0,
|
|
12892
|
+
rightHeader: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("button", { className: closeButtonClassName, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Cross_default, { fill: isLight ? "black" : "white" }) }),
|
|
12680
12893
|
children: [
|
|
12681
|
-
/* @__PURE__ */ (0,
|
|
12682
|
-
iconSymbol ? /* @__PURE__ */ (0,
|
|
12683
|
-
/* @__PURE__ */ (0,
|
|
12684
|
-
/* @__PURE__ */ (0,
|
|
12685
|
-
address && /* @__PURE__ */ (0,
|
|
12894
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "summary", children: [
|
|
12895
|
+
iconSymbol ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "summary-icon", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ChainIcon, { width: 100, height: 100, symbol: iconSymbol }) }) : null,
|
|
12896
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "address", children: [
|
|
12897
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("h2", { children: address ? getShortenedAddress(address) : "\u2014" }),
|
|
12898
|
+
address && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CopyButton_default, { text: address })
|
|
12686
12899
|
] }),
|
|
12687
|
-
isBalanceLoading ? /* @__PURE__ */ (0,
|
|
12900
|
+
isBalanceLoading ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "balance-skeleton", "aria-label": "balance-loading" }) : /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("h3", { children: [
|
|
12688
12901
|
balance == null ? "0" : decimals == null ? balance.toString() : formatBigInt({ value: balance, decimals }),
|
|
12689
12902
|
" ",
|
|
12690
12903
|
symbol
|
|
12691
12904
|
] })
|
|
12692
12905
|
] }),
|
|
12693
|
-
/* @__PURE__ */ (0,
|
|
12694
|
-
/* @__PURE__ */ (0,
|
|
12695
|
-
/* @__PURE__ */ (0,
|
|
12696
|
-
/* @__PURE__ */ (0,
|
|
12906
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SecondaryButton_default, { className: "block-explorer", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(ExternalLink_default, { className: "link", to: explorerUrl, children: [
|
|
12907
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Explorer_default, { fill: "#778DA3" }),
|
|
12908
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { children: "Block explorer" }),
|
|
12909
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ExternalUrl_default, { fill: "#778DA3" })
|
|
12697
12910
|
] }) }),
|
|
12698
|
-
/* @__PURE__ */ (0,
|
|
12911
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PrimaryButton_default, { clickHandler: onDisconnect, disabled: disableDisconnect, children: "Disconnect" })
|
|
12699
12912
|
]
|
|
12700
12913
|
}
|
|
12701
12914
|
);
|
|
@@ -12704,7 +12917,7 @@ var AccountDetailsModalBase_default = AccountDetailsModalBase;
|
|
|
12704
12917
|
|
|
12705
12918
|
// src/widgets/transfer/components/solana/AccountDetailsModal.tsx
|
|
12706
12919
|
var import_react_hot_toast7 = __toESM(require("react-hot-toast"), 1);
|
|
12707
|
-
var
|
|
12920
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
12708
12921
|
var AccountDetailsModal = () => {
|
|
12709
12922
|
const dispatch = (0, import_react_redux57.useDispatch)();
|
|
12710
12923
|
const theme = (0, import_react_redux57.useSelector)(selectTheme);
|
|
@@ -12721,7 +12934,7 @@ var AccountDetailsModal = () => {
|
|
|
12721
12934
|
} = useSolNativeBalance();
|
|
12722
12935
|
const isSol = sourceChain.shortName === "SOL" /* SOLANA */;
|
|
12723
12936
|
if (!isSol) return null;
|
|
12724
|
-
const explorerUrl = (0,
|
|
12937
|
+
const explorerUrl = (0, import_react71.useMemo)(
|
|
12725
12938
|
() => getSolanaAccountExplorerUrl(sourceAddress, networkOption),
|
|
12726
12939
|
[sourceAddress, networkOption]
|
|
12727
12940
|
);
|
|
@@ -12739,13 +12952,13 @@ var AccountDetailsModal = () => {
|
|
|
12739
12952
|
if (isUserRejected2(e)) {
|
|
12740
12953
|
(0, import_react_hot_toast7.default)("Wallet disconnect was cancelled.");
|
|
12741
12954
|
} else {
|
|
12742
|
-
import_react_hot_toast7.default.error("Failed to disconnect wallet.", { icon: /* @__PURE__ */ (0,
|
|
12955
|
+
import_react_hot_toast7.default.error("Failed to disconnect wallet.", { icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Error_default, {}) });
|
|
12743
12956
|
}
|
|
12744
12957
|
} finally {
|
|
12745
12958
|
close();
|
|
12746
12959
|
}
|
|
12747
12960
|
};
|
|
12748
|
-
return /* @__PURE__ */ (0,
|
|
12961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12749
12962
|
AccountDetailsModalBase_default,
|
|
12750
12963
|
{
|
|
12751
12964
|
isOpen: !!isOpen,
|
|
@@ -12767,7 +12980,7 @@ var AccountDetailsModal_default = AccountDetailsModal;
|
|
|
12767
12980
|
|
|
12768
12981
|
// src/widgets/transfer/components/WalletConnectModalBase.tsx
|
|
12769
12982
|
var import_react_redux58 = require("react-redux");
|
|
12770
|
-
var
|
|
12983
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
12771
12984
|
var WalletConnectModalBase = ({
|
|
12772
12985
|
isOpen,
|
|
12773
12986
|
mode,
|
|
@@ -12777,14 +12990,14 @@ var WalletConnectModalBase = ({
|
|
|
12777
12990
|
children
|
|
12778
12991
|
}) => {
|
|
12779
12992
|
const dispatch = (0, import_react_redux58.useDispatch)();
|
|
12780
|
-
return /* @__PURE__ */ (0,
|
|
12993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
12781
12994
|
WalletModalShell_default,
|
|
12782
12995
|
{
|
|
12783
12996
|
isOpen,
|
|
12784
12997
|
title: "Connect Wallet",
|
|
12785
12998
|
onClose,
|
|
12786
12999
|
className: "wallet-connect",
|
|
12787
|
-
rightHeader: /* @__PURE__ */ (0,
|
|
13000
|
+
rightHeader: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("button", { className: "cross-icon-button", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
12788
13001
|
Cross_default,
|
|
12789
13002
|
{
|
|
12790
13003
|
width: 30,
|
|
@@ -12793,9 +13006,9 @@ var WalletConnectModalBase = ({
|
|
|
12793
13006
|
}
|
|
12794
13007
|
) }),
|
|
12795
13008
|
children: [
|
|
12796
|
-
demoMessage && /* @__PURE__ */ (0,
|
|
12797
|
-
mode !== "light" /* light */ ? children : /* @__PURE__ */ (0,
|
|
12798
|
-
/* @__PURE__ */ (0,
|
|
13009
|
+
demoMessage && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: "muted", children: demoMessage }),
|
|
13010
|
+
mode !== "light" /* light */ ? children : /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "wallet-modal-actions", children: [
|
|
13011
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
12799
13012
|
"button",
|
|
12800
13013
|
{
|
|
12801
13014
|
className: "secondary",
|
|
@@ -12803,7 +13016,7 @@ var WalletConnectModalBase = ({
|
|
|
12803
13016
|
children: "View Account"
|
|
12804
13017
|
}
|
|
12805
13018
|
),
|
|
12806
|
-
/* @__PURE__ */ (0,
|
|
13019
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("button", { className: "primary", onClick: onClose, children: "Close" })
|
|
12807
13020
|
] })
|
|
12808
13021
|
]
|
|
12809
13022
|
}
|
|
@@ -12812,30 +13025,30 @@ var WalletConnectModalBase = ({
|
|
|
12812
13025
|
var WalletConnectModalBase_default = WalletConnectModalBase;
|
|
12813
13026
|
|
|
12814
13027
|
// src/widgets/transfer/components/solana/SolanaConnectModal.tsx
|
|
12815
|
-
var
|
|
13028
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
12816
13029
|
var SolanaWalletConnectModal = () => {
|
|
12817
13030
|
const dispatch = (0, import_react_redux59.useDispatch)();
|
|
12818
13031
|
const theme = (0, import_react_redux59.useSelector)(selectTheme);
|
|
12819
13032
|
const isOpen = (0, import_react_redux59.useSelector)(selectSolanaConnectModal);
|
|
12820
13033
|
const mode = (0, import_react_redux59.useSelector)(selectMode);
|
|
12821
13034
|
const { connecting, connected, publicKey } = (0, import_wallet_adapter_react8.useWallet)();
|
|
12822
|
-
const close = (0,
|
|
13035
|
+
const close = (0, import_react72.useCallback)(() => {
|
|
12823
13036
|
dispatch(setSolanaConnectModal(false));
|
|
12824
13037
|
}, [dispatch]);
|
|
12825
|
-
|
|
13038
|
+
import_react72.default.useEffect(() => {
|
|
12826
13039
|
logger_default.debug("[SolanaConnectModal] wallet-adapter state", {
|
|
12827
13040
|
connecting,
|
|
12828
13041
|
connected,
|
|
12829
13042
|
publicKey: publicKey?.toBase58?.()
|
|
12830
13043
|
});
|
|
12831
13044
|
}, [connecting, connected, publicKey]);
|
|
12832
|
-
const demoMsg = (0,
|
|
13045
|
+
const demoMsg = (0, import_react72.useMemo)(
|
|
12833
13046
|
() => mode === "light" /* light */ ? `Light mode uses a demo Solana address (${lightDemoAccounts.SOL}).` : "",
|
|
12834
13047
|
[mode]
|
|
12835
13048
|
);
|
|
12836
|
-
return /* @__PURE__ */ (0,
|
|
12837
|
-
/* @__PURE__ */ (0,
|
|
12838
|
-
/* @__PURE__ */ (0,
|
|
13049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
|
|
13050
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(AccountDetailsModal_default, {}),
|
|
13051
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12839
13052
|
WalletConnectModalBase_default,
|
|
12840
13053
|
{
|
|
12841
13054
|
isOpen: !!isOpen,
|
|
@@ -12843,7 +13056,7 @@ var SolanaWalletConnectModal = () => {
|
|
|
12843
13056
|
themeMode: theme.colorMode ?? "light" /* light */,
|
|
12844
13057
|
demoMessage: demoMsg,
|
|
12845
13058
|
onClose: close,
|
|
12846
|
-
children: /* @__PURE__ */ (0,
|
|
13059
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(SolanaWalletSelect_default, {})
|
|
12847
13060
|
}
|
|
12848
13061
|
)
|
|
12849
13062
|
] });
|
|
@@ -12851,15 +13064,15 @@ var SolanaWalletConnectModal = () => {
|
|
|
12851
13064
|
var SolanaConnectModal_default = SolanaWalletConnectModal;
|
|
12852
13065
|
|
|
12853
13066
|
// src/widgets/transfer/components/tron/TronWalletConnectModal.tsx
|
|
12854
|
-
var
|
|
13067
|
+
var import_react75 = require("react");
|
|
12855
13068
|
var import_react_redux62 = require("react-redux");
|
|
12856
13069
|
|
|
12857
13070
|
// src/widgets/transfer/components/tron/AccountDetailsModal.tsx
|
|
12858
|
-
var
|
|
13071
|
+
var import_react73 = require("react");
|
|
12859
13072
|
var import_react_redux60 = require("react-redux");
|
|
12860
13073
|
var import_tronwallet_adapter_react_hooks6 = require("@tronweb3/tronwallet-adapter-react-hooks");
|
|
12861
13074
|
var import_react_hot_toast8 = __toESM(require("react-hot-toast"), 1);
|
|
12862
|
-
var
|
|
13075
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
12863
13076
|
var AccountDetailsModal2 = () => {
|
|
12864
13077
|
const dispatch = (0, import_react_redux60.useDispatch)();
|
|
12865
13078
|
const theme = (0, import_react_redux60.useSelector)(selectTheme);
|
|
@@ -12876,7 +13089,7 @@ var AccountDetailsModal2 = () => {
|
|
|
12876
13089
|
} = useTronNativeBalance();
|
|
12877
13090
|
const isTrx = sourceChain.shortName === "TRX" /* TRON */;
|
|
12878
13091
|
if (!isTrx) return null;
|
|
12879
|
-
const explorerUrl = (0,
|
|
13092
|
+
const explorerUrl = (0, import_react73.useMemo)(
|
|
12880
13093
|
() => getTronAccountExplorerUrl(sourceAddress, networkOption),
|
|
12881
13094
|
[sourceAddress, networkOption]
|
|
12882
13095
|
);
|
|
@@ -12894,13 +13107,13 @@ var AccountDetailsModal2 = () => {
|
|
|
12894
13107
|
if (isUserRejected2(e)) {
|
|
12895
13108
|
(0, import_react_hot_toast8.default)("Wallet disconnect was cancelled.");
|
|
12896
13109
|
} else {
|
|
12897
|
-
import_react_hot_toast8.default.error("Failed to disconnect wallet.", { icon: /* @__PURE__ */ (0,
|
|
13110
|
+
import_react_hot_toast8.default.error("Failed to disconnect wallet.", { icon: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Error_default, {}) });
|
|
12898
13111
|
}
|
|
12899
13112
|
} finally {
|
|
12900
13113
|
close();
|
|
12901
13114
|
}
|
|
12902
13115
|
};
|
|
12903
|
-
return /* @__PURE__ */ (0,
|
|
13116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
12904
13117
|
AccountDetailsModalBase_default,
|
|
12905
13118
|
{
|
|
12906
13119
|
isOpen: !!isOpen,
|
|
@@ -12921,12 +13134,12 @@ var AccountDetailsModal2 = () => {
|
|
|
12921
13134
|
var AccountDetailsModal_default2 = AccountDetailsModal2;
|
|
12922
13135
|
|
|
12923
13136
|
// src/widgets/transfer/components/tron/TronWalletSelect.tsx
|
|
12924
|
-
var
|
|
13137
|
+
var import_react74 = require("react");
|
|
12925
13138
|
var import_react_redux61 = require("react-redux");
|
|
12926
13139
|
var import_tronwallet_adapter_react_hooks7 = require("@tronweb3/tronwallet-adapter-react-hooks");
|
|
12927
13140
|
var import_tronwallet_abstract_adapter = require("@tronweb3/tronwallet-abstract-adapter");
|
|
12928
13141
|
var import_react_hot_toast9 = __toESM(require("react-hot-toast"), 1);
|
|
12929
|
-
var
|
|
13142
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
12930
13143
|
var TronWalletSelect = () => {
|
|
12931
13144
|
const dispatch = (0, import_react_redux61.useDispatch)();
|
|
12932
13145
|
const {
|
|
@@ -12936,7 +13149,7 @@ var TronWalletSelect = () => {
|
|
|
12936
13149
|
connect,
|
|
12937
13150
|
connected
|
|
12938
13151
|
} = (0, import_tronwallet_adapter_react_hooks7.useWallet)();
|
|
12939
|
-
const options = (0,
|
|
13152
|
+
const options = (0, import_react74.useMemo)(() => {
|
|
12940
13153
|
return wallets.map((wallet) => ({
|
|
12941
13154
|
id: wallet.adapter.name,
|
|
12942
13155
|
name: wallet.adapter.name,
|
|
@@ -12945,7 +13158,7 @@ var TronWalletSelect = () => {
|
|
|
12945
13158
|
installed: wallet.state === import_tronwallet_abstract_adapter.AdapterState.Connected || wallet.state === import_tronwallet_abstract_adapter.AdapterState.Disconnect || wallet.state === import_tronwallet_abstract_adapter.AdapterState.Loading
|
|
12946
13159
|
}));
|
|
12947
13160
|
}, [wallets]);
|
|
12948
|
-
(0,
|
|
13161
|
+
(0, import_react74.useEffect)(() => {
|
|
12949
13162
|
connected && dispatch(setTronConnectModal(false));
|
|
12950
13163
|
}, [connected]);
|
|
12951
13164
|
const connectWallet = async (walletName) => {
|
|
@@ -12963,27 +13176,27 @@ var TronWalletSelect = () => {
|
|
|
12963
13176
|
}
|
|
12964
13177
|
}
|
|
12965
13178
|
};
|
|
12966
|
-
return /* @__PURE__ */ (0,
|
|
13179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(WalletOptionList_default, { options, onSelect: connectWallet });
|
|
12967
13180
|
};
|
|
12968
13181
|
var TronWalletSelect_default = TronWalletSelect;
|
|
12969
13182
|
|
|
12970
13183
|
// src/widgets/transfer/components/tron/TronWalletConnectModal.tsx
|
|
12971
|
-
var
|
|
13184
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
12972
13185
|
var TronWalletConnectModal = () => {
|
|
12973
13186
|
const dispatch = (0, import_react_redux62.useDispatch)();
|
|
12974
13187
|
const theme = (0, import_react_redux62.useSelector)(selectTheme);
|
|
12975
13188
|
const isOpen = (0, import_react_redux62.useSelector)(selectTronConnectModal);
|
|
12976
13189
|
const mode = (0, import_react_redux62.useSelector)(selectMode);
|
|
12977
|
-
const close = (0,
|
|
13190
|
+
const close = (0, import_react75.useCallback)(() => {
|
|
12978
13191
|
dispatch(setTronConnectModal(false));
|
|
12979
13192
|
}, [dispatch]);
|
|
12980
|
-
const demoMsg = (0,
|
|
13193
|
+
const demoMsg = (0, import_react75.useMemo)(
|
|
12981
13194
|
() => mode === "light" /* light */ ? `Light mode uses a demo Tron address (${lightDemoAccounts.TRX}).` : "",
|
|
12982
13195
|
[mode]
|
|
12983
13196
|
);
|
|
12984
|
-
return /* @__PURE__ */ (0,
|
|
12985
|
-
/* @__PURE__ */ (0,
|
|
12986
|
-
/* @__PURE__ */ (0,
|
|
13197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
13198
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(AccountDetailsModal_default2, {}),
|
|
13199
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
12987
13200
|
WalletConnectModalBase_default,
|
|
12988
13201
|
{
|
|
12989
13202
|
isOpen: !!isOpen,
|
|
@@ -12991,7 +13204,7 @@ var TronWalletConnectModal = () => {
|
|
|
12991
13204
|
themeMode: theme.colorMode ?? "light" /* light */,
|
|
12992
13205
|
demoMessage: demoMsg,
|
|
12993
13206
|
onClose: close,
|
|
12994
|
-
children: /* @__PURE__ */ (0,
|
|
13207
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TronWalletSelect_default, {})
|
|
12995
13208
|
}
|
|
12996
13209
|
)
|
|
12997
13210
|
] });
|
|
@@ -12999,17 +13212,17 @@ var TronWalletConnectModal = () => {
|
|
|
12999
13212
|
var TronWalletConnectModal_default = TronWalletConnectModal;
|
|
13000
13213
|
|
|
13001
13214
|
// src/widgets/transfer/components/btc/BtcConnectModal.tsx
|
|
13002
|
-
var
|
|
13215
|
+
var import_react79 = require("react");
|
|
13003
13216
|
var import_react_redux65 = require("react-redux");
|
|
13004
13217
|
var import_react_hot_toast11 = __toESM(require("react-hot-toast"), 1);
|
|
13005
13218
|
|
|
13006
13219
|
// src/features/connect-wallet/btc/useBtcWallet.ts
|
|
13007
|
-
var
|
|
13220
|
+
var import_react76 = require("react");
|
|
13008
13221
|
var import_react_redux63 = require("react-redux");
|
|
13009
13222
|
var useBtcWallet = () => {
|
|
13010
13223
|
const dispatch = (0, import_react_redux63.useDispatch)();
|
|
13011
13224
|
const networkOption = (0, import_react_redux63.useSelector)(selectNetworkOption);
|
|
13012
|
-
const ensureNetworkMatch = (0,
|
|
13225
|
+
const ensureNetworkMatch = (0, import_react76.useCallback)(
|
|
13013
13226
|
(address) => {
|
|
13014
13227
|
if (!address) return;
|
|
13015
13228
|
if (isBtcAddressOnNetwork(address, networkOption)) return;
|
|
@@ -13023,7 +13236,7 @@ var useBtcWallet = () => {
|
|
|
13023
13236
|
},
|
|
13024
13237
|
[networkOption]
|
|
13025
13238
|
);
|
|
13026
|
-
const connect = (0,
|
|
13239
|
+
const connect = (0, import_react76.useCallback)(
|
|
13027
13240
|
async (options) => {
|
|
13028
13241
|
const walletType = options?.wallet;
|
|
13029
13242
|
const unisat = walletType === "unisat" || !walletType ? getUnisat() : null;
|
|
@@ -13074,7 +13287,7 @@ var useBtcWallet = () => {
|
|
|
13074
13287
|
},
|
|
13075
13288
|
[dispatch, ensureNetworkMatch]
|
|
13076
13289
|
);
|
|
13077
|
-
const disconnect = (0,
|
|
13290
|
+
const disconnect = (0, import_react76.useCallback)(async () => {
|
|
13078
13291
|
const unisat = getUnisat();
|
|
13079
13292
|
if (unisat?.disconnect) {
|
|
13080
13293
|
await unisat.disconnect();
|
|
@@ -13088,14 +13301,14 @@ var useBtcWallet = () => {
|
|
|
13088
13301
|
};
|
|
13089
13302
|
|
|
13090
13303
|
// src/widgets/transfer/components/btc/BtcWalletSelect.tsx
|
|
13091
|
-
var
|
|
13092
|
-
var
|
|
13304
|
+
var import_react77 = require("react");
|
|
13305
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
13093
13306
|
var BtcWalletSelect = ({
|
|
13094
13307
|
selectedWallet,
|
|
13095
13308
|
onSelect,
|
|
13096
13309
|
disabled = false
|
|
13097
13310
|
}) => {
|
|
13098
|
-
const wallets = (0,
|
|
13311
|
+
const wallets = (0, import_react77.useMemo)(() => {
|
|
13099
13312
|
const unisatInstalled = !!getUnisat();
|
|
13100
13313
|
const list = [
|
|
13101
13314
|
{
|
|
@@ -13103,12 +13316,12 @@ var BtcWalletSelect = ({
|
|
|
13103
13316
|
name: "UniSat",
|
|
13104
13317
|
installUrl: "https://unisat.io/download",
|
|
13105
13318
|
installed: unisatInstalled,
|
|
13106
|
-
icon: /* @__PURE__ */ (0,
|
|
13319
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(UniSat_default, {})
|
|
13107
13320
|
}
|
|
13108
13321
|
];
|
|
13109
13322
|
return list;
|
|
13110
13323
|
}, []);
|
|
13111
|
-
return /* @__PURE__ */ (0,
|
|
13324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
13112
13325
|
WalletOptionList_default,
|
|
13113
13326
|
{
|
|
13114
13327
|
options: wallets,
|
|
@@ -13121,10 +13334,10 @@ var BtcWalletSelect = ({
|
|
|
13121
13334
|
var BtcWalletSelect_default = BtcWalletSelect;
|
|
13122
13335
|
|
|
13123
13336
|
// src/widgets/transfer/components/btc/AccountDetailsModal.tsx
|
|
13124
|
-
var
|
|
13337
|
+
var import_react78 = require("react");
|
|
13125
13338
|
var import_react_redux64 = require("react-redux");
|
|
13126
13339
|
var import_react_hot_toast10 = __toESM(require("react-hot-toast"), 1);
|
|
13127
|
-
var
|
|
13340
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
13128
13341
|
var AccountDetailsModal3 = () => {
|
|
13129
13342
|
const dispatch = (0, import_react_redux64.useDispatch)();
|
|
13130
13343
|
const theme = (0, import_react_redux64.useSelector)(selectTheme);
|
|
@@ -13141,7 +13354,7 @@ var AccountDetailsModal3 = () => {
|
|
|
13141
13354
|
} = useBtcBalance();
|
|
13142
13355
|
const isBtc2 = sourceChain.shortName === "BTC" /* BTC */;
|
|
13143
13356
|
if (!isBtc2) return null;
|
|
13144
|
-
const explorerUrl = (0,
|
|
13357
|
+
const explorerUrl = (0, import_react78.useMemo)(
|
|
13145
13358
|
() => getBtcAccountExplorerUrl(sourceAddress, networkOption),
|
|
13146
13359
|
[sourceAddress, networkOption]
|
|
13147
13360
|
);
|
|
@@ -13159,13 +13372,13 @@ var AccountDetailsModal3 = () => {
|
|
|
13159
13372
|
if (isUserRejected2(e)) {
|
|
13160
13373
|
(0, import_react_hot_toast10.default)("Wallet disconnect was cancelled.");
|
|
13161
13374
|
} else {
|
|
13162
|
-
import_react_hot_toast10.default.error("Failed to disconnect wallet.", { icon: /* @__PURE__ */ (0,
|
|
13375
|
+
import_react_hot_toast10.default.error("Failed to disconnect wallet.", { icon: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Error_default, {}) });
|
|
13163
13376
|
}
|
|
13164
13377
|
} finally {
|
|
13165
13378
|
close();
|
|
13166
13379
|
}
|
|
13167
13380
|
};
|
|
13168
|
-
return /* @__PURE__ */ (0,
|
|
13381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
13169
13382
|
AccountDetailsModalBase_default,
|
|
13170
13383
|
{
|
|
13171
13384
|
isOpen: !!isOpen,
|
|
@@ -13186,7 +13399,7 @@ var AccountDetailsModal3 = () => {
|
|
|
13186
13399
|
var AccountDetailsModal_default3 = AccountDetailsModal3;
|
|
13187
13400
|
|
|
13188
13401
|
// src/widgets/transfer/components/btc/BtcConnectModal.tsx
|
|
13189
|
-
var
|
|
13402
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
13190
13403
|
var BtcConnectModal = () => {
|
|
13191
13404
|
const dispatch = (0, import_react_redux65.useDispatch)();
|
|
13192
13405
|
const theme = (0, import_react_redux65.useSelector)(selectTheme);
|
|
@@ -13194,13 +13407,13 @@ var BtcConnectModal = () => {
|
|
|
13194
13407
|
const mode = (0, import_react_redux65.useSelector)(selectMode);
|
|
13195
13408
|
const sourceChain = (0, import_react_redux65.useSelector)(selectSourceChain);
|
|
13196
13409
|
const { connect } = useBtcWallet();
|
|
13197
|
-
const [selectedWallet, setSelectedWallet] = (0,
|
|
13198
|
-
const [connecting, setConnecting] = (0,
|
|
13410
|
+
const [selectedWallet, setSelectedWallet] = (0, import_react79.useState)(null);
|
|
13411
|
+
const [connecting, setConnecting] = (0, import_react79.useState)(false);
|
|
13199
13412
|
const isBtc2 = sourceChain.shortName === "BTC" /* BTC */;
|
|
13200
|
-
const close = (0,
|
|
13413
|
+
const close = (0, import_react79.useCallback)(() => {
|
|
13201
13414
|
dispatch(setBtcConnectModal(false));
|
|
13202
13415
|
}, [dispatch]);
|
|
13203
|
-
(0,
|
|
13416
|
+
(0, import_react79.useEffect)(() => {
|
|
13204
13417
|
if (!isOpen) return;
|
|
13205
13418
|
if (selectedWallet) return;
|
|
13206
13419
|
if (getUnisat()) {
|
|
@@ -13208,7 +13421,7 @@ var BtcConnectModal = () => {
|
|
|
13208
13421
|
return;
|
|
13209
13422
|
}
|
|
13210
13423
|
}, [isOpen, selectedWallet]);
|
|
13211
|
-
const onSelectWallet = (0,
|
|
13424
|
+
const onSelectWallet = (0, import_react79.useCallback)(
|
|
13212
13425
|
async (walletId) => {
|
|
13213
13426
|
if (!isBtc2) return;
|
|
13214
13427
|
setSelectedWallet(walletId);
|
|
@@ -13226,22 +13439,22 @@ var BtcConnectModal = () => {
|
|
|
13226
13439
|
if (isUserRejected2(e)) {
|
|
13227
13440
|
(0, import_react_hot_toast11.default)("Wallet connection was cancelled.");
|
|
13228
13441
|
} else if (e?.error?.message) {
|
|
13229
|
-
import_react_hot_toast11.default.error(e.error.message, { icon: /* @__PURE__ */ (0,
|
|
13442
|
+
import_react_hot_toast11.default.error(e.error.message, { icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Error_default, {}) });
|
|
13230
13443
|
} else if (e?.code === "UNISAT_NOT_FOUND") {
|
|
13231
|
-
import_react_hot_toast11.default.error("UniSat wallet not found.", { icon: /* @__PURE__ */ (0,
|
|
13444
|
+
import_react_hot_toast11.default.error("UniSat wallet not found.", { icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Error_default, {}) });
|
|
13232
13445
|
} else if (e?.code === "BTC_WALLET_NOT_FOUND") {
|
|
13233
|
-
import_react_hot_toast11.default.error("Bitcoin wallet not found.", { icon: /* @__PURE__ */ (0,
|
|
13446
|
+
import_react_hot_toast11.default.error("Bitcoin wallet not found.", { icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Error_default, {}) });
|
|
13234
13447
|
} else if (e?.code === "BTC_NO_ACCOUNT") {
|
|
13235
13448
|
import_react_hot_toast11.default.error("No Bitcoin account returned. Please try again.", {
|
|
13236
|
-
icon: /* @__PURE__ */ (0,
|
|
13449
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Error_default, {})
|
|
13237
13450
|
});
|
|
13238
13451
|
} else if (e?.code === "BTC_WRONG_NETWORK") {
|
|
13239
13452
|
const expected = e?.expectedNetwork ? String(e.expectedNetwork) : "";
|
|
13240
13453
|
const detected = e?.detectedNetwork ? String(e.detectedNetwork) : "";
|
|
13241
13454
|
const detail = expected && detected ? `Wallet is on ${detected}. Switch to ${expected}.` : "Wallet network mismatch. Please switch networks.";
|
|
13242
|
-
import_react_hot_toast11.default.error(detail, { icon: /* @__PURE__ */ (0,
|
|
13455
|
+
import_react_hot_toast11.default.error(detail, { icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Error_default, {}) });
|
|
13243
13456
|
} else {
|
|
13244
|
-
import_react_hot_toast11.default.error("Failed to connect wallet.", { icon: /* @__PURE__ */ (0,
|
|
13457
|
+
import_react_hot_toast11.default.error("Failed to connect wallet.", { icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Error_default, {}) });
|
|
13245
13458
|
}
|
|
13246
13459
|
logger_default.error("[BtcConnectModal] connect error", e);
|
|
13247
13460
|
} finally {
|
|
@@ -13250,10 +13463,10 @@ var BtcConnectModal = () => {
|
|
|
13250
13463
|
},
|
|
13251
13464
|
[connect, connecting, dispatch, isBtc2, mode]
|
|
13252
13465
|
);
|
|
13253
|
-
const demoMsg = (0,
|
|
13254
|
-
return /* @__PURE__ */ (0,
|
|
13255
|
-
/* @__PURE__ */ (0,
|
|
13256
|
-
/* @__PURE__ */ (0,
|
|
13466
|
+
const demoMsg = (0, import_react79.useMemo)(() => "", []);
|
|
13467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
|
|
13468
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(AccountDetailsModal_default3, {}),
|
|
13469
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
13257
13470
|
WalletConnectModalBase_default,
|
|
13258
13471
|
{
|
|
13259
13472
|
isOpen: !!isOpen,
|
|
@@ -13261,7 +13474,7 @@ var BtcConnectModal = () => {
|
|
|
13261
13474
|
themeMode: theme.colorMode ?? "light" /* light */,
|
|
13262
13475
|
demoMessage: demoMsg,
|
|
13263
13476
|
onClose: close,
|
|
13264
|
-
children: /* @__PURE__ */ (0,
|
|
13477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
13265
13478
|
BtcWalletSelect_default,
|
|
13266
13479
|
{
|
|
13267
13480
|
selectedWallet,
|
|
@@ -13276,7 +13489,7 @@ var BtcConnectModal = () => {
|
|
|
13276
13489
|
var BtcConnectModal_default = BtcConnectModal;
|
|
13277
13490
|
|
|
13278
13491
|
// src/widgets/transfer/components/TransferWidget.tsx
|
|
13279
|
-
var
|
|
13492
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
13280
13493
|
var PERMIT2_INFO_MESSAGE = "This approval uses Permit2, so you can skip a separate approval transaction and save gas.";
|
|
13281
13494
|
var PERMIT2_DOCS_URL = "https://docs.kima.network/kima-network/the-kima-sdk/use-kima-sdk-without-widget/message-signing#permit2-tokens";
|
|
13282
13495
|
var TransferWidget = ({
|
|
@@ -13287,18 +13500,18 @@ var TransferWidget = ({
|
|
|
13287
13500
|
}) => {
|
|
13288
13501
|
logger_default.debug("[TransferWidget] mount");
|
|
13289
13502
|
const dispatch = (0, import_react_redux66.useDispatch)();
|
|
13290
|
-
const mainRef = (0,
|
|
13291
|
-
const [signature, setSignature2] = (0,
|
|
13292
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
13293
|
-
const [formStep, setFormStep] = (0,
|
|
13294
|
-
const [warningModalOpen, setWarningModalOpen] = (0,
|
|
13295
|
-
const [resetModalOpen, setResetModalOpen] = (0,
|
|
13296
|
-
const [isPermit2TooltipOpen, setPermit2TooltipOpen] = (0,
|
|
13297
|
-
const permit2TooltipRef = (0,
|
|
13298
|
-
const [isCancellingApprove, setCancellingApprove] = (0,
|
|
13299
|
-
const [isApproving, setApproving] = (0,
|
|
13300
|
-
const [isSigning, setSigning] = (0,
|
|
13301
|
-
const [feeOptionDisabled, setFeeOptionDisabled] = (0,
|
|
13503
|
+
const mainRef = (0, import_react80.useRef)(null);
|
|
13504
|
+
const [signature, setSignature2] = (0, import_react80.useState)("");
|
|
13505
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react80.useState)(false);
|
|
13506
|
+
const [formStep, setFormStep] = (0, import_react80.useState)(0);
|
|
13507
|
+
const [warningModalOpen, setWarningModalOpen] = (0, import_react80.useState)(null);
|
|
13508
|
+
const [resetModalOpen, setResetModalOpen] = (0, import_react80.useState)(false);
|
|
13509
|
+
const [isPermit2TooltipOpen, setPermit2TooltipOpen] = (0, import_react80.useState)(false);
|
|
13510
|
+
const permit2TooltipRef = (0, import_react80.useRef)(null);
|
|
13511
|
+
const [isCancellingApprove, setCancellingApprove] = (0, import_react80.useState)(false);
|
|
13512
|
+
const [isApproving, setApproving] = (0, import_react80.useState)(false);
|
|
13513
|
+
const [isSigning, setSigning] = (0, import_react80.useState)(false);
|
|
13514
|
+
const [feeOptionDisabled, setFeeOptionDisabled] = (0, import_react80.useState)(false);
|
|
13302
13515
|
const networkOption = (0, import_react_redux66.useSelector)(selectNetworkOption);
|
|
13303
13516
|
const dAppOption = (0, import_react_redux66.useSelector)(selectDappOption);
|
|
13304
13517
|
const mode = (0, import_react_redux66.useSelector)(selectMode);
|
|
@@ -13331,7 +13544,7 @@ var TransferWidget = ({
|
|
|
13331
13544
|
panelRef: toastPanelRef,
|
|
13332
13545
|
formatTime: formatToastTime
|
|
13333
13546
|
} = useToastHistory();
|
|
13334
|
-
(0,
|
|
13547
|
+
(0, import_react80.useEffect)(() => {
|
|
13335
13548
|
if (!isPermit2TooltipOpen) return;
|
|
13336
13549
|
const handler = (event) => {
|
|
13337
13550
|
const target = event.target;
|
|
@@ -13374,7 +13587,7 @@ var TransferWidget = ({
|
|
|
13374
13587
|
targetSymbol: targetCurrency,
|
|
13375
13588
|
backendUrl
|
|
13376
13589
|
});
|
|
13377
|
-
const isSwap = (0,
|
|
13590
|
+
const isSwap = (0, import_react80.useMemo)(
|
|
13378
13591
|
() => sourceCurrency !== targetCurrency && !isSamePeggedToken(
|
|
13379
13592
|
sourceChain,
|
|
13380
13593
|
sourceCurrency,
|
|
@@ -13383,8 +13596,8 @@ var TransferWidget = ({
|
|
|
13383
13596
|
),
|
|
13384
13597
|
[sourceChain, sourceCurrency, targetChain, targetCurrency]
|
|
13385
13598
|
);
|
|
13386
|
-
const prevAmountRef = (0,
|
|
13387
|
-
(0,
|
|
13599
|
+
const prevAmountRef = (0, import_react80.useRef)("");
|
|
13600
|
+
(0, import_react80.useEffect)(() => {
|
|
13388
13601
|
setSignature2("");
|
|
13389
13602
|
setFeeOptionDisabled(false);
|
|
13390
13603
|
setApproving(false);
|
|
@@ -13397,7 +13610,7 @@ var TransferWidget = ({
|
|
|
13397
13610
|
targetChain.shortName,
|
|
13398
13611
|
targetCurrency
|
|
13399
13612
|
]);
|
|
13400
|
-
(0,
|
|
13613
|
+
(0, import_react80.useEffect)(() => {
|
|
13401
13614
|
const prevAmount = prevAmountRef.current;
|
|
13402
13615
|
if (prevAmount !== "" && amount !== prevAmount) {
|
|
13403
13616
|
dispatch(clearPermit2Signature());
|
|
@@ -13407,10 +13620,10 @@ var TransferWidget = ({
|
|
|
13407
13620
|
}
|
|
13408
13621
|
prevAmountRef.current = amount;
|
|
13409
13622
|
}, [amount, dispatch, isBtcOrigin]);
|
|
13410
|
-
(0,
|
|
13623
|
+
(0, import_react80.useEffect)(() => {
|
|
13411
13624
|
dispatch(clearPermit2Signature());
|
|
13412
13625
|
}, [dispatch, feeDeduct]);
|
|
13413
|
-
(0,
|
|
13626
|
+
(0, import_react80.useEffect)(() => {
|
|
13414
13627
|
try {
|
|
13415
13628
|
if (fees) dispatch(setServiceFee(fees));
|
|
13416
13629
|
if (mode === "payment" /* payment */ && transactionOption?.sourceChain) {
|
|
@@ -13426,11 +13639,11 @@ var TransferWidget = ({
|
|
|
13426
13639
|
);
|
|
13427
13640
|
import_react_hot_toast12.default.error(
|
|
13428
13641
|
"An unexpected error occurred while preparing the transfer. Please contact support for assistance.",
|
|
13429
|
-
{ icon: /* @__PURE__ */ (0,
|
|
13642
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) }
|
|
13430
13643
|
);
|
|
13431
13644
|
}
|
|
13432
13645
|
}, [fees, mode, transactionOption, dispatch]);
|
|
13433
|
-
const isBackButtonEnabled = (0,
|
|
13646
|
+
const isBackButtonEnabled = (0, import_react80.useMemo)(() => {
|
|
13434
13647
|
if (formStep !== 0) {
|
|
13435
13648
|
if (["BANK", "CC"].includes(sourceChain.shortName)) {
|
|
13436
13649
|
return ccTransactionStatus === "idle" || ccTransactionStatus === "failed";
|
|
@@ -13439,14 +13652,14 @@ var TransferWidget = ({
|
|
|
13439
13652
|
}
|
|
13440
13653
|
return false;
|
|
13441
13654
|
}, [ccTransactionStatus, sourceChain, formStep]);
|
|
13442
|
-
const isSubmitButtonEnabled = (0,
|
|
13655
|
+
const isSubmitButtonEnabled = (0, import_react80.useMemo)(() => {
|
|
13443
13656
|
if (submitted) return false;
|
|
13444
13657
|
if (["BANK", "CC"].includes(sourceChain.shortName)) {
|
|
13445
13658
|
return ccTransactionStatus === "idle";
|
|
13446
13659
|
}
|
|
13447
13660
|
return true;
|
|
13448
13661
|
}, [sourceChain, ccTransactionStatus, submitted]);
|
|
13449
|
-
const [initialSelection, setInitialSelection] = (0,
|
|
13662
|
+
const [initialSelection, setInitialSelection] = (0, import_react80.useState)({
|
|
13450
13663
|
sourceSelection: true,
|
|
13451
13664
|
targetSelection: true
|
|
13452
13665
|
});
|
|
@@ -13481,17 +13694,17 @@ var TransferWidget = ({
|
|
|
13481
13694
|
isSubmitting,
|
|
13482
13695
|
setIsSubmitting
|
|
13483
13696
|
);
|
|
13484
|
-
const submit = (0,
|
|
13697
|
+
const submit = (0, import_react80.useCallback)(async () => {
|
|
13485
13698
|
try {
|
|
13486
13699
|
await submitTransaction(signature);
|
|
13487
13700
|
} catch (err) {
|
|
13488
13701
|
logger_default.error("[TransferWidget] submit failed", err);
|
|
13489
13702
|
const message = err instanceof Error && err.message ? err.message : "Failed to submit your transaction. Please contact support for assistance.";
|
|
13490
|
-
import_react_hot_toast12.default.error(message, { icon: /* @__PURE__ */ (0,
|
|
13703
|
+
import_react_hot_toast12.default.error(message, { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) });
|
|
13491
13704
|
dispatch(setCCTransactionStatus("error-generic"));
|
|
13492
13705
|
}
|
|
13493
13706
|
}, [signature, submitTransaction, dispatch]);
|
|
13494
|
-
const requestSignature = (0,
|
|
13707
|
+
const requestSignature = (0, import_react80.useCallback)(async () => {
|
|
13495
13708
|
let sig;
|
|
13496
13709
|
setSigning(true);
|
|
13497
13710
|
setFeeOptionDisabled(true);
|
|
@@ -13515,7 +13728,7 @@ var TransferWidget = ({
|
|
|
13515
13728
|
logger_default.error("[TransferWidget] signing failed", err);
|
|
13516
13729
|
import_react_hot_toast12.default.error(
|
|
13517
13730
|
"Failed to sign the message. Please contact support for assistance.",
|
|
13518
|
-
{ icon: /* @__PURE__ */ (0,
|
|
13731
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) }
|
|
13519
13732
|
);
|
|
13520
13733
|
}
|
|
13521
13734
|
return void 0;
|
|
@@ -13533,7 +13746,7 @@ var TransferWidget = ({
|
|
|
13533
13746
|
const handleSubmit = async () => {
|
|
13534
13747
|
const { error, message: validationMessage } = validate(true);
|
|
13535
13748
|
if (error === "ValidationError" /* Error */) {
|
|
13536
|
-
import_react_hot_toast12.default.error(validationMessage, { icon: /* @__PURE__ */ (0,
|
|
13749
|
+
import_react_hot_toast12.default.error(validationMessage, { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) });
|
|
13537
13750
|
return;
|
|
13538
13751
|
}
|
|
13539
13752
|
if (["BANK", "CC"].includes(sourceChain.shortName)) {
|
|
@@ -13560,7 +13773,7 @@ var TransferWidget = ({
|
|
|
13560
13773
|
if (msg.includes("ChainMismatch")) {
|
|
13561
13774
|
import_react_hot_toast12.default.error(
|
|
13562
13775
|
`Your wallet is on the wrong network. Please switch to ${sourceChain.name} and try again.`,
|
|
13563
|
-
{ icon: /* @__PURE__ */ (0,
|
|
13776
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) }
|
|
13564
13777
|
);
|
|
13565
13778
|
return;
|
|
13566
13779
|
}
|
|
@@ -13568,14 +13781,14 @@ var TransferWidget = ({
|
|
|
13568
13781
|
if (/internal json-rpc error|internal rpc error/i.test(errMessage)) {
|
|
13569
13782
|
import_react_hot_toast12.default.error(
|
|
13570
13783
|
"Internal RPC error while approving. Please try again. If this keeps happening, contact support for assistance.",
|
|
13571
|
-
{ icon: /* @__PURE__ */ (0,
|
|
13784
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) }
|
|
13572
13785
|
);
|
|
13573
13786
|
return;
|
|
13574
13787
|
}
|
|
13575
13788
|
logger_default.error("[TransferWidget] approval failed", err);
|
|
13576
13789
|
import_react_hot_toast12.default.error(
|
|
13577
13790
|
"Failed to approve the token allowance. Please contact support for assistance.",
|
|
13578
|
-
{ icon: /* @__PURE__ */ (0,
|
|
13791
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) }
|
|
13579
13792
|
);
|
|
13580
13793
|
} finally {
|
|
13581
13794
|
setApproving(false);
|
|
@@ -13602,11 +13815,11 @@ var TransferWidget = ({
|
|
|
13602
13815
|
logger_default.error("[TransferWidget] handleSubmit failed", err);
|
|
13603
13816
|
const msg = err?.message;
|
|
13604
13817
|
if (msg && String(msg).includes("Fees unavailable")) {
|
|
13605
|
-
import_react_hot_toast12.default.error(String(msg), { icon: /* @__PURE__ */ (0,
|
|
13818
|
+
import_react_hot_toast12.default.error(String(msg), { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) });
|
|
13606
13819
|
} else {
|
|
13607
13820
|
import_react_hot_toast12.default.error(
|
|
13608
13821
|
"An unexpected error occurred while submitting. Please contact support for assistance.",
|
|
13609
|
-
{ icon: /* @__PURE__ */ (0,
|
|
13822
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) }
|
|
13610
13823
|
);
|
|
13611
13824
|
}
|
|
13612
13825
|
setIsSubmitting(false);
|
|
@@ -13627,7 +13840,7 @@ var TransferWidget = ({
|
|
|
13627
13840
|
void handleSubmit();
|
|
13628
13841
|
return;
|
|
13629
13842
|
}
|
|
13630
|
-
import_react_hot_toast12.default.error(validationMessage, { icon: /* @__PURE__ */ (0,
|
|
13843
|
+
import_react_hot_toast12.default.error(validationMessage, { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) });
|
|
13631
13844
|
mainRef.current?.click();
|
|
13632
13845
|
};
|
|
13633
13846
|
const onBack = () => {
|
|
@@ -13655,7 +13868,7 @@ var TransferWidget = ({
|
|
|
13655
13868
|
logger_default.error("[TransferWidget] cancel approve failed", err);
|
|
13656
13869
|
import_react_hot_toast12.default.error(
|
|
13657
13870
|
"Unable to cancel the approval. Please contact support for assistance.",
|
|
13658
|
-
{ icon: /* @__PURE__ */ (0,
|
|
13871
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) }
|
|
13659
13872
|
);
|
|
13660
13873
|
}
|
|
13661
13874
|
} finally {
|
|
@@ -13682,8 +13895,8 @@ var TransferWidget = ({
|
|
|
13682
13895
|
const primaryButtonLabel = getButtonLabel();
|
|
13683
13896
|
const isSmallScreen = windowWidth > 0 && windowWidth <= 500;
|
|
13684
13897
|
const showPermit2Info = formStep === 1 && isPermit2Required && mode !== "light" /* light */ && dAppOption === "none" /* None */ && signature && !isApproved && (primaryButtonLabel === "Approve" || primaryButtonLabel === "Approving...");
|
|
13685
|
-
const permit2InfoTooltip = showPermit2Info ? /* @__PURE__ */ (0,
|
|
13686
|
-
/* @__PURE__ */ (0,
|
|
13898
|
+
const permit2InfoTooltip = showPermit2Info ? /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "permit2-button-info", ref: permit2TooltipRef, children: [
|
|
13899
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13687
13900
|
"button",
|
|
13688
13901
|
{
|
|
13689
13902
|
type: "button",
|
|
@@ -13700,23 +13913,23 @@ var TransferWidget = ({
|
|
|
13700
13913
|
children: "i"
|
|
13701
13914
|
}
|
|
13702
13915
|
),
|
|
13703
|
-
/* @__PURE__ */ (0,
|
|
13916
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
13704
13917
|
"div",
|
|
13705
13918
|
{
|
|
13706
13919
|
className: `permit2-tooltip ${theme.colorMode} ${isPermit2TooltipOpen ? "open" : ""}`,
|
|
13707
13920
|
children: [
|
|
13708
|
-
/* @__PURE__ */ (0,
|
|
13709
|
-
/* @__PURE__ */ (0,
|
|
13921
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("p", { children: PERMIT2_INFO_MESSAGE }),
|
|
13922
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(ExternalLink_default, { className: "permit2-tooltip-link", to: PERMIT2_DOCS_URL, children: "Learn more" })
|
|
13710
13923
|
]
|
|
13711
13924
|
}
|
|
13712
13925
|
)
|
|
13713
13926
|
] }) : null;
|
|
13714
|
-
(0,
|
|
13927
|
+
(0, import_react80.useEffect)(() => {
|
|
13715
13928
|
if (!showPermit2Info && isPermit2TooltipOpen) {
|
|
13716
13929
|
setPermit2TooltipOpen(false);
|
|
13717
13930
|
}
|
|
13718
13931
|
}, [showPermit2Info, isPermit2TooltipOpen]);
|
|
13719
|
-
(0,
|
|
13932
|
+
(0, import_react80.useEffect)(() => {
|
|
13720
13933
|
if (!isSmallScreen && isPermit2TooltipOpen) {
|
|
13721
13934
|
setPermit2TooltipOpen(false);
|
|
13722
13935
|
}
|
|
@@ -13747,11 +13960,11 @@ var TransferWidget = ({
|
|
|
13747
13960
|
logger_default.error("[TransferWidget] reset failed", e);
|
|
13748
13961
|
import_react_hot_toast12.default.error(
|
|
13749
13962
|
"Unable to reset the form. Please contact support for assistance.",
|
|
13750
|
-
{ icon: /* @__PURE__ */ (0,
|
|
13963
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Error_default, {}) }
|
|
13751
13964
|
);
|
|
13752
13965
|
}
|
|
13753
13966
|
};
|
|
13754
|
-
return /* @__PURE__ */ (0,
|
|
13967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
13755
13968
|
"div",
|
|
13756
13969
|
{
|
|
13757
13970
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -13759,7 +13972,7 @@ var TransferWidget = ({
|
|
|
13759
13972
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
13760
13973
|
},
|
|
13761
13974
|
children: [
|
|
13762
|
-
resetModalOpen && /* @__PURE__ */ (0,
|
|
13975
|
+
resetModalOpen && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13763
13976
|
WarningModal_default,
|
|
13764
13977
|
{
|
|
13765
13978
|
message: "Are you sure you want to reset the widget?",
|
|
@@ -13771,7 +13984,7 @@ var TransferWidget = ({
|
|
|
13771
13984
|
onCancel: () => setResetModalOpen(false)
|
|
13772
13985
|
}
|
|
13773
13986
|
),
|
|
13774
|
-
warningModalOpen && /* @__PURE__ */ (0,
|
|
13987
|
+
warningModalOpen && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13775
13988
|
WarningModal_default,
|
|
13776
13989
|
{
|
|
13777
13990
|
message: warningModalOpen.message,
|
|
@@ -13785,21 +13998,22 @@ var TransferWidget = ({
|
|
|
13785
13998
|
}
|
|
13786
13999
|
}
|
|
13787
14000
|
),
|
|
13788
|
-
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */ (0,
|
|
13789
|
-
/* @__PURE__ */ (0,
|
|
13790
|
-
|
|
13791
|
-
|
|
13792
|
-
|
|
13793
|
-
/* @__PURE__ */ (0,
|
|
13794
|
-
|
|
14001
|
+
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("h2", { className: "invalid-option-banner", children: "We're unable to process your payment. Please ensure the necessary transaction details are provided. Contact support if the issue persists." }),
|
|
14002
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(VersionInfo_default, { theme }),
|
|
14003
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "transfer-card", children: [
|
|
14004
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "kima-card-header", children: [
|
|
14005
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "topbar", children: [
|
|
14006
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "title", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("h3", { style: { marginRight: "5px" }, children: formStep === 0 ? titleOption?.initialTitle ?? (mode === "payment" /* payment */ ? "New Purchase" : "New Transfer") : titleOption?.confirmTitle ?? (mode === "payment" /* payment */ ? "Confirm Purchase" : isSwap ? "Swap Details" : "Transfer Details") }) }),
|
|
14007
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "control-buttons", children: [
|
|
14008
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13795
14009
|
ExternalLink_default,
|
|
13796
14010
|
{
|
|
13797
14011
|
to: helpURL ? helpURL : networkOption === "testnet" /* testnet */ ? "https://docs.kima.network/kima-network/try-kima-with-the-demo-app" : "https://support.kima.network",
|
|
13798
|
-
children: /* @__PURE__ */ (0,
|
|
14012
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "menu-button", children: "I need help" })
|
|
13799
14013
|
}
|
|
13800
14014
|
),
|
|
13801
|
-
["BANK", "CC"].includes(sourceChain.shortName) && formStep > 0 && /* @__PURE__ */ (0,
|
|
13802
|
-
formStep === 0 && mode !== "payment" /* payment */ && /* @__PURE__ */ (0,
|
|
14015
|
+
["BANK", "CC"].includes(sourceChain.shortName) && formStep > 0 && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(ExternalLink_default, { to: "https://docs.kima.network/kima-network/supported-fiat#unsupported-countries-credit-cards", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "menu-button", children: "Unsupported Countries" }) }),
|
|
14016
|
+
formStep === 0 && mode !== "payment" /* payment */ && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13803
14017
|
"button",
|
|
13804
14018
|
{
|
|
13805
14019
|
className: "reset-button",
|
|
@@ -13808,32 +14022,32 @@ var TransferWidget = ({
|
|
|
13808
14022
|
children: "Reset"
|
|
13809
14023
|
}
|
|
13810
14024
|
),
|
|
13811
|
-
toastHistory.length > 0 && /* @__PURE__ */ (0,
|
|
14025
|
+
toastHistory.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
13812
14026
|
"div",
|
|
13813
14027
|
{
|
|
13814
14028
|
ref: toastPanelRef,
|
|
13815
14029
|
className: `toast-history ${theme.colorMode}`,
|
|
13816
14030
|
children: [
|
|
13817
|
-
/* @__PURE__ */ (0,
|
|
14031
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13818
14032
|
"button",
|
|
13819
14033
|
{
|
|
13820
14034
|
className: "toast-history-button",
|
|
13821
14035
|
onClick: () => setToastPanelOpen(true),
|
|
13822
14036
|
"aria-label": "Notifications",
|
|
13823
|
-
children: /* @__PURE__ */ (0,
|
|
14037
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Notification_default, { width: 30, height: 30 })
|
|
13824
14038
|
}
|
|
13825
14039
|
),
|
|
13826
|
-
toastPanelOpen && /* @__PURE__ */ (0,
|
|
13827
|
-
/* @__PURE__ */ (0,
|
|
13828
|
-
/* @__PURE__ */ (0,
|
|
13829
|
-
/* @__PURE__ */ (0,
|
|
13830
|
-
/* @__PURE__ */ (0,
|
|
14040
|
+
toastPanelOpen && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: `toast-history-panel ${theme.colorMode}`, children: [
|
|
14041
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "toast-history-header", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { children: "Notifications" }) }),
|
|
14042
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "toast-history-list", children: toastHistory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "toast-history-item", children: [
|
|
14043
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "toast-history-message", children: item.message }),
|
|
14044
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "toast-history-time", children: formatToastTime(item.time) })
|
|
13831
14045
|
] }, item.id)) })
|
|
13832
14046
|
] })
|
|
13833
14047
|
]
|
|
13834
14048
|
}
|
|
13835
14049
|
),
|
|
13836
|
-
closeHandler && /* @__PURE__ */ (0,
|
|
14050
|
+
closeHandler && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13837
14051
|
"button",
|
|
13838
14052
|
{
|
|
13839
14053
|
className: "cross-icon-button",
|
|
@@ -13841,14 +14055,14 @@ var TransferWidget = ({
|
|
|
13841
14055
|
resetForm();
|
|
13842
14056
|
closeHandler(0);
|
|
13843
14057
|
},
|
|
13844
|
-
children: /* @__PURE__ */ (0,
|
|
14058
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Cross_default, {})
|
|
13845
14059
|
}
|
|
13846
14060
|
)
|
|
13847
14061
|
] })
|
|
13848
14062
|
] }),
|
|
13849
|
-
mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */ (0,
|
|
14063
|
+
mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("h4", { className: "subtitle", children: paymentTitleOption.title })
|
|
13850
14064
|
] }),
|
|
13851
|
-
/* @__PURE__ */ (0,
|
|
14065
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "kima-card-content", ref: mainRef, children: formStep === 0 ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13852
14066
|
SingleForm_default,
|
|
13853
14067
|
{
|
|
13854
14068
|
...{
|
|
@@ -13862,7 +14076,7 @@ var TransferWidget = ({
|
|
|
13862
14076
|
setInitialSelection
|
|
13863
14077
|
}
|
|
13864
14078
|
}
|
|
13865
|
-
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */ (0,
|
|
14079
|
+
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(FiatWidget_default, { submitCallback: submit }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13866
14080
|
ConfirmDetails_default,
|
|
13867
14081
|
{
|
|
13868
14082
|
...{
|
|
@@ -13871,12 +14085,12 @@ var TransferWidget = ({
|
|
|
13871
14085
|
}
|
|
13872
14086
|
}
|
|
13873
14087
|
) }),
|
|
13874
|
-
/* @__PURE__ */ (0,
|
|
14088
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13875
14089
|
"div",
|
|
13876
14090
|
{
|
|
13877
14091
|
className: `kima-card-footer ${mode === "bridge" /* bridge */ && formStep !== 0 && "confirm"}`,
|
|
13878
|
-
children: /* @__PURE__ */ (0,
|
|
13879
|
-
isBackButtonEnabled && /* @__PURE__ */ (0,
|
|
14092
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "button-group", children: [
|
|
14093
|
+
isBackButtonEnabled && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13880
14094
|
SecondaryButton_default,
|
|
13881
14095
|
{
|
|
13882
14096
|
clickHandler: onBack,
|
|
@@ -13885,7 +14099,7 @@ var TransferWidget = ({
|
|
|
13885
14099
|
children: formStep > 0 && ccTransactionStatus !== "initialized" ? "Back" : "Cancel"
|
|
13886
14100
|
}
|
|
13887
14101
|
),
|
|
13888
|
-
(!!allowance && allowance > 0n || isPermit2Required && !!permit2Signature) && formStep !== 0 && !["BANK", "CC", "BTC"].includes(sourceChain.shortName) && mode !== "light" /* light */ && /* @__PURE__ */ (0,
|
|
14102
|
+
(!!allowance && allowance > 0n || isPermit2Required && !!permit2Signature) && formStep !== 0 && !["BANK", "CC", "BTC"].includes(sourceChain.shortName) && mode !== "light" /* light */ && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13889
14103
|
SecondaryButton_default,
|
|
13890
14104
|
{
|
|
13891
14105
|
clickHandler: onCancelApprove,
|
|
@@ -13895,7 +14109,7 @@ var TransferWidget = ({
|
|
|
13895
14109
|
children: isCancellingApprove ? "Cancelling Approval" : "Cancel Approve"
|
|
13896
14110
|
}
|
|
13897
14111
|
),
|
|
13898
|
-
isSubmitButtonEnabled && /* @__PURE__ */ (0,
|
|
14112
|
+
isSubmitButtonEnabled && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13899
14113
|
PrimaryButton_default,
|
|
13900
14114
|
{
|
|
13901
14115
|
clickHandler: onNext,
|
|
@@ -13908,10 +14122,10 @@ var TransferWidget = ({
|
|
|
13908
14122
|
] })
|
|
13909
14123
|
}
|
|
13910
14124
|
),
|
|
13911
|
-
/* @__PURE__ */ (0,
|
|
13912
|
-
/* @__PURE__ */ (0,
|
|
13913
|
-
/* @__PURE__ */ (0,
|
|
13914
|
-
/* @__PURE__ */ (0,
|
|
14125
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SolanaConnectModal_default, {}),
|
|
14126
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TronWalletConnectModal_default, {}),
|
|
14127
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(BtcConnectModal_default, {}),
|
|
14128
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
13915
14129
|
import_react_hot_toast12.Toaster,
|
|
13916
14130
|
{
|
|
13917
14131
|
position: "top-right",
|
|
@@ -13935,9 +14149,9 @@ var TransferWidget = ({
|
|
|
13935
14149
|
}
|
|
13936
14150
|
}
|
|
13937
14151
|
),
|
|
13938
|
-
/* @__PURE__ */ (0,
|
|
13939
|
-
/* @__PURE__ */ (0,
|
|
13940
|
-
/* @__PURE__ */ (0,
|
|
14152
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "floating-footer", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: `items ${theme.colorMode}`, children: [
|
|
14153
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { children: "Powered by" }),
|
|
14154
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(KimaNetwork_default, {})
|
|
13941
14155
|
] }) })
|
|
13942
14156
|
] })
|
|
13943
14157
|
]
|
|
@@ -13946,7 +14160,7 @@ var TransferWidget = ({
|
|
|
13946
14160
|
};
|
|
13947
14161
|
|
|
13948
14162
|
// src/widgets/common/KimaWidgetWrapper.tsx
|
|
13949
|
-
var
|
|
14163
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
13950
14164
|
var KimaWidgetWrapper = ({
|
|
13951
14165
|
mode,
|
|
13952
14166
|
txId,
|
|
@@ -13965,7 +14179,7 @@ var KimaWidgetWrapper = ({
|
|
|
13965
14179
|
useDebugCode();
|
|
13966
14180
|
const { kimaBackendUrl } = useKimaContext();
|
|
13967
14181
|
const dispatch = (0, import_react_redux67.useDispatch)();
|
|
13968
|
-
const { setThemeMode, setThemeVariables } = (0,
|
|
14182
|
+
const { setThemeMode, setThemeVariables } = (0, import_react81.useAppKitTheme)();
|
|
13969
14183
|
const submitted = (0, import_react_redux67.useSelector)(selectSubmitted);
|
|
13970
14184
|
const sourceChain = (0, import_react_redux67.useSelector)(selectSourceChain);
|
|
13971
14185
|
const ccTransactionStatus = (0, import_react_redux67.useSelector)(selectCCTransactionStatus);
|
|
@@ -13974,8 +14188,8 @@ var KimaWidgetWrapper = ({
|
|
|
13974
14188
|
const networkOption = envOptions?.env;
|
|
13975
14189
|
const kimaExplorer = envOptions?.kimaExplorer || "https://explorer.sardis.kima.network";
|
|
13976
14190
|
const { currentPlugin } = useGetCurrentPlugin_default();
|
|
13977
|
-
const prevColorMode = (0,
|
|
13978
|
-
(0,
|
|
14191
|
+
const prevColorMode = (0, import_react82.useRef)(void 0);
|
|
14192
|
+
(0, import_react82.useEffect)(() => {
|
|
13979
14193
|
if (prevColorMode.current !== theme?.colorMode) {
|
|
13980
14194
|
dispatch(setTheme(theme));
|
|
13981
14195
|
setThemeMode(
|
|
@@ -13988,7 +14202,7 @@ var KimaWidgetWrapper = ({
|
|
|
13988
14202
|
prevColorMode.current = theme?.colorMode;
|
|
13989
14203
|
}
|
|
13990
14204
|
}, [theme?.colorMode, dispatch, setThemeMode, setThemeVariables, theme]);
|
|
13991
|
-
const prevConfigRef = (0,
|
|
14205
|
+
const prevConfigRef = (0, import_react82.useRef)({
|
|
13992
14206
|
compliantOption: void 0,
|
|
13993
14207
|
backendUrl: void 0,
|
|
13994
14208
|
mode: void 0,
|
|
@@ -13998,7 +14212,7 @@ var KimaWidgetWrapper = ({
|
|
|
13998
14212
|
excludedSourceNetworksJson: "",
|
|
13999
14213
|
excludedTargetNetworksJson: ""
|
|
14000
14214
|
});
|
|
14001
|
-
(0,
|
|
14215
|
+
(0, import_react82.useEffect)(() => {
|
|
14002
14216
|
const excludedSourceNetworksJson = JSON.stringify(excludedSourceNetworks);
|
|
14003
14217
|
const excludedTargetNetworksJson = JSON.stringify(excludedTargetNetworks);
|
|
14004
14218
|
if (prevConfigRef.current.compliantOption !== compliantOption) {
|
|
@@ -14044,7 +14258,7 @@ var KimaWidgetWrapper = ({
|
|
|
14044
14258
|
excludedTargetNetworks,
|
|
14045
14259
|
dispatch
|
|
14046
14260
|
]);
|
|
14047
|
-
(0,
|
|
14261
|
+
(0, import_react82.useEffect)(() => {
|
|
14048
14262
|
const activeTransactionOption = mode === "payment" /* payment */ ? transactionOption : void 0;
|
|
14049
14263
|
const nextJson = activeTransactionOption ? JSON.stringify(transactionOption) : null;
|
|
14050
14264
|
const storedJson = storedTransactionOption ? JSON.stringify(storedTransactionOption) : null;
|
|
@@ -14073,9 +14287,9 @@ var KimaWidgetWrapper = ({
|
|
|
14073
14287
|
dispatch(setAmount(String(activeTransactionOption.amount)));
|
|
14074
14288
|
}
|
|
14075
14289
|
}, [transactionOption, storedTransactionOption, mode, chainData, dispatch]);
|
|
14076
|
-
const prevModeRef = (0,
|
|
14077
|
-
const prevTxIdRef = (0,
|
|
14078
|
-
(0,
|
|
14290
|
+
const prevModeRef = (0, import_react82.useRef)(void 0);
|
|
14291
|
+
const prevTxIdRef = (0, import_react82.useRef)(void 0);
|
|
14292
|
+
(0, import_react82.useEffect)(() => {
|
|
14079
14293
|
const modeChanged = prevModeRef.current !== mode;
|
|
14080
14294
|
const txChanged = prevTxIdRef.current !== txId;
|
|
14081
14295
|
if (mode === "payment" /* payment */ && !transactionOption) {
|
|
@@ -14106,7 +14320,7 @@ var KimaWidgetWrapper = ({
|
|
|
14106
14320
|
prevTxIdRef.current = txId;
|
|
14107
14321
|
}
|
|
14108
14322
|
}, [mode, txId, transactionOption, dispatch]);
|
|
14109
|
-
(0,
|
|
14323
|
+
(0, import_react82.useEffect)(() => {
|
|
14110
14324
|
logger_default.debug("[KimaWidgetWrapper] render", {
|
|
14111
14325
|
mode,
|
|
14112
14326
|
dAppOption,
|
|
@@ -14116,16 +14330,16 @@ var KimaWidgetWrapper = ({
|
|
|
14116
14330
|
sourceChain: sourceChain?.shortName
|
|
14117
14331
|
});
|
|
14118
14332
|
});
|
|
14119
|
-
const pluginKey = (0,
|
|
14333
|
+
const pluginKey = (0, import_react82.useMemo)(() => {
|
|
14120
14334
|
if (!currentPlugin?.id) return null;
|
|
14121
14335
|
return `transfer-${currentPlugin.id}-${sourceChain?.shortName ?? "unknown"}`;
|
|
14122
14336
|
}, [currentPlugin?.id, sourceChain?.shortName]);
|
|
14123
|
-
const content = (0,
|
|
14337
|
+
const content = (0, import_react82.useMemo)(() => {
|
|
14124
14338
|
if (mode === "status" /* status */) {
|
|
14125
|
-
return /* @__PURE__ */ (0,
|
|
14339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TransactionWidget, { theme });
|
|
14126
14340
|
}
|
|
14127
14341
|
if (!currentPlugin && !sourceChain?.shortName) {
|
|
14128
|
-
return /* @__PURE__ */ (0,
|
|
14342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
14129
14343
|
TransferWidget,
|
|
14130
14344
|
{
|
|
14131
14345
|
theme,
|
|
@@ -14137,15 +14351,15 @@ var KimaWidgetWrapper = ({
|
|
|
14137
14351
|
);
|
|
14138
14352
|
}
|
|
14139
14353
|
if (!currentPlugin) {
|
|
14140
|
-
return /* @__PURE__ */ (0,
|
|
14354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(SkeletonLoader_default, { theme });
|
|
14141
14355
|
}
|
|
14142
14356
|
if (sourceChain.shortName === "CC") {
|
|
14143
14357
|
if (submitted) {
|
|
14144
14358
|
logger_default.debug("[KimaWidgetWrapper] CC mode -> TransactionWidget");
|
|
14145
|
-
return /* @__PURE__ */ (0,
|
|
14359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TransactionWidget, { theme });
|
|
14146
14360
|
}
|
|
14147
14361
|
if (ccTransactionStatus === "error-id") {
|
|
14148
|
-
return /* @__PURE__ */ (0,
|
|
14362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
14149
14363
|
ErrorWidget_default,
|
|
14150
14364
|
{
|
|
14151
14365
|
theme,
|
|
@@ -14160,7 +14374,7 @@ var KimaWidgetWrapper = ({
|
|
|
14160
14374
|
);
|
|
14161
14375
|
}
|
|
14162
14376
|
if (ccTransactionStatus === "error-generic") {
|
|
14163
|
-
return /* @__PURE__ */ (0,
|
|
14377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
14164
14378
|
ErrorWidget_default,
|
|
14165
14379
|
{
|
|
14166
14380
|
theme,
|
|
@@ -14174,7 +14388,7 @@ var KimaWidgetWrapper = ({
|
|
|
14174
14388
|
}
|
|
14175
14389
|
);
|
|
14176
14390
|
}
|
|
14177
|
-
return /* @__PURE__ */ (0,
|
|
14391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
14178
14392
|
TransferWidget,
|
|
14179
14393
|
{
|
|
14180
14394
|
theme,
|
|
@@ -14189,7 +14403,7 @@ var KimaWidgetWrapper = ({
|
|
|
14189
14403
|
"[KimaWidgetWrapper] rendering TransferWidget with plugin",
|
|
14190
14404
|
currentPlugin?.id
|
|
14191
14405
|
);
|
|
14192
|
-
return submitted ? /* @__PURE__ */ (0,
|
|
14406
|
+
return submitted ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TransactionWidget, { theme }) : /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
14193
14407
|
TransferWidget,
|
|
14194
14408
|
{
|
|
14195
14409
|
theme,
|
|
@@ -14218,7 +14432,7 @@ var KimaWidgetWrapper = ({
|
|
|
14218
14432
|
var KimaWidgetWrapper_default = KimaWidgetWrapper;
|
|
14219
14433
|
|
|
14220
14434
|
// src/widgets/common/KimaTransactionWidget.tsx
|
|
14221
|
-
var
|
|
14435
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
14222
14436
|
var KimaTransactionWidget = ({
|
|
14223
14437
|
mode,
|
|
14224
14438
|
txId,
|
|
@@ -14234,7 +14448,7 @@ var KimaTransactionWidget = ({
|
|
|
14234
14448
|
}) => {
|
|
14235
14449
|
const dispatch = (0, import_react_redux68.useDispatch)();
|
|
14236
14450
|
const { kimaBackendUrl } = useKimaContext();
|
|
14237
|
-
const [hydrated, setHydrated] = (0,
|
|
14451
|
+
const [hydrated, setHydrated] = (0, import_react83.useState)(false);
|
|
14238
14452
|
const {
|
|
14239
14453
|
data: envOptions,
|
|
14240
14454
|
error: envOptionsError,
|
|
@@ -14245,20 +14459,20 @@ var KimaTransactionWidget = ({
|
|
|
14245
14459
|
error: chainDataError,
|
|
14246
14460
|
isLoading: isLoadingChainData
|
|
14247
14461
|
} = useChainData(kimaBackendUrl);
|
|
14248
|
-
(0,
|
|
14462
|
+
(0, import_react83.useEffect)(() => {
|
|
14249
14463
|
if (typeof window !== "undefined") setHydrated(true);
|
|
14250
14464
|
}, []);
|
|
14251
|
-
(0,
|
|
14465
|
+
(0, import_react83.useEffect)(() => {
|
|
14252
14466
|
if (theme?.colorMode) {
|
|
14253
14467
|
dispatch(setTheme(theme));
|
|
14254
14468
|
}
|
|
14255
14469
|
}, [theme?.colorMode, dispatch, theme]);
|
|
14256
14470
|
if (!hydrated || !theme?.colorMode)
|
|
14257
|
-
return /* @__PURE__ */ (0,
|
|
14471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ring_default, { width: 20, height: 20, fill: "#86b8ce" });
|
|
14258
14472
|
if (isLoadingEnvs || isLoadingChainData)
|
|
14259
|
-
return /* @__PURE__ */ (0,
|
|
14473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SkeletonLoader_default, { theme });
|
|
14260
14474
|
if (envOptionsError || !envOptions)
|
|
14261
|
-
return /* @__PURE__ */ (0,
|
|
14475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14262
14476
|
ErrorWidget_default,
|
|
14263
14477
|
{
|
|
14264
14478
|
theme,
|
|
@@ -14267,7 +14481,7 @@ var KimaTransactionWidget = ({
|
|
|
14267
14481
|
}
|
|
14268
14482
|
);
|
|
14269
14483
|
if (chainDataError || !chainData)
|
|
14270
|
-
return /* @__PURE__ */ (0,
|
|
14484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14271
14485
|
ErrorWidget_default,
|
|
14272
14486
|
{
|
|
14273
14487
|
theme,
|
|
@@ -14275,7 +14489,7 @@ var KimaTransactionWidget = ({
|
|
|
14275
14489
|
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 */
|
|
14276
14490
|
}
|
|
14277
14491
|
);
|
|
14278
|
-
return /* @__PURE__ */ (0,
|
|
14492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ToastHistoryProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14279
14493
|
KimaWidgetWrapper_default,
|
|
14280
14494
|
{
|
|
14281
14495
|
...{
|