@aurora-is-near/intents-swap-widget 3.17.0 → 3.17.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/components/Input.d.ts +8 -2
- package/dist/components/Input.js +88 -84
- package/dist/components/Input.js.map +1 -1
- package/dist/{config-BMe2x51b.js → config-BVaLnxO9.js} +804 -788
- package/dist/config-BVaLnxO9.js.map +1 -0
- package/dist/config.js +6 -5
- 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/index.js +1 -1
- package/dist/features/DepositMethodSwitcher.js +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +5 -4
- 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 +64 -55
- package/dist/features/TokensModal.js.map +1 -1
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +3 -3
- 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/useHandleKeyDown.d.ts +1 -1
- package/dist/hooks/useHandleKeyDown.js +12 -8
- package/dist/hooks/useHandleKeyDown.js.map +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 +4 -3
- package/dist/hooks/useMakeIntentsTransfer.js.map +1 -1
- package/dist/hooks/useMakeNEARFtTransferCall.js +4 -2
- package/dist/hooks/useMakeNEARFtTransferCall.js.map +1 -1
- package/dist/hooks/useMakeQuote.js +1 -1
- package/dist/hooks/useMakeQuoteTransfer.js +3 -2
- package/dist/hooks/useMakeQuoteTransfer.js.map +1 -1
- package/dist/hooks/useMakeSolanaTransfer.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-Ce9bzNHX.js → index-JGjxyZXI.js} +70 -70
- package/dist/index-JGjxyZXI.js.map +1 -0
- package/dist/index.browser.esm-COWShN0a.js.map +1 -1
- package/dist/index.js +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/checkers/isUserDeniedSigning.d.ts +2 -1
- package/dist/utils/checkers/isUserDeniedSigning.js +6 -4
- package/dist/utils/checkers/isUserDeniedSigning.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +26 -24
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/intents/signers/near.d.ts +1 -1
- package/dist/utils/intents/signers/near.js +2 -2
- package/dist/utils/intents/signers/privy.d.ts +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/intents/signers/solana.d.ts +1 -1
- package/dist/utils/intents/signers/solana.js.map +1 -1
- package/dist/utils/isErrorLikeObject.d.ts +4 -0
- package/dist/utils/isErrorLikeObject.js +5 -0
- package/dist/utils/isErrorLikeObject.js.map +1 -0
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +5 -4
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +5 -4
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +5 -4
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
- package/package.json +2 -2
- package/src/components/Input.tsx +111 -96
- package/src/features/TokensModal.tsx +19 -2
- package/src/hooks/useHandleKeyDown.ts +25 -3
- package/src/hooks/useMakeIntentsTransfer.ts +40 -29
- package/src/hooks/useMakeNEARFtTransferCall.ts +10 -0
- package/src/hooks/useMakeQuoteTransfer.ts +2 -1
- package/src/utils/checkers/isUserDeniedSigning.ts +11 -3
- package/src/utils/index.ts +1 -0
- package/src/utils/intents/signers/near.ts +1 -1
- package/src/utils/intents/signers/privy.ts +1 -1
- package/src/utils/intents/signers/solana.ts +1 -1
- package/src/utils/isErrorLikeObject.ts +11 -0
- package/dist/config-BMe2x51b.js.map +0 -1
- package/dist/index-Ce9bzNHX.js.map +0 -1
|
@@ -9,12 +9,12 @@ import "ethers";
|
|
|
9
9
|
import "../../utils/cn.js";
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
11
|
import "@defuse-protocol/one-click-sdk-typescript";
|
|
12
|
-
import { ag as F, af as G, z as H } from "../../config-
|
|
12
|
+
import { ag as F, af as G, z as H } from "../../config-BVaLnxO9.js";
|
|
13
13
|
import "../../machine/machine.js";
|
|
14
14
|
import "zod";
|
|
15
15
|
import "../../utils/near/rpc.js";
|
|
16
16
|
import "../../index-DEq3oXQF.js";
|
|
17
|
-
import "@defuse-protocol/
|
|
17
|
+
import "@defuse-protocol/intents-sdk";
|
|
18
18
|
import "change-case";
|
|
19
19
|
import "@defuse-protocol/internal-utils";
|
|
20
20
|
import "bs58";
|
|
@@ -28,7 +28,7 @@ import "lucide-react";
|
|
|
28
28
|
import "../../components/Card.js";
|
|
29
29
|
import "../../components/Button.js";
|
|
30
30
|
import "copy-text-to-clipboard";
|
|
31
|
-
import "
|
|
31
|
+
import "../../components/Input.js";
|
|
32
32
|
import "../../components/InputAmount.js";
|
|
33
33
|
import "../../components/Notes.js";
|
|
34
34
|
import "../../components/CloseButton.js";
|
|
@@ -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-BVaLnxO9.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-BVaLnxO9.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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-BVaLnxO9.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";
|
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-BVaLnxO9.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-BVaLnxO9.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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useHandleKeyDown: (key:
|
|
1
|
+
export declare const useHandleKeyDown: (key: "Escape" | "ArrowDown" | "ArrowUp" | "Alphanumeric", onKeyPress: (key: string) => void, deps?: unknown[]) => void;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
const w = (e, o) => {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { useEffect as i } from "react";
|
|
2
|
+
const s = (e) => e.length === 1 && /^[a-z]$/i.test(e), u = (e) => e.length === 1 && /^[0-9]$/.test(e), c = (e) => s(e) || u(e), w = (e, t, o = []) => {
|
|
3
|
+
i(() => {
|
|
4
|
+
const r = (n) => {
|
|
5
|
+
if (e === "Alphanumeric" && c(n.key)) {
|
|
6
|
+
t(n.key);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
n.key === e && t(e);
|
|
6
10
|
};
|
|
7
|
-
return window.addEventListener("keydown",
|
|
8
|
-
window.removeEventListener("keydown",
|
|
11
|
+
return window.addEventListener("keydown", r), () => {
|
|
12
|
+
window.removeEventListener("keydown", r);
|
|
9
13
|
};
|
|
10
|
-
}, [e]);
|
|
14
|
+
}, [e, ...o]);
|
|
11
15
|
};
|
|
12
16
|
export {
|
|
13
17
|
w as useHandleKeyDown
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHandleKeyDown.js","sources":["../../src/hooks/useHandleKeyDown.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nexport const useHandleKeyDown = (key:
|
|
1
|
+
{"version":3,"file":"useHandleKeyDown.js","sources":["../../src/hooks/useHandleKeyDown.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nconst isLetter = (key: string) => {\n return key.length === 1 && /^[a-z]$/i.test(key);\n};\n\nconst isNumber = (key: string) => {\n return key.length === 1 && /^[0-9]$/.test(key);\n};\n\nconst isAlphanumeric = (key: string) => {\n return isLetter(key) || isNumber(key);\n};\n\nexport const useHandleKeyDown = (\n key: 'Escape' | 'ArrowDown' | 'ArrowUp' | 'Alphanumeric',\n onKeyPress: (key: string) => void,\n deps: unknown[] = [],\n) => {\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (key === 'Alphanumeric' && isAlphanumeric(event.key)) {\n onKeyPress(event.key);\n\n return;\n }\n\n if (event.key === key) {\n onKeyPress(key);\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [key, ...deps]);\n};\n"],"names":["isLetter","key","isNumber","isAlphanumeric","useHandleKeyDown","onKeyPress","deps","useEffect","handleKeyDown","event"],"mappings":";AAEA,MAAMA,IAAW,CAACC,MACTA,EAAI,WAAW,KAAK,WAAW,KAAKA,CAAG,GAG1CC,IAAW,CAACD,MACTA,EAAI,WAAW,KAAK,UAAU,KAAKA,CAAG,GAGzCE,IAAiB,CAACF,MACfD,EAASC,CAAG,KAAKC,EAASD,CAAG,GAGzBG,IAAmB,CAC9BH,GACAI,GACAC,IAAkB,CAAA,MACf;AACH,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAgB,CAACC,MAAyB;AAC9C,UAAIR,MAAQ,kBAAkBE,EAAeM,EAAM,GAAG,GAAG;AACvD,QAAAJ,EAAWI,EAAM,GAAG;AAEpB;AAAA,MACF;AAEA,MAAIA,EAAM,QAAQR,KAChBI,EAAWJ,CAAG;AAAA,IAElB;AAEA,kBAAO,iBAAiB,WAAWO,CAAa,GAEzC,MAAM;AACX,aAAO,oBAAoB,WAAWA,CAAa;AAAA,IACrD;AAAA,EACF,GAAG,CAACP,GAAK,GAAGK,CAAI,CAAC;AACnB;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import "../index-DEq3oXQF.js";
|
|
2
|
-
import "@defuse-protocol/
|
|
2
|
+
import "@defuse-protocol/intents-sdk";
|
|
3
3
|
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
|
|
7
|
+
import { g as b } from "../config-BVaLnxO9.js";
|
|
8
8
|
import "../constants/chains.js";
|
|
9
9
|
import "../constants/intents.js";
|
|
10
10
|
import "../utils/notReachable.js";
|
|
11
|
+
import "../utils/isErrorLikeObject.js";
|
|
11
12
|
import "../utils/localstorage.js";
|
|
12
13
|
import "../utils/near/queryContract.js";
|
|
13
14
|
import "../utils/formatters/formatBigToHuman.js";
|
|
@@ -15,6 +16,6 @@ import "../utils/intents/getIntentsAccountId.js";
|
|
|
15
16
|
import "../utils/formatters/getTransactionLink.js";
|
|
16
17
|
import "../utils/checkers/isUserDeniedSigning.js";
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
b as useMakeIntentsTransfer
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=useMakeIntentsTransfer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMakeIntentsTransfer.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMakeIntentsTransfer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import "../utils/near/config.js";
|
|
2
|
-
import { a0 as
|
|
2
|
+
import { a0 as s } from "../config-BVaLnxO9.js";
|
|
3
3
|
import "../utils/near/getNearNep141MinStorageBalance.js";
|
|
4
4
|
import "../logger.js";
|
|
5
|
+
import "../utils/isErrorLikeObject.js";
|
|
6
|
+
import "../utils/checkers/isUserDeniedSigning.js";
|
|
5
7
|
import "../constants/tokens.js";
|
|
6
8
|
export {
|
|
7
|
-
|
|
9
|
+
s as useMakeNEARFtTransferCall
|
|
8
10
|
};
|
|
9
11
|
//# sourceMappingURL=useMakeNEARFtTransferCall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMakeNEARFtTransferCall.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMakeNEARFtTransferCall.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -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-BVaLnxO9.js";
|
|
7
7
|
import "../network.js";
|
|
8
8
|
import "../machine/guards/index.js";
|
|
9
9
|
import "../constants/tokens.js";
|
|
@@ -5,15 +5,16 @@ import "viem";
|
|
|
5
5
|
import "../utils/evm/isEvmBaseToken.js";
|
|
6
6
|
import "ethers";
|
|
7
7
|
import "../utils/cn.js";
|
|
8
|
+
import "../utils/isErrorLikeObject.js";
|
|
8
9
|
import "./useMakeEvmTransfer.js";
|
|
9
10
|
import "../utils/evm/isEvmAddress.js";
|
|
10
11
|
import "./useMakeSolanaTransfer.js";
|
|
11
|
-
import { j as
|
|
12
|
+
import { j as T } from "../config-BVaLnxO9.js";
|
|
12
13
|
import "../utils/solana/isSolanaAddress.js";
|
|
13
14
|
import "../logger.js";
|
|
14
15
|
import "../constants/tokens.js";
|
|
15
16
|
import "../utils/checkers/isUserDeniedSigning.js";
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
T as useMakeQuoteTransfer
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=useMakeQuoteTransfer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMakeQuoteTransfer.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMakeQuoteTransfer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -33,7 +33,7 @@ const E = ({
|
|
|
33
33
|
transactionLink: `https://solscan.io/tx/${m}`
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
const { getAssociatedTokenAddress: k, createTransferInstruction: b } = await import("../index-
|
|
36
|
+
const { getAssociatedTokenAddress: k, createTransferInstruction: b } = await import("../index-JGjxyZXI.js"), l = BigInt(t.amount);
|
|
37
37
|
if (l <= 0n)
|
|
38
38
|
throw new Error("Transfer amount must be positive");
|
|
39
39
|
const f = new c(t.tokenAddress), p = await k(
|
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-BVaLnxO9.js";
|
|
5
5
|
import "../constants/chains.js";
|
|
6
6
|
import "../constants/tokens.js";
|
|
7
7
|
import "../utils/checkers/isValidChain.js";
|
|
@@ -1,90 +1,90 @@
|
|
|
1
1
|
import { P as o, L as n, T as z } from "./index.browser.esm-COWShN0a.js";
|
|
2
|
-
import { a as
|
|
3
|
-
const
|
|
2
|
+
import { a as u } from "./index-DEq3oXQF.js";
|
|
3
|
+
const x = new o("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
4
4
|
new o("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
5
5
|
const M = new o("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
|
6
6
|
new o("So11111111111111111111111111111111111111112");
|
|
7
7
|
new o("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
|
|
8
|
-
const
|
|
8
|
+
const b = (e) => {
|
|
9
9
|
const r = e.decode.bind(e), s = e.encode.bind(e);
|
|
10
10
|
return { decode: r, encode: s };
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var d = {}, E;
|
|
13
13
|
function C() {
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
function e(
|
|
14
|
+
if (E) return d;
|
|
15
|
+
E = 1, Object.defineProperty(d, "__esModule", { value: !0 });
|
|
16
|
+
function e(i) {
|
|
17
17
|
{
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const a =
|
|
18
|
+
const t = u.from(i);
|
|
19
|
+
t.reverse();
|
|
20
|
+
const a = t.toString("hex");
|
|
21
21
|
return a.length === 0 ? BigInt(0) : BigInt(`0x${a}`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
function r(
|
|
24
|
+
d.toBigIntLE = e;
|
|
25
|
+
function r(i) {
|
|
26
26
|
{
|
|
27
|
-
const
|
|
28
|
-
return
|
|
27
|
+
const t = i.toString("hex");
|
|
28
|
+
return t.length === 0 ? BigInt(0) : BigInt(`0x${t}`);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
function s(
|
|
31
|
+
d.toBigIntBE = r;
|
|
32
|
+
function s(i, t) {
|
|
33
33
|
{
|
|
34
|
-
const a =
|
|
34
|
+
const a = i.toString(16), f = u.from(a.padStart(t * 2, "0").slice(0, t * 2), "hex");
|
|
35
35
|
return f.reverse(), f;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
function l(
|
|
38
|
+
d.toBufferLE = s;
|
|
39
|
+
function l(i, t) {
|
|
40
40
|
{
|
|
41
|
-
const a =
|
|
42
|
-
return
|
|
41
|
+
const a = i.toString(16);
|
|
42
|
+
return u.from(a.padStart(t * 2, "0").slice(0, t * 2), "hex");
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
return
|
|
45
|
+
return d.toBufferBE = l, d;
|
|
46
46
|
}
|
|
47
47
|
var p = C();
|
|
48
|
-
const
|
|
49
|
-
const s = n.blob(e, r), { encode: l, decode:
|
|
50
|
-
return
|
|
51
|
-
const
|
|
52
|
-
return p.toBigIntLE(
|
|
53
|
-
},
|
|
54
|
-
const
|
|
55
|
-
return l(
|
|
56
|
-
}, i;
|
|
57
|
-
}, B = S(8), y = (e) => {
|
|
58
|
-
const r = n.u8(e), { encode: s, decode: l } = E(r), t = r;
|
|
59
|
-
return t.decode = (i, a) => !!l(i, a), t.encode = (i, a, f) => {
|
|
60
|
-
const d = Number(i);
|
|
61
|
-
return s(d, a, f);
|
|
48
|
+
const y = (e) => (r) => {
|
|
49
|
+
const s = n.blob(e, r), { encode: l, decode: i } = b(s), t = s;
|
|
50
|
+
return t.decode = (a, f) => {
|
|
51
|
+
const c = i(a, f);
|
|
52
|
+
return p.toBigIntLE(u.from(c));
|
|
53
|
+
}, t.encode = (a, f, c) => {
|
|
54
|
+
const m = p.toBufferLE(a, e);
|
|
55
|
+
return l(m, f, c);
|
|
62
56
|
}, t;
|
|
63
|
-
},
|
|
64
|
-
const r = n.
|
|
65
|
-
return
|
|
66
|
-
const
|
|
57
|
+
}, h = y(8), v = (e) => {
|
|
58
|
+
const r = n.u8(e), { encode: s, decode: l } = b(r), i = r;
|
|
59
|
+
return i.decode = (t, a) => !!l(t, a), i.encode = (t, a, f) => {
|
|
60
|
+
const c = Number(t);
|
|
61
|
+
return s(c, a, f);
|
|
62
|
+
}, i;
|
|
63
|
+
}, g = (e) => {
|
|
64
|
+
const r = n.blob(32, e), { encode: s, decode: l } = b(r), i = r;
|
|
65
|
+
return i.decode = (t, a) => {
|
|
66
|
+
const f = l(t, a);
|
|
67
67
|
return new o(f);
|
|
68
|
-
},
|
|
69
|
-
const
|
|
70
|
-
return s(
|
|
71
|
-
},
|
|
68
|
+
}, i.encode = (t, a, f) => {
|
|
69
|
+
const c = t.toBuffer();
|
|
70
|
+
return s(c, a, f);
|
|
71
|
+
}, i;
|
|
72
72
|
};
|
|
73
|
-
class
|
|
73
|
+
class S extends Error {
|
|
74
74
|
constructor(r) {
|
|
75
75
|
super(r);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
class
|
|
78
|
+
class w extends S {
|
|
79
79
|
constructor() {
|
|
80
80
|
super(...arguments), this.name = "TokenOwnerOffCurveError";
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
var A;
|
|
84
84
|
(function(e) {
|
|
85
|
-
e[e.InitializeMint = 0] = "InitializeMint", e[e.InitializeAccount = 1] = "InitializeAccount", e[e.InitializeMultisig = 2] = "InitializeMultisig", e[e.Transfer = 3] = "Transfer", e[e.Approve = 4] = "Approve", e[e.Revoke = 5] = "Revoke", e[e.SetAuthority = 6] = "SetAuthority", e[e.MintTo = 7] = "MintTo", e[e.Burn = 8] = "Burn", e[e.CloseAccount = 9] = "CloseAccount", e[e.FreezeAccount = 10] = "FreezeAccount", e[e.ThawAccount = 11] = "ThawAccount", e[e.TransferChecked = 12] = "TransferChecked", e[e.ApproveChecked = 13] = "ApproveChecked", e[e.MintToChecked = 14] = "MintToChecked", e[e.BurnChecked = 15] = "BurnChecked", e[e.InitializeAccount2 = 16] = "InitializeAccount2", e[e.SyncNative = 17] = "SyncNative", e[e.InitializeAccount3 = 18] = "InitializeAccount3", e[e.InitializeMultisig2 = 19] = "InitializeMultisig2", e[e.InitializeMint2 = 20] = "InitializeMint2", e[e.GetAccountDataSize = 21] = "GetAccountDataSize", e[e.InitializeImmutableOwner = 22] = "InitializeImmutableOwner", e[e.AmountToUiAmount = 23] = "AmountToUiAmount", e[e.UiAmountToAmount = 24] = "UiAmountToAmount", e[e.InitializeMintCloseAuthority = 25] = "InitializeMintCloseAuthority", e[e.TransferFeeExtension = 26] = "TransferFeeExtension", e[e.ConfidentialTransferExtension = 27] = "ConfidentialTransferExtension", e[e.DefaultAccountStateExtension = 28] = "DefaultAccountStateExtension", e[e.Reallocate = 29] = "Reallocate", e[e.MemoTransferExtension = 30] = "MemoTransferExtension", e[e.CreateNativeMint = 31] = "CreateNativeMint", e[e.InitializeNonTransferableMint = 32] = "InitializeNonTransferableMint", e[e.InterestBearingMintExtension = 33] = "InterestBearingMintExtension", e[e.CpiGuardExtension = 34] = "CpiGuardExtension", e[e.InitializePermanentDelegate = 35] = "InitializePermanentDelegate", e[e.TransferHookExtension = 36] = "TransferHookExtension", e[e.MetadataPointerExtension = 39] = "MetadataPointerExtension"
|
|
85
|
+
e[e.InitializeMint = 0] = "InitializeMint", e[e.InitializeAccount = 1] = "InitializeAccount", e[e.InitializeMultisig = 2] = "InitializeMultisig", e[e.Transfer = 3] = "Transfer", e[e.Approve = 4] = "Approve", e[e.Revoke = 5] = "Revoke", e[e.SetAuthority = 6] = "SetAuthority", e[e.MintTo = 7] = "MintTo", e[e.Burn = 8] = "Burn", e[e.CloseAccount = 9] = "CloseAccount", e[e.FreezeAccount = 10] = "FreezeAccount", e[e.ThawAccount = 11] = "ThawAccount", e[e.TransferChecked = 12] = "TransferChecked", e[e.ApproveChecked = 13] = "ApproveChecked", e[e.MintToChecked = 14] = "MintToChecked", e[e.BurnChecked = 15] = "BurnChecked", e[e.InitializeAccount2 = 16] = "InitializeAccount2", e[e.SyncNative = 17] = "SyncNative", e[e.InitializeAccount3 = 18] = "InitializeAccount3", e[e.InitializeMultisig2 = 19] = "InitializeMultisig2", e[e.InitializeMint2 = 20] = "InitializeMint2", e[e.GetAccountDataSize = 21] = "GetAccountDataSize", e[e.InitializeImmutableOwner = 22] = "InitializeImmutableOwner", e[e.AmountToUiAmount = 23] = "AmountToUiAmount", e[e.UiAmountToAmount = 24] = "UiAmountToAmount", e[e.InitializeMintCloseAuthority = 25] = "InitializeMintCloseAuthority", e[e.TransferFeeExtension = 26] = "TransferFeeExtension", e[e.ConfidentialTransferExtension = 27] = "ConfidentialTransferExtension", e[e.DefaultAccountStateExtension = 28] = "DefaultAccountStateExtension", e[e.Reallocate = 29] = "Reallocate", e[e.MemoTransferExtension = 30] = "MemoTransferExtension", e[e.CreateNativeMint = 31] = "CreateNativeMint", e[e.InitializeNonTransferableMint = 32] = "InitializeNonTransferableMint", e[e.InterestBearingMintExtension = 33] = "InterestBearingMintExtension", e[e.CpiGuardExtension = 34] = "CpiGuardExtension", e[e.InitializePermanentDelegate = 35] = "InitializePermanentDelegate", e[e.TransferHookExtension = 36] = "TransferHookExtension", e[e.MetadataPointerExtension = 39] = "MetadataPointerExtension";
|
|
86
86
|
})(A || (A = {}));
|
|
87
|
-
function
|
|
87
|
+
function L(e, r, s) {
|
|
88
88
|
if (s.length) {
|
|
89
89
|
e.push({ pubkey: r, isSigner: !1, isWritable: !1 });
|
|
90
90
|
for (const l of s)
|
|
@@ -97,42 +97,42 @@ function w(e, r, s) {
|
|
|
97
97
|
e.push({ pubkey: r, isSigner: !0, isWritable: !1 });
|
|
98
98
|
return e;
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const P = n.struct([
|
|
101
101
|
n.u32("mintAuthorityOption"),
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
g("mintAuthority"),
|
|
103
|
+
h("supply"),
|
|
104
104
|
n.u8("decimals"),
|
|
105
|
-
|
|
105
|
+
v("isInitialized"),
|
|
106
106
|
n.u32("freezeAuthorityOption"),
|
|
107
|
-
|
|
107
|
+
g("freezeAuthority")
|
|
108
108
|
]);
|
|
109
|
-
|
|
110
|
-
async function D(e, r, s = !1, l =
|
|
109
|
+
P.span;
|
|
110
|
+
async function D(e, r, s = !1, l = x, i = M) {
|
|
111
111
|
if (!s && !o.isOnCurve(r.toBuffer()))
|
|
112
|
-
throw new
|
|
113
|
-
const [
|
|
114
|
-
return
|
|
112
|
+
throw new w();
|
|
113
|
+
const [t] = await o.findProgramAddress([r.toBuffer(), l.toBuffer(), e.toBuffer()], i);
|
|
114
|
+
return t;
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
function G(e, r, s, l,
|
|
118
|
-
const a =
|
|
116
|
+
const B = n.struct([n.u8("instruction"), h("amount")]);
|
|
117
|
+
function G(e, r, s, l, i = [], t = x) {
|
|
118
|
+
const a = L([
|
|
119
119
|
{ pubkey: e, isSigner: !1, isWritable: !0 },
|
|
120
120
|
{ pubkey: r, isSigner: !1, isWritable: !0 }
|
|
121
|
-
], s,
|
|
122
|
-
return
|
|
121
|
+
], s, i), f = u.alloc(B.span);
|
|
122
|
+
return B.encode({
|
|
123
123
|
instruction: A.Transfer,
|
|
124
124
|
amount: BigInt(l)
|
|
125
|
-
}, f), new z({ keys: a, programId:
|
|
125
|
+
}, f), new z({ keys: a, programId: t, data: f });
|
|
126
126
|
}
|
|
127
127
|
export {
|
|
128
128
|
M as ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
P as MintLayout,
|
|
130
|
+
x as TOKEN_PROGRAM_ID,
|
|
131
|
+
S as TokenError,
|
|
132
132
|
A as TokenInstruction,
|
|
133
|
-
|
|
133
|
+
w as TokenOwnerOffCurveError,
|
|
134
134
|
G as createTransferInstruction,
|
|
135
135
|
D as getAssociatedTokenAddress,
|
|
136
|
-
|
|
136
|
+
B as transferInstructionData
|
|
137
137
|
};
|
|
138
|
-
//# sourceMappingURL=index-
|
|
138
|
+
//# sourceMappingURL=index-JGjxyZXI.js.map
|