function HarmonyExtension(wallet, config) {
        if (config === void 0) { config = {
            chainId: utils.defaultConfig.Default.Chain_ID,
            chainType: utils.defaultConfig.Default.Chain_Type,
        }; }
        this.extensionType = null;
        this.wallet = wallet;
        // check if it is mathwallet or onewallet
        this.isExtension(this.wallet);
        if (wallet.messenger) {
            this.provider = wallet.messenger.provider;
            this.messenger = wallet.messenger;
        }
        else {
            this.provider = new network_1.Provider(config.chainUrl || wallet.network.chain_url).provider;
            this.messenger = new network_1.Messenger(this.provider, config.chainType, config.chainId);
        }
        this.wallet.messenger = this.messenger;
        this.blockchain = new blockchain_1.Blockchain(this.messenger);
        this.transactions = new transaction_1.TransactionFactory(this.messenger);
        this.contracts = new contract_1.ContractFactory(this.wallet);
        this.crypto = crypto;
        this.utils = utils;
    }
/**
     * Create an blockchain instance support wallet injection
     *
     * @param wallet could be MathWallet or OneWallet instance
     * @param config (optional), using default `Chain_Id` and `Chain_Type`
     *
     * @example
     * ```javascript
     * // Using Mathwallet instance
     * export const initEx = async() => {
     *   hmyEx = new HarmonyExtension(window.harmony);
     * }
     * // Using OneWallet instance
     * export const initEx = async() => {
     *   hmyEx = new HarmonyExtension(window.onewallet);
     * }
     * ```
     */
Create an blockchain instance support wallet injection
@param wallet could be MathWallet or OneWallet instance
@param config (optional), using default `Chain_Id` and `Chain_Type`


Create an blockchain instance support wallet injection @param wallet could be MathWallet or OneWallet instance @param config ( optional ) using default ` Chain_Id ` and ` Chain_Type `
function HarmonyExtension(wallet, config) {
        if (config === void 0) { config = {
            chainId: utils.defaultConfig.Default.Chain_ID,
            chainType: utils.defaultConfig.Default.Chain_Type,
        }; }
        this.extensionType = null;
        this.wallet = wallet;
        this.isExtension(this.wallet);
        if (wallet.messenger) {
            this.provider = wallet.messenger.provider;
            this.messenger = wallet.messenger;
        }
        else {
            this.provider = new network_1.Provider(config.chainUrl || wallet.network.chain_url).provider;
            this.messenger = new network_1.Messenger(this.provider, config.chainType, config.chainId);
        }
        this.wallet.messenger = this.messenger;
        this.blockchain = new blockchain_1.Blockchain(this.messenger);
        this.transactions = new transaction_1.TransactionFactory(this.messenger);
        this.contracts = new contract_1.ContractFactory(this.wallet);
        this.crypto = crypto;
        this.utils = utils;
    }
function HarmonyExtension ( wallet , config ) { if ( config === void 0 ) { config = { chainId : utils . defaultConfig . Default . Chain_ID , chainType : utils . defaultConfig . Default . Chain_Type , } ; } this . extensionType = null ; this . wallet = wallet ; this . isExtension ( this . wallet ) ; if ( wallet . messenger ) { this . provider = wallet . messenger . provider ; this . messenger = wallet . messenger ; } else { this . provider = new network_1 . Provider ( config . chainUrl || wallet . network . chain_url ) . provider ; this . messenger = new network_1 . Messenger ( this . provider , config . chainType , config . chainId ) ; } this . wallet . messenger = this . messenger ; this . blockchain = new blockchain_1 . Blockchain ( this . messenger ) ; this . transactions = new transaction_1 . TransactionFactory ( this . messenger ) ; this . contracts = new contract_1 . ContractFactory ( this . wallet ) ; this . crypto = crypto ; this . utils = utils ; }
Create an blockchain instance support wallet injection
 @param wallet could be MathWallet or OneWallet instance
 @param config (optional), using default `Chain_Id` and `Chain_Type`
Create an blockchain instance support wallet injection @param wallet could be MathWallet or OneWallet instance @param config ( optional ) using default ` Chain_Id ` and ` Chain_Type `
// check if it is mathwallet or onewallet