@aurora-is-near/intents-swap-widget 3.14.0-redesign.2 → 3.14.0-redesign.3
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-Bmc4hOIl.js → config-1EcDCy24.js} +603 -584
- package/dist/config-1EcDCy24.js.map +1 -0
- package/dist/config.js +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/index.js +1 -1
- package/dist/features/DepositMethodSwitcher.js +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +18 -18
- package/dist/features/ExternalDeposit.js.map +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 +1 -1
- package/dist/features/WalletCompatibilityCheck/index.js +1 -1
- package/dist/features/index.js +1 -1
- package/dist/hooks/index.js +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/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/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 +1 -1
- package/dist/machine/computed/getIsDirectNearTokenWithdrawal.js +1 -1
- package/dist/machine/computed/getIsDirectNearTokenWithdrawal.js.map +1 -1
- package/dist/machine/computed/getIsDirectTokenOnNearDeposit.js +1 -1
- package/dist/machine/computed/getIsDirectTokenOnNearDeposit.js.map +1 -1
- package/dist/machine/computed/getIsDirectTokenOnNearTransfer.js +1 -1
- package/dist/machine/computed/getIsDirectTokenOnNearTransfer.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/types/localisation.d.ts +1 -1
- package/dist/utils/intents/signers/near.js +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/localstorage.js +41 -28
- package/dist/utils/localstorage.js.map +1 -1
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
- package/package.json +2 -2
- package/src/features/ExternalDeposit.tsx +2 -1
- package/src/features/SubmitButton/index.tsx +40 -0
- package/src/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.ts +2 -1
- package/src/machine/computed/getIsDirectNearTokenWithdrawal.ts +2 -1
- package/src/machine/computed/getIsDirectTokenOnNearDeposit.ts +2 -1
- package/src/machine/computed/getIsDirectTokenOnNearTransfer.ts +2 -1
- package/src/types/localisation.ts +3 -0
- package/src/utils/localstorage.ts +35 -10
- package/dist/config-Bmc4hOIl.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as o, M as t, Q as s, S as a, o as n, p, T as f, q as m, w as i, W as u, v as x, x as d, r as c, t as S, e as l, d as k, u as T, f as g, g as h, h as B, j as C, i as E, k as M, a as I, c as W, l as w, n as D, m as A, b as v } from "./config-
|
|
1
|
+
import { B as o, M as t, Q as s, S as a, o as n, p, T as f, q as m, w as i, W as u, v as x, x as d, r as c, t as S, e as l, d as k, u as T, f as g, g as h, h as B, j as C, i as E, k as M, a as I, c as W, l as w, n as D, m as A, b as v } from "./config-1EcDCy24.js";
|
|
2
2
|
import { DEFAULT_RPCS as y } from "./rpcs.js";
|
|
3
3
|
import { Accordion as L } from "./components/Accordion.js";
|
|
4
4
|
import { Badge as R } from "./components/Badge.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const n = (e) => !!(e.sourceToken && e.targetToken && e.sourceToken.isIntent && !e.targetToken.isIntent && e.targetToken.symbol === e.sourceToken.symbol && e.targetToken.blockchain === "near");
|
|
1
|
+
const n = (e) => !!(e.sourceToken && e.targetToken && e.sourceToken.isIntent && !e.targetToken.isIntent && e.targetToken.symbol === e.sourceToken.symbol && e.targetToken.blockchain === "near" && e.sourceToken.blockchain === "near");
|
|
2
2
|
export {
|
|
3
3
|
n as getIsDirectNearTokenWithdrawal
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIsDirectNearTokenWithdrawal.js","sources":["../../../src/machine/computed/getIsDirectNearTokenWithdrawal.ts"],"sourcesContent":["import type { Context } from '../context';\nimport type { DeepReadonly } from '@/types/utils';\n\nexport const getIsDirectNearTokenWithdrawal = (\n ctx: DeepReadonly<Context>,\n): boolean => {\n return !!(\n ctx.sourceToken &&\n ctx.targetToken &&\n ctx.sourceToken.isIntent &&\n !ctx.targetToken.isIntent &&\n ctx.targetToken.symbol === ctx.sourceToken.symbol &&\n ctx.targetToken.blockchain === 'near'\n );\n};\n"],"names":["getIsDirectNearTokenWithdrawal","ctx"],"mappings":"AAGO,MAAMA,IAAiC,CAC5CC,MAEO,CAAC,EACNA,EAAI,eACJA,EAAI,eACJA,EAAI,YAAY,YAChB,CAACA,EAAI,YAAY,YACjBA,EAAI,YAAY,WAAWA,EAAI,YAAY,UAC3CA,EAAI,YAAY,eAAe;"}
|
|
1
|
+
{"version":3,"file":"getIsDirectNearTokenWithdrawal.js","sources":["../../../src/machine/computed/getIsDirectNearTokenWithdrawal.ts"],"sourcesContent":["import type { Context } from '../context';\nimport type { DeepReadonly } from '@/types/utils';\n\nexport const getIsDirectNearTokenWithdrawal = (\n ctx: DeepReadonly<Context>,\n): boolean => {\n return !!(\n ctx.sourceToken &&\n ctx.targetToken &&\n ctx.sourceToken.isIntent &&\n !ctx.targetToken.isIntent &&\n ctx.targetToken.symbol === ctx.sourceToken.symbol &&\n ctx.targetToken.blockchain === 'near' &&\n ctx.sourceToken.blockchain === 'near'\n );\n};\n"],"names":["getIsDirectNearTokenWithdrawal","ctx"],"mappings":"AAGO,MAAMA,IAAiC,CAC5CC,MAEO,CAAC,EACNA,EAAI,eACJA,EAAI,eACJA,EAAI,YAAY,YAChB,CAACA,EAAI,YAAY,YACjBA,EAAI,YAAY,WAAWA,EAAI,YAAY,UAC3CA,EAAI,YAAY,eAAe,UAC/BA,EAAI,YAAY,eAAe;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const n = (e) => !!(e.sourceToken && e.targetToken && e.targetToken.isIntent && !e.sourceToken.isIntent && e.targetToken.assetId === e.sourceToken.assetId && e.targetToken.blockchain === "near");
|
|
1
|
+
const n = (e) => !!(e.sourceToken && e.targetToken && e.targetToken.isIntent && !e.sourceToken.isIntent && e.targetToken.assetId === e.sourceToken.assetId && e.targetToken.blockchain === "near" && e.sourceToken.blockchain === "near");
|
|
2
2
|
export {
|
|
3
3
|
n as getIsDirectTokenOnNearDeposit
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIsDirectTokenOnNearDeposit.js","sources":["../../../src/machine/computed/getIsDirectTokenOnNearDeposit.ts"],"sourcesContent":["import type { Context } from '../context';\nimport type { DeepReadonly } from '@/types/utils';\n\nexport const getIsDirectTokenOnNearDeposit = (\n ctx: DeepReadonly<Context>,\n): boolean => {\n return !!(\n ctx.sourceToken &&\n ctx.targetToken &&\n ctx.targetToken.isIntent &&\n !ctx.sourceToken.isIntent &&\n ctx.targetToken.assetId === ctx.sourceToken.assetId &&\n ctx.targetToken.blockchain === 'near'\n );\n};\n"],"names":["getIsDirectTokenOnNearDeposit","ctx"],"mappings":"AAGO,MAAMA,IAAgC,CAC3CC,MAEO,CAAC,EACNA,EAAI,eACJA,EAAI,eACJA,EAAI,YAAY,YAChB,CAACA,EAAI,YAAY,YACjBA,EAAI,YAAY,YAAYA,EAAI,YAAY,WAC5CA,EAAI,YAAY,eAAe;"}
|
|
1
|
+
{"version":3,"file":"getIsDirectTokenOnNearDeposit.js","sources":["../../../src/machine/computed/getIsDirectTokenOnNearDeposit.ts"],"sourcesContent":["import type { Context } from '../context';\nimport type { DeepReadonly } from '@/types/utils';\n\nexport const getIsDirectTokenOnNearDeposit = (\n ctx: DeepReadonly<Context>,\n): boolean => {\n return !!(\n ctx.sourceToken &&\n ctx.targetToken &&\n ctx.targetToken.isIntent &&\n !ctx.sourceToken.isIntent &&\n ctx.targetToken.assetId === ctx.sourceToken.assetId &&\n ctx.targetToken.blockchain === 'near' &&\n ctx.sourceToken.blockchain === 'near'\n );\n};\n"],"names":["getIsDirectTokenOnNearDeposit","ctx"],"mappings":"AAGO,MAAMA,IAAgC,CAC3CC,MAEO,CAAC,EACNA,EAAI,eACJA,EAAI,eACJA,EAAI,YAAY,YAChB,CAACA,EAAI,YAAY,YACjBA,EAAI,YAAY,YAAYA,EAAI,YAAY,WAC5CA,EAAI,YAAY,eAAe,UAC/BA,EAAI,YAAY,eAAe;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const n = (e) => !!(e.sourceToken && e.targetToken && !e.targetToken.isIntent && !e.sourceToken.isIntent && e.targetToken.assetId === e.sourceToken.assetId && e.targetToken.blockchain === "near");
|
|
1
|
+
const n = (e) => !!(e.sourceToken && e.targetToken && !e.targetToken.isIntent && !e.sourceToken.isIntent && e.targetToken.assetId === e.sourceToken.assetId && e.targetToken.blockchain === "near" && e.sourceToken.blockchain === "near");
|
|
2
2
|
export {
|
|
3
3
|
n as getIsDirectTokenOnNearTransfer
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIsDirectTokenOnNearTransfer.js","sources":["../../../src/machine/computed/getIsDirectTokenOnNearTransfer.ts"],"sourcesContent":["import type { Context } from '../context';\nimport type { DeepReadonly } from '@/types/utils';\n\nexport const getIsDirectTokenOnNearTransfer = (\n ctx: DeepReadonly<Context>,\n): boolean => {\n return !!(\n ctx.sourceToken &&\n ctx.targetToken &&\n !ctx.targetToken.isIntent &&\n !ctx.sourceToken.isIntent &&\n ctx.targetToken.assetId === ctx.sourceToken.assetId &&\n ctx.targetToken.blockchain === 'near'\n );\n};\n"],"names":["getIsDirectTokenOnNearTransfer","ctx"],"mappings":"AAGO,MAAMA,IAAiC,CAC5CC,MAEO,CAAC,EACNA,EAAI,eACJA,EAAI,eACJ,CAACA,EAAI,YAAY,YACjB,CAACA,EAAI,YAAY,YACjBA,EAAI,YAAY,YAAYA,EAAI,YAAY,WAC5CA,EAAI,YAAY,eAAe;"}
|
|
1
|
+
{"version":3,"file":"getIsDirectTokenOnNearTransfer.js","sources":["../../../src/machine/computed/getIsDirectTokenOnNearTransfer.ts"],"sourcesContent":["import type { Context } from '../context';\nimport type { DeepReadonly } from '@/types/utils';\n\nexport const getIsDirectTokenOnNearTransfer = (\n ctx: DeepReadonly<Context>,\n): boolean => {\n return !!(\n ctx.sourceToken &&\n ctx.targetToken &&\n !ctx.targetToken.isIntent &&\n !ctx.sourceToken.isIntent &&\n ctx.targetToken.assetId === ctx.sourceToken.assetId &&\n ctx.targetToken.blockchain === 'near' &&\n ctx.sourceToken.blockchain === 'near'\n );\n};\n"],"names":["getIsDirectTokenOnNearTransfer","ctx"],"mappings":"AAGO,MAAMA,IAAiC,CAC5CC,MAEO,CAAC,EACNA,EAAI,eACJA,EAAI,eACJ,CAACA,EAAI,YAAY,YACjB,CAACA,EAAI,YAAY,YACjBA,EAAI,YAAY,YAAYA,EAAI,YAAY,WAC5CA,EAAI,YAAY,eAAe,UAC/BA,EAAI,YAAY,eAAe;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "../../logger.js";
|
|
3
3
|
import "../guards/checks/isDryQuote.js";
|
|
4
|
-
import { N as a } from "../../config-
|
|
4
|
+
import { N as a } from "../../config-1EcDCy24.js";
|
|
5
5
|
import "../guards/index.js";
|
|
6
6
|
import "../machine.js";
|
|
7
7
|
import "../events/utils/fireEvent.js";
|
|
@@ -2,7 +2,7 @@ import "react";
|
|
|
2
2
|
import "../../utils/solana/isSolanaAddress.js";
|
|
3
3
|
import "../../utils/evm/isEvmAddress.js";
|
|
4
4
|
import "../../utils/near/isNearAddress.js";
|
|
5
|
-
import { O as l } from "../../config-
|
|
5
|
+
import { O as l } from "../../config-1EcDCy24.js";
|
|
6
6
|
import "../../utils/tokens/getMainTokenByChain.js";
|
|
7
7
|
import "../../utils/tokens/getDefaultIntentsToken.js";
|
|
8
8
|
import "../../utils/tokens/getTokenWithHighBalance.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "../../hooks/useWalletAddressForToken.js";
|
|
3
|
-
import { G as f } from "../../config-
|
|
3
|
+
import { G as f } from "../../config-1EcDCy24.js";
|
|
4
4
|
import "../guards/index.js";
|
|
5
5
|
import "../machine.js";
|
|
6
6
|
import "../events/utils/fireEvent.js";
|
|
@@ -3,7 +3,7 @@ import "./tokenSelectRotate.js";
|
|
|
3
3
|
import "./errorSet.js";
|
|
4
4
|
import "./quoteSet.js";
|
|
5
5
|
import "./addressSet.js";
|
|
6
|
-
import { Y as b } from "../../config-
|
|
6
|
+
import { Y as b } from "../../config-1EcDCy24.js";
|
|
7
7
|
import "./tokenSetAmount.js";
|
|
8
8
|
import "./quoteSetStatus.js";
|
|
9
9
|
import "./depositTypeSet.js";
|
|
@@ -3,7 +3,7 @@ import "../../utils/near/checkNearAccountExists.js";
|
|
|
3
3
|
import "../../utils/checkers/isNotEmptyAmount.js";
|
|
4
4
|
import "../../utils/checkers/isValidBigint.js";
|
|
5
5
|
import "../../utils/near/isNearAddress.js";
|
|
6
|
-
import { I, J as d, K as u } from "../../config-
|
|
6
|
+
import { I, J as d, K as u } from "../../config-1EcDCy24.js";
|
|
7
7
|
import "../guards/index.js";
|
|
8
8
|
import "../machine.js";
|
|
9
9
|
import "../guards/checks/isBalanceSufficient.js";
|
package/dist/machine/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as o, u as t, a as r, c as a, b as f } from "../config-
|
|
1
|
+
import { r as o, u as t, a as r, c as a, b as f } from "../config-1EcDCy24.js";
|
|
2
2
|
import { guardStates as S } from "./guards/index.js";
|
|
3
3
|
import { machine as n, moveTo as u } from "./machine.js";
|
|
4
4
|
import { fireEvent as i } from "./events/utils/fireEvent.js";
|
package/dist/machine/snap.js
CHANGED
|
@@ -2,7 +2,7 @@ import "valtio";
|
|
|
2
2
|
import "derive-valtio";
|
|
3
3
|
import "./computed/getIsNativeNearDeposit.js";
|
|
4
4
|
import "./computed/getIsDirectTokenOnNearDeposit.js";
|
|
5
|
-
import { u as h, a as b, b as d } from "../config-
|
|
5
|
+
import { u as h, a as b, b as d } from "../config-1EcDCy24.js";
|
|
6
6
|
import "./machine.js";
|
|
7
7
|
import "./guards/index.js";
|
|
8
8
|
import "./computed/getUsdTradeDelta.js";
|
|
@@ -5,7 +5,7 @@ import "./checkers/isOnlyErrorChanged.js";
|
|
|
5
5
|
import "./checkers/isValidInitialState.js";
|
|
6
6
|
import "./checkers/isWalletDisconnected.js";
|
|
7
7
|
import "./checkers/isSendAddressForbidden.js";
|
|
8
|
-
import { U as g, V as u } from "../../config-
|
|
8
|
+
import { U as g, V as u } from "../../config-1EcDCy24.js";
|
|
9
9
|
import "./checkers/isAmountChangedFromQuote.js";
|
|
10
10
|
import "ethers";
|
|
11
11
|
import "../machine.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type LocalisationKeys = 'chain.all.label' | 'wallet.recipient.placeholder' | 'wallet.recipient.info.selectToken' | 'wallet.recipient.error.noAddress' | 'wallet.recipient.error.tokenNotSelected' | 'wallet.recipient.error.invalidAddress' | 'wallet.recipient.error.sendAddressNotFound' | 'wallet.recipient.error.sendAddressInvalid' | 'wallet.recipient.warn.compatibleNetwork' | 'wallet.recipient.message.networkVerified' | 'wallet.recipient.message.receiveFunds' | 'wallet.connected.error.notSupportedChain' | 'transfer.success.hash.label' | 'transfer.success.intent.label' | 'quote.result.maxSlippage.label' | 'quote.result.processingTime.label' | 'tokens.input.max.label' | 'tokens.input.half.label' | 'tokens.input.externalBalance.label' | 'tokens.list.noBalanceOnApp.label' | 'tokens.list.noBalanceOnApp.subLabel' | 'tokens.list.searchEmpty.label' | 'tokens.list.searchEmpty.subLabel' | 'tokens.list.searchReset.label' | 'deposit.external.error.noStatus' | 'deposit.external.error.incomplete' | 'deposit.external.error.failed' | 'deposit.external.loading.waiting' | 'deposit.external.loading.fetching' | 'submit.error.connectWallet' | 'submit.error.invalidTransferData.label' | 'submit.error.transferFailed.label' | 'submit.error.insufficientBalance' | 'submit.error.invalidAddress' | 'submit.error.sendAddressNotFound' | 'submit.error.sendAddressInvalid' | 'submit.error.amountTooLow.label' | 'submit.error.amountTooLow.message' | 'submit.error.quoteFailed.label' | 'submit.error.quoteFailed.message' | 'submit.error.transfer.noFees' | 'submit.error.transfer.failed' | 'sendAddress.label' | 'sendAddress.button.magic.label' | 'submit.active.swap' | 'submit.active.intentsSwap' | 'submit.active.withdraw' | 'submit.active.deposit' | 'submit.disabled.temporary.label' | 'submit.disabled.temporary.message' | 'submit.disabled.selectTokenToReceive' | 'submit.disabled.enterRecipientAddress' | 'submit.disabled.enterAmount' | 'submit.pending.quote.finalizing' | 'submit.pending.quote.refreshing' | 'submit.pending.transfer.confirmInWallet' | 'submit.pending.transfer.finalizing' | 'submit.pending.externalDeposit.waiting' | 'submit.pending.externalDeposit.processing' | 'submit.pending.switchingChain' | 'submit.pending.validating' | 'walletCompatibility.modal.title.initial' | 'walletCompatibility.modal.title.error' | 'walletCompatibility.modal.description.initial' | 'walletCompatibility.modal.description.error' | 'walletCompatibility.modal.feature.secureTransactions' | 'walletCompatibility.modal.feature.fullAccess' | 'walletCompatibility.modal.feature.fundProtection' | 'walletCompatibility.modal.button.verified' | 'walletCompatibility.modal.button.signing' | 'walletCompatibility.modal.button.verify' | 'walletCompatibility.modal.button.closeTimer' | 'walletCompatibility.modal.button.tryAgain' | 'walletCompatibility.modal.button.tryAgainDesc' | 'walletCompatibility.modal.button.signOut' | 'tokenInput.heading.source.withdraw' | 'tokenInput.heading.target.withdraw' | 'tokenInput.heading.source.deposit' | 'tokenInput.heading.source.swap' | 'tokenInput.heading.target.swap';
|
|
1
|
+
export type LocalisationKeys = 'chain.all.label' | 'wallet.recipient.placeholder' | 'wallet.recipient.info.selectToken' | 'wallet.recipient.error.noAddress' | 'wallet.recipient.error.tokenNotSelected' | 'wallet.recipient.error.invalidAddress' | 'wallet.recipient.error.sendAddressNotFound' | 'wallet.recipient.error.sendAddressInvalid' | 'wallet.recipient.warn.compatibleNetwork' | 'wallet.recipient.message.networkVerified' | 'wallet.recipient.message.receiveFunds' | 'wallet.connected.error.notSupportedChain' | 'transfer.success.hash.label' | 'transfer.success.intent.label' | 'quote.result.maxSlippage.label' | 'quote.result.processingTime.label' | 'tokens.input.max.label' | 'tokens.input.half.label' | 'tokens.input.externalBalance.label' | 'tokens.list.noBalanceOnApp.label' | 'tokens.list.noBalanceOnApp.subLabel' | 'tokens.list.searchEmpty.label' | 'tokens.list.searchEmpty.subLabel' | 'tokens.list.searchReset.label' | 'deposit.external.error.noStatus' | 'deposit.external.error.incomplete' | 'deposit.external.error.failed' | 'deposit.external.loading.waiting' | 'deposit.external.loading.fetching' | 'submit.error.connectWallet' | 'submit.error.invalidTransferData.label' | 'submit.error.transferFailed.label' | 'submit.error.insufficientBalance' | 'submit.error.invalidAddress' | 'submit.error.sendAddressNotFound' | 'submit.error.sendAddressInvalid' | 'submit.error.amountTooLow.label' | 'submit.error.amountTooLow.message' | 'submit.error.quoteFailed.label' | 'submit.error.quoteFailed.message' | 'submit.error.transfer.noFees' | 'submit.error.transfer.failed' | 'submit.error.externalTransferFailed.label' | 'submit.error.externalTransferFailed.incompleteMessage' | 'submit.error.externalTransferFailed.refundedMessage' | 'sendAddress.label' | 'sendAddress.button.magic.label' | 'submit.active.swap' | 'submit.active.intentsSwap' | 'submit.active.withdraw' | 'submit.active.deposit' | 'submit.disabled.temporary.label' | 'submit.disabled.temporary.message' | 'submit.disabled.selectTokenToReceive' | 'submit.disabled.enterRecipientAddress' | 'submit.disabled.enterAmount' | 'submit.pending.quote.finalizing' | 'submit.pending.quote.refreshing' | 'submit.pending.transfer.confirmInWallet' | 'submit.pending.transfer.finalizing' | 'submit.pending.externalDeposit.waiting' | 'submit.pending.externalDeposit.processing' | 'submit.pending.switchingChain' | 'submit.pending.validating' | 'walletCompatibility.modal.title.initial' | 'walletCompatibility.modal.title.error' | 'walletCompatibility.modal.description.initial' | 'walletCompatibility.modal.description.error' | 'walletCompatibility.modal.feature.secureTransactions' | 'walletCompatibility.modal.feature.fullAccess' | 'walletCompatibility.modal.feature.fundProtection' | 'walletCompatibility.modal.button.verified' | 'walletCompatibility.modal.button.signing' | 'walletCompatibility.modal.button.verify' | 'walletCompatibility.modal.button.closeTimer' | 'walletCompatibility.modal.button.tryAgain' | 'walletCompatibility.modal.button.tryAgainDesc' | 'walletCompatibility.modal.button.signOut' | 'tokenInput.heading.source.withdraw' | 'tokenInput.heading.target.withdraw' | 'tokenInput.heading.source.deposit' | 'tokenInput.heading.source.swap' | 'tokenInput.heading.target.swap';
|
|
2
2
|
export type LocalisationDict = Partial<Record<LocalisationKeys, string>>;
|
|
@@ -1,47 +1,60 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import { logger as
|
|
3
|
-
const
|
|
1
|
+
import { p as l } from "../index-xuotMAFm.js";
|
|
2
|
+
import { logger as n } from "../logger.js";
|
|
3
|
+
const a = {
|
|
4
4
|
verifiedWallets: [],
|
|
5
5
|
verifiedNearAccounts: [],
|
|
6
6
|
nearWalletsPk: {}
|
|
7
|
-
},
|
|
8
|
-
if (!
|
|
9
|
-
return
|
|
10
|
-
`[WIDGET] Attempted to read ${e} on server; returning default`
|
|
11
|
-
),
|
|
7
|
+
}, s = typeof window < "u" && !!window.localStorage, i = "sw", o = (e) => `${i}.${e}`, c = (e) => {
|
|
8
|
+
if (!s)
|
|
9
|
+
return l.env.NODE_ENV === "development" && n.debug(
|
|
10
|
+
`[WIDGET] Attempted to read ${o(e)} from localstorage on server; returning default`
|
|
11
|
+
), a[e];
|
|
12
12
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
13
|
+
const t = window.localStorage.getItem(e);
|
|
14
|
+
let r = window.localStorage.getItem(o(e));
|
|
15
|
+
return t && !r && (r = t, window.localStorage.setItem(o(e), t), window.localStorage.removeItem(e)), // @ts-expect-error It's ok to pass null to JSON.parse
|
|
16
|
+
JSON.parse(r) ?? a[e];
|
|
17
17
|
} catch (t) {
|
|
18
|
-
return
|
|
18
|
+
return n.warn(
|
|
19
|
+
`[WIDGET] Failed to parse ${o(e)} from localStorage:`,
|
|
20
|
+
t
|
|
21
|
+
), a[e];
|
|
19
22
|
}
|
|
20
|
-
},
|
|
21
|
-
if (!
|
|
22
|
-
|
|
23
|
+
}, d = (e, t) => {
|
|
24
|
+
if (!s) {
|
|
25
|
+
l.env.NODE_ENV === "development" && n.debug(
|
|
26
|
+
`[WIDGET] Attempted to set ${o(e)} on server; skipping`
|
|
27
|
+
);
|
|
23
28
|
return;
|
|
24
29
|
}
|
|
25
30
|
try {
|
|
26
|
-
const
|
|
27
|
-
window.localStorage.setItem(e,
|
|
28
|
-
} catch (
|
|
29
|
-
|
|
31
|
+
const r = typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : JSON.stringify(t);
|
|
32
|
+
window.localStorage.setItem(o(e), r);
|
|
33
|
+
} catch (r) {
|
|
34
|
+
n.warn(
|
|
35
|
+
`[WIDGET] Failed to set ${o(e)} in localStorage:`,
|
|
36
|
+
r
|
|
37
|
+
);
|
|
30
38
|
}
|
|
31
|
-
},
|
|
32
|
-
if (!
|
|
33
|
-
|
|
39
|
+
}, g = (e) => {
|
|
40
|
+
if (!s) {
|
|
41
|
+
l.env.NODE_ENV === "development" && n.debug(
|
|
42
|
+
`[WIDGET] Attempted to remove ${o(e)} from localstorage on server; skipping`
|
|
43
|
+
);
|
|
34
44
|
return;
|
|
35
45
|
}
|
|
36
46
|
try {
|
|
37
|
-
window.localStorage.removeItem(e);
|
|
47
|
+
window.localStorage.removeItem(o(e));
|
|
38
48
|
} catch (t) {
|
|
39
|
-
|
|
49
|
+
n.warn(
|
|
50
|
+
`[WIDGET] Failed to remove ${o(e)} from localStorage:`,
|
|
51
|
+
t
|
|
52
|
+
);
|
|
40
53
|
}
|
|
41
54
|
}, p = {
|
|
42
|
-
getItem:
|
|
43
|
-
setItem:
|
|
44
|
-
removeItem:
|
|
55
|
+
getItem: c,
|
|
56
|
+
setItem: d,
|
|
57
|
+
removeItem: g
|
|
45
58
|
};
|
|
46
59
|
export {
|
|
47
60
|
p as localStorageTyped
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localstorage.js","sources":["../../src/utils/localstorage.ts"],"sourcesContent":["import { logger } from '@/logger';\n\ntype LocalStorage = {\n verifiedWallets: string[];\n verifiedNearAccounts: string[];\n nearWalletsPk: Record<string, string>;\n};\n\nconst defaultValues: LocalStorage = {\n verifiedWallets: [],\n verifiedNearAccounts: [],\n nearWalletsPk: {},\n};\n\nconst isBrowser = typeof window !== 'undefined' && !!window.localStorage;\n\nconst getItem = <T extends keyof LocalStorage>(key: T): LocalStorage[T] => {\n if (!isBrowser) {\n if (process.env.NODE_ENV === 'development') {\n logger.debug(\n `[WIDGET] Attempted to read ${key} on server; returning default`,\n );\n }\n\n return defaultValues[key];\n }\n\n try {\n return (\n // @ts-expect-error It's ok to pass null to JSON.parse\n (JSON.parse(
|
|
1
|
+
{"version":3,"file":"localstorage.js","sources":["../../src/utils/localstorage.ts"],"sourcesContent":["import { logger } from '@/logger';\n\ntype LocalStorage = {\n verifiedWallets: string[];\n verifiedNearAccounts: string[];\n nearWalletsPk: Record<string, string>;\n};\n\nconst defaultValues: LocalStorage = {\n verifiedWallets: [],\n verifiedNearAccounts: [],\n nearWalletsPk: {},\n};\n\nconst isBrowser = typeof window !== 'undefined' && !!window.localStorage;\n\nconst KEY_PREFIX = 'sw';\nconst getStorageKey = (key: string) => `${KEY_PREFIX}.${key}`;\n\nconst getItem = <T extends keyof LocalStorage>(key: T): LocalStorage[T] => {\n if (!isBrowser) {\n if (process.env.NODE_ENV === 'development') {\n logger.debug(\n `[WIDGET] Attempted to read ${getStorageKey(key)} from localstorage on server; returning default`,\n );\n }\n\n return defaultValues[key];\n }\n\n try {\n const storedValueLegacy = window.localStorage.getItem(key);\n let storedValue = window.localStorage.getItem(getStorageKey(key));\n\n // Migrate legacy key to new namespaced key\n if (storedValueLegacy && !storedValue) {\n storedValue = storedValueLegacy;\n window.localStorage.setItem(getStorageKey(key), storedValueLegacy);\n window.localStorage.removeItem(key);\n }\n\n return (\n // @ts-expect-error It's ok to pass null to JSON.parse\n (JSON.parse(storedValue) as LocalStorage[T]) ?? defaultValues[key]\n );\n } catch (error) {\n logger.warn(\n `[WIDGET] Failed to parse ${getStorageKey(key)} from localStorage:`,\n error,\n );\n\n return defaultValues[key];\n }\n};\n\nconst setItem = <T extends keyof LocalStorage>(\n key: T,\n value: LocalStorage[T],\n) => {\n if (!isBrowser) {\n if (process.env.NODE_ENV === 'development') {\n logger.debug(\n `[WIDGET] Attempted to set ${getStorageKey(key)} on server; skipping`,\n );\n }\n\n return;\n }\n\n try {\n const serialized =\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n ? String(value)\n : JSON.stringify(value);\n\n window.localStorage.setItem(getStorageKey(key), serialized);\n } catch (error) {\n logger.warn(\n `[WIDGET] Failed to set ${getStorageKey(key)} in localStorage:`,\n error,\n );\n }\n};\n\nconst removeItem = (key: keyof LocalStorage) => {\n if (!isBrowser) {\n if (process.env.NODE_ENV === 'development') {\n logger.debug(\n `[WIDGET] Attempted to remove ${getStorageKey(key)} from localstorage on server; skipping`,\n );\n }\n\n return;\n }\n\n try {\n window.localStorage.removeItem(getStorageKey(key));\n } catch (error) {\n logger.warn(\n `[WIDGET] Failed to remove ${getStorageKey(key)} from localStorage:`,\n error,\n );\n }\n};\n\nexport const localStorageTyped = {\n getItem,\n setItem,\n removeItem,\n};\n"],"names":["defaultValues","isBrowser","KEY_PREFIX","getStorageKey","key","getItem","process","logger","storedValueLegacy","storedValue","error","setItem","value","serialized","removeItem","localStorageTyped"],"mappings":";;AAQA,MAAMA,IAA8B;AAAA,EAClC,iBAAiB,CAAA;AAAA,EACjB,sBAAsB,CAAA;AAAA,EACtB,eAAe,CAAA;AACjB,GAEMC,IAAY,OAAO,SAAW,OAAe,CAAC,CAAC,OAAO,cAEtDC,IAAa,MACbC,IAAgB,CAACC,MAAgB,GAAGF,CAAU,IAAIE,CAAG,IAErDC,IAAU,CAA+BD,MAA4B;AACzE,MAAI,CAACH;AACH,WAAIK,EAAQ,IAAI,aAAa,iBAC3BC,EAAO;AAAA,MACL,8BAA8BJ,EAAcC,CAAG,CAAC;AAAA,IAAA,GAI7CJ,EAAcI,CAAG;AAG1B,MAAI;AACF,UAAMI,IAAoB,OAAO,aAAa,QAAQJ,CAAG;AACzD,QAAIK,IAAc,OAAO,aAAa,QAAQN,EAAcC,CAAG,CAAC;AAGhE,WAAII,KAAqB,CAACC,MACxBA,IAAcD,GACd,OAAO,aAAa,QAAQL,EAAcC,CAAG,GAAGI,CAAiB,GACjE,OAAO,aAAa,WAAWJ,CAAG;AAAA,IAKjC,KAAK,MAAMK,CAAW,KAAyBT,EAAcI,CAAG;AAAA,EAErE,SAASM,GAAO;AACd,WAAAH,EAAO;AAAA,MACL,4BAA4BJ,EAAcC,CAAG,CAAC;AAAA,MAC9CM;AAAA,IAAA,GAGKV,EAAcI,CAAG;AAAA,EAC1B;AACF,GAEMO,IAAU,CACdP,GACAQ,MACG;AACH,MAAI,CAACX,GAAW;AACd,IAAIK,EAAQ,IAAI,aAAa,iBAC3BC,EAAO;AAAA,MACL,6BAA6BJ,EAAcC,CAAG,CAAC;AAAA,IAAA;AAInD;AAAA,EACF;AAEA,MAAI;AACF,UAAMS,IACJ,OAAOD,KAAU,YACjB,OAAOA,KAAU,YACjB,OAAOA,KAAU,YACb,OAAOA,CAAK,IACZ,KAAK,UAAUA,CAAK;AAE1B,WAAO,aAAa,QAAQT,EAAcC,CAAG,GAAGS,CAAU;AAAA,EAC5D,SAASH,GAAO;AACd,IAAAH,EAAO;AAAA,MACL,0BAA0BJ,EAAcC,CAAG,CAAC;AAAA,MAC5CM;AAAA,IAAA;AAAA,EAEJ;AACF,GAEMI,IAAa,CAACV,MAA4B;AAC9C,MAAI,CAACH,GAAW;AACd,IAAIK,EAAQ,IAAI,aAAa,iBAC3BC,EAAO;AAAA,MACL,gCAAgCJ,EAAcC,CAAG,CAAC;AAAA,IAAA;AAItD;AAAA,EACF;AAEA,MAAI;AACF,WAAO,aAAa,WAAWD,EAAcC,CAAG,CAAC;AAAA,EACnD,SAASM,GAAO;AACd,IAAAH,EAAO;AAAA,MACL,6BAA6BJ,EAAcC,CAAG,CAAC;AAAA,MAC/CM;AAAA,IAAA;AAAA,EAEJ;AACF,GAEaK,IAAoB;AAAA,EAC/B,SAAAV;AAAA,EACA,SAAAM;AAAA,EACA,YAAAG;AACF;"}
|
|
@@ -3,7 +3,7 @@ import { useState as y, useEffect as l, useCallback as B } from "react";
|
|
|
3
3
|
import { useTokenModal as R } from "../../hooks/useTokenModal.js";
|
|
4
4
|
import { useTypedTranslation as A } from "../../localisation.js";
|
|
5
5
|
import { WidgetDepositSkeleton as b } from "./WidgetDepositSkeleton.js";
|
|
6
|
-
import { b as F, u as q, y as N, n as j, c as O, p as Q, o as U, S as K } from "../../config-
|
|
6
|
+
import { b as F, u as q, y as N, n as j, c as O, p as Q, o as U, S as K } from "../../config-1EcDCy24.js";
|
|
7
7
|
import "@tanstack/react-query";
|
|
8
8
|
import "@headlessui/react";
|
|
9
9
|
import "framer-motion";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import a from "clsx";
|
|
3
3
|
import { SkeletonBox as s } from "../../components/SkeletonBox.js";
|
|
4
|
-
import { y as i } from "../../config-
|
|
4
|
+
import { y as i } from "../../config-1EcDCy24.js";
|
|
5
5
|
const p = () => {
|
|
6
6
|
const { hideTokenInputHeadings: l } = i();
|
|
7
7
|
return /* @__PURE__ */ o("div", { className: "w-full gap-sw-xl relative flex flex-col", children: [
|
|
@@ -3,7 +3,7 @@ import { useState as b, useEffect as y } from "react";
|
|
|
3
3
|
import { useTokenModal as R } from "../../hooks/useTokenModal.js";
|
|
4
4
|
import { WidgetSwapSkeleton as S } from "./WidgetSwapSkeleton.js";
|
|
5
5
|
import { useTypedTranslation as D } from "../../localisation.js";
|
|
6
|
-
import { b as N, u as O, y as Q, n as j, c as q, p as w, o as F, S as U } from "../../config-
|
|
6
|
+
import { b as N, u as O, y as Q, n as j, c as q, p as w, o as F, S as U } from "../../config-1EcDCy24.js";
|
|
7
7
|
import "@tanstack/react-query";
|
|
8
8
|
import "@headlessui/react";
|
|
9
9
|
import "framer-motion";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import o from "clsx";
|
|
3
3
|
import { SkeletonBox as s } from "../../components/SkeletonBox.js";
|
|
4
|
-
import { y as i } from "../../config-
|
|
4
|
+
import { y as i } from "../../config-1EcDCy24.js";
|
|
5
5
|
const m = () => {
|
|
6
6
|
const { hideTokenInputHeadings: e } = i();
|
|
7
7
|
return /* @__PURE__ */ a("div", { className: "w-full gap-sw-lg relative flex flex-col", children: [
|
|
@@ -3,7 +3,7 @@ import { useState as w, useEffect as b } from "react";
|
|
|
3
3
|
import { useTokenModal as B } from "../../hooks/useTokenModal.js";
|
|
4
4
|
import { WidgetWithdrawSkeleton as y } from "./WidgetWithdrawSkeleton.js";
|
|
5
5
|
import { useTypedTranslation as D } from "../../localisation.js";
|
|
6
|
-
import { b as N, u as O, y as Q, n as j, c as q, p as S, o as F, S as U } from "../../config-
|
|
6
|
+
import { b as N, u as O, y as Q, n as j, c as q, p as S, o as F, S as U } from "../../config-1EcDCy24.js";
|
|
7
7
|
import "@tanstack/react-query";
|
|
8
8
|
import "@headlessui/react";
|
|
9
9
|
import "framer-motion";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import o from "clsx";
|
|
3
3
|
import { SkeletonBox as l } from "../../components/SkeletonBox.js";
|
|
4
|
-
import { y as x } from "../../config-
|
|
4
|
+
import { y as x } from "../../config-1EcDCy24.js";
|
|
5
5
|
const p = () => {
|
|
6
6
|
const { hideTokenInputHeadings: s } = x();
|
|
7
7
|
return /* @__PURE__ */ a("div", { className: "w-full gap-sw-xl relative flex flex-col", children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurora-is-near/intents-swap-widget",
|
|
3
|
-
"version": "3.14.0-redesign.
|
|
3
|
+
"version": "3.14.0-redesign.3",
|
|
4
4
|
"description": "Provides components and hooks to build your own Intents swap widget",
|
|
5
5
|
"author": "Maksim Vashchuk",
|
|
6
6
|
"license": "MIT",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"@types/jest": "^30.0.0",
|
|
113
113
|
"@types/jest-image-snapshot": "^6.4.0",
|
|
114
114
|
"@types/puppeteer": "^7.0.4",
|
|
115
|
-
"glob": "^
|
|
115
|
+
"glob": "^10.5.0",
|
|
116
116
|
"is-ci": "^4.1.0",
|
|
117
117
|
"jest-environment-jsdom": "^30.2.0",
|
|
118
118
|
"jest-image-snapshot": "^6.5.1",
|
|
@@ -139,7 +139,8 @@ export const ExternalDeposit = ({ onMsg }: Props) => {
|
|
|
139
139
|
default:
|
|
140
140
|
notReachable(status);
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
// do not include onMsg to avoid infinite loop
|
|
143
|
+
}, [depositStatusQuery.data, ctx.sourceToken]);
|
|
143
144
|
|
|
144
145
|
if (!isValidState) {
|
|
145
146
|
return <Skeleton />;
|
|
@@ -125,6 +125,46 @@ const useGetErrorButton = (ctx: Context) => {
|
|
|
125
125
|
);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
if (ctx.error?.code === 'EXTERNAL_TRANSFER_FAILED') {
|
|
129
|
+
return (
|
|
130
|
+
<Button state="error" {...commonBtnProps}>
|
|
131
|
+
{t('submit.error.externalTransferFailed.label', 'Transfer failed')}
|
|
132
|
+
</Button>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (ctx.error?.code === 'EXTERNAL_TRANSFER_INCOMPLETE') {
|
|
137
|
+
return (
|
|
138
|
+
<div className="gap-sw-md flex flex-col">
|
|
139
|
+
<Button state="error" {...commonBtnProps}>
|
|
140
|
+
{t('submit.error.externalTransferFailed.label', 'Transfer failed')}
|
|
141
|
+
</Button>
|
|
142
|
+
<ErrorMessage>
|
|
143
|
+
{t(
|
|
144
|
+
'submit.error.externalTransferFailed.incompleteMessage',
|
|
145
|
+
'Incomplete transfer. Deposited amount will be refunded.',
|
|
146
|
+
)}
|
|
147
|
+
</ErrorMessage>
|
|
148
|
+
</div>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (ctx.error?.code === 'EXTERNAL_TRANSFER_REFUNDED') {
|
|
153
|
+
return (
|
|
154
|
+
<div className="gap-sw-md flex flex-col">
|
|
155
|
+
<Button state="error" {...commonBtnProps}>
|
|
156
|
+
{t('submit.error.externalTransferFailed.label', 'Transfer failed')}
|
|
157
|
+
</Button>
|
|
158
|
+
<ErrorMessage>
|
|
159
|
+
{t(
|
|
160
|
+
'submit.error.externalTransferFailed.refundedMessage',
|
|
161
|
+
'Deposited amount will be refunded.',
|
|
162
|
+
)}
|
|
163
|
+
</ErrorMessage>
|
|
164
|
+
</div>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
128
168
|
if (ctx.error?.code === 'DIRECT_TRANSFER_ERROR') {
|
|
129
169
|
return (
|
|
130
170
|
<div className="gap-sw-md flex flex-col">
|
|
@@ -28,7 +28,7 @@ type DepositResult = {
|
|
|
28
28
|
account_id: string;
|
|
29
29
|
created_at: string;
|
|
30
30
|
near_token_id: string;
|
|
31
|
-
status: 'COMPLETED' | 'PENDING' | 'FAILED';
|
|
31
|
+
status: 'COMPLETED' | 'PENDING' | 'FAILED' | 'CREDITED';
|
|
32
32
|
tx_hash?: string;
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -92,6 +92,7 @@ const oneClickBridgeStatusMap: Record<
|
|
|
92
92
|
DepositResult['status'],
|
|
93
93
|
GetExecutionStatusResponse.status
|
|
94
94
|
> = {
|
|
95
|
+
CREDITED: GetExecutionStatusResponse.status.PROCESSING,
|
|
95
96
|
PENDING: GetExecutionStatusResponse.status.PROCESSING,
|
|
96
97
|
COMPLETED: GetExecutionStatusResponse.status.SUCCESS,
|
|
97
98
|
FAILED: GetExecutionStatusResponse.status.FAILED,
|
|
@@ -10,6 +10,7 @@ export const getIsDirectNearTokenWithdrawal = (
|
|
|
10
10
|
ctx.sourceToken.isIntent &&
|
|
11
11
|
!ctx.targetToken.isIntent &&
|
|
12
12
|
ctx.targetToken.symbol === ctx.sourceToken.symbol &&
|
|
13
|
-
ctx.targetToken.blockchain === 'near'
|
|
13
|
+
ctx.targetToken.blockchain === 'near' &&
|
|
14
|
+
ctx.sourceToken.blockchain === 'near'
|
|
14
15
|
);
|
|
15
16
|
};
|
|
@@ -10,6 +10,7 @@ export const getIsDirectTokenOnNearDeposit = (
|
|
|
10
10
|
ctx.targetToken.isIntent &&
|
|
11
11
|
!ctx.sourceToken.isIntent &&
|
|
12
12
|
ctx.targetToken.assetId === ctx.sourceToken.assetId &&
|
|
13
|
-
ctx.targetToken.blockchain === 'near'
|
|
13
|
+
ctx.targetToken.blockchain === 'near' &&
|
|
14
|
+
ctx.sourceToken.blockchain === 'near'
|
|
14
15
|
);
|
|
15
16
|
};
|
|
@@ -10,6 +10,7 @@ export const getIsDirectTokenOnNearTransfer = (
|
|
|
10
10
|
!ctx.targetToken.isIntent &&
|
|
11
11
|
!ctx.sourceToken.isIntent &&
|
|
12
12
|
ctx.targetToken.assetId === ctx.sourceToken.assetId &&
|
|
13
|
-
ctx.targetToken.blockchain === 'near'
|
|
13
|
+
ctx.targetToken.blockchain === 'near' &&
|
|
14
|
+
ctx.sourceToken.blockchain === 'near'
|
|
14
15
|
);
|
|
15
16
|
};
|
|
@@ -48,6 +48,9 @@ export type LocalisationKeys =
|
|
|
48
48
|
| 'submit.error.quoteFailed.message'
|
|
49
49
|
| 'submit.error.transfer.noFees'
|
|
50
50
|
| 'submit.error.transfer.failed'
|
|
51
|
+
| 'submit.error.externalTransferFailed.label'
|
|
52
|
+
| 'submit.error.externalTransferFailed.incompleteMessage'
|
|
53
|
+
| 'submit.error.externalTransferFailed.refundedMessage'
|
|
51
54
|
// send address
|
|
52
55
|
| 'sendAddress.label'
|
|
53
56
|
| 'sendAddress.button.magic.label'
|