@gelatonetwork/smartwallet-react-privy 0.0.16 → 0.0.17

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.16",
3
+ "version": "0.0.17",
4
4
  "author": "Gelato",
5
5
  "type": "module",
6
6
  "description": "Context provider supporting Privy WaaS",
@@ -11,8 +11,8 @@
11
11
  "typescript": "^5.3",
12
12
  "viem": "~2.29",
13
13
  "wagmi": "~2.15",
14
- "@gelatonetwork/smartwallet": "0.0.16",
15
- "@gelatonetwork/smartwallet-react-types": "0.0.16"
14
+ "@gelatonetwork/smartwallet": "0.0.17",
15
+ "@gelatonetwork/smartwallet-react-types": "0.0.17"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "typescript": {
@@ -32,8 +32,8 @@
32
32
  "viem": "~2.29",
33
33
  "wagmi": "~2.15",
34
34
  "zod": "3.24.4",
35
- "@gelatonetwork/smartwallet": "0.0.16",
36
- "@gelatonetwork/smartwallet-react-types": "0.0.16"
35
+ "@gelatonetwork/smartwallet": "0.0.17",
36
+ "@gelatonetwork/smartwallet-react-types": "0.0.17"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/react": "^18.3",
package/src/provider.tsx CHANGED
@@ -21,6 +21,7 @@ import {
21
21
  createWalletClient,
22
22
  custom
23
23
  } from "viem";
24
+ import { prepareAuthorization } from "viem/actions";
24
25
  import * as chains from "viem/chains";
25
26
  import { extractChain } from "viem/utils";
26
27
  import type { Config as WagmiConfig } from "wagmi";
@@ -113,17 +114,12 @@ const GelatoSmartWalletPrivyInternal: FC<{
113
114
  });
114
115
 
115
116
  client.signAuthorization = async (parameters) => {
116
- const { chainId, nonce } = parameters;
117
- const contractAddress = parameters.contractAddress ?? parameters.address;
118
-
119
- if (!contractAddress) {
120
- throw new Error("Contract address is required");
121
- }
117
+ const preparedAuthorization = await prepareAuthorization(client, parameters);
122
118
 
123
119
  const signedAuthorization = await signAuthorization({
124
- contractAddress,
125
- chainId,
126
- nonce
120
+ contractAddress: preparedAuthorization.address,
121
+ chainId: preparedAuthorization.chainId,
122
+ nonce: preparedAuthorization.nonce
127
123
  });
128
124
 
129
125
  return signedAuthorization;