@privy-io/react-auth 1.22.0 → 1.23.0-beta.1
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/esm/index.js +223 -124
- package/dist/index.d.ts +61 -1
- package/dist/index.js +223 -124
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,60 @@ import WCProvider from '@walletconnect/web3-provider';
|
|
|
4
4
|
import { AbstractProvider } from 'web3-core';
|
|
5
5
|
import { AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
6
6
|
|
|
7
|
+
type Address = string;
|
|
8
|
+
type HexString = string;
|
|
9
|
+
type BytesLike = ArrayLike<number> | string;
|
|
10
|
+
type AccessList = Array<{
|
|
11
|
+
address: string;
|
|
12
|
+
storageKeys: Array<string>;
|
|
13
|
+
}>;
|
|
14
|
+
type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
|
|
15
|
+
type Quantity = HexString | number | bigint;
|
|
16
|
+
type UnsignedTransactionRequest = {
|
|
17
|
+
to?: Address;
|
|
18
|
+
nonce?: number;
|
|
19
|
+
gasLimit?: Quantity;
|
|
20
|
+
gasPrice?: Quantity;
|
|
21
|
+
data?: BytesLike;
|
|
22
|
+
/** Integer of the value sent with this transaction, in Wei. */
|
|
23
|
+
value?: Quantity;
|
|
24
|
+
chainId?: number;
|
|
25
|
+
type?: number;
|
|
26
|
+
accessList?: AccessListish;
|
|
27
|
+
maxPriorityFeePerGas?: Quantity;
|
|
28
|
+
maxFeePerGas?: Quantity;
|
|
29
|
+
};
|
|
30
|
+
type Log = {
|
|
31
|
+
blockNumber: number;
|
|
32
|
+
blockHash: string;
|
|
33
|
+
transactionIndex: number;
|
|
34
|
+
removed: boolean;
|
|
35
|
+
address: string;
|
|
36
|
+
data: string;
|
|
37
|
+
topics: Array<string>;
|
|
38
|
+
transactionHash: string;
|
|
39
|
+
logIndex: number;
|
|
40
|
+
};
|
|
41
|
+
type TransactionReceipt = {
|
|
42
|
+
to: string;
|
|
43
|
+
from: string;
|
|
44
|
+
contractAddress: string;
|
|
45
|
+
transactionIndex: number;
|
|
46
|
+
root?: string;
|
|
47
|
+
logs: Array<Log>;
|
|
48
|
+
logsBloom: string;
|
|
49
|
+
blockHash: string;
|
|
50
|
+
transactionHash: string;
|
|
51
|
+
blockNumber: number;
|
|
52
|
+
confirmations: number;
|
|
53
|
+
byzantium: boolean;
|
|
54
|
+
type: number;
|
|
55
|
+
status?: number;
|
|
56
|
+
gasUsed: string;
|
|
57
|
+
cumulativeGasUsed: string;
|
|
58
|
+
effectiveGasPrice: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
7
61
|
declare const SUPPORTED_OAUTH_PROVIDERS: readonly ["google", "discord", "twitter", "github", "apple"];
|
|
8
62
|
type OAuthProviderType = typeof SUPPORTED_OAUTH_PROVIDERS[number];
|
|
9
63
|
declare const SUPPORTED_WALLET_CONNECTION_TYPES: readonly ["metamask", "phantom", "coinbase_wallet", "wallet_connect"];
|
|
@@ -235,6 +289,11 @@ type SignMessageModalUIOptions = {
|
|
|
235
289
|
description?: string;
|
|
236
290
|
buttonText?: string;
|
|
237
291
|
};
|
|
292
|
+
type SendTransactionModalUIOptions = {
|
|
293
|
+
title?: string;
|
|
294
|
+
description?: string;
|
|
295
|
+
buttonText?: string;
|
|
296
|
+
};
|
|
238
297
|
|
|
239
298
|
declare function getAccessToken(): Promise<string | null>;
|
|
240
299
|
/**
|
|
@@ -677,7 +736,8 @@ interface PrivyInterface {
|
|
|
677
736
|
*
|
|
678
737
|
* This function currently has a precondition that the user has a Privy wallet. It will fail otherwise.
|
|
679
738
|
*/
|
|
680
|
-
signMessage: (message: string,
|
|
739
|
+
signMessage: (message: string, uiOptions?: SignMessageModalUIOptions) => Promise<string>;
|
|
740
|
+
sendTransaction: (data: UnsignedTransactionRequest, uiOptions?: SendTransactionModalUIOptions) => Promise<TransactionReceipt>;
|
|
681
741
|
exportWallet: () => Promise<void>;
|
|
682
742
|
}
|
|
683
743
|
/**
|