Skip to main content

Overview

Enumerations​

Classes​

Interfaces​

Type Aliases​

AddLiquidityOptions​

AddLiquidityOptions: MintOptions | IncreaseLiquidityOptions

Defined in: PositionManager.ts:187


CollectOptions​

CollectOptions: CommonOptions & CollectSpecificOptions

Defined in: PositionManager.ts:191


HookPermissions​

HookPermissions: { [key in HookOptions]: boolean }

Defined in: utils/hook.ts:4


IncreaseLiquidityOptions​

IncreaseLiquidityOptions: CommonOptions & CommonAddLiquidityOptions & ModifyPositionSpecificOptions

Defined in: PositionManager.ts:185


MintOptions​

MintOptions: CommonOptions & CommonAddLiquidityOptions & MintSpecificOptions

Defined in: PositionManager.ts:184


Param​

Param: object

Defined in: utils/v4BaseActionsParser.ts:6

Type declaration​

name​

readonly name: string

value​

readonly value: any


ParamType​

ParamType: object

Defined in: utils/v4Planner.ts:60

Type declaration​

name​

readonly name: string

subparser?​

readonly optional subparser: Subparser

type​

readonly type: string


PathKey​

PathKey: object

Defined in: utils/encodeRouteToPath.ts:5

Type declaration​

fee​

fee: number

hookData​

hookData: string

hooks​

hooks: string

intermediateCurrency​

intermediateCurrency: string

tickSpacing​

tickSpacing: number


PoolKey​

PoolKey: object

Defined in: entities/pool.ts:22

Type declaration​

currency0​

currency0: string

currency1​

currency1: string

fee​

fee: number

hooks​

hooks: string

tickSpacing​

tickSpacing: number


RemoveLiquidityOptions​

RemoveLiquidityOptions: CommonOptions & RemoveLiquiditySpecificOptions & ModifyPositionSpecificOptions

Defined in: PositionManager.ts:189


SwapExactIn​

SwapExactIn: object

Defined in: utils/v4BaseActionsParser.ts:29

Type declaration​

amountIn​

readonly amountIn: string

amountOutMinimum​

readonly amountOutMinimum: string

currencyIn​

readonly currencyIn: string

path​

readonly path: readonly PathKey[]


SwapExactInSingle​

SwapExactInSingle: object

Defined in: utils/v4BaseActionsParser.ts:21

Type declaration​

amountIn​

readonly amountIn: string

amountOutMinimum​

readonly amountOutMinimum: string

hookData​

readonly hookData: string

poolKey​

readonly poolKey: PoolKey

zeroForOne​

readonly zeroForOne: boolean


SwapExactOut​

SwapExactOut: object

Defined in: utils/v4BaseActionsParser.ts:44

Type declaration​

amountInMaximum​

readonly amountInMaximum: string

amountOut​

readonly amountOut: string

currencyOut​

readonly currencyOut: string

path​

readonly path: readonly PathKey[]


SwapExactOutSingle​

SwapExactOutSingle: object

Defined in: utils/v4BaseActionsParser.ts:36

Type declaration​

amountInMaximum​

readonly amountInMaximum: string

amountOut​

readonly amountOut: string

hookData​

readonly hookData: string

poolKey​

readonly poolKey: PoolKey

zeroForOne​

readonly zeroForOne: boolean


V4RouterAction​

V4RouterAction: object

Defined in: utils/v4BaseActionsParser.ts:11

Type declaration​

actionName​

readonly actionName: string

actionType​

readonly actionType: Actions

params​

readonly params: readonly Param[]


V4RouterCall​

V4RouterCall: object

Defined in: utils/v4BaseActionsParser.ts:17

Type declaration​

actions​

readonly actions: readonly V4RouterAction[]

Variables​

DYNAMIC_FEE_FLAG​

const DYNAMIC_FEE_FLAG: 8388608 = 0x800000

Defined in: entities/pool.ts:19


hookFlagIndex​

const hookFlagIndex: object

Defined in: utils/hook.ts:23

Type declaration​

afterAddLiquidity​

afterAddLiquidity: number = 10

afterAddLiquidityReturnsDelta​

afterAddLiquidityReturnsDelta: number = 1

afterDonate​

afterDonate: number = 4

afterInitialize​

afterInitialize: number = 12

afterRemoveLiquidity​

afterRemoveLiquidity: number = 8

afterRemoveLiquidityReturnsDelta​

afterRemoveLiquidityReturnsDelta: number = 0

afterSwap​

afterSwap: number = 6

afterSwapReturnsDelta​

afterSwapReturnsDelta: number = 2

beforeAddLiquidity​

beforeAddLiquidity: number = 11

beforeDonate​

beforeDonate: number = 5

beforeInitialize​

beforeInitialize: number = 13

beforeRemoveLiquidity​

beforeRemoveLiquidity: number = 9

beforeSwap​

beforeSwap: number = 7

beforeSwapReturnsDelta​

beforeSwapReturnsDelta: number = 3


V4_BASE_ACTIONS_ABI_DEFINITION​

const V4_BASE_ACTIONS_ABI_DEFINITION: { [key in Actions]: readonly ParamType[] }

Defined in: utils/v4Planner.ts:82

Functions​

amountWithPathCurrency()​

amountWithPathCurrency(amount, pool): CurrencyAmount<Currency>

Defined in: utils/pathCurrency.ts:4

Parameters​

ParameterType
amountCurrencyAmount<Currency>
poolPool

Returns​

CurrencyAmount<Currency>


encodeRouteToPath()​

encodeRouteToPath(route, exactOutput?): PathKey[]

Defined in: utils/encodeRouteToPath.ts:13

Parameters​

ParameterType
routeRoute<Currency, Currency>
exactOutput?boolean

Returns​

PathKey[]


getPathCurrency()​

getPathCurrency(currency, pool): Currency

Defined in: utils/pathCurrency.ts:12

Parameters​

ParameterType
currencyCurrency
poolPool

Returns​

Currency


priceToClosestTick()​

priceToClosestTick(price): number

Defined in: utils/priceTickConversions.ts:35

Returns the first tick for which the given price is greater than or equal to the tick price

Parameters​

ParameterTypeDescription
pricePrice<Currency, Currency>for which to return the closest tick that represents a price less than or equal to the input price, i.e. the price of the returned tick is less than or equal to the input price

Returns​

number


sortsBefore()​

sortsBefore(currencyA, currencyB): boolean

Defined in: utils/sortsBefore.ts:3

Parameters​

ParameterType
currencyACurrency
currencyBCurrency

Returns​

boolean


tickToPrice()​

tickToPrice(baseCurrency, quoteCurrency, tick): Price<Currency, Currency>

Defined in: utils/priceTickConversions.ts:20

Returns a price object corresponding to the input tick and the base/quote token Inputs must be tokens because the address order is used to interpret the price represented by the tick

Parameters​

ParameterTypeDescription
baseCurrencyCurrency-
quoteCurrencyCurrency-
ticknumberthe tick for which to return the price

Returns​

Price<Currency, Currency>


toAddress()​

toAddress(currency): string

Defined in: utils/currencyMap.ts:7

Parameters​

ParameterType
currencyCurrency

Returns​

string


toHex()​

toHex(bigintIsh): string

Defined in: utils/calldata.ts:23

Converts a big int to a hex string

Parameters​

ParameterTypeDescription
bigintIshBigintIsh

Returns​

string

The hex encoded calldata


tradeComparator()​

tradeComparator<TInput, TOutput, TTradeType>(a, b): number

Defined in: entities/trade.ts:17

Trades comparator, an extension of the input output comparator that also considers other dimensions of the trade in ranking them

Type Parameters​

Type ParameterDescription
TInput extends CurrencyThe input currency, either Ether or an ERC-20
TOutput extends CurrencyThe output currency, either Ether or an ERC-20
TTradeType extends TradeTypeThe trade type, either exact input or exact output

Parameters​

ParameterTypeDescription
aTrade<TInput, TOutput, TTradeType>The first trade to compare
bTrade<TInput, TOutput, TTradeType>The second trade to compare

Returns​

number

A sorted ordering for two neighboring elements in a trade array