@getpara/react-sdk 2.0.0-alpha.3 → 2.0.0-alpha.6
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/cli/cli.mjs +1 -6
- package/dist/index.js +11 -6499
- package/dist/modal/ParaModal.js +262 -0
- package/dist/modal/components/Account/Account.js +139 -0
- package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -2
- package/dist/modal/components/AddFunds/AddFunds.js +69 -0
- package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsAsset.js +125 -0
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +78 -0
- package/dist/modal/components/AddFunds/AddFundsContext.d.ts +31 -0
- package/dist/modal/components/AddFunds/AddFundsContext.js +160 -0
- package/dist/modal/components/AddFunds/AddFundsDone.js +49 -0
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsProvider.js +109 -0
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsReceive.js +83 -0
- package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsSettings.js +237 -0
- package/dist/{MoonPayEmbed-Q2HP2BFI.js → modal/components/AddFunds/MoonPayEmbed.js} +1 -3
- package/dist/modal/components/AddFunds/common.d.ts +19 -0
- package/dist/modal/components/AddFunds/common.js +24 -0
- package/dist/modal/components/AddFunds/index.js +4 -0
- package/dist/modal/components/AuthInput/AuthInput.js +262 -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.d.ts +4 -3
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +50 -0
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +4 -3
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +157 -0
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +4 -3
- package/dist/modal/components/AuthOptions/AuthOptions.js +67 -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.d.ts +5 -1
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +49 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +63 -0
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +55 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +29 -0
- package/dist/modal/components/Body/Body.d.ts +4 -3
- package/dist/modal/components/Body/Body.js +327 -0
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +95 -0
- package/dist/modal/components/ChainSwitch/config.js +17 -0
- package/dist/modal/components/Controls/Controls.js +77 -0
- package/dist/modal/components/Controls/Selects.js +189 -0
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +144 -0
- package/dist/modal/components/ExternalWalletStep/config.js +17 -0
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +34 -0
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +173 -0
- package/dist/modal/components/Footer/Footer.js +95 -0
- package/dist/modal/components/Header/Header.js +43 -0
- package/dist/modal/components/Header/hooks/useStepTitle.js +54 -0
- package/dist/modal/components/Hero/Hero.js +116 -0
- package/dist/modal/components/IFrameStep/IFrameStep.js +59 -0
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +31 -0
- package/dist/modal/components/ModalContent/ModalContent.js +95 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +27 -0
- package/dist/modal/components/OAuth/OAuth.d.ts +2 -2
- package/dist/modal/components/OAuth/OAuth.js +79 -0
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +90 -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 +107 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +132 -0
- package/dist/modal/components/StripeComponents/StripeComponents.js +88 -0
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +27 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +143 -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.d.ts +3 -3
- package/dist/modal/components/WalletCard/WalletCard.js +128 -0
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +73 -0
- package/dist/modal/components/common.d.ts +32 -13
- package/dist/modal/components/common.js +175 -0
- package/dist/modal/components/index.js +2 -0
- package/dist/modal/constants/constants.d.ts +9 -2
- package/dist/modal/constants/constants.js +138 -0
- package/dist/modal/constants/defaults.js +10 -0
- package/dist/modal/constants/oAuthLogos.d.ts +3 -3
- package/dist/modal/constants/oAuthLogos.js +24 -0
- package/dist/modal/hooks/useGoBack.js +43 -0
- package/dist/modal/index.d.ts +1 -2
- package/dist/modal/index.js +29 -0
- package/dist/modal/stores/index.js +2 -0
- package/dist/modal/stores/modal/actions.js +133 -0
- package/dist/modal/stores/modal/useModalStore.d.ts +12 -4
- package/dist/modal/stores/modal/useModalStore.js +68 -0
- package/dist/modal/types/commonTypes.d.ts +0 -47
- package/dist/modal/types/commonTypes.js +1 -0
- package/dist/modal/types/externalWallets.d.ts +2 -0
- package/dist/modal/types/externalWallets.js +32 -0
- package/dist/modal/types/modalProps.d.ts +10 -2
- package/dist/modal/types/modalProps.js +12 -0
- package/dist/modal/utils/authInputHelpers.d.ts +7 -0
- package/dist/modal/utils/authInputHelpers.js +38 -0
- package/dist/modal/utils/authLayoutHelpers.js +8 -0
- package/dist/modal/utils/countryCodes.js +45 -0
- package/dist/modal/utils/getMailtoLink.js +10 -0
- package/dist/modal/utils/getTileButtonFlex.js +20 -0
- package/dist/modal/utils/isPasskeySupported.js +15 -0
- package/dist/modal/utils/openPopup.js +60 -0
- package/dist/modal/utils/routeMobileExternalWallet.js +31 -0
- package/dist/modal/utils/steps.d.ts +6 -0
- package/dist/modal/utils/steps.js +247 -0
- package/dist/modal/utils/stringFormatters.d.ts +1 -0
- package/dist/modal/utils/stringFormatters.js +19 -0
- package/dist/modal/utils/validateOnRampConfig.js +32 -0
- package/dist/package.json +6 -0
- package/dist/provider/ParaProvider.js +83 -0
- package/dist/provider/actions/getAccount.d.ts +8 -1
- package/dist/provider/actions/getAccount.js +51 -0
- package/dist/provider/actions/getWallet.d.ts +2 -2
- package/dist/provider/actions/getWallet.js +14 -0
- package/dist/provider/actions/index.d.ts +2 -0
- package/dist/provider/actions/index.js +59 -0
- package/dist/provider/actions/utils.js +15 -0
- package/dist/provider/components/CosmosWalletWrapper.js +34 -0
- package/dist/provider/components/EvmWalletWrapper.js +34 -0
- package/dist/provider/components/ExternalWalletWrapper.js +139 -0
- package/dist/provider/components/SolanaWalletWrapper.js +36 -0
- package/dist/provider/external/getParaCosmosConnector.js +22 -0
- package/dist/provider/external/getParaEvmConnector.js +22 -0
- package/dist/provider/external/getParaSolanaConnector.js +22 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +18 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +21 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +14 -0
- package/dist/provider/hooks/index.js +4 -0
- package/dist/provider/hooks/mutations/index.d.ts +1 -0
- package/dist/provider/hooks/mutations/index.js +61 -0
- package/dist/provider/hooks/mutations/utils.js +22 -0
- package/dist/provider/hooks/queries/index.d.ts +1 -0
- package/dist/provider/hooks/queries/index.js +10 -0
- package/dist/provider/hooks/queries/useAccount.js +21 -0
- package/dist/provider/hooks/queries/useWallet.js +22 -0
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +6 -0
- package/dist/provider/hooks/queries/useWalletBalance.js +55 -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.d.ts +1 -1
- package/dist/provider/hooks/utils/useEventListeners.js +147 -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.d.ts +3 -3
- package/dist/provider/hooks/utils/useWalletState.js +48 -0
- package/dist/provider/index.js +9 -0
- package/dist/provider/providers/AuthProvider.d.ts +10 -6
- package/dist/provider/providers/AuthProvider.js +498 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.js +66 -0
- package/dist/provider/providers/EvmExternalWalletProvider.js +74 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +5 -2
- package/dist/provider/providers/ExternalWalletProvider.js +428 -0
- package/dist/provider/providers/SolanaExternalWalletProvider.js +66 -0
- package/dist/provider/stores/getters.d.ts +1 -1
- package/dist/provider/stores/getters.js +13 -0
- package/dist/provider/stores/setters.js +7 -0
- package/dist/provider/stores/slices/client.js +9 -0
- package/dist/provider/stores/slices/config.js +9 -0
- package/dist/provider/stores/slices/externalWallets.js +40 -0
- package/dist/provider/stores/slices/index.js +5 -0
- package/dist/provider/stores/slices/modal.js +16 -0
- package/dist/provider/stores/slices/wallet.js +13 -0
- package/dist/provider/stores/types.d.ts +7 -4
- package/dist/provider/stores/types.js +1 -0
- package/dist/provider/stores/useStore.js +28 -0
- package/dist/provider/types/externalWalletProviders.d.ts +2 -2
- package/dist/provider/types/externalWalletProviders.js +1 -0
- package/dist/provider/types/provider.d.ts +9 -3
- 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/constants.d.ts +5 -0
- package/dist/provider/utils/constants.js +10 -0
- package/dist/provider/utils/paraConfigTypeGuards.js +13 -0
- package/dist/provider/utils/renameMutations.js +18 -0
- package/package.json +18 -16
- 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
- /package/dist/modal/{components/AuthInput → utils}/countryCodes.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ParaCosmosProviderConfig } from '@getpara/cosmos-wallet-connectors';
|
|
2
|
-
import { TExternalWallet } from '../../modal/index.js';
|
|
3
2
|
import { ParaSolanaProviderConfig } from '@getpara/solana-wallet-connectors';
|
|
4
3
|
import { Chain, Transport } from 'viem';
|
|
5
|
-
import { ParaEvmProviderConfig } from '@getpara/evm-wallet-connectors';
|
|
4
|
+
import { type ParaEvmProviderConfig } from '@getpara/evm-wallet-connectors';
|
|
5
|
+
import { type TExternalWallet } from '@getpara/react-common';
|
|
6
6
|
export type ExternalWalletProviderCommon = {
|
|
7
7
|
isUsing: boolean;
|
|
8
8
|
wallets: TExternalWallet[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ParaWagmiProviderProps } from '@getpara/evm-wallet-connectors';
|
|
2
|
-
import ParaWeb, { AccountCreationEvent, AccountSetupEvent, ConstructorOpts, Environment, ExternalWalletChangeEvent, LoginEvent, LogoutEvent, PregenWalletClaimedEvent, SignMessageEvent, SignTransactionEvent, WalletCreatedEvent, WalletsChangeEvent } from '@getpara/web-sdk';
|
|
2
|
+
import ParaWeb, { AccountCreationEvent, AccountSetupEvent, ConstructorOpts, Environment, ExternalWalletChangeEvent, LoginEvent, LogoutEvent, PregenWalletClaimedEvent, SignMessageEvent, SignTransactionEvent, WalletCreatedEvent, WalletsChangeEvent, GuestWalletsCreatedEvent } from '@getpara/web-sdk';
|
|
3
3
|
import { PropsWithChildren } from 'react';
|
|
4
4
|
import { Chain, Transport } from 'viem';
|
|
5
|
-
import { ParaModalProps
|
|
5
|
+
import { ParaModalProps } from '../../modal/index.js';
|
|
6
6
|
import { ParaGrazProviderProps } from '@getpara/cosmos-wallet-connectors';
|
|
7
7
|
import { ParaCosmosProviderConfigNoWallets, ParaEvmProviderConfigNoWallets, ParaSolanaProviderConfigNoWallets } from './externalWalletProviders.js';
|
|
8
|
+
import { type TExternalWallet } from '@getpara/react-common';
|
|
8
9
|
export type Callbacks = {
|
|
9
10
|
onLogout?: (event: LogoutEvent) => void;
|
|
10
11
|
onLogin?: (event: LoginEvent) => void;
|
|
@@ -16,6 +17,7 @@ export type Callbacks = {
|
|
|
16
17
|
onWalletsChange?: (event: WalletsChangeEvent) => void;
|
|
17
18
|
onWalletCreated?: (event: WalletCreatedEvent) => void;
|
|
18
19
|
onPregenWalletClaimed?: (event: PregenWalletClaimedEvent) => void;
|
|
20
|
+
onGuestWalletsCreated?: (event: GuestWalletsCreatedEvent) => void;
|
|
19
21
|
};
|
|
20
22
|
export type ParaProviderConfig = {
|
|
21
23
|
/**
|
|
@@ -30,6 +32,10 @@ export type ParaProviderConfig = {
|
|
|
30
32
|
* Disables the ParaModal that's provided by ParaProvider. Use this is you're providing a separate modal in another location in your app.
|
|
31
33
|
*/
|
|
32
34
|
disableEmbeddedModal?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* RPC url to use for retrieving the embedded wallet balance
|
|
37
|
+
*/
|
|
38
|
+
rpcUrl?: string;
|
|
33
39
|
};
|
|
34
40
|
export type ExternalWalletConfig<chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>> = {
|
|
35
41
|
/**
|
|
@@ -99,7 +105,7 @@ export type ExternalWalletConfig<chains extends readonly [Chain, ...Chain[]], tr
|
|
|
99
105
|
*
|
|
100
106
|
* NOTE: Any wallets that are detected as installed will be sorted first, followed by those that are not detected or not installed.
|
|
101
107
|
*/
|
|
102
|
-
wallets
|
|
108
|
+
wallets?: TExternalWallet[];
|
|
103
109
|
/**
|
|
104
110
|
* Which external wallets will include full verification and Para auth.
|
|
105
111
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../chunk-MMUBH76A.js";
|
|
3
|
+
import ParaWeb from "@getpara/web-sdk";
|
|
4
|
+
function isConfigType(obj) {
|
|
5
|
+
return !!obj && typeof obj === "object" && "env" in obj && "apiKey" in obj;
|
|
6
|
+
}
|
|
7
|
+
function isParaWeb(obj) {
|
|
8
|
+
return obj instanceof ParaWeb;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
isConfigType,
|
|
12
|
+
isParaWeb
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../chunk-MMUBH76A.js";
|
|
5
|
+
function renameMutations(mutationObj, name) {
|
|
6
|
+
const newMutations = {
|
|
7
|
+
[name]: mutationObj.mutate,
|
|
8
|
+
[`${name}Async`]: mutationObj.mutateAsync
|
|
9
|
+
};
|
|
10
|
+
return __spreadValues(__spreadValues({}, newMutations), mutationObj);
|
|
11
|
+
}
|
|
12
|
+
function renameCoreMutations(mutationObj, name) {
|
|
13
|
+
return renameMutations(mutationObj, name);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
renameCoreMutations,
|
|
17
|
+
renameMutations
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,10 +15,9 @@
|
|
|
15
15
|
"*.css"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@getpara/react-common": "2.0.0-alpha.
|
|
19
|
-
"@getpara/react-components": "2.0.0-alpha.
|
|
20
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
21
|
-
"@tanstack/react-query": "^5.0.0",
|
|
18
|
+
"@getpara/react-common": "2.0.0-alpha.6",
|
|
19
|
+
"@getpara/react-components": "2.0.0-alpha.6",
|
|
20
|
+
"@getpara/web-sdk": "2.0.0-alpha.6",
|
|
22
21
|
"date-fns": "^3.6.0",
|
|
23
22
|
"framer-motion": "11.3.28",
|
|
24
23
|
"libphonenumber-js": "^1.11.1",
|
|
@@ -34,22 +33,25 @@
|
|
|
34
33
|
"cli": "node ./dist/cli/cli.mjs"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.
|
|
38
|
-
"@getpara/evm-wallet-connectors": "2.0.0-alpha.
|
|
39
|
-
"@getpara/solana-wallet-connectors": "2.0.0-alpha.
|
|
40
|
-
"@testing-library/dom": "^10.
|
|
41
|
-
"@testing-library/react": "^16.
|
|
36
|
+
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.6",
|
|
37
|
+
"@getpara/evm-wallet-connectors": "2.0.0-alpha.6",
|
|
38
|
+
"@getpara/solana-wallet-connectors": "2.0.0-alpha.6",
|
|
39
|
+
"@testing-library/dom": "^10.4.0",
|
|
40
|
+
"@testing-library/react": "^16.3.0",
|
|
41
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
42
|
+
"@testing-library/user-event": "^14.6.1",
|
|
42
43
|
"@types/chrome": "^0.0.237",
|
|
43
44
|
"@types/react": "^18.0.31",
|
|
44
45
|
"@types/react-dom": "^18.2.7",
|
|
45
46
|
"typescript": "^5.4.3",
|
|
46
|
-
"viem": "2.
|
|
47
|
-
"wagmi": "2.
|
|
47
|
+
"viem": "^2.24.2",
|
|
48
|
+
"wagmi": "^2.14.16"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
|
-
"@getpara/cosmos-wallet-connectors": "^2.0.0-alpha.
|
|
51
|
-
"@getpara/evm-wallet-connectors": "^2.0.0-alpha.
|
|
52
|
-
"@getpara/solana-wallet-connectors": "^2.0.0-alpha.
|
|
51
|
+
"@getpara/cosmos-wallet-connectors": "^2.0.0-alpha.5",
|
|
52
|
+
"@getpara/evm-wallet-connectors": "^2.0.0-alpha.5",
|
|
53
|
+
"@getpara/solana-wallet-connectors": "^2.0.0-alpha.5",
|
|
54
|
+
"@tanstack/react-query": ">=5.0.0",
|
|
53
55
|
"react": "*",
|
|
54
56
|
"react-dom": "*"
|
|
55
57
|
},
|
|
@@ -61,5 +63,5 @@
|
|
|
61
63
|
"resolutions": {
|
|
62
64
|
"styled-components": "^6"
|
|
63
65
|
},
|
|
64
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "d3b01a8fb475c2af9bf255800bc10d05e011b2eb"
|
|
65
67
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.js.br
DELETED
|
Binary file
|
package/dist/index.js.gz
DELETED
|
Binary file
|
|
File without changes
|