@gelatonetwork/smartwallet-react-privy 0.0.25 → 0.0.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gelatonetwork/smartwallet-react-privy",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "author": "Gelato",
5
5
  "type": "module",
6
6
  "description": "Context provider supporting Privy WaaS",
@@ -11,8 +11,8 @@
11
11
  "typescript": "^5.9.2",
12
12
  "viem": "~2.36.0",
13
13
  "wagmi": "~2.16.8",
14
- "@gelatonetwork/smartwallet": "0.0.25",
15
- "@gelatonetwork/smartwallet-react-types": "0.0.25"
14
+ "@gelatonetwork/smartwallet": "0.0.26",
15
+ "@gelatonetwork/smartwallet-react-types": "0.0.26"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "typescript": {
@@ -32,8 +32,8 @@
32
32
  "viem": "~2.36.0",
33
33
  "wagmi": "~2.16.8",
34
34
  "zod": "3.25.76",
35
- "@gelatonetwork/smartwallet": "0.0.25",
36
- "@gelatonetwork/smartwallet-react-types": "0.0.25"
35
+ "@gelatonetwork/smartwallet": "0.0.26",
36
+ "@gelatonetwork/smartwallet-react-types": "0.0.26"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/react": "^18.3.1",
@@ -14,7 +14,7 @@ export const GelatoSmartWalletPrivyConnectButton: FC<GelatoSmartWalletPrivyConne
14
14
  const disableLogin = !ready || (ready && authenticated);
15
15
 
16
16
  return (
17
- <button type="button" disabled={disableLogin} onClick={login}>
17
+ <button disabled={disableLogin} onClick={login} type="button">
18
18
  {children}
19
19
  </button>
20
20
  );
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
+ export { GelatoSmartWalletPrivyConnectButton } from "./components/connect.js";
1
2
  export {
2
3
  GelatoSmartWalletPrivyContextProvider,
3
4
  useGelatoSmartWalletPrivyContext
4
5
  } from "./provider.js";
5
- export { GelatoSmartWalletPrivyConnectButton } from "./components/connect.js";
package/src/provider.tsx CHANGED
@@ -1,40 +1,28 @@
1
1
  import {
2
- type GelatoSmartWalletClient,
3
- createGelatoSmartWalletClient
2
+ createGelatoSmartWalletClient,
3
+ type GelatoSmartWalletClient
4
4
  } from "@gelatonetwork/smartwallet";
5
- import type { wallet } from "@gelatonetwork/smartwallet-react-types";
6
5
  import type {
7
6
  GelatoSmartAccount,
8
7
  GelatoSmartAccountSCW
9
8
  } from "@gelatonetwork/smartwallet/accounts";
9
+ import type { wallet } from "@gelatonetwork/smartwallet-react-types";
10
10
  import { PrivyProvider, usePrivy, useSignAuthorization, useWallets } from "@privy-io/react-auth";
11
- import { WagmiProvider, createConfig } from "@privy-io/wagmi";
11
+ import { createConfig, WagmiProvider } from "@privy-io/wagmi";
12
12
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
13
13
  import { ChainId } from "caip";
14
14
  import type { FC, ReactNode } from "react";
15
- import {
16
- createContext,
17
- useCallback,
18
- useContext,
19
- useEffect,
20
- useMemo,
21
- useRef,
22
- useState
23
- } from "react";
15
+ import { createContext, useCallback, useContext, useEffect, useRef, useState } from "react";
24
16
  import {
25
17
  type Account,
26
18
  type Chain,
27
- type Hex,
28
- type Transport,
29
19
  createWalletClient,
30
- custom
20
+ custom,
21
+ type Hex,
22
+ type Transport
31
23
  } from "viem";
32
24
  import type { SmartAccount } from "viem/account-abstraction";
33
- import {
34
- type PrepareAuthorizationParameters,
35
- SignAuthorizationReturnType,
36
- prepareAuthorization
37
- } from "viem/actions";
25
+ import { type PrepareAuthorizationParameters, prepareAuthorization } from "viem/actions";
38
26
  import * as chains from "viem/chains";
39
27
  import { extractChain } from "viem/utils";
40
28
  import type { Config as WagmiConfig } from "wagmi";
@@ -102,7 +90,6 @@ const GelatoSmartWalletPrivyInternal: FC<{
102
90
  [smartWalletClient, wallets]
103
91
  );
104
92
 
105
- // biome-ignore lint/correctness/useExhaustiveDependencies: off
106
93
  useEffect(() => {
107
94
  if (!ready || !walletsReady) {
108
95
  return;
@@ -128,7 +115,7 @@ const GelatoSmartWalletPrivyInternal: FC<{
128
115
  const { reference: chainId } = ChainId.parse(primaryWallet.chainId);
129
116
  const chain = extractChain({
130
117
  chains: Object.values(chains),
131
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
118
+ // biome-ignore lint/suspicious/noExplicitAny: chainId type override
132
119
  id: Number(chainId) as any
133
120
  });
134
121
 
@@ -149,8 +136,8 @@ const GelatoSmartWalletPrivyInternal: FC<{
149
136
  const preparedAuthorization = await prepareAuthorization(client, parameters);
150
137
 
151
138
  const signedAuthorization = await signAuthorization({
152
- contractAddress: preparedAuthorization.address,
153
139
  chainId: preparedAuthorization.chainId,
140
+ contractAddress: preparedAuthorization.address,
154
141
  nonce: preparedAuthorization.nonce
155
142
  });
156
143
 
@@ -177,11 +164,11 @@ const GelatoSmartWalletPrivyInternal: FC<{
177
164
  gelato: {
178
165
  client: smartWalletClient as GelatoSmartWalletClient<Transport, Chain, GelatoSmartAccount>
179
166
  },
167
+ logout: logoutWrapper,
168
+ switchNetwork,
180
169
  wagmi: {
181
170
  config: wagmi.config
182
- },
183
- logout: logoutWrapper,
184
- switchNetwork
171
+ }
185
172
  }}
186
173
  >
187
174
  {children}
@@ -207,9 +194,9 @@ export const GelatoSmartWalletPrivyContextProvider: FC<GelatoSmartWalletPrivyCon
207
194
  }}
208
195
  >
209
196
  <GelatoSmartWalletPrivyInternal
210
- wagmi={{ config: wagmiConfig }}
211
197
  apiKey={settings.apiKey}
212
198
  scw={settings.scw}
199
+ wagmi={{ config: wagmiConfig }}
213
200
  >
214
201
  {wagmiConfig ? (
215
202
  <QueryClientProvider client={queryClient}>