import { Connector } from '../types' ; import { ConnectionRejectedError } from '../errors' ; export default async function init ( ) { const { BscConnector , UserRejectedRequestError } = await import ( '@binance-chain/bsc-connector' ) ; return { web3ReactConnector ( { chainId } ) { return new BscConnector ( { supportedChainIds : [ chainId ] } ) ; } , handleActivationError ( err ) { if ( err instanceof UserRejectedRequestError ) { return new ConnectionRejectedError ( ) ; } return null ; } } ; }