@dcentralab/wc-binance
TypeScript icon, indicating that this package has built-in type declarations

2.0.32 • Public • Published

Binance Wallet connector

Instalation

npm install @dcentralab/wc-binance

or

yarn add @dcentralab/wc-binance

Getting started

Binance wallet connector for web3-wc-modal, package that implement wallet connection with Binance Wallet chrome extension https://chrome.google.com/webstore/detail/binance-wallet/fhbohimaelbohpjbbldcngcnapndodjp

Interface

export type TConnect = (connectingWalletType: string, options?: IConnectionOptions) => void
export type TDisconnect = (clearDerivationPath?: boolean) => void

export interface IConnectionOptions {
  rpcUrl?: string
  networkId?: number
  derivationPath?: string
  blockchainType?: BLOCKCHAIN_TYPE
  connectionType?: TWalletType
  onConnectStart?: () => void
  savePath?: boolean
  removeLSKey?: boolean,
  showModalOnError?: boolean,
  showToast?: (msg: string, duration?: number) => any
  connectWallet?: TConnect
  disconnectWallet?: TDisconnect
  internal?: boolean
}

export interface IConnectionResult {
  provider: any
  providerName?: string
}

export interface IConnector {
  type: TWalletType,
  blockchainType: BLOCKCHAIN_TYPE
  mobile: boolean
  enabled: () => boolean;
  connector: (opts: IConnectionOptions) => Promise<IConnectionResult>

  disconnector?: () => Promise<void>

  getAccount: (provider: AbstractProvider | IBinanceProvider | ICardanoProvider) => Promise<string | undefined>
  getBalance: (provider: AbstractProvider | IBinanceProvider | ICardanoProvider, address: string) => Promise<string | undefined>
  getHWAccounts?: (opts: IGetHWAccounts) => Promise<string[]>
  showToast?: (msg: string, duration?: number) => void
  localStorageKey?: string
  connectWallet?: TConnect
  disconnectWallet?: TDisconnect
  unsubscribeEvents?: () => void
}

Dependents (1)

Package Sidebar

Install

npm i @dcentralab/wc-binance

Weekly Downloads

27

Version

2.0.32

License

ISC

Unpacked Size

16.4 kB

Total Files

11

Last publish

Collaborators

  • aydnep
  • eitanlavi