Skip to content

Multiple embedded wallets

Ethereum embedded wallets are hierarchical deterministic (HD) wallets, and a user's seed entropy can support multiple separate embedded wallets.

WARNING

HD wallets are only supported on Ethereum. allowAdditional is not supported for Solana wallets.

Send a request with the new wallet

To send a request to an embedded wallet not at the 0-index, pass the desired wallet address as an optional second parameter to provider.request.

swift
guard case .connected(let wallets) = privy.embeddedWallet.embeddedWalletState else {
    print("Wallet not connected")
    return
}

// the target wallet here is looked up by it's position in the list,
// but you may choose to have some application state that includes
// it's address, and look it up that way
let wallet = wallets[1]

// Get RPC provider for wallet
let provider = try privy.embeddedWallet.getProvider(for: wallet.address)

let response = try await provider.request(
    RpcRequest(
        method: "personal_sign",
        params: ["The message that is being signed", wallet.address]
    )
)