@makerdao/dai-plugin-walletlink
v0.0.9
Published
A [Dai.js][daijs] plugin for using Coinbase WalletLink in a browser environment.
Downloads
66
Readme
dai-plugin-walletlink
A Dai.js plugin for using Coinbase WalletLink in a browser environment.
Example usage
import WalletLinkPlugin from '@makerdao/dai-plugin-walletlink';
import Maker from '@makerdao/dai';
const maker = await Maker.create('http', {
plugins: [WalletLinkPlugin],
accounts: {
myWalletLink1: { type: 'walletlink' }
}
});
// this will not resolve until the account is set up
await maker.authenticate();
// or you can defer setting the account up until later
await maker.addAccount('myWalletLink2', { type: 'walletlink' });
Using the optional address callback
await maker.addAccount('myWalletLink', {
type: 'walletlink',
callback: address => {
//e.g. for analytics
console.log('My WalletLink address', address);
}
});