import { Address } from '@btc-vision/transaction'; import { CallResult } from '../../../../contracts/CallResult.js'; import { OPNetEvent } from '../../../../contracts/OPNetEvent.js'; import { IOP20Contract } from '../opnet/IOP20Contract.js'; export type Reserves = { readonly reserve0: bigint; readonly reserve1: bigint; readonly blockTimestampLast: bigint; }; // Events export type LiquidityRemovedEvent = { readonly sender: Address; readonly amount0: bigint; readonly amount1: bigint; readonly to: Address; }; export type LiquidityAddedEvent = { readonly sender: Address; readonly amount0: bigint; readonly amount1: bigint; }; export type SwappedEvent = { readonly sender: Address; readonly amount0In: bigint; readonly amount1In: bigint; readonly amount0Out: bigint; readonly amount1Out: bigint; readonly to: Address; }; /** * @description This interface represents a motoswap pool contract. * @interface IMotoswapPoolContract * @extends {Omit} * @cathegory Contracts */ export interface IMotoswapPoolContract extends Omit { /** * @description This method returns the token0 address. * @returns {Promise>} */ token0(): Promise>; /** * @description This method returns the token1 address. * @returns {Promise>} */ token1(): Promise>; /** * @description This method returns the reserves. * @returns {Promise>} */ getReserves(): Promise>; /** * @description This method swaps tokens. * @param {bigint} amount0Out * @param {bigint} amount1Out * @param {string} to * @param {Uint8Array} data * @returns {Promise} */ swap( amount0Out: bigint, amount1Out: bigint, to: string, data: Uint8Array, ): Promise]>>; /** * Skim */ skim(): Promise; /** * kLast */ kLast(): Promise>; /** * @description This method burns liquidity. * @param {Address} to * @returns {Promise} */ burn( to: Address, ): Promise< CallResult<{ amount0: bigint; amount1: bigint }, [OPNetEvent]> >; /** * Get block timestamp last */ blockTimestampLast(): Promise>; /** * @description This method syncs the pool. * @returns {Promise} */ sync(): Promise; /** * @description This method returns the price0 cumulative last. * @returns {bigint} * @returns {Promise} */ price0CumulativeLast(): Promise>; /** * @description This method returns the price1 cumulative last. * @returns {bigint} * @returns {Promise} */ price1CumulativeLast(): Promise>; MINIMUM_LIQUIDITY(): Promise>; mint( to: Address, ): Promise]>>; initialize(token0: Address, token1: Address): Promise; }