This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@rangodev/wallets-core
TypeScript icon, indicating that this package has built-in type declarations

0.1.11-next.64 • Public • Published

[ ] Add a type for child classes (Metamask, ..) to ensure they are implementing required methods.

Template

Template for creating a new provider

const WALLET = WalletType.COINBASE;

class TemplateWallet extends Wallet<InstanceType> implements WalletInterface {
  constructor(onChangeState: EventHandler) {
    super(WALLET, onChangeState);

    // let instance = metamask_instance();
    // if (!!instance) {
    //   this.setProvider(instance);
    //   this.subscirbe();
    // }
  }

  async check() {}
  async connect() {}
  async disconnect() {}
  async subscribe() {}
}

export default {
  initializer: TemplateWallet,
  type: WALLET
};

TODO

  • [ ] subscirbe -> subscribe

  • [ ] add eagerConnect to core (maybe instead of check?)

  • [ ] Reading from wallets (like eth_chainId, eth_accounts) should've a timeout. because sometimes wallet doesn't responding corretly. But requesting (like eth_requestAccounts) shouldn't have a timeout, because it opens a popup and it take some time to get a confirmation or rejction from user.

  • add provider to checkWalletProviders

Readme

Keywords

none

Package Sidebar

Install

npm i @rangodev/wallets-core

Weekly Downloads

8

Version

0.1.11-next.64

License

MIT

Unpacked Size

264 kB

Total Files

24

Last publish

Collaborators

  • npm