import { TransactionRequest } from 'ethers'; import { PriceAndFees, FeesInfo, FixedPriceExchange, ReceiptOrEstimate, AbiItem } from '../@types/index.js'; import { SmartContractWithAddress } from './SmartContractWithAddress.js'; export declare class FixedRateExchange extends SmartContractWithAddress { getDefaultAbi(): AbiItem[]; /** * Creates unique exchange identifier. * @param {String} baseToken baseToken contract address * @param {String} datatoken Datatoken contract address * @return {Promise} exchangeId */ generateExchangeId(baseToken: string, datatoken: string): Promise; /** * Atomic swap * @param {String} exchangeId ExchangeId * @param {String} datatokenAmount Amount of datatokens * @param {String} maxBaseTokenAmount max amount of baseToken we want to pay for datatokenAmount * @param {String} consumeMarketAddress consumeMarketAddress * @param {String} consumeMarketFee consumeMarketFee in fraction * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ buyDatatokens(exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string, estimateGas?: G): Promise>; buyDatatokensTx(exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string): Promise; /** * Sell datatokenAmount while expecting at least minBaseTokenAmount * @param {String} exchangeId ExchangeId * @param {String} datatokenAmount Amount of datatokens * @param {String} minBaseTokenAmount min amount of baseToken we want to receive back * @param {String} consumeMarketAddress consumeMarketAddress * @param {String} consumeMarketFee consumeMarketFee in fraction * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ sellDatatokens(exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string, estimateGas?: G): Promise>; sellDatatokensTx(exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string): Promise; /** * Gets total number of exchanges * @return {Promise} no of available exchanges */ getNumberOfExchanges(): Promise; /** * Set new rate * @param {String} exchangeId Exchange ID * @param {String} newRate New rate * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ setRate(exchangeId: string, newRate: string, estimateGas?: G): Promise>; setRateTx(exchangeId: string, newRate: string): Promise; /** * Sets a new allowedSwapper * @param {String} exchangeId Exchange ID * @param {String} newAllowedSwapper The address of the new allowed swapper (set address zero if we want to remove allowed swapper) * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ setAllowedSwapper(exchangeId: string, newAllowedSwapper: string, estimateGas?: G): Promise>; setAllowedSwapperTx(exchangeId: string, newAllowedSwapper: string): Promise; /** * Activate an exchange * @param {String} exchangeId ExchangeId * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ activate(exchangeId: string, estimateGas?: G): Promise>; activateTx(exchangeId: string): Promise; /** * Deactivate an exchange * @param {String} exchangeId ExchangeId * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ deactivate(exchangeId: string, estimateGas?: G): Promise>; deactivateTx(exchangeId: string): Promise; /** * Get Exchange Rate * @param {String} exchangeId Exchange ID * @return {Promise} Rate (converted from wei) */ getRate(exchangeId: string): Promise; /** * Get Datatoken Supply in the exchange * @param {String} exchangeId Exchange Id * @return {Promise} dt supply formatted */ getDatatokenSupply(exchangeId: string): Promise; /** * Returns basetoken supply in the exchange * @param {String} exchangeId Exchange Id * @return {Promise} dt supply formatted */ getBasetokenSupply(exchangeId: string): Promise; /** * Get Allower Swapper (if set this is the only account which can use this exchange, else is set at address(0)) * @param {String} exchangeId Exchange Id * @return {Promise} address of allowed swapper */ getAllowedSwapper(exchangeId: string): Promise; /** * calcBaseInGivenDatatokensOut - Calculates how many base tokens are needed to get specified amount of datatokens * @param {String} exchangeId Exchange Id * @param {string} datatokenAmount Amount of datatokens user wants to buy * @param {String} consumeMarketFee consumeMarketFee in fraction * @return {Promise} how many base tokens are needed and fees */ calcBaseInGivenDatatokensOut(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise; /** * Returns amount in baseToken that user will receive for datatokenAmount sold * @param {String} exchangeId Exchange Id * @param {Number} datatokenAmount Amount of datatokens * @param {String} consumeMarketFee consumeMarketFee in fraction * @return {Promise} Amount of baseTokens user will receive */ getAmountBasetokensOut(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise; /** * Get exchange details * @param {String} exchangeId Exchange Id * @return {Promise} Exchange details */ getExchange(exchangeId: string): Promise; /** * Get fee details for an exchange * @param {String} exchangeId Exchange Id * @return {Promise} Exchange details */ getFeesInfo(exchangeId: string): Promise; /** * Returns all exchanges * @return {Promise} Exchanges list */ getExchanges(): Promise; /** * Check if an exchange is active * @param {String} exchangeId ExchangeId * @return {Promise} */ isActive(exchangeId: string): Promise; /** * Activate minting option for fixed rate contract * @param {String} exchangeId Exchang eId * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ activateMint(exchangeId: string, estimateGas?: G): Promise>; activateMintTx(exchangeId: string): Promise; /** * Deactivate minting for fixed rate * @param {String} exchangeId ExchangeId * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ deactivateMint(exchangeId: string, estimateGas?: G): Promise>; deactivateMintTx(exchangeId: string): Promise; /** * Collect BaseTokens in the contract (anyone can call this, funds are sent to Datatoken.paymentCollector) * @param {String} exchangeId Exchange Id * @param {String} amount amount to be collected * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ collectBasetokens(exchangeId: string, amount: string, estimateGas?: G): Promise>; collectBasetokensTx(exchangeId: string, amount: string): Promise; /** * Collect datatokens in the contract (anyone can call this, funds are sent to Datatoken.paymentCollector) * @param {String} exchangeId Exchange Id * @param {String} amount amount to be collected * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ collectDatatokens(exchangeId: string, amount: string, estimateGas?: G): Promise>; collectDatatokensTx(exchangeId: string, amount: string): Promise; /** * Collect market fee and send it to marketFeeCollector (anyone can call it) * @param {String} exchangeId Exchange Id * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ collectMarketFee(exchangeId: string, estimateGas?: G): Promise>; collectMarketFeeTx(exchangeId: string): Promise; /** * Collect ocean fee and send it to OPF collector (anyone can call it) * @param {String} exchangeId Exchange Id * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ collectOceanFee(exchangeId: string, estimateGas?: G): Promise>; collectOceanFeeTx(exchangeId: string): Promise; /** * Get OPF Collector of fixed rate contract * @return {String} */ getOPCCollector(): Promise; /** * Get Router address set in fixed rate contract * @return {String} */ getRouter(): Promise; /** * Get Exchange Owner given an exchangeId * @param {String} exchangeId Exchange Id * @return {String} return exchange owner */ getExchangeOwner(exchangeId: string): Promise; /** * Set new market fee, only market fee collector can update it * @param {String} exchangeId Exchange Id * @param {String} newMarketFee New market fee * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ updateMarketFee(exchangeId: string, newMarketFee: string, estimateGas?: G): Promise>; updateMarketFeeTx(exchangeId: string, newMarketFee: string): Promise; /** * Set new market fee collector, only market fee collector can update it * @param {String} exchangeId Exchange Id * @param {String} newMarketFeeCollector New market fee collector * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} transaction receipt */ updateMarketFeeCollector(exchangeId: string, newMarketFeeCollector: string, estimateGas?: G): Promise>; updateMarketFeeCollectorTx(exchangeId: string, newMarketFeeCollector: string): Promise; }