@aurora-is-near/intents-swap-widget 3.15.1 → 3.15.2
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/{config-DCXH00Br.js → config-CJfcVohD.js} +419 -417
- package/dist/{config-DCXH00Br.js.map → config-CJfcVohD.js.map} +1 -1
- package/dist/config.js +5 -4
- package/dist/config.js.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/ext/alchemy/index.js +1 -1
- package/dist/ext/index.js +1 -1
- package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
- package/dist/features/BalanceRpcLoader/index.js +1 -1
- package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
- package/dist/features/ChainsDropdown/ChainItem.d.ts +4 -1
- package/dist/features/ChainsDropdown/ChainItem.js +28 -21
- package/dist/features/ChainsDropdown/ChainItem.js.map +1 -1
- package/dist/features/ChainsDropdown/index.js +65 -62
- package/dist/features/ChainsDropdown/index.js.map +1 -1
- package/dist/features/DepositMethodSwitcher.js +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +1 -1
- package/dist/features/SendAddress/index.js +1 -1
- package/dist/features/SendAddress/useNotification.js +1 -1
- package/dist/features/SubmitButton/index.js +1 -1
- package/dist/features/SuccessScreen/index.js +1 -1
- package/dist/features/SwapDirectionSwitcher.js +1 -1
- package/dist/features/SwapQuote/SwapQuote.js +1 -1
- package/dist/features/SwapQuote/index.js +1 -1
- package/dist/features/TokenInput/TokenInput.js +1 -1
- package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
- package/dist/features/TokenInput/TokenInputSource.js +1 -1
- package/dist/features/TokenInput/TokenInputTarget.js +1 -1
- package/dist/features/TokenInput/WalletBalance.js +1 -1
- package/dist/features/TokenInput/hooks/index.js +1 -1
- package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
- package/dist/features/TokenInput/index.js +1 -1
- package/dist/features/TokensList/TokenItem.js +1 -1
- package/dist/features/TokensList/TokensList.js +1 -1
- package/dist/features/TokensList/index.js +1 -1
- package/dist/features/TokensModal.js +37 -39
- package/dist/features/TokensModal.js.map +1 -1
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +20 -4
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js.map +1 -1
- package/dist/features/WalletCompatibilityCheck/index.js +1 -1
- package/dist/features/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +10 -8
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useAllTokens.js +1 -1
- package/dist/hooks/useChains.js +1 -1
- package/dist/hooks/useCompatibilityCheck.js +1 -1
- package/dist/hooks/useDefaultToken.js +1 -1
- package/dist/hooks/useExternalDepositStatus/index.js +1 -1
- package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
- package/dist/hooks/useHandleKeyDown.d.ts +1 -0
- package/dist/hooks/useHandleKeyDown.js +15 -0
- package/dist/hooks/useHandleKeyDown.js.map +1 -0
- package/dist/hooks/useIntentsBalance.js +1 -1
- package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
- package/dist/hooks/useMakeDepositAddress.js +1 -1
- package/dist/hooks/useMakeIntentsTransfer.js +1 -1
- package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
- package/dist/hooks/useMakeQuote.js +1 -1
- package/dist/hooks/useMakeQuoteTransfer.js +1 -1
- package/dist/hooks/useMakeTransfer.js +1 -1
- package/dist/hooks/useMergedBalance.js +1 -1
- package/dist/hooks/useSwitchChain.js +1 -1
- package/dist/hooks/useTheme.js +1 -1
- package/dist/hooks/useTokenInputPair.js +1 -1
- package/dist/hooks/useTokens.js +1 -1
- package/dist/hooks/useTokensFiltered.js +1 -1
- package/dist/hooks/useTokensIntentsUnique.js +1 -1
- package/dist/index.js +42 -40
- package/dist/index.js.map +1 -1
- package/dist/machine/effects/index.js +1 -1
- package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
- package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
- package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
- package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
- package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
- package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
- package/dist/machine/effects/useWalletConnEffect.js +1 -1
- package/dist/machine/events/index.js +1 -1
- package/dist/machine/events/tokenSelect.js +1 -1
- package/dist/machine/events/validateInputAndMoveTo.js +1 -1
- package/dist/machine/events/validateInputs.js +1 -1
- package/dist/machine/index.js +1 -1
- package/dist/machine/snap.js +1 -1
- package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
- package/dist/machine/subscriptions/index.js +1 -1
- package/dist/theme/ThemeProvider.js +1 -1
- package/dist/utils/intents/signers/near.js +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +10 -9
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +4 -3
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +4 -3
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
- package/package.json +1 -1
- package/src/features/ChainsDropdown/ChainItem.tsx +14 -6
- package/src/features/ChainsDropdown/index.tsx +56 -47
- package/src/features/TokensModal.tsx +6 -3
- package/src/features/WalletCompatibilityCheck/WalletCompatibilityModal.tsx +10 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useHandleKeyDown.ts +17 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as r, jsx as t, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import * as
|
|
4
|
-
import { b as
|
|
1
|
+
import { jsxs as r, jsx as t, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d } from "react";
|
|
3
|
+
import * as g from "lucide-react";
|
|
4
|
+
import { b as N, y as T, d as j, q as E } from "../config-CJfcVohD.js";
|
|
5
5
|
import { ChainsDropdown as I } from "./ChainsDropdown/index.js";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
7
|
import "@defuse-protocol/one-click-sdk-typescript";
|
|
8
8
|
import "../constants/chains.js";
|
|
9
9
|
import "ethers";
|
|
10
10
|
import "../machine/machine.js";
|
|
11
|
-
import { notReachable as
|
|
11
|
+
import { notReachable as h } from "../utils/notReachable.js";
|
|
12
12
|
import "zod";
|
|
13
13
|
import "../utils/near/rpc.js";
|
|
14
14
|
import "../index-DEq3oXQF.js";
|
|
@@ -23,53 +23,51 @@ import "viem";
|
|
|
23
23
|
import { cn as M } from "../utils/cn.js";
|
|
24
24
|
import "viem/chains";
|
|
25
25
|
import "browser-or-node";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
26
|
+
import { useHandleKeyDown as B } from "../hooks/useHandleKeyDown.js";
|
|
27
|
+
import { Hr as D } from "../components/Hr.js";
|
|
28
|
+
import { Card as H } from "../components/Card.js";
|
|
28
29
|
import { Input as q } from "../components/Input.js";
|
|
29
30
|
import { Banner as v } from "../components/Banner.js";
|
|
30
31
|
import { CloseButton as A } from "../components/CloseButton.js";
|
|
31
|
-
import { useTypedTranslation as
|
|
32
|
-
const
|
|
32
|
+
import { useTypedTranslation as K } from "../localisation.js";
|
|
33
|
+
const ue = ({
|
|
33
34
|
variant: s,
|
|
34
|
-
showBalances:
|
|
35
|
-
showChainsSelector:
|
|
35
|
+
showBalances: f,
|
|
36
|
+
showChainsSelector: u,
|
|
36
37
|
chainsFilter: a,
|
|
37
|
-
groupTokens:
|
|
38
|
-
className:
|
|
39
|
-
onMsg:
|
|
38
|
+
groupTokens: w,
|
|
39
|
+
className: x,
|
|
40
|
+
onMsg: l
|
|
40
41
|
}) => {
|
|
41
|
-
const { t:
|
|
42
|
+
const { t: C } = K(), { ctx: k } = N(), { walletSupportedChains: y } = T(), [i, p] = d(""), n = j(s), c = () => l({ type: "on_dismiss_tokens_modal" });
|
|
43
|
+
B("Escape", c);
|
|
44
|
+
const S = n.length === 1 && n[0]?.id ? n[0]?.id : "all", [o, _] = d(S), m = o !== "all" && o !== "intents" && a.external !== "all" && !y.includes(o);
|
|
42
45
|
return /* @__PURE__ */ r(
|
|
43
|
-
|
|
46
|
+
H,
|
|
44
47
|
{
|
|
45
48
|
padding: "none",
|
|
46
49
|
className: M(
|
|
47
50
|
"w-full gap-sw-xl flex flex-col px-sw-2xl pt-sw-2xl",
|
|
48
|
-
|
|
51
|
+
x
|
|
49
52
|
),
|
|
50
53
|
children: [
|
|
51
54
|
/* @__PURE__ */ r("header", { className: "flex items-center justify-between", children: [
|
|
52
55
|
/* @__PURE__ */ t("h2", { className: "text-sw-label-lg text-sw-gray-50", children: "Select token" }),
|
|
53
|
-
/* @__PURE__ */ t(
|
|
54
|
-
A,
|
|
55
|
-
{
|
|
56
|
-
onClick: () => i({ type: "on_dismiss_tokens_modal" })
|
|
57
|
-
}
|
|
58
|
-
)
|
|
56
|
+
/* @__PURE__ */ t(A, { onClick: c })
|
|
59
57
|
] }),
|
|
60
58
|
/* @__PURE__ */ r("div", { className: "gap-sw-xl flex items-center", children: [
|
|
61
59
|
/* @__PURE__ */ t(
|
|
62
60
|
q,
|
|
63
61
|
{
|
|
64
62
|
focusOnMount: !0,
|
|
65
|
-
icon:
|
|
66
|
-
defaultValue:
|
|
63
|
+
icon: g.Search,
|
|
64
|
+
defaultValue: i,
|
|
67
65
|
className: "w-full",
|
|
68
66
|
placeholder: "Search or paste address",
|
|
69
67
|
onChange: (e) => p(e.target.value.trim())
|
|
70
68
|
}
|
|
71
69
|
),
|
|
72
|
-
|
|
70
|
+
u && /* @__PURE__ */ t(
|
|
73
71
|
I,
|
|
74
72
|
{
|
|
75
73
|
variant: s,
|
|
@@ -78,48 +76,48 @@ const de = ({
|
|
|
78
76
|
onMsg: (e) => {
|
|
79
77
|
switch (e.type) {
|
|
80
78
|
case "on_click_chain":
|
|
81
|
-
|
|
79
|
+
_(e.chain);
|
|
82
80
|
break;
|
|
83
81
|
default:
|
|
84
|
-
|
|
82
|
+
h(e.type, { throwError: !1 });
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
)
|
|
89
87
|
] }),
|
|
90
|
-
|
|
88
|
+
m && !!k.walletAddress && /* @__PURE__ */ r(b, { children: [
|
|
91
89
|
/* @__PURE__ */ t(
|
|
92
90
|
v,
|
|
93
91
|
{
|
|
94
92
|
variant: "error",
|
|
95
|
-
message:
|
|
93
|
+
message: C(
|
|
96
94
|
"wallet.connected.error.notSupportedChain",
|
|
97
95
|
"This network isn’t supported by your wallet."
|
|
98
96
|
)
|
|
99
97
|
}
|
|
100
98
|
),
|
|
101
|
-
/* @__PURE__ */ t(
|
|
99
|
+
/* @__PURE__ */ t(D, {})
|
|
102
100
|
] }),
|
|
103
101
|
/* @__PURE__ */ t(
|
|
104
|
-
|
|
102
|
+
E,
|
|
105
103
|
{
|
|
106
104
|
variant: s,
|
|
107
|
-
search:
|
|
108
|
-
groupTokens:
|
|
109
|
-
showBalances:
|
|
105
|
+
search: i,
|
|
106
|
+
groupTokens: w,
|
|
107
|
+
showBalances: f,
|
|
110
108
|
chainsFilter: a,
|
|
111
109
|
selectedChain: o,
|
|
112
|
-
chainIsNotSupported:
|
|
110
|
+
chainIsNotSupported: m,
|
|
113
111
|
onMsg: (e) => {
|
|
114
112
|
switch (e.type) {
|
|
115
113
|
case "on_reset_search":
|
|
116
114
|
p("");
|
|
117
115
|
break;
|
|
118
116
|
case "on_select_token":
|
|
119
|
-
|
|
117
|
+
l(e);
|
|
120
118
|
break;
|
|
121
119
|
default:
|
|
122
|
-
|
|
120
|
+
h(e, { throwError: !1 });
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
}
|
|
@@ -129,6 +127,6 @@ const de = ({
|
|
|
129
127
|
);
|
|
130
128
|
};
|
|
131
129
|
export {
|
|
132
|
-
|
|
130
|
+
ue as TokensModal
|
|
133
131
|
};
|
|
134
132
|
//# sourceMappingURL=TokensModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokensModal.js","sources":["../../src/features/TokensModal.tsx"],"sourcesContent":["import { useState } from 'react';\nimport * as Icons from 'lucide-react';\n\nimport { TokensList } from './TokensList';\nimport { ChainsDropdown } from './ChainsDropdown';\nimport { useChains } from '../hooks';\nimport { Hr } from '@/components/Hr';\nimport { Card } from '@/components/Card';\nimport { Input } from '@/components/Input';\nimport { Banner } from '@/components/Banner';\nimport { CloseButton } from '@/components/CloseButton';\n\nimport { cn } from '@/utils/cn';\nimport { useConfig } from '@/config';\nimport { useUnsafeSnapshot } from '@/machine/snap';\nimport { notReachable } from '@/utils/notReachable';\nimport { useTypedTranslation } from '@/localisation';\nimport type { Chains, ChainsFilter } from '@/types/chain';\nimport type { Token } from '@/types/token';\n\ntype Msg =\n | { type: 'on_select_token'; token: Token }\n | { type: 'on_dismiss_tokens_modal' };\n\ntype Props = {\n variant: 'source' | 'target';\n groupTokens: boolean;\n showBalances: boolean;\n showChainsSelector: boolean;\n chainsFilter: ChainsFilter;\n className?: string;\n onMsg: (msg: Msg) => void;\n};\n\nexport const TokensModal = ({\n variant,\n showBalances,\n showChainsSelector,\n chainsFilter,\n groupTokens,\n className,\n onMsg,\n}: Props) => {\n const { t } = useTypedTranslation();\n const { ctx } = useUnsafeSnapshot();\n const { walletSupportedChains } = useConfig();\n\n const [search, setSearch] = useState('');\n const chains = useChains(variant);\n\n // If there is only one chain available, select it by default\n const defaultChain =\n chains.length === 1 && chains[0]?.id ? chains[0]?.id : 'all';\n\n const [selectedChain, setSelectedChain] = useState<\n 'all' | 'intents' | Chains\n >(defaultChain);\n\n // selected chain is not supported by connected wallet\n const chainIsNotSupported =\n selectedChain !== 'all' &&\n selectedChain !== 'intents' &&\n chainsFilter.external !== 'all' &&\n !walletSupportedChains.includes(selectedChain);\n\n return (\n <Card\n padding=\"none\"\n className={cn(\n 'w-full gap-sw-xl flex flex-col px-sw-2xl pt-sw-2xl',\n className,\n )}>\n <header className=\"flex items-center justify-between\">\n <h2 className=\"text-sw-label-lg text-sw-gray-50\">Select token</h2>\n <CloseButton
|
|
1
|
+
{"version":3,"file":"TokensModal.js","sources":["../../src/features/TokensModal.tsx"],"sourcesContent":["import { useState } from 'react';\nimport * as Icons from 'lucide-react';\n\nimport { TokensList } from './TokensList';\nimport { ChainsDropdown } from './ChainsDropdown';\nimport { useChains } from '../hooks';\nimport { Hr } from '@/components/Hr';\nimport { Card } from '@/components/Card';\nimport { Input } from '@/components/Input';\nimport { Banner } from '@/components/Banner';\nimport { CloseButton } from '@/components/CloseButton';\n\nimport { cn } from '@/utils/cn';\nimport { useConfig } from '@/config';\nimport { useHandleKeyDown } from '@/hooks';\nimport { useUnsafeSnapshot } from '@/machine/snap';\nimport { notReachable } from '@/utils/notReachable';\nimport { useTypedTranslation } from '@/localisation';\nimport type { Chains, ChainsFilter } from '@/types/chain';\nimport type { Token } from '@/types/token';\n\ntype Msg =\n | { type: 'on_select_token'; token: Token }\n | { type: 'on_dismiss_tokens_modal' };\n\ntype Props = {\n variant: 'source' | 'target';\n groupTokens: boolean;\n showBalances: boolean;\n showChainsSelector: boolean;\n chainsFilter: ChainsFilter;\n className?: string;\n onMsg: (msg: Msg) => void;\n};\n\nexport const TokensModal = ({\n variant,\n showBalances,\n showChainsSelector,\n chainsFilter,\n groupTokens,\n className,\n onMsg,\n}: Props) => {\n const { t } = useTypedTranslation();\n const { ctx } = useUnsafeSnapshot();\n const { walletSupportedChains } = useConfig();\n\n const [search, setSearch] = useState('');\n const chains = useChains(variant);\n\n const handleClose = () => onMsg({ type: 'on_dismiss_tokens_modal' });\n\n useHandleKeyDown('Escape', handleClose);\n\n // If there is only one chain available, select it by default\n const defaultChain =\n chains.length === 1 && chains[0]?.id ? chains[0]?.id : 'all';\n\n const [selectedChain, setSelectedChain] = useState<\n 'all' | 'intents' | Chains\n >(defaultChain);\n\n // selected chain is not supported by connected wallet\n const chainIsNotSupported =\n selectedChain !== 'all' &&\n selectedChain !== 'intents' &&\n chainsFilter.external !== 'all' &&\n !walletSupportedChains.includes(selectedChain);\n\n return (\n <Card\n padding=\"none\"\n className={cn(\n 'w-full gap-sw-xl flex flex-col px-sw-2xl pt-sw-2xl',\n className,\n )}>\n <header className=\"flex items-center justify-between\">\n <h2 className=\"text-sw-label-lg text-sw-gray-50\">Select token</h2>\n <CloseButton onClick={handleClose} />\n </header>\n\n <div className=\"gap-sw-xl flex items-center\">\n <Input\n focusOnMount\n icon={Icons.Search}\n defaultValue={search}\n className=\"w-full\"\n placeholder=\"Search or paste address\"\n onChange={(e) => setSearch(e.target.value.trim())}\n />\n {showChainsSelector && (\n <ChainsDropdown\n variant={variant}\n selected={selectedChain}\n chainsFilter={chainsFilter}\n onMsg={(msg) => {\n switch (msg.type) {\n case 'on_click_chain':\n setSelectedChain(msg.chain);\n break;\n default:\n notReachable(msg.type, { throwError: false });\n }\n }}\n />\n )}\n </div>\n\n {chainIsNotSupported && !!ctx.walletAddress && (\n <>\n <Banner\n variant=\"error\"\n message={t(\n 'wallet.connected.error.notSupportedChain',\n 'This network isn’t supported by your wallet.',\n )}\n />\n <Hr />\n </>\n )}\n\n <TokensList\n variant={variant}\n search={search}\n groupTokens={groupTokens}\n showBalances={showBalances}\n chainsFilter={chainsFilter}\n selectedChain={selectedChain}\n chainIsNotSupported={chainIsNotSupported}\n onMsg={(msg) => {\n switch (msg.type) {\n case 'on_reset_search':\n setSearch('');\n break;\n case 'on_select_token':\n onMsg(msg);\n break;\n default:\n notReachable(msg, { throwError: false });\n }\n }}\n />\n </Card>\n );\n};\n"],"names":["TokensModal","variant","showBalances","showChainsSelector","chainsFilter","groupTokens","className","onMsg","t","useTypedTranslation","ctx","useUnsafeSnapshot","walletSupportedChains","useConfig","search","setSearch","useState","chains","useChains","handleClose","useHandleKeyDown","defaultChain","selectedChain","setSelectedChain","chainIsNotSupported","jsxs","Card","cn","jsx","CloseButton","Input","Icons","ChainsDropdown","msg","notReachable","Fragment","Banner","Hr","TokensList"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,MAAMA,KAAc,CAAC;AAAA,EAC1B,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AACF,MAAa;AACX,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,KAAAC,EAAA,IAAQC,EAAA,GACV,EAAE,uBAAAC,EAAA,IAA0BC,EAAA,GAE5B,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAE,GACjCC,IAASC,EAAUjB,CAAO,GAE1BkB,IAAc,MAAMZ,EAAM,EAAE,MAAM,2BAA2B;AAEnE,EAAAa,EAAiB,UAAUD,CAAW;AAGtC,QAAME,IACJJ,EAAO,WAAW,KAAKA,EAAO,CAAC,GAAG,KAAKA,EAAO,CAAC,GAAG,KAAK,OAEnD,CAACK,GAAeC,CAAgB,IAAIP,EAExCK,CAAY,GAGRG,IACJF,MAAkB,SAClBA,MAAkB,aAClBlB,EAAa,aAAa,SAC1B,CAACQ,EAAsB,SAASU,CAAa;AAE/C,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,WAAWC;AAAA,QACT;AAAA,QACArB;AAAA,MAAA;AAAA,MAEF,UAAA;AAAA,QAAA,gBAAAmB,EAAC,UAAA,EAAO,WAAU,qCAChB,UAAA;AAAA,UAAA,gBAAAG,EAAC,MAAA,EAAG,WAAU,oCAAmC,UAAA,gBAAY;AAAA,UAC7D,gBAAAA,EAACC,GAAA,EAAY,SAASV,EAAA,CAAa;AAAA,QAAA,GACrC;AAAA,QAEA,gBAAAM,EAAC,OAAA,EAAI,WAAU,+BACb,UAAA;AAAA,UAAA,gBAAAG;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,cAAY;AAAA,cACZ,MAAMC,EAAM;AAAA,cACZ,cAAcjB;AAAA,cACd,WAAU;AAAA,cACV,aAAY;AAAA,cACZ,UAAU,CAAC,MAAMC,EAAU,EAAE,OAAO,MAAM,MAAM;AAAA,YAAA;AAAA,UAAA;AAAA,UAEjDZ,KACC,gBAAAyB;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,SAAA/B;AAAA,cACA,UAAUqB;AAAA,cACV,cAAAlB;AAAA,cACA,OAAO,CAAC6B,MAAQ;AACd,wBAAQA,EAAI,MAAA;AAAA,kBACV,KAAK;AACH,oBAAAV,EAAiBU,EAAI,KAAK;AAC1B;AAAA,kBACF;AACE,oBAAAC,EAAaD,EAAI,MAAM,EAAE,YAAY,IAAO;AAAA,gBAAA;AAAA,cAElD;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,GAEJ;AAAA,QAECT,KAAuB,CAAC,CAACd,EAAI,iBAC5B,gBAAAe,EAAAU,GAAA,EACE,UAAA;AAAA,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,SAAS5B;AAAA,gBACP;AAAA,gBACA;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,4BAED6B,GAAA,CAAA,CAAG;AAAA,QAAA,GACN;AAAA,QAGF,gBAAAT;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,SAAArC;AAAA,YACA,QAAAa;AAAA,YACA,aAAAT;AAAA,YACA,cAAAH;AAAA,YACA,cAAAE;AAAA,YACA,eAAAkB;AAAA,YACA,qBAAAE;AAAA,YACA,OAAO,CAACS,MAAQ;AACd,sBAAQA,EAAI,MAAA;AAAA,gBACV,KAAK;AACH,kBAAAlB,EAAU,EAAE;AACZ;AAAA,gBACF,KAAK;AACH,kBAAAR,EAAM0B,CAAG;AACT;AAAA,gBACF;AACE,kBAAAC,EAAaD,GAAK,EAAE,YAAY,GAAA,CAAO;AAAA,cAAA;AAAA,YAE7C;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -7,6 +7,23 @@ import "../../constants/chains.js";
|
|
|
7
7
|
import "viem";
|
|
8
8
|
import "ethers";
|
|
9
9
|
import "../../utils/cn.js";
|
|
10
|
+
import "@tanstack/react-query";
|
|
11
|
+
import "@defuse-protocol/one-click-sdk-typescript";
|
|
12
|
+
import { ag as F, af as G, z as H } from "../../config-CJfcVohD.js";
|
|
13
|
+
import "../../machine/machine.js";
|
|
14
|
+
import "zod";
|
|
15
|
+
import "../../utils/near/rpc.js";
|
|
16
|
+
import "../../index-DEq3oXQF.js";
|
|
17
|
+
import "@defuse-protocol/bridge-sdk";
|
|
18
|
+
import "change-case";
|
|
19
|
+
import "@defuse-protocol/internal-utils";
|
|
20
|
+
import "bs58";
|
|
21
|
+
import "../../index-xuotMAFm.js";
|
|
22
|
+
import "axios";
|
|
23
|
+
import "../../network.js";
|
|
24
|
+
import "viem/chains";
|
|
25
|
+
import "browser-or-node";
|
|
26
|
+
import "../../hooks/useHandleKeyDown.js";
|
|
10
27
|
import "lucide-react";
|
|
11
28
|
import "../../components/Card.js";
|
|
12
29
|
import "../../components/Button.js";
|
|
@@ -14,11 +31,10 @@ import "copy-text-to-clipboard";
|
|
|
14
31
|
import "@headlessui/react";
|
|
15
32
|
import "../../components/InputAmount.js";
|
|
16
33
|
import "../../components/Notes.js";
|
|
17
|
-
import { ag as C, af as E, z as I } from "../../config-DCXH00Br.js";
|
|
18
34
|
import "../../components/CloseButton.js";
|
|
19
35
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
36
|
+
F as ErrorView,
|
|
37
|
+
G as Initial,
|
|
38
|
+
H as WalletCompatibilityModal
|
|
23
39
|
};
|
|
24
40
|
//# sourceMappingURL=WalletCompatibilityModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletCompatibilityModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WalletCompatibilityModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as r } from "react";
|
|
3
|
-
import { b, z as n } from "../../config-
|
|
3
|
+
import { b, z as n } from "../../config-CJfcVohD.js";
|
|
4
4
|
import "ethers";
|
|
5
5
|
import "../../machine/machine.js";
|
|
6
6
|
import { notReachable as l } from "../../utils/notReachable.js";
|
package/dist/features/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as r, S as t, o as p, p as a, T as s, q as n } from "../config-
|
|
1
|
+
import { B as r, S as t, o as p, p as a, T as s, q as n } from "../config-CJfcVohD.js";
|
|
2
2
|
import { ChainsDropdown as m } from "./ChainsDropdown/index.js";
|
|
3
3
|
import { SendAddress as c } from "./SendAddress/index.js";
|
|
4
4
|
import { SuccessScreen as S } from "./SuccessScreen/index.js";
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export { useWalletBalance } from './useWalletBalance';
|
|
|
16
16
|
export { useExternalDepositStatus } from './useExternalDepositStatus';
|
|
17
17
|
export { useIsCompatibilityCheckRequired } from './useIsCompatibilityCheckRequired';
|
|
18
18
|
export { useToggleTheme } from './useToggleTheme';
|
|
19
|
+
export { useHandleKeyDown } from './useHandleKeyDown';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { e as a, d as r, f as o, g as t, h as
|
|
1
|
+
import { e as a, d as r, f as o, g as t, h as n, j as u, i as f, k as l, l as m, n as k, m as p } from "../config-CJfcVohD.js";
|
|
2
2
|
import { useMakeEvmTransfer as T } from "./useMakeEvmTransfer.js";
|
|
3
3
|
import { useMakeSolanaTransfer as M } from "./useMakeSolanaTransfer.js";
|
|
4
4
|
import { useTokenInputPair as c } from "./useTokenInputPair.js";
|
|
5
5
|
import { useWalletBalance as g } from "./useWalletBalance.js";
|
|
6
6
|
import { useExternalDepositStatus as I } from "./useExternalDepositStatus/index.js";
|
|
7
7
|
import { useIsCompatibilityCheckRequired as S } from "./useIsCompatibilityCheckRequired.js";
|
|
8
|
-
import { useToggleTheme as
|
|
8
|
+
import { useToggleTheme as y } from "./useToggleTheme.js";
|
|
9
|
+
import { useHandleKeyDown as E } from "./useHandleKeyDown.js";
|
|
9
10
|
export {
|
|
10
11
|
a as useAllTokens,
|
|
11
12
|
r as useChains,
|
|
12
13
|
I as useExternalDepositStatus,
|
|
14
|
+
E as useHandleKeyDown,
|
|
13
15
|
o as useIntentsBalance,
|
|
14
16
|
S as useIsCompatibilityCheckRequired,
|
|
15
17
|
T as useMakeEvmTransfer,
|
|
16
18
|
t as useMakeIntentsTransfer,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
n as useMakeQuote,
|
|
20
|
+
u as useMakeQuoteTransfer,
|
|
19
21
|
M as useMakeSolanaTransfer,
|
|
20
22
|
f as useMakeTransfer,
|
|
21
23
|
l as useMergedBalance,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
m as useSwitchChain,
|
|
25
|
+
y as useToggleTheme,
|
|
24
26
|
c as useTokenInputPair,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
k as useTokens,
|
|
28
|
+
p as useTokensFiltered,
|
|
27
29
|
g as useWalletBalance
|
|
28
30
|
};
|
|
29
31
|
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/dist/hooks/useChains.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState as f } from "react";
|
|
2
2
|
import { B as l } from "../index-DEq3oXQF.js";
|
|
3
3
|
import { verifyWalletSignature as N, walletVerificationMessageFactory as p } from "../utils/intents/walletCompatibilityVerification.js";
|
|
4
|
-
import { y, w as o } from "../config-
|
|
4
|
+
import { y, w as o } from "../config-CJfcVohD.js";
|
|
5
5
|
import { notReachable as A } from "../utils/notReachable.js";
|
|
6
6
|
import { getIntentsAccountId as S } from "../utils/intents/getIntentsAccountId.js";
|
|
7
7
|
import { localStorageTyped as u } from "../utils/localstorage.js";
|
|
@@ -5,7 +5,7 @@ import "ethers";
|
|
|
5
5
|
import "../../utils/cn.js";
|
|
6
6
|
import { notReachable as l } from "../../utils/notReachable.js";
|
|
7
7
|
import { useOneClickExternalDepositStatus as p } from "./useOneClickExternalDepositStatus.js";
|
|
8
|
-
import { b as c, u as m, A as S, v as f } from "../../config-
|
|
8
|
+
import { b as c, u as m, A as S, v as f } from "../../config-CJfcVohD.js";
|
|
9
9
|
import { WNEAR_ASSET_ID as D } from "../../constants/tokens.js";
|
|
10
10
|
import { guardStates as h } from "../../machine/guards/index.js";
|
|
11
11
|
import "../../machine/machine.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useHandleKeyDown: (key: string, onKeyPress: () => void) => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect as d } from "react";
|
|
2
|
+
const w = (e, o) => {
|
|
3
|
+
d(() => {
|
|
4
|
+
const n = (t) => {
|
|
5
|
+
t.key === e && o();
|
|
6
|
+
};
|
|
7
|
+
return window.addEventListener("keydown", n), () => {
|
|
8
|
+
window.removeEventListener("keydown", n);
|
|
9
|
+
};
|
|
10
|
+
}, [e]);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
w as useHandleKeyDown
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useHandleKeyDown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHandleKeyDown.js","sources":["../../src/hooks/useHandleKeyDown.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nexport const useHandleKeyDown = (key: string, onKeyPress: () => void) => {\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === key) {\n onKeyPress();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [key]);\n};\n"],"names":["useHandleKeyDown","key","onKeyPress","useEffect","handleKeyDown","event"],"mappings":";AAEO,MAAMA,IAAmB,CAACC,GAAaC,MAA2B;AACvE,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAgB,CAACC,MAAyB;AAC9C,MAAIA,EAAM,QAAQJ,KAChBC,EAAA;AAAA,IAEJ;AAEA,kBAAO,iBAAiB,WAAWE,CAAa,GAEzC,MAAM;AACX,aAAO,oBAAoB,WAAWA,CAAa;AAAA,IACrD;AAAA,EACF,GAAG,CAACH,CAAG,CAAC;AACV;"}
|
|
@@ -4,7 +4,7 @@ import "change-case";
|
|
|
4
4
|
import "../utils/near/getRandomBytes.js";
|
|
5
5
|
import "../utils/intents/signers/solana.js";
|
|
6
6
|
import "../logger.js";
|
|
7
|
-
import { g as T } from "../config-
|
|
7
|
+
import { g as T } from "../config-CJfcVohD.js";
|
|
8
8
|
import "../constants/chains.js";
|
|
9
9
|
import "../constants/intents.js";
|
|
10
10
|
import "../utils/notReachable.js";
|
|
@@ -3,7 +3,7 @@ import "change-case";
|
|
|
3
3
|
import "@defuse-protocol/one-click-sdk-typescript";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "../logger.js";
|
|
6
|
-
import { h as M } from "../config-
|
|
6
|
+
import { h as M } from "../config-CJfcVohD.js";
|
|
7
7
|
import "../network.js";
|
|
8
8
|
import "../machine/guards/index.js";
|
|
9
9
|
import "../constants/tokens.js";
|
|
@@ -8,7 +8,7 @@ import "../utils/cn.js";
|
|
|
8
8
|
import "./useMakeEvmTransfer.js";
|
|
9
9
|
import "../utils/evm/isEvmAddress.js";
|
|
10
10
|
import "./useMakeSolanaTransfer.js";
|
|
11
|
-
import { j as Q } from "../config-
|
|
11
|
+
import { j as Q } from "../config-CJfcVohD.js";
|
|
12
12
|
import "../utils/solana/isSolanaAddress.js";
|
|
13
13
|
import "../logger.js";
|
|
14
14
|
import "../constants/tokens.js";
|
package/dist/hooks/useTheme.js
CHANGED
package/dist/hooks/useTokens.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "@tanstack/react-query";
|
|
3
3
|
import "@defuse-protocol/one-click-sdk-typescript";
|
|
4
|
-
import { n } from "../config-
|
|
4
|
+
import { n } from "../config-CJfcVohD.js";
|
|
5
5
|
import "../constants/tokens.js";
|
|
6
6
|
import "../constants/chains.js";
|
|
7
7
|
import "../utils/checkers/isValidChain.js";
|