UNPKG

@q-dev/qdex-js-sdk

Version:

Typescript Library to interact with Q DEX Contracts

41 lines 1.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEXFactoryInstance = void 0; const DEXContractInstance_1 = require("../DEXContractInstance"); /** * Factory instance to interact with UniswapV2Factory contract. * See [onchain documentation]((@q-dex-repo/@network/UniswapV2Factory) for more details. * An instance of this class for a deployed network can be obtained via {@link ContractRegistryInstance.dexFactory} */ class DEXFactoryInstance extends DEXContractInstance_1.DEXContractInstance { constructor(web3, address) { super(web3, 'DEX_Factory.json', address); } /** * [External documentation](@q-dex-repo/@network/UniswapV2Factory/#allpairslength) */ async allPairsLength() { return await this.instance.methods.allPairsLength().call(); } /** * [External documentation](@q-dex-repo/@network/UniswapV2Factory/#inithash) */ async initHash() { return await this.instance.methods.initHash().call(); } /** * [External documentation](@q-dex-repo/@network/UniswapV2Factory/#checkforflatfee) */ async checkForFlatFee(pair) { return await this.instance.methods.checkForFlatFee(pair).call(); } /** * [External documentation](@q-dex-repo/@network/UniswapV2Factory/#createpair) */ async createPair(tokenA, tokenB) { return await this.instance.methods.createPair(tokenA, tokenB).call(); } } exports.DEXFactoryInstance = DEXFactoryInstance; DEXFactoryInstance.registryKey = 'governance.intApp.QDEX.factory'; //# sourceMappingURL=DEXFactoryInstance.js.map