createWallet
method:createWallet
with no parameters:createWallet
with createAdditional
set to true
:true
, will allow the user to create a wallet regardless if it is their first wallet or an
additional wallet. If false
, createWallet will succeed only if the use is creating their first
wallet. Defaults to false
.createWallet
will return a Promise that resolves to the Wallet
created for the user at the specified index, if it was successful. This method will reject with an error if:authenticated
createAdditional
was not set to true
createWallet
with the preferred walletIndex
.
This method will either create a new wallet, or return the existing one if one already exists at the specified index.0
for the user’s first
wallet.authenticated
walletIndex
is less than 0, or if walletIndex
is greater than 0 while user has no wallet with HD index 0.linkedAccounts
array of the user
object and the array of connected wallets returned by useWallets
.To find a specific embedded wallet for the user, search the useWallets
array for a wallet with walletClientType: 'privy'
and an address
that matches your desired address:useWallets
array for entries with walletClientType: 'privy'
:viem
or ethers
, per the instructions below.signMessage
, signTypedData
, and sendTransaction
methods with a specific embedded wallet, simply pass the address for your desired wallet as the final optional parameter to these methods:viem
or ethers
.To get the EIP1193 provider for a specific embedded wallet, first find the corresponding ConnectedWallet
object from the useWallets
array:getEthereumProvider
method to get an EIP1193 provider for that wallet:viem
or ethers
to use those libraries’ interfaces to send requests to the wallet.address
parameter to the exportWallet
method:address
is passed to exportWallet
, Privy will default to exporting the non-imported wallet at walletIndex: 0
.create_n_ethereum_wallets
set to the number of embedded wallets you want to generate for your user.