The Lamden Wallet listens for a "lamdenWalletConnect" event.
The event detail is expected to be a JSON object. Anything other than a JSON object will cause an error.
This is an example of a basic connection request
Basic Connection Info
Sending Connection Request
If the user has not previously approved your app then they will get an approval popup and follow the new Linked Account process.
If the user denies your connection request or closes the popup you will get an error on the lamdenWalletGetInfo listener.
Upgrading Linked Account Information
If at some point you need to make a change to the connection information you can resend the 'lamdenWalletConnect' event with an incremented version. The Lamden wallet will update the information automatically and then send back a lamdenWalletGetInfo object on the lamdenWalletInfo listener.
Updating Smart Contracts
All the connection information can be updated buy incrementing the the version of your request. This includes the smart contract name associated to the user's Linked Account.
Changing the smart contract of your DAPP should not be taken lightly and is not recommended. But the option is available.
Here are some considerations you may want to make before changing the smart contract.
- Any associations the user's account address had to the previous smart contract will not carry over to your new one. This will cause your users to lose items or ownership they once had. If you are migrating from one smart contract to another, you may need to setup some initial state in the new smart contract to accommodate this.
- The user will be supplied a popup when you change the smart contract. They will have to approve the change manually even if your DAPP has Trusted Status
- It's important that you communicate the reason for the change to your users. Before they click "Accept Change" on the popup they will be instructed seek out you for a reason.