@abstractswap/v4-sdk
Version:
⚒️ An SDK for building applications on top of Uniswap V4
54 lines (53 loc) • 1.58 kB
TypeScript
import { BigNumber } from 'ethers';
import { Currency, Percent, TradeType } from '@abstractswap/sdk-core';
import { Trade } from '../entities/trade';
/**
* Actions
* @description Constants that define what action to perform
* @enum {number}
*/
export declare enum Actions {
INCREASE_LIQUIDITY = 0,
DECREASE_LIQUIDITY = 1,
MINT_POSITION = 2,
BURN_POSITION = 3,
SWAP_EXACT_IN_SINGLE = 4,
SWAP_EXACT_IN = 5,
SWAP_EXACT_OUT_SINGLE = 6,
SWAP_EXACT_OUT = 7,
SETTLE = 9,
SETTLE_ALL = 16,
SETTLE_PAIR = 17,
TAKE = 18,
TAKE_ALL = 19,
TAKE_PORTION = 20,
TAKE_PAIR = 21,
SETTLE_TAKE_PAIR = 22,
CLOSE_CURRENCY = 23,
SWEEP = 25
}
export declare enum Subparser {
V4SwapExactInSingle = 0,
V4SwapExactIn = 1,
V4SwapExactOutSingle = 2,
V4SwapExactOut = 3,
PoolKey = 4
}
export declare type ParamType = {
readonly name: string;
readonly type: string;
readonly subparser?: Subparser;
};
export declare const V4_BASE_ACTIONS_ABI_DEFINITION: {
[key in Actions]: readonly ParamType[];
};
export declare class V4Planner {
actions: string;
params: string[];
constructor();
addAction(type: Actions, parameters: any[]): V4Planner;
addTrade(trade: Trade<Currency, Currency, TradeType>, slippageTolerance?: Percent): V4Planner;
addSettle(currency: Currency, payerIsUser: boolean, amount?: BigNumber): V4Planner;
addTake(currency: Currency, recipient: string, amount?: BigNumber): V4Planner;
finalize(): string;
}