UNPKG

opnet

Version:

The perfect library for building Bitcoin-based applications.

64 lines (63 loc) 2.16 kB
import { Address } from '../../../../../node_modules/@btc-vision/transaction/build/index.js'; 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; }; 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; }; export interface IMotoswapPoolContract extends Omit<IOP20Contract, 'burn' | 'mint'> { token0(): Promise<CallResult<{ token0: Address; }>>; token1(): Promise<CallResult<{ token1: Address; }>>; getReserves(): Promise<CallResult<Reserves>>; swap(amount0Out: bigint, amount1Out: bigint, to: string, data: Uint8Array): Promise<CallResult<{}, [OPNetEvent<SwappedEvent>]>>; skim(): Promise<CallResult>; kLast(): Promise<CallResult<{ kLast: bigint; }>>; burn(to: Address): Promise<CallResult<{ amount0: bigint; amount1: bigint; }, [OPNetEvent<LiquidityRemovedEvent>]>>; blockTimestampLast(): Promise<CallResult<{ blockTimestampLast: bigint; }>>; sync(): Promise<CallResult>; price0CumulativeLast(): Promise<CallResult<{ price0CumulativeLast: bigint; }>>; price1CumulativeLast(): Promise<CallResult<{ price1CumulativeLast: bigint; }>>; MINIMUM_LIQUIDITY(): Promise<CallResult<{ MINIMUM_LIQUIDITY: bigint; }>>; mint(to: Address): Promise<CallResult<{ liquidity: bigint; }, [OPNetEvent<LiquidityAddedEvent>]>>; initialize(token0: Address, token1: Address): Promise<CallResult>; }