@getpara/react-sdk 1.6.0 → 1.6.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -6367
- package/dist/modal/ParaModal.js +337 -0
- package/dist/modal/components/Account/Account.js +69 -0
- package/dist/modal/components/AddFunds/AddFunds.js +220 -0
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +72 -0
- package/dist/modal/components/AddFunds/AddFundsDone.js +43 -0
- package/dist/{MoonPayEmbed-Q2HP2BFI.js → modal/components/AddFunds/MoonPayEmbed.js} +1 -3
- package/dist/modal/components/AddFunds/index.js +4 -0
- package/dist/modal/components/AuthInput/AuthInput.js +283 -0
- package/dist/modal/components/AuthInput/countryCodes.js +42 -0
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +33 -0
- package/dist/modal/components/AuthInput/phoneMasks.js +253 -0
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +37 -0
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +113 -0
- package/dist/modal/components/AuthOptions/AuthOptions.js +33 -0
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +18 -0
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +10 -0
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +18 -0
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +44 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +52 -0
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +93 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +29 -0
- package/dist/modal/components/Body/Body.js +304 -0
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +94 -0
- package/dist/modal/components/ChainSwitch/config.js +17 -0
- package/dist/modal/components/Controls/Controls.js +74 -0
- package/dist/modal/components/Controls/Selects.js +213 -0
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +151 -0
- package/dist/modal/components/ExternalWalletStep/config.js +17 -0
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +172 -0
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +123 -0
- package/dist/modal/components/Footer/Footer.js +93 -0
- package/dist/modal/components/Header/Header.js +43 -0
- package/dist/modal/components/Header/hooks/useStepTitle.js +50 -0
- package/dist/modal/components/Hero/Hero.js +122 -0
- package/dist/modal/components/IFrameStep/IFrameStep.js +55 -0
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +28 -0
- package/dist/modal/components/ModalContent/ModalContent.js +310 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +81 -0
- package/dist/modal/components/OAuth/OAuth.js +153 -0
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +139 -0
- package/dist/modal/components/OnRampComponents/AddingFunds.js +23 -0
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +77 -0
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +101 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +141 -0
- package/dist/modal/components/StripeComponents/StripeComponents.js +88 -0
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +24 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +159 -0
- package/dist/modal/components/Waiting/Waiting.js +17 -0
- package/dist/modal/components/WalletCard/PartnerIcon.js +34 -0
- package/dist/modal/components/WalletCard/WalletCard.js +127 -0
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +52 -0
- package/dist/modal/components/common.js +83 -0
- package/dist/modal/components/index.js +2 -0
- package/dist/modal/constants/constants.js +111 -0
- package/dist/modal/constants/defaults.js +10 -0
- package/dist/modal/constants/oAuthLogos.js +24 -0
- package/dist/modal/hooks/useActiveWallet.js +15 -0
- package/dist/modal/hooks/useCreateAccount.js +72 -0
- package/dist/modal/hooks/useEmbeddedExternalConnection.js +39 -0
- package/dist/modal/hooks/useGoBack.js +35 -0
- package/dist/modal/hooks/useSetLoginURLs.d.ts +8 -0
- package/dist/modal/hooks/useSetLoginURLs.js +45 -0
- package/dist/modal/index.js +32 -0
- package/dist/modal/providers/CosmosExternalWalletContextStub.js +34 -0
- package/dist/modal/providers/EvmExternalWalletContextStub.js +38 -0
- package/dist/modal/providers/ExternalWalletContext.js +275 -0
- package/dist/modal/providers/SolanaExternalWalletContextStub.js +19 -0
- package/dist/modal/stores/externalWalletProvider/actions.js +10 -0
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +20 -0
- package/dist/modal/stores/index.js +4 -0
- package/dist/modal/stores/modal/actions.js +70 -0
- package/dist/modal/stores/modal/useModalStore.js +65 -0
- package/dist/modal/stores/theme/actions.js +28 -0
- package/dist/modal/stores/theme/useThemeStore.js +21 -0
- package/dist/modal/stores/userInfo/actions.js +30 -0
- package/dist/modal/stores/userInfo/useUserInfoStore.js +17 -0
- package/dist/modal/types/commonTypes.js +1 -0
- package/dist/modal/types/externalWallets.js +31 -0
- package/dist/modal/types/modalProps.js +12 -0
- package/dist/modal/utils/authLayoutHelpers.js +8 -0
- package/dist/modal/utils/getMailtoLink.js +10 -0
- package/dist/modal/utils/getTileButtonFlex.js +20 -0
- package/dist/modal/utils/openPopup.js +60 -0
- package/dist/modal/utils/routeMobileExternalWallet.js +31 -0
- package/dist/modal/utils/steps.js +228 -0
- package/dist/modal/utils/stringFormatters.js +14 -0
- package/dist/modal/utils/validateOnRampConfig.js +32 -0
- package/dist/provider/ParaProvider.js +22 -0
- package/dist/provider/actions/checkIfUserExists.js +21 -0
- package/dist/provider/actions/createUser.js +26 -0
- package/dist/provider/actions/getAccount.js +22 -0
- package/dist/provider/actions/getWallet.js +14 -0
- package/dist/provider/actions/initiateLogin.js +20 -0
- package/dist/provider/actions/keepSessionAlive.js +20 -0
- package/dist/provider/actions/logout.js +17 -0
- package/dist/provider/actions/signMessage.js +20 -0
- package/dist/provider/actions/signTransaction.js +20 -0
- package/dist/provider/actions/waitForAccountCreation.js +21 -0
- package/dist/provider/actions/waitForLoginAndSetup.js +24 -0
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +21 -0
- package/dist/provider/hooks/index.js +4 -0
- package/dist/provider/hooks/mutations/index.js +24 -0
- package/dist/provider/hooks/mutations/useCheckIfUserExists.js +23 -0
- package/dist/provider/hooks/mutations/useCreateUser.js +20 -0
- package/dist/provider/hooks/mutations/useInitiateLogin.js +23 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +20 -0
- package/dist/provider/hooks/mutations/useLogout.js +30 -0
- package/dist/provider/hooks/mutations/useSignMessage.js +33 -0
- package/dist/provider/hooks/mutations/useSignTransaction.js +33 -0
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +30 -0
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +30 -0
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +30 -0
- package/dist/provider/hooks/queries/index.js +8 -0
- package/dist/provider/hooks/queries/useAccount.js +21 -0
- package/dist/provider/hooks/queries/useWallet.js +22 -0
- package/dist/provider/hooks/utils/index.js +10 -0
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +74 -0
- package/dist/provider/hooks/utils/useClient.js +10 -0
- package/dist/provider/hooks/utils/useEventListeners.js +105 -0
- package/dist/provider/hooks/utils/useInternalClient.js +10 -0
- package/dist/provider/hooks/utils/useModal.js +17 -0
- package/dist/provider/hooks/utils/useWalletState.js +33 -0
- package/dist/provider/index.js +8 -0
- package/dist/provider/stores/getters.js +13 -0
- package/dist/provider/stores/slices/client.js +9 -0
- package/dist/provider/stores/slices/index.js +4 -0
- package/dist/provider/stores/slices/modal.js +9 -0
- package/dist/provider/stores/slices/wallet.js +11 -0
- package/dist/provider/stores/types.js +1 -0
- package/dist/provider/stores/useStore.js +27 -0
- package/dist/provider/types/provider.js +1 -0
- package/dist/provider/types/query.js +1 -0
- package/dist/provider/types/utils.js +1 -0
- package/dist/provider/utils/renameMutations.js +16 -0
- package/package.json +2 -2
- 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/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { useStore } from "../../stores/useStore.js";
|
|
4
|
+
import { useClient } from "./useClient.js";
|
|
5
|
+
const useWalletState = () => {
|
|
6
|
+
const client = useClient();
|
|
7
|
+
const selectedWalletId = useStore((state) => state.selectedWalletId);
|
|
8
|
+
const selectedWalletType = useStore((state) => state.selectedWalletType);
|
|
9
|
+
const setStoredSelectedWallet = useStore((state) => state.setSelectedWallet);
|
|
10
|
+
const clearSelectedWallet = useStore((state) => state.clearSelectedWallet);
|
|
11
|
+
const setSelectedWallet = ({ id, type }) => {
|
|
12
|
+
try {
|
|
13
|
+
const validId = client.findWalletId(id, { type: [type] });
|
|
14
|
+
if (validId !== id) {
|
|
15
|
+
clearSelectedWallet();
|
|
16
|
+
} else {
|
|
17
|
+
setStoredSelectedWallet(id, type);
|
|
18
|
+
}
|
|
19
|
+
} catch (e) {
|
|
20
|
+
clearSelectedWallet();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
selectedWallet: {
|
|
25
|
+
id: selectedWalletId,
|
|
26
|
+
type: selectedWalletType
|
|
27
|
+
},
|
|
28
|
+
setSelectedWallet
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
useWalletState
|
|
33
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../chunk-MMUBH76A.js";
|
|
3
|
+
import { vanillaStore } from "./useStore.js";
|
|
4
|
+
const getClient = () => vanillaStore.getState().client;
|
|
5
|
+
const getIsOpen = () => vanillaStore.getState().isOpen;
|
|
6
|
+
const getSelectedWalletId = () => vanillaStore.getState().selectedWalletId;
|
|
7
|
+
const getSelectedWalletType = () => vanillaStore.getState().selectedWalletType;
|
|
8
|
+
export {
|
|
9
|
+
getClient,
|
|
10
|
+
getIsOpen,
|
|
11
|
+
getSelectedWalletId,
|
|
12
|
+
getSelectedWalletType
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
const createWalletSlice = (set) => ({
|
|
4
|
+
selectedWalletId: void 0,
|
|
5
|
+
selectedWalletType: void 0,
|
|
6
|
+
setSelectedWallet: (selectedWalletId, selectedWalletType) => set({ selectedWalletId, selectedWalletType }),
|
|
7
|
+
clearSelectedWallet: () => set({ selectedWalletId: void 0, selectedWalletType: void 0 })
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
createWalletSlice
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../chunk-MMUBH76A.js";
|
|
5
|
+
import { createStore, useStore as useZustandStore } from "zustand";
|
|
6
|
+
import { createClientSlice, createModalSlice, createWalletSlice } from "./slices/index.js";
|
|
7
|
+
import { createJSONStorage, persist } from "zustand/middleware";
|
|
8
|
+
const vanillaStore = createStore()(
|
|
9
|
+
persist(
|
|
10
|
+
(...a) => __spreadValues(__spreadValues(__spreadValues({}, createClientSlice(...a)), createModalSlice(...a)), createWalletSlice(...a)),
|
|
11
|
+
{
|
|
12
|
+
version: 1,
|
|
13
|
+
name: "@PARA/web-state",
|
|
14
|
+
storage: createJSONStorage(() => localStorage),
|
|
15
|
+
partialize: (state) => ({
|
|
16
|
+
selectedWalletId: state.selectedWalletId,
|
|
17
|
+
selectedWalletType: state.selectedWalletType
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
const createBoundedUseStore = (store) => (selector) => useZustandStore(store, selector);
|
|
23
|
+
const useStore = createBoundedUseStore(vanillaStore);
|
|
24
|
+
export {
|
|
25
|
+
useStore,
|
|
26
|
+
vanillaStore
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../chunk-MMUBH76A.js";
|
|
6
|
+
function renameMutations(mutationObj, name) {
|
|
7
|
+
const _a = mutationObj, { mutate: _, mutateAsync: __ } = _a, mutationNoMutate = __objRest(_a, ["mutate", "mutateAsync"]);
|
|
8
|
+
const newMutations = {
|
|
9
|
+
[name]: mutationObj.mutate,
|
|
10
|
+
[`${name}Async`]: mutationObj.mutateAsync
|
|
11
|
+
};
|
|
12
|
+
return __spreadValues(__spreadValues({}, newMutations), mutationNoMutate);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
renameMutations
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk",
|
|
3
|
-
"version": "1.6.0",
|
|
3
|
+
"version": "1.6.1-dev.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"resolutions": {
|
|
50
50
|
"styled-components": "^6"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "e6e791d4e4f9afd94f2093d6045d686b85e5a682"
|
|
53
53
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.js.br
DELETED
|
Binary file
|
package/dist/index.js.gz
DELETED
|
Binary file
|