Skip to content

Documentation / react-auth / useSetWalletPassword

Function: useSetWalletPassword()

useSetWalletPassword(callbacks?): Object

Use this hook to set a password on the embedded wallet, and to attach callbacks for successful password sets, and password set errors. Note that the callbacks will only fire for explicit setWalletPassword calls from the Privy SDK.

Parameters

callbacks?: Object

callbacks.onError?: (error) => void

Callback that will execute in the case of a non-successful setWalletPassword.

Param {PrivyErrorCode} - the corresponding error code

callbacks.onSuccess?: (wallet) => void

Callback that will execute once a successful setWalletPassword completes.

ParamWallet- the wallet object that the password was set for

Returns

Object

setWalletPassword - opens the Privy modal and prompts the user to set a password on the embedded wallet

setWalletPassword

setWalletPassword: () => Promise<Wallet>

Returns

Promise<Wallet>