@makerdao/dai-plugin-walletconnect

0.0.20 • Public • Published

dai-plugin-walletconnect

A Dai.js plugin for using WalletConnect in a browser environment.

Example usage

import WalletConnect from '@makerdao/dai-plugin-walletconnect';
import Maker from '@makerdao/dai';

const maker = await Maker.create('http', {
  plugins: [WalletConnect],
  accounts: {
    myWalletConnect1: { type: 'walletconnect' }
  }
});

// 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('myWalletConnect2', { type: 'walletconnect' });

Using the optional address callback

await maker.addAccount('myWalletConnect', {
  type: 'walletconnect',
  callback: address => {
    //e.g. for analytics
    console.log('My WalletConnect address', address);
  }
});

Readme

Keywords

none

Package Sidebar

Install

npm i @makerdao/dai-plugin-walletconnect

Weekly Downloads

2

Version

0.0.20

License

MIT

Unpacked Size

9.02 kB

Total Files

4

Last publish

Collaborators

  • adamgoth
  • b-pmcg
  • krzkaczor
  • tyler17