Msafe Wallet Adaptor
Msafe Wallet Adaptor is used to integrate the browser plug-in wallet into msafe.
It includes two packages: msafe-wallet-adaptor and wallet-tester.
msafe-wallet-adaptor contains adapters for wallets, wallet-tester is a demo frontend to test these adapters.
Installation
yarn
Development
Implement new wallet class
To integrate a new browser plug-in wallet into msafe, you should:
- cd into 'msafe-wallet-adaptor' directory:
cd packages/msafe-wallet-adaptor
- create a new wallet class in
src/adaptors/${WalletNmae}Account.ts
and implementsWebAccount
interface. - add the new wallet into connector:
src/adaptors/Connector.ts
- build the package:
yarn build
For more detail, check msafe-wallet-adaptor.
Test the new wallet in demo front-end
- cd into 'wallet-tester':
cd packages/wallet-tester
- start the front-end:
yarn start
- switch network of wallet to mainnet.
- in the front-end page, click the button with the name of the new wallet to connect to the wallet. check if the address and public key is expected.
- click button
sign transaction
. if the error is 'success', then the wallet is passed our test, otherwise you should check the error and fix it.