KyberSwap Docs
Search
K

NonfungiblePositionManager

Handles the encoding of calldata for various position NFT operations.

Properties

Public

Property
Type
Modifier
Description
INTERFACE
Interface
static
The Application Binary Interface for the related Elastic contracts.

Constructor

Private constructor that cannot be constructed.

Methods

encodeCreate() - private static

Handles the encoding of calldata to create a new position if the pool does not exist. Additionally, unlocks/initializes a created pool to enable pool interactions.

Parameters

Params
Type
Description
pool
Pool
The pool to create and initialize.

Returns

Type
Description
string
The address of the pool that has been created/initialized. Formatted as a DataHexString.

createCallParameters() - public static

Add 0 hex value parameter to the encodeCreate() function.

Parameters

Params
Type
Description
pool
Pool
The pool to create and initialize.

Returns

Type
Description
An object containing: calldata: string = The hex encoded calldata to perform the given operation. value: string = The amount of ether (wei) to send in hex.

createCallParametersTest() - public static

Add ETH hex value parameter to the encodeCreate() function.

Parameters

Params
Type
Description
pool
Pool
The pool to create and initialize.
ethAmount
JSBI
The ETH amount (in wei) to be added to the value paramter.

Returns

Type
Description
An object containing: calldata: string = The hex encoded calldata to perform the given operation. value: string = The amount of ether (wei) to send in hex.

addCallParameters() - public static

Handles the encoding of calldata to mint a new position or add liquidity to an existing position.

Parameters

Params
Type
Description
position
The position(s) to create or add liquidity to.
ticks
number[] | number[][]
The previous ticks where liquidity was added to a position.
options
AddLiquidityOptions
The type of liquidity addition operation: MintOptions = Create a new position. IncreaseOptions = Add liquidity to existing position.

Returns

Type
Description
An object containing: calldata: string = The hex encoded calldata to perform the add liquidity operations. value: string = The amount of ether (wei) to send in hex.

encodeCollect() - private static

Handles the encoding of calldata to collect fees accrued to the position.

Parameters

Params
Type
Description
options
An object consisting of fee collection data: tokenId:BigintIsh = The position ID from which to collect fees. expectedCurrencyOwed0:CurrencyAmount<Currency> = Estimated token0 fees owed to the position owner. Includes liquidity value to be burned. expectedCurrencyOwed1:CurrencyAmount<Currency> = Estimated token1 fees owed to the position owner. Includes liquidity value to be burned. recipient: string = Account to receive the fee tokens. deadline:BigintIsh = Time after which the fee collection transaction will fail. isRemovingLiquid: boolean = true -> Liquidity is being removed together with the fee collection; false -> Only the fees are being collected. Optional. havingFee: boolean = true -> Position has accrued fees iwhich have been reinvested; false -> Position has yet to accrue any fees. Optional. isPositionClosed: boolean = true -> Position has been closed; false -> Position is still active. Optional. legacyMode: boolean = true -> Position supports syncFeeGrowth; false -> Position does not support syncFeeGrowth. Optional.

Returns

Type
Description
string[]
The hex encoded calldata to perform the collect fee operations.

collectCallParameters() - public static

Add 0 hex value parameter to the encodeCollect() function.

Parameters

Params
Type
Description
options
See encodeCollect() parameters.

Returns

Type
Description
An object containing: calldata: string = The hex encoded calldata to perform the given operation. value: string = The amount of ether (wei) to send in hex.

removeCallParameters() - public static

Handles the encoding of calldata to remove a position's liquidity.

Parameters

Params
Type
Description
options
An object consisting of NFT transfer data: sender: string = The account sending the NFT. recipient: string = The account receiving the NFT. tokenId:BigintIsh = The position ID of the NFT being sent. data: string = The optional parameter that passes data to the onERC721Received call for the staker

Returns

Type
Description
An object containing: calldata: string = The hex encoded calldata to perform the given operation. value: string = The amount of ether (wei) to send in hex.

safeTransferFromParameters() - public static

Handles the encoding of calldata to transfer the position NFT from one address to another.

Parameters

Params
Type
Description
position
Position
options
An object consisting of liquidity removal data: tokenId:BigintIsh = The position ID form which to remove liquidity. liquidityPercentage:Percent = The % of the position's liquidity to remove. slippageTolerance:Percent = The % amount that the pool price price is allowed to move before the transaction will revert. deadline:BigintIsh = Time after which the fee collection transaction will fail, in epoch seconds. burnToken: boolean = true -> Position NFT is burned as entire position's liquidity is removed; false -> Position NFT is not burned as liquidiyt is only partially removed. Optional. permit:NFTPermitOptions = The permit options for transacting with the NFT in the case that the address sending the removal transaction is not the NFT owner. Optional. collectOptions: Omit<CollectOption, 'tokenId'> = The collection parameters to be passed onto the collect fees function.

Returns

Type
Description
An object containing: calldata: string = The hex encoded calldata to perform the given operation. value: string = The amount of ether (wei) to send in hex.