@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.
Files changed (183) hide show
  1. package/dist/cli/cli.mjs +1 -6
  2. package/dist/index.js +11 -6499
  3. package/dist/modal/ParaModal.js +262 -0
  4. package/dist/modal/components/Account/Account.js +139 -0
  5. package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -2
  6. package/dist/modal/components/AddFunds/AddFunds.js +69 -0
  7. package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +1 -0
  8. package/dist/modal/components/AddFunds/AddFundsAsset.js +125 -0
  9. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +78 -0
  10. package/dist/modal/components/AddFunds/AddFundsContext.d.ts +31 -0
  11. package/dist/modal/components/AddFunds/AddFundsContext.js +160 -0
  12. package/dist/modal/components/AddFunds/AddFundsDone.js +49 -0
  13. package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +1 -0
  14. package/dist/modal/components/AddFunds/AddFundsProvider.js +109 -0
  15. package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +1 -0
  16. package/dist/modal/components/AddFunds/AddFundsReceive.js +83 -0
  17. package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +1 -0
  18. package/dist/modal/components/AddFunds/AddFundsSettings.js +237 -0
  19. package/dist/{MoonPayEmbed-Q2HP2BFI.js → modal/components/AddFunds/MoonPayEmbed.js} +1 -3
  20. package/dist/modal/components/AddFunds/common.d.ts +19 -0
  21. package/dist/modal/components/AddFunds/common.js +24 -0
  22. package/dist/modal/components/AddFunds/index.js +4 -0
  23. package/dist/modal/components/AuthInput/AuthInput.js +262 -0
  24. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +33 -0
  25. package/dist/modal/components/AuthInput/phoneMasks.js +253 -0
  26. package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +4 -3
  27. package/dist/modal/components/AuthMainStep/AuthMainStep.js +50 -0
  28. package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +4 -3
  29. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +157 -0
  30. package/dist/modal/components/AuthOptions/AuthOptions.d.ts +4 -3
  31. package/dist/modal/components/AuthOptions/AuthOptions.js +67 -0
  32. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +18 -0
  33. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +10 -0
  34. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +18 -0
  35. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +5 -1
  36. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +49 -0
  37. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +63 -0
  38. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +55 -0
  39. package/dist/modal/components/Body/AnimatedHeightWrapper.js +29 -0
  40. package/dist/modal/components/Body/Body.d.ts +4 -3
  41. package/dist/modal/components/Body/Body.js +327 -0
  42. package/dist/modal/components/ChainSwitch/ChainSwitch.js +95 -0
  43. package/dist/modal/components/ChainSwitch/config.js +17 -0
  44. package/dist/modal/components/Controls/Controls.js +77 -0
  45. package/dist/modal/components/Controls/Selects.js +189 -0
  46. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +144 -0
  47. package/dist/modal/components/ExternalWalletStep/config.js +17 -0
  48. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +34 -0
  49. package/dist/modal/components/ExternalWallets/ExternalWallets.js +173 -0
  50. package/dist/modal/components/Footer/Footer.js +95 -0
  51. package/dist/modal/components/Header/Header.js +43 -0
  52. package/dist/modal/components/Header/hooks/useStepTitle.js +54 -0
  53. package/dist/modal/components/Hero/Hero.js +116 -0
  54. package/dist/modal/components/IFrameStep/IFrameStep.js +59 -0
  55. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +31 -0
  56. package/dist/modal/components/ModalContent/ModalContent.js +95 -0
  57. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +27 -0
  58. package/dist/modal/components/OAuth/OAuth.d.ts +2 -2
  59. package/dist/modal/components/OAuth/OAuth.js +79 -0
  60. package/dist/modal/components/OAuth/TelegramOAuthStep.js +90 -0
  61. package/dist/modal/components/OnRampComponents/AddingFunds.js +23 -0
  62. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +77 -0
  63. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +107 -0
  64. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +132 -0
  65. package/dist/modal/components/StripeComponents/StripeComponents.js +88 -0
  66. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +27 -0
  67. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +143 -0
  68. package/dist/modal/components/Waiting/Waiting.js +17 -0
  69. package/dist/modal/components/WalletCard/PartnerIcon.js +34 -0
  70. package/dist/modal/components/WalletCard/WalletCard.d.ts +3 -3
  71. package/dist/modal/components/WalletCard/WalletCard.js +128 -0
  72. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +73 -0
  73. package/dist/modal/components/common.d.ts +32 -13
  74. package/dist/modal/components/common.js +175 -0
  75. package/dist/modal/components/index.js +2 -0
  76. package/dist/modal/constants/constants.d.ts +9 -2
  77. package/dist/modal/constants/constants.js +138 -0
  78. package/dist/modal/constants/defaults.js +10 -0
  79. package/dist/modal/constants/oAuthLogos.d.ts +3 -3
  80. package/dist/modal/constants/oAuthLogos.js +24 -0
  81. package/dist/modal/hooks/useGoBack.js +43 -0
  82. package/dist/modal/index.d.ts +1 -2
  83. package/dist/modal/index.js +29 -0
  84. package/dist/modal/stores/index.js +2 -0
  85. package/dist/modal/stores/modal/actions.js +133 -0
  86. package/dist/modal/stores/modal/useModalStore.d.ts +12 -4
  87. package/dist/modal/stores/modal/useModalStore.js +68 -0
  88. package/dist/modal/types/commonTypes.d.ts +0 -47
  89. package/dist/modal/types/commonTypes.js +1 -0
  90. package/dist/modal/types/externalWallets.d.ts +2 -0
  91. package/dist/modal/types/externalWallets.js +32 -0
  92. package/dist/modal/types/modalProps.d.ts +10 -2
  93. package/dist/modal/types/modalProps.js +12 -0
  94. package/dist/modal/utils/authInputHelpers.d.ts +7 -0
  95. package/dist/modal/utils/authInputHelpers.js +38 -0
  96. package/dist/modal/utils/authLayoutHelpers.js +8 -0
  97. package/dist/modal/utils/countryCodes.js +45 -0
  98. package/dist/modal/utils/getMailtoLink.js +10 -0
  99. package/dist/modal/utils/getTileButtonFlex.js +20 -0
  100. package/dist/modal/utils/isPasskeySupported.js +15 -0
  101. package/dist/modal/utils/openPopup.js +60 -0
  102. package/dist/modal/utils/routeMobileExternalWallet.js +31 -0
  103. package/dist/modal/utils/steps.d.ts +6 -0
  104. package/dist/modal/utils/steps.js +247 -0
  105. package/dist/modal/utils/stringFormatters.d.ts +1 -0
  106. package/dist/modal/utils/stringFormatters.js +19 -0
  107. package/dist/modal/utils/validateOnRampConfig.js +32 -0
  108. package/dist/package.json +6 -0
  109. package/dist/provider/ParaProvider.js +83 -0
  110. package/dist/provider/actions/getAccount.d.ts +8 -1
  111. package/dist/provider/actions/getAccount.js +51 -0
  112. package/dist/provider/actions/getWallet.d.ts +2 -2
  113. package/dist/provider/actions/getWallet.js +14 -0
  114. package/dist/provider/actions/index.d.ts +2 -0
  115. package/dist/provider/actions/index.js +59 -0
  116. package/dist/provider/actions/utils.js +15 -0
  117. package/dist/provider/components/CosmosWalletWrapper.js +34 -0
  118. package/dist/provider/components/EvmWalletWrapper.js +34 -0
  119. package/dist/provider/components/ExternalWalletWrapper.js +139 -0
  120. package/dist/provider/components/SolanaWalletWrapper.js +36 -0
  121. package/dist/provider/external/getParaCosmosConnector.js +22 -0
  122. package/dist/provider/external/getParaEvmConnector.js +22 -0
  123. package/dist/provider/external/getParaSolanaConnector.js +22 -0
  124. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +18 -0
  125. package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +21 -0
  126. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +14 -0
  127. package/dist/provider/hooks/index.js +4 -0
  128. package/dist/provider/hooks/mutations/index.d.ts +1 -0
  129. package/dist/provider/hooks/mutations/index.js +61 -0
  130. package/dist/provider/hooks/mutations/utils.js +22 -0
  131. package/dist/provider/hooks/queries/index.d.ts +1 -0
  132. package/dist/provider/hooks/queries/index.js +10 -0
  133. package/dist/provider/hooks/queries/useAccount.js +21 -0
  134. package/dist/provider/hooks/queries/useWallet.js +22 -0
  135. package/dist/provider/hooks/queries/useWalletBalance.d.ts +6 -0
  136. package/dist/provider/hooks/queries/useWalletBalance.js +55 -0
  137. package/dist/provider/hooks/utils/index.js +10 -0
  138. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +74 -0
  139. package/dist/provider/hooks/utils/useClient.js +10 -0
  140. package/dist/provider/hooks/utils/useEventListeners.d.ts +1 -1
  141. package/dist/provider/hooks/utils/useEventListeners.js +147 -0
  142. package/dist/provider/hooks/utils/useInternalClient.js +10 -0
  143. package/dist/provider/hooks/utils/useModal.js +17 -0
  144. package/dist/provider/hooks/utils/useWalletState.d.ts +3 -3
  145. package/dist/provider/hooks/utils/useWalletState.js +48 -0
  146. package/dist/provider/index.js +9 -0
  147. package/dist/provider/providers/AuthProvider.d.ts +10 -6
  148. package/dist/provider/providers/AuthProvider.js +498 -0
  149. package/dist/provider/providers/CosmosExternalWalletProvider.js +66 -0
  150. package/dist/provider/providers/EvmExternalWalletProvider.js +74 -0
  151. package/dist/provider/providers/ExternalWalletProvider.d.ts +5 -2
  152. package/dist/provider/providers/ExternalWalletProvider.js +428 -0
  153. package/dist/provider/providers/SolanaExternalWalletProvider.js +66 -0
  154. package/dist/provider/stores/getters.d.ts +1 -1
  155. package/dist/provider/stores/getters.js +13 -0
  156. package/dist/provider/stores/setters.js +7 -0
  157. package/dist/provider/stores/slices/client.js +9 -0
  158. package/dist/provider/stores/slices/config.js +9 -0
  159. package/dist/provider/stores/slices/externalWallets.js +40 -0
  160. package/dist/provider/stores/slices/index.js +5 -0
  161. package/dist/provider/stores/slices/modal.js +16 -0
  162. package/dist/provider/stores/slices/wallet.js +13 -0
  163. package/dist/provider/stores/types.d.ts +7 -4
  164. package/dist/provider/stores/types.js +1 -0
  165. package/dist/provider/stores/useStore.js +28 -0
  166. package/dist/provider/types/externalWalletProviders.d.ts +2 -2
  167. package/dist/provider/types/externalWalletProviders.js +1 -0
  168. package/dist/provider/types/provider.d.ts +9 -3
  169. package/dist/provider/types/provider.js +1 -0
  170. package/dist/provider/types/query.js +1 -0
  171. package/dist/provider/types/utils.js +1 -0
  172. package/dist/provider/utils/constants.d.ts +5 -0
  173. package/dist/provider/utils/constants.js +10 -0
  174. package/dist/provider/utils/paraConfigTypeGuards.js +13 -0
  175. package/dist/provider/utils/renameMutations.js +18 -0
  176. package/package.json +18 -16
  177. package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
  178. package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
  179. package/dist/chunk-MMUBH76A.js.br +0 -0
  180. package/dist/chunk-MMUBH76A.js.gz +0 -0
  181. package/dist/index.js.br +0 -0
  182. package/dist/index.js.gz +0 -0
  183. /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, TExternalWallet } from '../../modal/index.js';
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: TExternalWallet[];
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,5 @@
1
+ export declare const EXTERNAL_WALLET_PACKAGE_BY_TYPE: {
2
+ EVM: string;
3
+ COSMOS: string;
4
+ SOLANA: string;
5
+ };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import "../../chunk-MMUBH76A.js";
3
+ const EXTERNAL_WALLET_PACKAGE_BY_TYPE = {
4
+ EVM: "Wagmi",
5
+ COSMOS: "Graz",
6
+ SOLANA: "@solana/wallet-adapter-react"
7
+ };
8
+ export {
9
+ EXTERNAL_WALLET_PACKAGE_BY_TYPE
10
+ };
@@ -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",
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.3",
19
- "@getpara/react-components": "2.0.0-alpha.3",
20
- "@getpara/web-sdk": "2.0.0-alpha.3",
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.3",
38
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.3",
39
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.3",
40
- "@testing-library/dom": "^10.1.0",
41
- "@testing-library/react": "^16.0.0",
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.x",
47
- "wagmi": "2.x"
47
+ "viem": "^2.24.2",
48
+ "wagmi": "^2.14.16"
48
49
  },
49
50
  "peerDependencies": {
50
- "@getpara/cosmos-wallet-connectors": "^2.0.0-alpha.0",
51
- "@getpara/evm-wallet-connectors": "^2.0.0-alpha.0",
52
- "@getpara/solana-wallet-connectors": "^2.0.0-alpha.0",
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": "77a1e04b06258842ca9c81e3db2a2b0092517659"
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