@privy-io/react-auth 1.76.1 → 1.76.3-beta-20240726135350
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 +313 -313
- package/dist/index.d.ts +22 -17
- package/dist/index.js +313 -313
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -241,7 +241,7 @@ type RpcConfig = {
|
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
-
declare const DEFAULT_SUPPORTED_CHAINS: readonly [Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain];
|
|
244
|
+
declare const DEFAULT_SUPPORTED_CHAINS: readonly [Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain];
|
|
245
245
|
|
|
246
246
|
type WalletCreateRequestDataType = {
|
|
247
247
|
accessToken: string;
|
|
@@ -1122,8 +1122,8 @@ declare class PrivyClient {
|
|
|
1122
1122
|
updateApiUrl(customApiUrl?: string | null): void;
|
|
1123
1123
|
authenticate(): Promise<{
|
|
1124
1124
|
user: User | null;
|
|
1125
|
-
isNewUser?: boolean
|
|
1126
|
-
oAuthTokens?: OAuthTokens
|
|
1125
|
+
isNewUser?: boolean;
|
|
1126
|
+
oAuthTokens?: OAuthTokens;
|
|
1127
1127
|
}>;
|
|
1128
1128
|
link(): Promise<{
|
|
1129
1129
|
user: User | null;
|
|
@@ -2677,6 +2677,11 @@ interface PrivyInterface {
|
|
|
2677
2677
|
*
|
|
2678
2678
|
*/
|
|
2679
2679
|
updateEmail: () => void;
|
|
2680
|
+
/**
|
|
2681
|
+
* For users who are authenticated and have already linked a phone number, prompts the user to update their phone number.
|
|
2682
|
+
* This will open the Privy Modal which will guide the user through this action.
|
|
2683
|
+
*/
|
|
2684
|
+
updatePhone: () => void;
|
|
2680
2685
|
/**
|
|
2681
2686
|
* Log the current user out and clears their authentication state. `authenticated` will become false, `user` will become null, and the Privy Auth tokens will be deleted from the browser's local storage.
|
|
2682
2687
|
*
|
|
@@ -3177,8 +3182,8 @@ declare function useWallets(): UseWalletsInterface;
|
|
|
3177
3182
|
*/
|
|
3178
3183
|
declare function useMfa(): {
|
|
3179
3184
|
promptMfa: () => Promise<void>;
|
|
3180
|
-
init: (mfaMethod:
|
|
3181
|
-
submit: (mfaMethod:
|
|
3185
|
+
init: (mfaMethod: MfaMethod) => Promise<void | _simplewebauthn_types.PublicKeyCredentialRequestOptionsJSON>;
|
|
3186
|
+
submit: (mfaMethod: MfaMethod, mfaCode: string | _simplewebauthn_types.PublicKeyCredentialRequestOptionsJSON) => Promise<void>;
|
|
3182
3187
|
cancel: () => void;
|
|
3183
3188
|
mfaMethods: ("sms" | "totp" | "passkey")[];
|
|
3184
3189
|
};
|
|
@@ -3488,7 +3493,7 @@ declare function useLogin(callbacks?: PrivyEvents['login']): {
|
|
|
3488
3493
|
/**
|
|
3489
3494
|
* Opens the Privy login modal and prompts the user to login.
|
|
3490
3495
|
*/
|
|
3491
|
-
login: (options?: RuntimeLoginOverridableOptions | react.MouseEvent<any, any>
|
|
3496
|
+
login: (options?: RuntimeLoginOverridableOptions | react.MouseEvent<any, any>) => void;
|
|
3492
3497
|
};
|
|
3493
3498
|
|
|
3494
3499
|
/**
|
|
@@ -3767,8 +3772,8 @@ declare function useConnectWallet(callbacks?: PrivyEvents['connectWallet']): {
|
|
|
3767
3772
|
* Opens the Privy modal and prompts the user to connect a wallet.
|
|
3768
3773
|
*/
|
|
3769
3774
|
connectWallet: (options?: {
|
|
3770
|
-
suggestedAddress?: string
|
|
3771
|
-
} | react.MouseEvent<any, any>
|
|
3775
|
+
suggestedAddress?: string;
|
|
3776
|
+
} | react.MouseEvent<any, any>) => void;
|
|
3772
3777
|
};
|
|
3773
3778
|
|
|
3774
3779
|
/**
|
|
@@ -3824,7 +3829,7 @@ interface UseFundWalletInterface {
|
|
|
3824
3829
|
* @param callbacks.onUserExited {@link PrivyEvents} Callback that will execute when a funding flow is exited. This fires when a user closes a funding flow modal, for any reason.
|
|
3825
3830
|
* @returns fundWallet - function to on-ramp funds to any given wallet
|
|
3826
3831
|
*/
|
|
3827
|
-
declare const useFundWallet: (callbacks?: PrivyEvents[
|
|
3832
|
+
declare const useFundWallet: (callbacks?: PrivyEvents["fundWallet"]) => UseFundWalletInterface;
|
|
3828
3833
|
|
|
3829
3834
|
/**
|
|
3830
3835
|
* Hook to create and interact with Solana wallets. This currently only supports an embedded Solana wallet and no
|
|
@@ -3935,7 +3940,7 @@ declare function useSendTransaction(callbacks?: PrivyEvents['sendTransaction']):
|
|
|
3935
3940
|
/**
|
|
3936
3941
|
* Prompts a user to send a transaction using their embedded wallet.
|
|
3937
3942
|
*/
|
|
3938
|
-
sendTransaction: (data: UnsignedTransactionRequest, uiOptions?: SendTransactionModalUIOptions
|
|
3943
|
+
sendTransaction: (data: UnsignedTransactionRequest, uiOptions?: SendTransactionModalUIOptions, fundWalletConfig?: FundWalletConfig) => Promise<TransactionReceipt>;
|
|
3939
3944
|
};
|
|
3940
3945
|
|
|
3941
3946
|
/**
|
|
@@ -3983,7 +3988,7 @@ declare function useSignMessage(callbacks?: PrivyEvents['signMessage']): {
|
|
|
3983
3988
|
/**
|
|
3984
3989
|
* Prompts a user to sign a message using their embedded wallet.
|
|
3985
3990
|
*/
|
|
3986
|
-
signMessage: (message: string, uiOptions?: SignMessageModalUIOptions
|
|
3991
|
+
signMessage: (message: string, uiOptions?: SignMessageModalUIOptions) => Promise<string>;
|
|
3987
3992
|
};
|
|
3988
3993
|
|
|
3989
3994
|
/**
|
|
@@ -3997,7 +4002,7 @@ declare function useSignTypedData(callbacks?: PrivyEvents['signTypedData']): {
|
|
|
3997
4002
|
/**
|
|
3998
4003
|
* Prompts a user to sign typed data using their embedded wallet.
|
|
3999
4004
|
*/
|
|
4000
|
-
signTypedData: (typedData: SignTypedDataParams, uiOptions?: SignMessageModalUIOptions
|
|
4005
|
+
signTypedData: (typedData: SignTypedDataParams, uiOptions?: SignMessageModalUIOptions) => Promise<string>;
|
|
4001
4006
|
};
|
|
4002
4007
|
|
|
4003
4008
|
/**
|
|
@@ -4077,7 +4082,7 @@ declare function addRpcUrlOverrideToChain(chain: Chain, rpcUrl: string): {
|
|
|
4077
4082
|
};
|
|
4078
4083
|
default: {
|
|
4079
4084
|
http: readonly string[];
|
|
4080
|
-
webSocket?: readonly string[]
|
|
4085
|
+
webSocket?: readonly string[];
|
|
4081
4086
|
};
|
|
4082
4087
|
} | {
|
|
4083
4088
|
privyWalletOverride: {
|
|
@@ -4085,12 +4090,12 @@ declare function addRpcUrlOverrideToChain(chain: Chain, rpcUrl: string): {
|
|
|
4085
4090
|
};
|
|
4086
4091
|
default: {
|
|
4087
4092
|
http: readonly string[];
|
|
4088
|
-
webSocket?: readonly string[]
|
|
4093
|
+
webSocket?: readonly string[];
|
|
4089
4094
|
};
|
|
4090
4095
|
};
|
|
4091
4096
|
id: number;
|
|
4092
4097
|
name: string;
|
|
4093
|
-
network?: string
|
|
4098
|
+
network?: string;
|
|
4094
4099
|
nativeCurrency: {
|
|
4095
4100
|
name: string;
|
|
4096
4101
|
symbol: string;
|
|
@@ -4105,8 +4110,8 @@ declare function addRpcUrlOverrideToChain(chain: Chain, rpcUrl: string): {
|
|
|
4105
4110
|
name: string;
|
|
4106
4111
|
url: string;
|
|
4107
4112
|
};
|
|
4108
|
-
}
|
|
4109
|
-
testnet?: boolean
|
|
4113
|
+
};
|
|
4114
|
+
testnet?: boolean;
|
|
4110
4115
|
};
|
|
4111
4116
|
|
|
4112
4117
|
/**
|