Get User Account Info

Your DAPP can get the user’s Linked Account information by listening for the lamdenWalletInfo event.

This event is triggered when:

  1. You send a “lamdenWalletConnect” event
  2. You request information from the Lamden Wallet by sending a “lamdenWalletGetInfo” event
  3. The user locks or unlocks the wallet

Listen for Wallet Info #

This example assumes your DAPP has previously been approved

document.addEventListener('lamdenWalletInfo', (response) => {
    if (response.error.length > 0){
        //Respond to Errors
    if (response.locked){
        //Prompt user to unlock wallet
        //Get user's account address
// Get Wallet Info
document.dispatchEvent(new CustomEvent('lamdenWalletGetInfo'));

Request Wallet Info #

// Get Wallet Info
document.dispatchEvent(new CustomEvent('lamdenWalletGetInfo'));
walletVersionThe version of the installed Lamden Wallet you are conencted to
installedBoolean: Wallet is installed in the broswer
setupBoolean: If the user has run the Lamden Wallet through the inital setup
lockedBoolean: If the wallet is locked or not
walletsArray: The Lamden public key your dApp was assigned. There will only ever be 1 value in this array.
approvalsObject: The networks that are currently approved and the information about those approvals including, ContractName, trustedApp and version.

The wallets and approvals properties will return empty objects until the user unlocks the Lamden Wallet

Updated on February 3, 2021