@getpara/react-sdk 1.8.0 → 2.0.0-alpha.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/{modal/components/AddFunds/MoonPayEmbed.js → MoonPayEmbed-Q2HP2BFI.js} +3 -1
- package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
- package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
- package/dist/chunk-MMUBH76A.js.br +0 -0
- package/dist/chunk-MMUBH76A.js.gz +0 -0
- package/dist/cli/cli.mjs +40 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6499 -6
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/modal/components/AuthInput/AuthInput.d.ts +1 -1
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +4 -4
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +1 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -1
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -1
- package/dist/modal/components/Controls/Selects.d.ts +1 -1
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -1
- package/dist/modal/components/Footer/Footer.d.ts +1 -1
- package/dist/modal/components/WalletCard/WalletCard.d.ts +2 -2
- package/dist/modal/components/common.d.ts +7 -7
- package/dist/modal/constants/constants.d.ts +1 -1
- package/dist/modal/index.d.ts +0 -2
- package/dist/modal/stores/index.d.ts +0 -2
- package/dist/modal/stores/modal/useModalStore.d.ts +22 -20
- package/dist/modal/types/commonTypes.d.ts +4 -9
- package/dist/modal/types/externalWallets.d.ts +0 -2
- package/dist/modal/types/modalProps.d.ts +1 -33
- package/dist/modal/utils/authLayoutHelpers.d.ts +2 -2
- package/dist/modal/utils/getTileButtonFlex.d.ts +1 -1
- package/dist/modal/utils/isPasskeySupported.d.ts +1 -0
- package/dist/modal/utils/openPopup.d.ts +2 -2
- package/dist/modal/utils/stringFormatters.d.ts +0 -1
- package/dist/provider/ParaProvider.d.ts +3 -1
- package/dist/provider/actions/getAccount.d.ts +19 -7
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/index.d.ts +25 -0
- package/dist/provider/actions/utils.d.ts +3 -0
- package/dist/provider/components/CosmosWalletWrapper.d.ts +11 -0
- package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
- package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
- package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
- package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
- package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
- package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +12 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +3 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +8 -0
- package/dist/provider/hooks/mutations/index.d.ts +25 -10
- package/dist/provider/hooks/mutations/utils.d.ts +4 -0
- package/dist/provider/hooks/queries/index.d.ts +0 -1
- package/dist/provider/hooks/queries/useAccount.d.ts +1 -6
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/utils/useWalletState.d.ts +3 -2
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/providers/AuthProvider.d.ts +31 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +73 -0
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
- package/dist/provider/stores/getters.d.ts +3 -3
- package/dist/provider/stores/setters.d.ts +1 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
- package/dist/provider/stores/slices/index.d.ts +1 -0
- package/dist/provider/stores/types.d.ts +46 -3
- package/dist/provider/types/externalWalletProviders.d.ts +12 -0
- package/dist/provider/types/provider.d.ts +119 -16
- package/dist/provider/types/utils.d.ts +16 -0
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
- package/dist/provider/utils/renameMutations.d.ts +3 -0
- package/package.json +19 -7
- package/dist/modal/ParaModal.js +0 -362
- package/dist/modal/components/Account/Account.js +0 -77
- package/dist/modal/components/AddFunds/AddFunds.js +0 -220
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -72
- package/dist/modal/components/AddFunds/AddFundsDone.js +0 -43
- package/dist/modal/components/AddFunds/index.js +0 -4
- package/dist/modal/components/AuthInput/AuthInput.js +0 -283
- package/dist/modal/components/AuthInput/countryCodes.js +0 -42
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
- package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -37
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -113
- package/dist/modal/components/AuthOptions/AuthOptions.js +0 -33
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -44
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -55
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -93
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
- package/dist/modal/components/Body/Body.js +0 -308
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -94
- package/dist/modal/components/ChainSwitch/config.js +0 -17
- package/dist/modal/components/Controls/Controls.js +0 -74
- package/dist/modal/components/Controls/Selects.js +0 -234
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -140
- package/dist/modal/components/ExternalWalletStep/config.js +0 -17
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -96
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -172
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +0 -8
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -124
- package/dist/modal/components/Footer/Footer.js +0 -93
- package/dist/modal/components/Header/Header.js +0 -43
- package/dist/modal/components/Header/hooks/useStepTitle.js +0 -50
- package/dist/modal/components/Hero/Hero.js +0 -116
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -55
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -28
- package/dist/modal/components/ModalContent/ModalContent.js +0 -324
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
- package/dist/modal/components/OAuth/OAuth.js +0 -153
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -139
- package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -101
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -141
- package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -24
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -159
- package/dist/modal/components/Waiting/Waiting.js +0 -17
- package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
- package/dist/modal/components/WalletCard/WalletCard.js +0 -127
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -52
- package/dist/modal/components/common.js +0 -96
- package/dist/modal/components/index.js +0 -2
- package/dist/modal/constants/constants.js +0 -111
- package/dist/modal/constants/defaults.js +0 -10
- package/dist/modal/constants/oAuthLogos.js +0 -24
- package/dist/modal/hooks/useActiveWallet.d.ts +0 -1
- package/dist/modal/hooks/useActiveWallet.js +0 -15
- package/dist/modal/hooks/useCreateAccount.d.ts +0 -4
- package/dist/modal/hooks/useCreateAccount.js +0 -72
- package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +0 -1
- package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -54
- package/dist/modal/hooks/useGoBack.js +0 -42
- package/dist/modal/hooks/useSetLoginURLs.d.ts +0 -8
- package/dist/modal/hooks/useSetLoginURLs.js +0 -49
- package/dist/modal/hooks/useWalletBalance.d.ts +0 -4
- package/dist/modal/hooks/useWalletBalance.js +0 -47
- package/dist/modal/index.js +0 -33
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +0 -42
- package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -38
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +0 -46
- package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -55
- package/dist/modal/providers/ExternalWalletContext.d.ts +0 -92
- package/dist/modal/providers/ExternalWalletContext.js +0 -394
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +0 -32
- package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -32
- package/dist/modal/stores/externalWalletProvider/actions.d.ts +0 -3
- package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +0 -22
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -21
- package/dist/modal/stores/index.js +0 -4
- package/dist/modal/stores/modal/actions.js +0 -70
- package/dist/modal/stores/modal/useModalStore.js +0 -65
- package/dist/modal/stores/theme/actions.d.ts +0 -3
- package/dist/modal/stores/theme/actions.js +0 -28
- package/dist/modal/stores/theme/useThemeStore.d.ts +0 -20
- package/dist/modal/stores/theme/useThemeStore.js +0 -21
- package/dist/modal/stores/userInfo/actions.d.ts +0 -3
- package/dist/modal/stores/userInfo/actions.js +0 -30
- package/dist/modal/stores/userInfo/useUserInfoStore.d.ts +0 -19
- package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
- package/dist/modal/types/commonTypes.js +0 -1
- package/dist/modal/types/externalWallets.js +0 -32
- package/dist/modal/types/modalProps.js +0 -12
- package/dist/modal/utils/authLayoutHelpers.js +0 -8
- package/dist/modal/utils/getMailtoLink.js +0 -10
- package/dist/modal/utils/getTileButtonFlex.js +0 -20
- package/dist/modal/utils/openPopup.js +0 -60
- package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
- package/dist/modal/utils/steps.js +0 -232
- package/dist/modal/utils/stringFormatters.js +0 -19
- package/dist/modal/utils/validateOnRampConfig.js +0 -32
- package/dist/package.json +0 -6
- package/dist/provider/ParaProvider.js +0 -22
- package/dist/provider/actions/checkIfUserExists.d.ts +0 -9
- package/dist/provider/actions/checkIfUserExists.js +0 -21
- package/dist/provider/actions/createUser.d.ts +0 -12
- package/dist/provider/actions/createUser.js +0 -26
- package/dist/provider/actions/getAccount.js +0 -22
- package/dist/provider/actions/getWallet.js +0 -14
- package/dist/provider/actions/getWalletBalance.d.ts +0 -2
- package/dist/provider/actions/getWalletBalance.js +0 -14
- package/dist/provider/actions/initiateLogin.d.ts +0 -4
- package/dist/provider/actions/initiateLogin.js +0 -20
- package/dist/provider/actions/keepSessionAlive.d.ts +0 -2
- package/dist/provider/actions/keepSessionAlive.js +0 -20
- package/dist/provider/actions/logout.d.ts +0 -2
- package/dist/provider/actions/logout.js +0 -17
- package/dist/provider/actions/signMessage.d.ts +0 -8
- package/dist/provider/actions/signMessage.js +0 -20
- package/dist/provider/actions/signTransaction.d.ts +0 -8
- package/dist/provider/actions/signTransaction.js +0 -20
- package/dist/provider/actions/waitForAccountCreation.d.ts +0 -2
- package/dist/provider/actions/waitForAccountCreation.js +0 -21
- package/dist/provider/actions/waitForLoginAndSetup.d.ts +0 -6
- package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.d.ts +0 -2
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
- package/dist/provider/hooks/index.js +0 -4
- package/dist/provider/hooks/mutations/index.js +0 -24
- package/dist/provider/hooks/mutations/useCheckIfUserExists.d.ts +0 -13
- package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
- package/dist/provider/hooks/mutations/useCreateUser.d.ts +0 -13
- package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
- package/dist/provider/hooks/mutations/useInitiateLogin.d.ts +0 -14
- package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +0 -12
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
- package/dist/provider/hooks/mutations/useLogout.d.ts +0 -12
- package/dist/provider/hooks/mutations/useLogout.js +0 -30
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +0 -15
- package/dist/provider/hooks/mutations/useSignMessage.js +0 -39
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +0 -14
- package/dist/provider/hooks/mutations/useSignTransaction.js +0 -39
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.d.ts +0 -12
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.d.ts +0 -14
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.d.ts +0 -13
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
- package/dist/provider/hooks/queries/index.js +0 -10
- package/dist/provider/hooks/queries/useAccount.js +0 -21
- package/dist/provider/hooks/queries/useWallet.js +0 -22
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -7
- package/dist/provider/hooks/queries/useWalletBalance.js +0 -26
- package/dist/provider/hooks/utils/index.js +0 -10
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
- package/dist/provider/hooks/utils/useClient.js +0 -10
- package/dist/provider/hooks/utils/useEventListeners.js +0 -105
- package/dist/provider/hooks/utils/useInternalClient.js +0 -10
- package/dist/provider/hooks/utils/useModal.js +0 -17
- package/dist/provider/hooks/utils/useWalletState.js +0 -33
- package/dist/provider/index.js +0 -8
- package/dist/provider/stores/getters.js +0 -13
- package/dist/provider/stores/slices/client.js +0 -9
- package/dist/provider/stores/slices/index.js +0 -4
- package/dist/provider/stores/slices/modal.js +0 -9
- package/dist/provider/stores/slices/wallet.js +0 -13
- package/dist/provider/stores/types.js +0 -1
- package/dist/provider/stores/useStore.js +0 -27
- package/dist/provider/types/provider.js +0 -1
- package/dist/provider/types/query.js +0 -1
- package/dist/provider/types/utils.js +0 -1
- package/dist/provider/utils/constants.d.ts +0 -5
- package/dist/provider/utils/constants.js +0 -11
- package/dist/provider/utils/renameMutations.js +0 -16
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
|
|
6
|
-
import { DEFAULTS } from "../constants/defaults.js";
|
|
7
|
-
import { useModalStore } from "../stores/index.js";
|
|
8
|
-
import { openPopup } from "../utils/openPopup.js";
|
|
9
|
-
import { ModalStep } from "../utils/steps.js";
|
|
10
|
-
import { useGoBack } from "./useGoBack.js";
|
|
11
|
-
function useCreateAccount() {
|
|
12
|
-
const para = useInternalClient();
|
|
13
|
-
const goBack = useGoBack();
|
|
14
|
-
const refs = useModalStore((state) => state.refs);
|
|
15
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
16
|
-
const webAuthURLForCreate = useModalStore((state) => state.webAuthURLForCreate);
|
|
17
|
-
const setWebAuthURLForCreate = useModalStore((state) => state.setWebAuthURLForCreate);
|
|
18
|
-
const setIFrameUrl = useModalStore((state) => state.setIFrameUrl);
|
|
19
|
-
const awaitWalletCreationTransition = () => __async(this, null, function* () {
|
|
20
|
-
var _a;
|
|
21
|
-
const isComplete = yield para.waitForAccountCreation({ popupWindow: refs.popupWindow.current });
|
|
22
|
-
window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
|
|
23
|
-
refs.poll.current = void 0;
|
|
24
|
-
refs.popupWindow.current = void 0;
|
|
25
|
-
if (isComplete) {
|
|
26
|
-
setWebAuthURLForCreate("");
|
|
27
|
-
setIFrameUrl("");
|
|
28
|
-
setStep(ModalStep.AWAITING_WALLET_CREATION);
|
|
29
|
-
} else if (refs.currentStep.current === ModalStep.AWAITING_BIOMETRIC_CREATION) {
|
|
30
|
-
goBack();
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
withPasskey: () => {
|
|
35
|
-
var _a, _b;
|
|
36
|
-
if (((_a = refs.poll.current) == null ? void 0 : _a.action) === "createPasskey") {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
clearTimeout((_b = refs.poll.current) == null ? void 0 : _b.timeout);
|
|
40
|
-
refs.popupWindow.current = openPopup({
|
|
41
|
-
url: webAuthURLForCreate,
|
|
42
|
-
target: "ParaPasskey",
|
|
43
|
-
type: "CREATE_PASSKEY",
|
|
44
|
-
current: refs.popupWindow.current
|
|
45
|
-
});
|
|
46
|
-
refs.poll.current = {
|
|
47
|
-
action: "createPasskey",
|
|
48
|
-
timeout: window.setTimeout(awaitWalletCreationTransition, DEFAULTS.POLLING_INTERVAL_MS)
|
|
49
|
-
};
|
|
50
|
-
if (refs.currentStep.current !== ModalStep.AWAITING_BIOMETRIC_CREATION) {
|
|
51
|
-
setStep(ModalStep.AWAITING_BIOMETRIC_CREATION);
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
withPassword: () => {
|
|
55
|
-
var _a, _b;
|
|
56
|
-
if (((_a = refs.poll.current) == null ? void 0 : _a.action) === "createPassword") {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
clearTimeout((_b = refs.poll.current) == null ? void 0 : _b.timeout);
|
|
60
|
-
refs.poll.current = {
|
|
61
|
-
action: "createPassword",
|
|
62
|
-
timeout: window.setTimeout(awaitWalletCreationTransition, DEFAULTS.POLLING_INTERVAL_MS)
|
|
63
|
-
};
|
|
64
|
-
if (refs.currentStep.current !== ModalStep.PASSWORD_CREATION) {
|
|
65
|
-
setStep(ModalStep.PASSWORD_CREATION);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
export {
|
|
71
|
-
useCreateAccount
|
|
72
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useEmbeddedExternalConnection: () => () => Promise<void>;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { WalletType } from "@getpara/web-sdk";
|
|
6
|
-
import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
|
|
7
|
-
import { useWalletState } from "../../provider/index.js";
|
|
8
|
-
import { useExternalWalletProviderStore } from "../stores/externalWalletProvider/useExternalWalletProviderStore.js";
|
|
9
|
-
const useEmbeddedExternalConnection = () => {
|
|
10
|
-
const client = useInternalClient();
|
|
11
|
-
const { setSelectedWallet } = useWalletState();
|
|
12
|
-
const connectParaEvmWallet = useExternalWalletProviderStore((state) => state.connectParaEvmWallet);
|
|
13
|
-
const EvmProvider = useExternalWalletProviderStore((state) => state.EvmProvider);
|
|
14
|
-
const evmContext = useExternalWalletProviderStore((state) => state.evmContext);
|
|
15
|
-
const connectParaCosmosWallet = useExternalWalletProviderStore((state) => state.connectParaCosmosWallet);
|
|
16
|
-
const CosmosProvider = useExternalWalletProviderStore((state) => state.CosmosProvider);
|
|
17
|
-
const cosmosContext = useExternalWalletProviderStore((state) => state.cosmosContext);
|
|
18
|
-
const connectEmbeddedToExternalConnectors = () => __async(void 0, null, function* () {
|
|
19
|
-
if (evmContext && EvmProvider && connectParaEvmWallet) {
|
|
20
|
-
try {
|
|
21
|
-
const { error } = yield connectParaEvmWallet();
|
|
22
|
-
if (error) {
|
|
23
|
-
console.warn("Failed to connect Para EVM wallet to Wagmi:", error);
|
|
24
|
-
} else {
|
|
25
|
-
const wallet = client.findWallet(void 0, void 0, { type: [WalletType.EVM] });
|
|
26
|
-
if (wallet) {
|
|
27
|
-
setSelectedWallet({ id: wallet.id, type: WalletType.EVM });
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
} catch (err) {
|
|
31
|
-
console.warn("Error calling connectParaEvmWallet:", err);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (cosmosContext && CosmosProvider && connectParaCosmosWallet) {
|
|
35
|
-
try {
|
|
36
|
-
const { error } = yield connectParaCosmosWallet();
|
|
37
|
-
if (error) {
|
|
38
|
-
console.warn("Failed to connect Para Cosmos wallet to Graz:", error);
|
|
39
|
-
} else {
|
|
40
|
-
const wallet = client.findWallet(void 0, void 0, { type: [WalletType.COSMOS] });
|
|
41
|
-
if (wallet) {
|
|
42
|
-
setSelectedWallet({ id: wallet.id, type: WalletType.COSMOS });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
} catch (err) {
|
|
46
|
-
console.warn("Error calling connectParaCosmosWallet:", err);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
return connectEmbeddedToExternalConnectors;
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
useEmbeddedExternalConnection
|
|
54
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../chunk-MMUBH76A.js";
|
|
3
|
-
import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
|
|
4
|
-
import { useExternalWallets } from "../providers/ExternalWalletContext.js";
|
|
5
|
-
import { useModalStore } from "../stores/index.js";
|
|
6
|
-
import { getAddFundsStep, ModalStep } from "../utils/steps.js";
|
|
7
|
-
const useGoBack = () => {
|
|
8
|
-
const currentStep = useModalStore((state) => state.step);
|
|
9
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
10
|
-
const accountAddFundTab = useModalStore((state) => state.accountAddFundTab);
|
|
11
|
-
const decrementStep = useModalStore((state) => state.decrementStep);
|
|
12
|
-
const resetState = useModalStore((state) => state.resetState);
|
|
13
|
-
const { setChainIdSwitchingTo, disconnectExternalWallet } = useExternalWallets();
|
|
14
|
-
const client = useInternalClient();
|
|
15
|
-
const goBack = () => {
|
|
16
|
-
if (currentStep === ModalStep.ADD_FUNDS_AWAITING) {
|
|
17
|
-
setStep(getAddFundsStep(accountAddFundTab));
|
|
18
|
-
} else {
|
|
19
|
-
decrementStep();
|
|
20
|
-
}
|
|
21
|
-
switch (currentStep) {
|
|
22
|
-
case ModalStep.AUTH_MAIN:
|
|
23
|
-
case ModalStep.AUTH_MORE:
|
|
24
|
-
case ModalStep.EX_WALLET_SELECTED:
|
|
25
|
-
case ModalStep.EXTERNAL_WALLET_VERIFICATION: {
|
|
26
|
-
resetState();
|
|
27
|
-
if (client.isExternalWalletAuth) {
|
|
28
|
-
disconnectExternalWallet();
|
|
29
|
-
}
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
case ModalStep.CHAIN_SWITCH: {
|
|
33
|
-
setChainIdSwitchingTo();
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
return goBack;
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
useGoBack
|
|
42
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AuthType } from '@getpara/user-management-client';
|
|
2
|
-
import { AuthMethod } from '@getpara/web-sdk';
|
|
3
|
-
export declare const useSetLoginURLs: () => ({ supportedAuthMethods, authType, displayName, pfpUrl, }: {
|
|
4
|
-
supportedAuthMethods: Set<AuthMethod>;
|
|
5
|
-
authType: AuthType;
|
|
6
|
-
displayName?: string;
|
|
7
|
-
pfpUrl?: string;
|
|
8
|
-
}) => Promise<void>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { AuthMethod, getPublicKeyHex } from "@getpara/web-sdk";
|
|
6
|
-
import { useModalStore } from "../stores/index.js";
|
|
7
|
-
import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
|
|
8
|
-
const useSetLoginURLs = () => {
|
|
9
|
-
const para = useInternalClient();
|
|
10
|
-
const setWebAuthURLForLogin = useModalStore((state) => state.setWebAuthURLForLogin);
|
|
11
|
-
const setPasswordURLForLogin = useModalStore((state) => state.setPasswordUrlForLogin);
|
|
12
|
-
const setSupportedAuthMethods = useModalStore((state) => state.setSupportedAuthMethods);
|
|
13
|
-
return (_0) => __async(void 0, [_0], function* ({
|
|
14
|
-
supportedAuthMethods,
|
|
15
|
-
authType,
|
|
16
|
-
displayName,
|
|
17
|
-
pfpUrl
|
|
18
|
-
}) {
|
|
19
|
-
setSupportedAuthMethods(supportedAuthMethods);
|
|
20
|
-
const res = yield para.touchSession();
|
|
21
|
-
const webAuthUrlForLogin = (supportedAuthMethods == null ? void 0 : supportedAuthMethods.has(AuthMethod.PASSKEY)) ? yield para.shortenLoginLink(
|
|
22
|
-
yield para.getWebAuthURLForLogin({
|
|
23
|
-
sessionId: res.data.sessionId,
|
|
24
|
-
loginEncryptionPublicKey: getPublicKeyHex(para.loginEncryptionKeyPair),
|
|
25
|
-
partnerId: res.data.partnerId,
|
|
26
|
-
newDeviceSessionId: res.data.sessionLookupId,
|
|
27
|
-
newDeviceEncryptionKey: getPublicKeyHex(para.loginEncryptionKeyPair),
|
|
28
|
-
authType,
|
|
29
|
-
displayName,
|
|
30
|
-
pfpUrl
|
|
31
|
-
})
|
|
32
|
-
) : void 0;
|
|
33
|
-
const passwordAuthUrlForLogin = (supportedAuthMethods == null ? void 0 : supportedAuthMethods.has(AuthMethod.PASSWORD)) ? yield para.shortenLoginLink(
|
|
34
|
-
yield para.getPasswordURLForLogin({
|
|
35
|
-
sessionId: res.data.sessionId,
|
|
36
|
-
loginEncryptionPublicKey: getPublicKeyHex(para.loginEncryptionKeyPair),
|
|
37
|
-
partnerId: res.data.partnerId,
|
|
38
|
-
authType,
|
|
39
|
-
displayName,
|
|
40
|
-
pfpUrl
|
|
41
|
-
})
|
|
42
|
-
) : void 0;
|
|
43
|
-
setWebAuthURLForLogin(webAuthUrlForLogin);
|
|
44
|
-
setPasswordURLForLogin(passwordAuthUrlForLogin);
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
export {
|
|
48
|
-
useSetLoginURLs
|
|
49
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useEffect, useState } from "react";
|
|
6
|
-
import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
|
|
7
|
-
import { useActiveWallet } from "./useActiveWallet.js";
|
|
8
|
-
import { WalletType } from "@getpara/web-sdk";
|
|
9
|
-
import { useExternalWallets } from "../providers/ExternalWalletContext.js";
|
|
10
|
-
import { useStore } from "../../provider/stores/useStore.js";
|
|
11
|
-
function useWalletBalance() {
|
|
12
|
-
const client = useInternalClient();
|
|
13
|
-
const wallet = useActiveWallet();
|
|
14
|
-
const [balance, setBalance] = useState();
|
|
15
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
16
|
-
const { balance: externalWalletBalance } = useExternalWallets();
|
|
17
|
-
const rpcUrl = useStore((state) => state.rpcUrl);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
const loadBalance = () => __async(this, null, function* () {
|
|
20
|
-
const skipGetBalance = !wallet || [WalletType.COSMOS, WalletType.SOLANA].includes(wallet.type);
|
|
21
|
-
if (skipGetBalance) {
|
|
22
|
-
setBalance(void 0);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
setIsLoading(true);
|
|
26
|
-
if (wallet.isExternal) {
|
|
27
|
-
setBalance(externalWalletBalance);
|
|
28
|
-
} else {
|
|
29
|
-
try {
|
|
30
|
-
const balance2 = yield client.getWalletBalance({
|
|
31
|
-
walletId: wallet.id,
|
|
32
|
-
rpcUrl
|
|
33
|
-
});
|
|
34
|
-
setBalance(balance2);
|
|
35
|
-
} catch (err) {
|
|
36
|
-
console.error("Error fetching wallet balance: ", err);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
setIsLoading(false);
|
|
40
|
-
});
|
|
41
|
-
loadBalance();
|
|
42
|
-
}, [wallet == null ? void 0 : wallet.id, wallet == null ? void 0 : wallet.type, wallet == null ? void 0 : wallet.isExternal, externalWalletBalance]);
|
|
43
|
-
return { balance, isLoading };
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
useWalletBalance
|
|
47
|
-
};
|
package/dist/modal/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../chunk-MMUBH76A.js";
|
|
3
|
-
export * from "./ParaModal.js";
|
|
4
|
-
import { ModalStep } from "./utils/steps.js";
|
|
5
|
-
import { AuthLayout } from "./types/modalProps.js";
|
|
6
|
-
export * from "./utils/openPopup.js";
|
|
7
|
-
import {
|
|
8
|
-
ON_RAMP_PROVIDERS,
|
|
9
|
-
ON_RAMP_ASSETS,
|
|
10
|
-
NETWORKS,
|
|
11
|
-
getAssetIcon,
|
|
12
|
-
getAssetName,
|
|
13
|
-
getNetworkIcon,
|
|
14
|
-
getNetworkName
|
|
15
|
-
} from "./constants/constants.js";
|
|
16
|
-
import { SaveRecoverySecret } from "./components/RecoverySecretStep/RecoverySecretStep.js";
|
|
17
|
-
export * from "./utils/validateOnRampConfig.js";
|
|
18
|
-
export * from "./types/externalWallets.js";
|
|
19
|
-
import { useExternalWalletProviderStore } from "./stores/externalWalletProvider/useExternalWalletProviderStore.js";
|
|
20
|
-
export * from "./types/commonTypes.js";
|
|
21
|
-
export {
|
|
22
|
-
AuthLayout,
|
|
23
|
-
ModalStep,
|
|
24
|
-
NETWORKS,
|
|
25
|
-
ON_RAMP_ASSETS,
|
|
26
|
-
ON_RAMP_PROVIDERS,
|
|
27
|
-
SaveRecoverySecret,
|
|
28
|
-
getAssetIcon,
|
|
29
|
-
getAssetName,
|
|
30
|
-
getNetworkIcon,
|
|
31
|
-
getNetworkName,
|
|
32
|
-
useExternalWalletProviderStore
|
|
33
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CommonChain, CommonWallet } from '../types/commonTypes.js';
|
|
3
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
4
|
-
export declare const defaultCosmosExternalWallet: {
|
|
5
|
-
wallets: any[];
|
|
6
|
-
chains: any[];
|
|
7
|
-
chainId: any;
|
|
8
|
-
disconnect: () => Promise<void>;
|
|
9
|
-
switchChain: () => Promise<{}>;
|
|
10
|
-
signMessage: () => Promise<{}>;
|
|
11
|
-
signVerificationMessage: () => Promise<{}>;
|
|
12
|
-
};
|
|
13
|
-
export type CosmosExternalWalletContextType = {
|
|
14
|
-
wallets: CommonWallet[];
|
|
15
|
-
chains: CommonChain[];
|
|
16
|
-
chainId: string;
|
|
17
|
-
disconnect: () => Promise<void>;
|
|
18
|
-
switchChain: (chainId: string) => Promise<{
|
|
19
|
-
error?: string[];
|
|
20
|
-
}>;
|
|
21
|
-
signMessage: (message: string) => Promise<{
|
|
22
|
-
signature?: string;
|
|
23
|
-
error?: string;
|
|
24
|
-
}>;
|
|
25
|
-
signVerificationMessage: () => Promise<{
|
|
26
|
-
address?: string;
|
|
27
|
-
signature?: string;
|
|
28
|
-
cosmosPublicKeyHex?: string;
|
|
29
|
-
cosmosSigner?: string;
|
|
30
|
-
error?: string;
|
|
31
|
-
}>;
|
|
32
|
-
};
|
|
33
|
-
export declare const CosmosExternalWalletContext: import("react").Context<CosmosExternalWalletContextType>;
|
|
34
|
-
export interface CosmosExternalWalletProviderProps {
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
para: ParaWeb;
|
|
37
|
-
onSwitchWallet: (args: {
|
|
38
|
-
address?: string;
|
|
39
|
-
error?: string;
|
|
40
|
-
}) => void;
|
|
41
|
-
}
|
|
42
|
-
export declare function CosmosExternalWalletProvider({ children }: CosmosExternalWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { createContext, useMemo } from "react";
|
|
5
|
-
const defaultCosmosExternalWallet = {
|
|
6
|
-
wallets: [],
|
|
7
|
-
chains: [],
|
|
8
|
-
chainId: void 0,
|
|
9
|
-
disconnect: () => Promise.resolve(),
|
|
10
|
-
switchChain: () => Promise.resolve({}),
|
|
11
|
-
signMessage: () => Promise.resolve({}),
|
|
12
|
-
signVerificationMessage: () => Promise.resolve({})
|
|
13
|
-
};
|
|
14
|
-
const CosmosExternalWalletContext = createContext(defaultCosmosExternalWallet);
|
|
15
|
-
function CosmosExternalWalletProvider({ children }) {
|
|
16
|
-
const wallets = [];
|
|
17
|
-
const chains = [];
|
|
18
|
-
const chainId = void 0;
|
|
19
|
-
const disconnect = () => Promise.resolve();
|
|
20
|
-
const switchChain = () => Promise.resolve({});
|
|
21
|
-
const signMessage = () => Promise.resolve({});
|
|
22
|
-
const signVerificationMessage = () => Promise.resolve({});
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
-
CosmosExternalWalletContext.Provider,
|
|
25
|
-
{
|
|
26
|
-
value: useMemo(
|
|
27
|
-
() => ({ wallets, chains, chainId, disconnect, switchChain, signMessage, signVerificationMessage }),
|
|
28
|
-
[wallets, chains, chainId, disconnect, switchChain, signMessage, signVerificationMessage]
|
|
29
|
-
),
|
|
30
|
-
children
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
CosmosExternalWalletContext,
|
|
36
|
-
CosmosExternalWalletProvider,
|
|
37
|
-
defaultCosmosExternalWallet
|
|
38
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CommonChain, CommonWallet } from '../types/commonTypes.js';
|
|
3
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
4
|
-
export declare const defaultEvmExternalWallet: {
|
|
5
|
-
wallets: any[];
|
|
6
|
-
chains: any[];
|
|
7
|
-
chainId: any;
|
|
8
|
-
username: any;
|
|
9
|
-
avatar: any;
|
|
10
|
-
balance: any;
|
|
11
|
-
disconnect: () => Promise<void>;
|
|
12
|
-
switchChain: () => Promise<{}>;
|
|
13
|
-
signMessage: () => Promise<{}>;
|
|
14
|
-
signVerificationMessage: () => Promise<{}>;
|
|
15
|
-
};
|
|
16
|
-
export type EvmExternalWalletContextType = {
|
|
17
|
-
wallets: CommonWallet[];
|
|
18
|
-
chains: CommonChain[];
|
|
19
|
-
chainId: number;
|
|
20
|
-
username: string;
|
|
21
|
-
avatar?: string;
|
|
22
|
-
balance?: string;
|
|
23
|
-
disconnect: () => Promise<void>;
|
|
24
|
-
switchChain: (chainId: number) => Promise<{
|
|
25
|
-
error?: string[];
|
|
26
|
-
}>;
|
|
27
|
-
signMessage: (message: string) => Promise<{
|
|
28
|
-
signature?: string;
|
|
29
|
-
error?: string;
|
|
30
|
-
}>;
|
|
31
|
-
signVerificationMessage: () => Promise<{
|
|
32
|
-
address?: string;
|
|
33
|
-
signature?: string;
|
|
34
|
-
error?: string;
|
|
35
|
-
}>;
|
|
36
|
-
};
|
|
37
|
-
export declare const EvmExternalWalletContext: import("react").Context<EvmExternalWalletContextType>;
|
|
38
|
-
export interface EvmExternalWalletProviderProps {
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
para: ParaWeb;
|
|
41
|
-
onSwitchWallet: (args: {
|
|
42
|
-
address?: string;
|
|
43
|
-
error?: string;
|
|
44
|
-
}) => void;
|
|
45
|
-
}
|
|
46
|
-
export declare function EvmExternalWalletProvider({ children }: EvmExternalWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { createContext, useMemo } from "react";
|
|
5
|
-
const defaultEvmExternalWallet = {
|
|
6
|
-
wallets: [],
|
|
7
|
-
chains: [],
|
|
8
|
-
chainId: void 0,
|
|
9
|
-
username: void 0,
|
|
10
|
-
avatar: void 0,
|
|
11
|
-
balance: void 0,
|
|
12
|
-
disconnect: () => Promise.resolve(),
|
|
13
|
-
switchChain: () => Promise.resolve({}),
|
|
14
|
-
signMessage: () => Promise.resolve({}),
|
|
15
|
-
signVerificationMessage: () => Promise.resolve({})
|
|
16
|
-
};
|
|
17
|
-
const EvmExternalWalletContext = createContext(defaultEvmExternalWallet);
|
|
18
|
-
function EvmExternalWalletProvider({ children }) {
|
|
19
|
-
const wallets = [];
|
|
20
|
-
const chains = [];
|
|
21
|
-
const chainId = void 0;
|
|
22
|
-
const username = void 0;
|
|
23
|
-
const avatar = void 0;
|
|
24
|
-
const balance = void 0;
|
|
25
|
-
const disconnect = () => Promise.resolve();
|
|
26
|
-
const switchChain = () => Promise.resolve({});
|
|
27
|
-
const signMessage = () => Promise.resolve({});
|
|
28
|
-
const signVerificationMessage = () => Promise.resolve({});
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
-
EvmExternalWalletContext.Provider,
|
|
31
|
-
{
|
|
32
|
-
value: useMemo(
|
|
33
|
-
() => ({
|
|
34
|
-
wallets,
|
|
35
|
-
chains,
|
|
36
|
-
chainId,
|
|
37
|
-
username,
|
|
38
|
-
avatar,
|
|
39
|
-
balance,
|
|
40
|
-
disconnect,
|
|
41
|
-
switchChain,
|
|
42
|
-
signMessage,
|
|
43
|
-
signVerificationMessage
|
|
44
|
-
}),
|
|
45
|
-
[wallets, chains, chainId, username, avatar, balance, disconnect, switchChain, signMessage, signVerificationMessage]
|
|
46
|
-
),
|
|
47
|
-
children
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
EvmExternalWalletContext,
|
|
53
|
-
EvmExternalWalletProvider,
|
|
54
|
-
defaultEvmExternalWallet
|
|
55
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { Context, ReactNode } from 'react';
|
|
2
|
-
import { CommonChain, CommonWallet } from '../types/commonTypes.js';
|
|
3
|
-
import { EvmExternalWalletContextType } from './EvmExternalWalletContextStub.js';
|
|
4
|
-
import { TExternalWallet } from '../types/externalWallets.js';
|
|
5
|
-
import { SolanaExternalWalletContextType } from './SolanaExternalWalletContextStub.js';
|
|
6
|
-
import { CosmosExternalWalletContextType } from './CosmosExternalWalletContextStub.js';
|
|
7
|
-
export declare const defaultExternalWallet: {
|
|
8
|
-
wallets: any[];
|
|
9
|
-
chains: any[];
|
|
10
|
-
chainId: any;
|
|
11
|
-
wallet: any;
|
|
12
|
-
qrUri: any;
|
|
13
|
-
chainIdSwitchingTo: any;
|
|
14
|
-
walletDisplayHelpers: {
|
|
15
|
-
showExtension: boolean;
|
|
16
|
-
showMobile: boolean;
|
|
17
|
-
isSolanaMobileIOS: boolean;
|
|
18
|
-
isCosmosMobileWallet: boolean;
|
|
19
|
-
};
|
|
20
|
-
username: any;
|
|
21
|
-
avatar: any;
|
|
22
|
-
balance: any;
|
|
23
|
-
connectExternalWallet: () => void;
|
|
24
|
-
disconnectExternalWallet: () => Promise<void>;
|
|
25
|
-
switchChain: () => Promise<void>;
|
|
26
|
-
setChainIdSwitchingTo: () => void;
|
|
27
|
-
verifyWalletSignature: () => Promise<{}>;
|
|
28
|
-
};
|
|
29
|
-
export declare const ExternalWalletContext: Context<{
|
|
30
|
-
wallets: CommonWallet[];
|
|
31
|
-
chains: CommonChain[];
|
|
32
|
-
chainId: string;
|
|
33
|
-
wallet?: CommonWallet;
|
|
34
|
-
qrUri?: string;
|
|
35
|
-
chainIdSwitchingTo?: string;
|
|
36
|
-
walletDisplayHelpers: {
|
|
37
|
-
showExtension: boolean;
|
|
38
|
-
showMobile: boolean;
|
|
39
|
-
isSolanaMobileIOS: boolean;
|
|
40
|
-
isCosmosMobileWallet: boolean;
|
|
41
|
-
};
|
|
42
|
-
username?: string;
|
|
43
|
-
avatar?: string;
|
|
44
|
-
balance?: string;
|
|
45
|
-
connectExternalWallet: (wallet: CommonWallet, isMobile?: boolean, isManualWalletConnect?: boolean) => void;
|
|
46
|
-
disconnectExternalWallet: () => Promise<void>;
|
|
47
|
-
switchChain: (chainId: string) => Promise<void>;
|
|
48
|
-
setChainIdSwitchingTo: (chainId?: string) => void;
|
|
49
|
-
verifyWalletSignature: () => Promise<{
|
|
50
|
-
address?: string;
|
|
51
|
-
signature?: string;
|
|
52
|
-
cosmosPublicKeyHex?: string;
|
|
53
|
-
cosmosSigner?: string;
|
|
54
|
-
}>;
|
|
55
|
-
}>;
|
|
56
|
-
interface ExternalWalletProviderProps {
|
|
57
|
-
children: ReactNode;
|
|
58
|
-
walletSort: TExternalWallet[];
|
|
59
|
-
evmContext: Context<EvmExternalWalletContextType>;
|
|
60
|
-
solanaContext: Context<SolanaExternalWalletContextType>;
|
|
61
|
-
cosmosContext: Context<CosmosExternalWalletContextType>;
|
|
62
|
-
externalWalletsWithFullAuth?: TExternalWallet[];
|
|
63
|
-
}
|
|
64
|
-
export declare function ExternalWalletProvider({ children, evmContext, solanaContext, cosmosContext, walletSort, externalWalletsWithFullAuth, }: ExternalWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
65
|
-
export declare const useExternalWallets: () => {
|
|
66
|
-
wallets: CommonWallet[];
|
|
67
|
-
chains: CommonChain[];
|
|
68
|
-
chainId: string;
|
|
69
|
-
wallet?: CommonWallet;
|
|
70
|
-
qrUri?: string;
|
|
71
|
-
chainIdSwitchingTo?: string;
|
|
72
|
-
walletDisplayHelpers: {
|
|
73
|
-
showExtension: boolean;
|
|
74
|
-
showMobile: boolean;
|
|
75
|
-
isSolanaMobileIOS: boolean;
|
|
76
|
-
isCosmosMobileWallet: boolean;
|
|
77
|
-
};
|
|
78
|
-
username?: string;
|
|
79
|
-
avatar?: string;
|
|
80
|
-
balance?: string;
|
|
81
|
-
connectExternalWallet: (wallet: CommonWallet, isMobile?: boolean, isManualWalletConnect?: boolean) => void;
|
|
82
|
-
disconnectExternalWallet: () => Promise<void>;
|
|
83
|
-
switchChain: (chainId: string) => Promise<void>;
|
|
84
|
-
setChainIdSwitchingTo: (chainId?: string) => void;
|
|
85
|
-
verifyWalletSignature: () => Promise<{
|
|
86
|
-
address?: string;
|
|
87
|
-
signature?: string;
|
|
88
|
-
cosmosPublicKeyHex?: string;
|
|
89
|
-
cosmosSigner?: string;
|
|
90
|
-
}>;
|
|
91
|
-
};
|
|
92
|
-
export {};
|