@getpara/react-sdk 1.10.0 → 1.11.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.
@@ -40,10 +40,23 @@ function AddFundsReceive() {
40
40
  copy(address);
41
41
  };
42
42
  return /* @__PURE__ */ jsxs(Fragment, { children: [
43
- /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsxs(FilledDisabledInput, { noAutoDisable: true, readonly: true, placeholder: address, children: [
44
- /* @__PURE__ */ jsx(CpslIdenticon, { slot: "start", size: "32px", hash: para.getIdenticonHash(activeWallet.id, activeWallet.type) }),
45
- /* @__PURE__ */ jsx(CpslButton, { slot: "end", variant: "ghost", onClick: onCopy, children: /* @__PURE__ */ jsx(CpslIcon, { icon: isCopied ? "check" : "copy" }) })
46
- ] }, address) }),
43
+ /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsxs(
44
+ FilledDisabledInput,
45
+ {
46
+ noAutoDisable: true,
47
+ readonly: true,
48
+ placeholder: para.getDisplayAddress(activeWallet.id, {
49
+ truncate: true,
50
+ addressType: activeWallet.type,
51
+ targetLength: 16
52
+ }),
53
+ children: [
54
+ /* @__PURE__ */ jsx(CpslIdenticon, { slot: "start", size: "32px", hash: para.getIdenticonHash(activeWallet.id, activeWallet.type) }),
55
+ /* @__PURE__ */ jsx(CpslButton, { slot: "end", variant: "ghost", onClick: onCopy, children: /* @__PURE__ */ jsx(CpslIcon, { icon: isCopied ? "check" : "copy" }) })
56
+ ]
57
+ },
58
+ address
59
+ ) }),
47
60
  !isMobile() && /* @__PURE__ */ jsxs(Fragment, { children: [
48
61
  /* @__PURE__ */ jsx(CpslDivider, { children: "or" }),
49
62
  /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
@@ -36,6 +36,7 @@ import { useEffect, useState } from "react";
36
36
  import { TelegramOAuthStep } from "../OAuth/TelegramOAuthStep.js";
37
37
  import { AwaitingPasswordStep } from "../AwaitingPasswordStep/AwaitingPasswordStep.js";
38
38
  import { IFrameStep } from "../IFrameStep/IFrameStep.js";
39
+ import { NetworkSpeedBanner } from "@getpara/react-common";
39
40
  const MIN_HEIGHT = {
40
41
  [ModalStep.ADD_FUNDS_AWAITING]: "680px"
41
42
  };
@@ -211,6 +212,7 @@ const Body = ({ oAuthMethods, twoFactorAuthEnabled, disableEmailLogin, disablePh
211
212
  $step: currentStep,
212
213
  $isIFrameStep: IFrameSteps.includes(currentStep),
213
214
  children: [
215
+ /* @__PURE__ */ jsx(NetworkSpeedBanner, { fontSize: "12px", iconSize: "16px" }),
214
216
  Content(),
215
217
  (onRampConfig == null ? void 0 : onRampConfig.testMode) && [
216
218
  ModalStep.ADD_FUNDS_BUY,
@@ -0,0 +1,2 @@
1
+ import ParaWeb, { CreateGuestWalletsParams } from '@getpara/web-sdk';
2
+ export declare const createGuestWallets: (para?: ParaWeb, args?: CreateGuestWalletsParams) => Promise<import("@getpara/web-sdk").Wallet[]>;
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import {
3
+ __async
4
+ } from "../../chunk-MMUBH76A.js";
5
+ const createGuestWallets = (para, args) => __async(void 0, null, function* () {
6
+ if (!para) {
7
+ throw new Error("no para instance");
8
+ }
9
+ return yield para.createGuestWallets(args);
10
+ });
11
+ export {
12
+ createGuestWallets
13
+ };
@@ -1,6 +1,7 @@
1
1
  import ParaWeb from '@getpara/web-sdk';
2
2
  export declare const getAccount: (para?: ParaWeb) => Promise<{
3
3
  isConnected: boolean;
4
+ isGuestMode: boolean;
4
5
  email: any;
5
6
  phone: any;
6
7
  wallets: any;
@@ -6,6 +6,7 @@ const getAccount = (para) => __async(void 0, null, function* () {
6
6
  const isLoggedIn = yield para == null ? void 0 : para.isFullyLoggedIn();
7
7
  const resp = {
8
8
  isConnected: !!isLoggedIn,
9
+ isGuestMode: para == null ? void 0 : para.isGuestMode,
9
10
  email: void 0,
10
11
  phone: void 0,
11
12
  wallets: void 0
@@ -8,3 +8,4 @@ export { useLogout } from './useLogout.js';
8
8
  export { useKeepSessionAlive } from './useKeepSessionAlive.js';
9
9
  export { useSignMessage } from './useSignMessage.js';
10
10
  export { useSignTransaction } from './useSignTransaction.js';
11
+ export { useCreateGuestWallets } from './useCreateGuestWallets.js';
@@ -10,8 +10,10 @@ import { useLogout } from "./useLogout.js";
10
10
  import { useKeepSessionAlive } from "./useKeepSessionAlive.js";
11
11
  import { useSignMessage } from "./useSignMessage.js";
12
12
  import { useSignTransaction } from "./useSignTransaction.js";
13
+ import { useCreateGuestWallets } from "./useCreateGuestWallets.js";
13
14
  export {
14
15
  useCheckIfUserExists,
16
+ useCreateGuestWallets,
15
17
  useCreateUser,
16
18
  useInitiateLogin,
17
19
  useKeepSessionAlive,
@@ -0,0 +1,15 @@
1
+ import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
2
+ import { createGuestWallets } from '../../actions/createGuestWallets.js';
3
+ import { Compute } from '../../types/utils.js';
4
+ import { UseMutationReturnType } from '../../types/query.js';
5
+ import { CreateGuestWalletsParams } from '@getpara/web-sdk';
6
+ type Data = Awaited<ReturnType<typeof createGuestWallets>>;
7
+ type UseCreateGuestWalletsReturnType<TData = Data, TError = Error, TVariables = CreateGuestWalletsParams, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
8
+ createGuestWallets: UseMutateFunction<TData, TError, TVariables, TContext>;
9
+ createGuestWalletsAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
10
+ }>;
11
+ /**
12
+ * Hook for creating guest mode wallets
13
+ */
14
+ export declare const useCreateGuestWallets: () => UseCreateGuestWalletsReturnType<import("@getpara/web-sdk").Wallet[], Error, CreateGuestWalletsParams, unknown>;
15
+ export {};
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import {
3
+ __async
4
+ } from "../../../chunk-MMUBH76A.js";
5
+ import { useMutation } from "@tanstack/react-query";
6
+ import { useClient } from "../index.js";
7
+ import { createGuestWallets } from "../../actions/createGuestWallets.js";
8
+ import { renameMutations } from "../../utils/renameMutations.js";
9
+ const useCreateGuestWallets = () => {
10
+ const client = useClient();
11
+ const mutation = useMutation({
12
+ mutationFn: (args) => __async(void 0, null, function* () {
13
+ return yield createGuestWallets(client, args);
14
+ })
15
+ });
16
+ return renameMutations(
17
+ mutation,
18
+ "createGuestWallets"
19
+ );
20
+ };
21
+ export {
22
+ useCreateGuestWallets
23
+ };
@@ -4,6 +4,7 @@ export declare const ACCOUNT_BASE_KEY = "PARA_ACCOUNT";
4
4
  */
5
5
  export declare const useAccount: () => import("@tanstack/react-query").UseQueryResult<{
6
6
  isConnected: boolean;
7
+ isGuestMode: boolean;
7
8
  email: any;
8
9
  phone: any;
9
10
  wallets: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,9 +12,9 @@
12
12
  "*.css"
13
13
  ],
14
14
  "dependencies": {
15
- "@getpara/react-common": "1.10.0",
16
- "@getpara/react-components": "1.10.0",
17
- "@getpara/web-sdk": "1.10.0",
15
+ "@getpara/react-common": "1.11.0",
16
+ "@getpara/react-components": "1.11.0",
17
+ "@getpara/web-sdk": "1.11.0",
18
18
  "@tanstack/react-query": "^5.0.0",
19
19
  "date-fns": "^3.6.0",
20
20
  "framer-motion": "11.3.28",
@@ -30,9 +30,10 @@
30
30
  "test": "vitest run --coverage"
31
31
  },
32
32
  "devDependencies": {
33
- "@testing-library/dom": "^10.1.0",
34
- "@testing-library/react": "^16.0.0",
33
+ "@testing-library/dom": "^10.4.0",
34
+ "@testing-library/react": "^16.3.0",
35
35
  "@testing-library/react-hooks": "^8.0.1",
36
+ "@testing-library/user-event": "^14.6.1",
36
37
  "@types/chrome": "^0.0.237",
37
38
  "@types/react": "^18.0.31",
38
39
  "@types/react-dom": "^18.2.7",
@@ -50,5 +51,5 @@
50
51
  "resolutions": {
51
52
  "styled-components": "^6"
52
53
  },
53
- "gitHead": "617cf0aa1307a96ec5e91d39e306e8a0b3b86b82"
54
+ "gitHead": "91b68e4ead22e2104307c934f2a582245b176619"
54
55
  }