@privy-io/react-auth 1.30.0-beta.2 → 1.30.0-beta.4

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/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import react, { ReactElement } from 'react';
2
2
  import { ExternalProvider, JsonRpcProvider, Web3Provider } from '@ethersproject/providers';
3
3
  import { AbstractProvider } from 'web3-core';
4
4
  import EventEmitter from 'eventemitter3';
5
+ import { TypedMessage, MessageTypes } from '@metamask/eth-sig-util';
5
6
  import { FetchOptions } from 'ofetch';
6
7
 
7
8
  /**
@@ -14,7 +15,8 @@ import { FetchOptions } from 'ofetch';
14
15
  * who can create signatures. All other methods do not need the private key and
15
16
  * can therefore be implemented by clients of the iframe.
16
17
  */
17
- declare const SUPPORTED_JSON_RPC_METHODS: readonly ["eth_sign", "eth_populateTransactionRequest", "eth_signTransaction", "personal_sign"];
18
+
19
+ declare const SUPPORTED_JSON_RPC_METHODS: readonly ["eth_sign", "eth_populateTransactionRequest", "eth_signTransaction", "personal_sign", "eth_signTypedData_v4"];
18
20
  type JsonRpcMethodType = typeof SUPPORTED_JSON_RPC_METHODS[number];
19
21
  type Quantity = string | number | bigint;
20
22
  type UnsignedTransactionRequest = {
@@ -99,8 +101,16 @@ interface eth_signTransactionResponse {
99
101
  method: 'eth_signTransaction';
100
102
  data: string;
101
103
  }
102
- type RpcRequestType = eth_signTransaction | eth_populateTransactionRequest | eth_sign | personal_sign;
103
- type RpcResponseType = eth_signTransactionResponse | eth_populateTransactionRequestResponse | eth_signResponse | personal_signResponse;
104
+ interface eth_signTypedData_v4 extends BaseRpcRequestType {
105
+ method: 'eth_signTypedData_v4';
106
+ params: [string, TypedMessage<MessageTypes> | string];
107
+ }
108
+ interface eth_signTypedData_v4Response {
109
+ method: 'eth_signTypedData_v4';
110
+ data: string;
111
+ }
112
+ type RpcRequestType = eth_signTransaction | eth_populateTransactionRequest | eth_sign | personal_sign | eth_signTypedData_v4;
113
+ type RpcResponseType = eth_signTransactionResponse | eth_populateTransactionRequestResponse | eth_signResponse | personal_signResponse | eth_signTypedData_v4Response;
104
114
 
105
115
  type WalletCreateRequestDataType = {
106
116
  accessToken: string;