Methods
# add(params) → {Promise.<uint256>}
Add/enable new pool, only owner mode
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
token |
address
|
Token address as IERC20 |
allocPoint |
uint256
|
Pool allocation point/share distributed to this pool from mining rewards |
pid added token pool index
Promise.<uint256>
# addPauser(params) → {Promise.<void>}
Add pauser role to given address.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
account |
address
|
Address to assign pauser role to. |
Promise.<void>
# async balanceOf(params) → {Promise.<uint256>}
Returns the available funds for the given stream id and address. Throws if the id does not point to a valid stream.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
streamId |
uint256
|
The id of the stream for which to query the balance. |
who |
address
|
The address for which to query the balance. |
balance The total funds allocated to who
as uint256.
Promise.<uint256>
# async blockNumberAndTimestamp() → {Promise.<uint256, uint256>}
Get block number and timestamp
Promise.<uint256, uint256>
# async burn(params) → {Promise.<UniswapV3Pool~burn>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tickLower |
int24
|
|
tickUpper |
int24
|
|
amount |
uint128
|
Promise.<UniswapV3Pool~burn>
# cancelStream(params) → {Promise.<bool>}
Cancels the stream and transfers the tokens back on a pro rata basis. Throws if the id does not point to a valid stream. Throws if the caller is not the sender or the recipient of the stream. Throws if there is a token transfer failure.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
streamId |
uint256
|
The id of the stream to cancel. |
True if success, otherwise false.
Promise.<bool>
# async collect(params) → {Promise.<UniswapV3Pool~collect>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
recipient |
address
|
|
tickLower |
int24
|
|
tickUpper |
int24
|
|
amount0Requested |
uint128
|
|
amount1Requested |
uint128
|
Promise.<UniswapV3Pool~collect>
# async collectProtocol(params) → {Promise.<UniswapV3Pool~collectProtocol>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
recipient |
address
|
|
amount0Requested |
uint128
|
|
amount1Requested |
uint128
|
Promise.<UniswapV3Pool~collectProtocol>
# collectRewards(params) → {Promise.<uint256>}
User collects his share of LP tokens reward
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
LP reward tokens amount sent to user address
Promise.<uint256>
# async collectRewardsCall(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Promise.<uint256>
# async createCompoundingStream(params) → {Promise.<uint256>}
Creates a new compounding stream funded by msg.sender
and paid towards recipient
.
Inherits all security checks from createStream
.
Throws if the cToken is not whitelisted.
Throws if the sender share percentage and the recipient share percentage do not sum up to 100.
Throws if the the sender share mantissa calculation has a math error.
Throws if the the recipient share mantissa calculation has a math error.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
recipient |
address
|
The address towards which the money is streamed. |
deposit |
uint256
|
The amount of money to be streamed. |
tokenAddress |
address
|
The ERC20 token to use as streaming currency. |
startTime |
uint256
|
The unix timestamp for when the stream starts. |
stopTime |
uint256
|
The unix timestamp for when the stream stops. |
senderSharePercentage |
uint256
|
The sender's share of the interest, as a percentage. |
recipientSharePercentage |
uint256
|
The recipient's share of the interest, as a percentage. |
The uint256 id of the newly created compounding stream.
Promise.<uint256>
# createPool(params) → {Promise.<address>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tokenA |
address
|
|
tokenB |
address
|
|
fee |
uint24
|
pool
Promise.<address>
# async createStream(params) → {Promise.<uint256>}
Creates a new stream funded by msg.sender
and paid towards recipient
.
Throws if paused.
Throws if the recipient is the zero address, the contract itself or the caller.
Throws if the deposit is 0.
Throws if the start time is before block.timestamp
.
Throws if the stop time is before the start time.
Throws if the duration calculation has a math error.
Throws if the deposit is smaller than the duration.
Throws if the deposit is not a multiple of the duration.
Throws if the rate calculation has a math error.
Throws if the next stream id calculation has a math error.
Throws if the contract is not allowed to transfer enough tokens.
Throws if there is a token transfer failure.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
recipient |
address
|
The address towards which the money is streamed. |
deposit |
uint256
|
The amount of money to be streamed. |
tokenAddress |
address
|
The ERC20 token to use as streaming currency. |
startTime |
uint256
|
The unix timestamp for when the stream starts. |
stopTime |
uint256
|
The unix timestamp for when the stream stops. |
The uint256 id of the newly created stream.
Promise.<uint256>
# async currentStake(params) → {Promise.<uint256>}
Current total user stake in a given pool
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
user |
address
|
The user address |
stake tokens amount
Promise.<uint256>
# async decimals(tokenAddress) → {Promise.<uint8>}
Get token decimals given token address
Parameters:
Name | Type | Description |
---|---|---|
tokenAddress |
address
|
Promise.<uint8>
# deltaOf(params) → {Promise.<uint256>}
Returns either the delta in seconds between block.timestamp
and startTime
or
between stopTime
and startTime, whichever is smaller. If
block.timestampis before
startTime`, it returns 0.
Throws if the id does not point to a valid stream.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
streamId |
uint256
|
The id of the stream for which to query the delta. |
delta The time delta in seconds.
Promise.<uint256>
# async earnings(params) → {Promise.<uint256>}
Percentage of how much a user has earned so far from the other users exit, would be just a statistic
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
user |
address
|
The user address |
earnings percent as integer
Promise.<uint256>
# enableFeeAmount(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
fee |
uint24
|
|
tickSpacing |
int24
|
Promise.<void>
# exactInput(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tuple |
tuple
|
amountOut
Promise.<uint256>
# exactInputSingle(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tuple |
tuple
|
amountOut
Promise.<uint256>
# exactOutput(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tuple |
tuple
|
amountIn
Promise.<uint256>
# exactOutputSingle(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tuple |
tuple
|
amountIn
Promise.<uint256>
# async exit(params) → {Promise.<uint256>}
User exit staking amount from main pool, require main pool only
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
amount |
uint256
|
The token amount user wants to exit/unstake from the pool. |
amountOutMinimum |
uint256
|
The min LP token amount expected to be received from exchange, needed from outside for security reasons, using zero value in production is discouraged. |
net tokens amount sent to user address
Promise.<uint256>
# exitLP(params) → {Promise.<uint256>}
User exit staking amount from LOOP pool, require LOOP pool only
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
amount |
uint256
|
The token amount user wants to exit/unstake from the pool. |
net tokens amount sent to user address
Promise.<uint256>
# async exitPenalty() → {Promise.<uint256>}
Promise.<uint256>
# async exitPenaltyLP() → {Promise.<uint256>}
Promise.<uint256>
# factory() → {Promise.<address>}
Promise.<address>
# feeAmountTickSpacing(params) → {Promise.<int24>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
fee |
uint24
|
Promise.<int24>
# feeGrowthGlobal0X128() → {Promise.<uint256>}
Promise.<uint256>
# feeGrowthGlobal1X128() → {Promise.<uint256>}
Promise.<uint256>
# flash(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
recipient |
address
|
|
amount0 |
uint256
|
|
amount1 |
uint256
|
|
data |
bytes
|
Promise.<void>
# async fromBNToDecimals(amount, pid) → {Promise.<number>}
Convert float number with decimals from UI to tokens amount integer for smart contract function.
Parameters:
Name | Type | Description |
---|---|---|
amount |
number
|
Tokens float amount to convert |
pid |
number
|
Pool id |
tokensAmount
Promise.<number>
# async fromDecimalsToBN(amount, pid) → {Promise.<number>}
Convert given tokens amount integer to float number with decimals for UI.
Parameters:
Name | Type | Description |
---|---|---|
amount |
number
|
Tokens amount to convert |
pid |
number
|
Pool id |
tokensAmount
Promise.<number>
# getBlockNumber() → {Promise.<uint256>}
Get current block number
current block number
Promise.<uint256>
# async getBlocksFromRange(params) → {Promise.<uint256>}
Get blocks range given two block numbers, usually computes blocks elapsed since last mining reward block.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
from |
uint256
|
block start |
to |
uint256
|
block end |
blocks count
Promise.<uint256>
# getBlockTimestamp() → {Promise.<uint256>}
Get current block timestamp
current block timestamp
Promise.<uint256>
# async getCompoundingStream(params) → {Promise.<Sablier~getCompoundingStream>}
Returns the compounding stream object with all its properties. Throws if the id does not point to a valid compounding stream.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
streamId |
uint256
|
The id of the compounding stream to query. |
The compounding stream object.
Promise.<Sablier~getCompoundingStream>
# async getCurrentEntryStakeUser(params) → {Promise.<uint256>}
Get 'entry stake adjusted' for a given user address in a pool id
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
user |
address
|
User address |
user entry stake adjusted amount in given pool
Promise.<uint256>
# async getEarnings(params) → {Promise.<uint256>}
Returns the amount of interest that has been accrued for the given token address.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tokenAddress |
address
|
The address of the token to get the earnings for. |
The amount of interest as uint256.
Promise.<uint256>
# async getEntryStakeAdjusted(params) → {Promise.<uint256>}
Get 'entry stake adjusted' for a given user address in a pool id
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
user |
address
|
User address |
user entry stake adjusted amount in given pool
Promise.<uint256>
# getFunctionSelector() → {Promise.<bytes4>}
Get function selector from function signature NOTE: function selector is first 4 bytes of keccak256 for bytes of string of a function signature
Promise.<bytes4>
# async getGasCostOfGetSqrtRatioAtTick(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tick |
int24
|
Promise.<uint256>
# async getGasCostOfGetTickAtSqrtRatio(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
sqrtPriceX96 |
uint160
|
Promise.<uint256>
# async getPool(params) → {Promise.<Loophole~PoolInfo>}
Get pool attributes
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
Promise.<Loophole~PoolInfo>
# getPoolInfo(params) → {Promise.<Loophole~PoolInfo>}
Get pool attributes, raw with no conversion.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Promise.<Loophole~PoolInfo>
# async getPoolReward(params) → {Promise.<uint256>}
Get LP tokens reward for given pool id, only MAIN pool, LOOP pool reward will always be zero
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
tokensReward Tokens amount as reward based on last mining block
Promise.<uint256>
# async getPoolTokenDecimals(params) → {Promise.<uint256>}
Get pool token decimals given pool id
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
poolTokenDecimals
Promise.<uint256>
# async getSqrtRatioAtTick(params) → {Promise.<uint160>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tick |
int24
|
Promise.<uint160>
# async getStream(params) → {Promise.<Sablier~getStream>}
Returns the compounding stream with all its properties. Throws if the id does not point to a valid stream.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
streamId |
uint256
|
The id of the stream to query. |
The stream object.
Promise.<Sablier~getStream>
# async getTickAtSqrtRatio(params) → {Promise.<int24>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
sqrtPriceX96 |
uint160
|
Promise.<int24>
# getTokenDecimalsFromStream(streamId)
Get token decimals given a stream id. This is an utility function for DApp layer when converting to float numbers.
Parameters:
Name | Type | Description |
---|---|---|
streamId |
The id of the stream. |
# async getTotalEntryStakeUser(params) → {Promise.<uint256>}
Get total accumulated 'entry stake' so far for a given user address in a pool id
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
user |
address
|
User address |
user entry stake amount in a given pool
Promise.<uint256>
# async getTotalUnstakeUser(params) → {Promise.<uint256>}
Get total accumulated 'unstake' so far for a given user address in a pool id
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
user |
address
|
User address |
user unstake amount in a given pool
Promise.<uint256>
# async getUserInfo(params) → {Promise.<Loophole~UserInfo>}
Get pool attributes as struct
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
user |
address
|
User address |
Promise.<Loophole~UserInfo>
# async getUserReward(params) → {Promise.<uint256>}
View pending LP token rewards for user
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id of main pool |
user |
address
|
User address to check pending rewards for |
Pending LP token rewards for user
Promise.<uint256>
# increaseObservationCardinalityNext(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
observationCardinalityNext |
uint16
|
Promise.<void>
# initialize(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
sqrtPriceX96 |
uint160
|
Promise.<void>
# async interestOf(params) → {Promise.<Sablier~interestOf>}
Computes the interest accrued while the money has been streamed. Returns (0, 0, 0) if the stream is either not a compounding stream or it does not exist. Throws if there is a math error. We do not assert the calculations which involve the current exchange rate, because we can't know what value we'll get back from the cToken contract.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
streamId |
uint256
|
The id of the compounding stream for which to calculate the interest. |
amount |
uint256
|
The amount of money with respect to which to calculate the interest. |
The interest accrued by the sender, the recipient and sablier, respectively, as uint256s.
Promise.<Sablier~interestOf>
# isCompoundingStream(params) → {Promise.<bool>}
Checks if the provided id points to a valid compounding stream.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
streamId |
uint256
|
The id of the compounding stream to check. |
True if it is a compounding stream, otherwise false.
Promise.<bool>
# isLoopPoolId(pid) → {Boolean}
Returns true if given pis is a LOOP pool id, false otherwise.
Parameters:
Name | Type | Description |
---|---|---|
pid |
uint256
|
Pool id |
Boolean
# isPauser(params) → {Promise.<bool>}
Check if the given address has pauser role.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
account |
address
|
Address to check. |
Promise.<bool>
# liquidity() → {Promise.<uint128>}
Promise.<uint128>
# async lpToken() → {Promise.<address>}
Promise.<address>
# LPTokenContract()
LPTokenContract|undefined
# async lpTokensPerBlock() → {Promise.<uint256>}
Promise.<uint256>
# async MAX_SQRT_RATIO() → {Promise.<uint160>}
Promise.<uint160>
# maxLiquidityPerTick() → {Promise.<uint128>}
Promise.<uint128>
# async MIN_SQRT_RATIO() → {Promise.<uint160>}
Promise.<uint160>
# async mint(params) → {Promise.<UniswapV3Pool~mint>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
recipient |
address
|
|
tickLower |
int24
|
|
tickUpper |
int24
|
|
amount |
uint128
|
|
data |
bytes
|
Promise.<UniswapV3Pool~mint>
# multicall(data) → {Promise.<Array.<bytes>>}
Parameters:
Name | Type | Description |
---|---|---|
data |
Array.<bytes>
|
results
Promise.<Array.<bytes>>
# name(tokenAddress) → {Promise.<string>}
Get token name given token address
Parameters:
Name | Type | Description |
---|---|---|
tokenAddress |
address
|
Promise.<string>
# observe(params) → {Promise.<UniswapV3Pool~observe>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
secondsAgos |
Array.<uint32>
|
Promise.<UniswapV3Pool~observe>
# owner() → {Promise.<address>}
Promise.<address>
# async parameters() → {Promise.<UniswapV3Factory~parameters>}
Promise.<UniswapV3Factory~parameters>
# poolExists(address) → {Promise.<bool>}
Parameters:
Name | Type | Description |
---|---|---|
address |
address
|
Promise.<bool>
# poolFee() → {Promise.<uint24>}
Promise.<uint24>
# async protocolFees() → {Promise.<UniswapV3Pool~protocolFees>}
Promise.<UniswapV3Pool~protocolFees>
# selfPermit(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
token |
address
|
|
value |
uint256
|
|
deadline |
uint256
|
|
v |
uint8
|
|
r |
bytes32
|
|
s |
bytes32
|
Promise.<void>
# selfPermitAllowed(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
token |
address
|
|
nonce |
uint256
|
|
expiry |
uint256
|
|
v |
uint8
|
|
r |
bytes32
|
|
s |
bytes32
|
Promise.<void>
# selfPermitAllowedIfNecessary(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
token |
address
|
|
nonce |
uint256
|
|
expiry |
uint256
|
|
v |
uint8
|
|
r |
bytes32
|
|
s |
bytes32
|
Promise.<void>
# selfPermitIfNecessary(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
token |
address
|
|
value |
uint256
|
|
deadline |
uint256
|
|
v |
uint8
|
|
r |
bytes32
|
|
s |
bytes32
|
Promise.<void>
# set(params) → {Promise.<void>}
Update pool allocation point/share
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
allocPoint |
uint256
|
Set allocation point/share for pool id |
withUpdate |
bool
|
Update all pools and distribute mining reward for all |
Promise.<void>
# setFeeProtocol(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
feeProtocol0 |
uint8
|
|
feeProtocol1 |
uint8
|
Promise.<void>
# setOwner(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
owner |
address
|
Promise.<void>
# async slot0() → {Promise.<UniswapV3Pool~slot0>}
Promise.<UniswapV3Pool~slot0>
# async snapshotCumulativesInside(params) → {Promise.<UniswapV3Pool~snapshotCumulativesInside>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tickLower |
int24
|
|
tickUpper |
int24
|
Promise.<UniswapV3Pool~snapshotCumulativesInside>
# async stake(params) → {Promise.<void>}
Stake tokens on given pool id
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
amount |
uint256
|
The token amount user wants to stake to the pool. |
Promise.<void>
# startBlock() → {Promise.<uint256>}
Promise.<uint256>
# async swap(params) → {Promise.<UniswapV3Pool~swap>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
recipient |
address
|
|
zeroForOne |
bool
|
|
amountSpecified |
int256
|
|
sqrtPriceLimitX96 |
uint160
|
|
data |
bytes
|
Promise.<UniswapV3Pool~swap>
# swap0ForExact1(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pool |
address
|
|
amount1Out |
uint256
|
|
recipient |
address
|
|
sqrtPriceLimitX96 |
uint160
|
Promise.<void>
# swap1ForExact0(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pool |
address
|
|
amount0Out |
uint256
|
|
recipient |
address
|
|
sqrtPriceLimitX96 |
uint160
|
Promise.<void>
# swapExact0For1(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pool |
address
|
|
amount0In |
uint256
|
|
recipient |
address
|
|
sqrtPriceLimitX96 |
uint160
|
Promise.<void>
# swapExact1For0(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pool |
address
|
|
amount1In |
uint256
|
|
recipient |
address
|
|
sqrtPriceLimitX96 |
uint160
|
Promise.<void>
# swapExactInputSingleEx(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tokenIn |
address
|
|
tokenOut |
address
|
|
poolFee |
uint24
|
|
amountIn |
uint256
|
|
amountOutMinimum |
uint256
|
amountOut
Promise.<uint256>
# swapExactOutputSingleEx(params) → {Promise.<uint256>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tokenIn |
address
|
|
tokenOut |
address
|
|
poolFee |
uint24
|
|
amountOut |
uint256
|
|
amountInMaximum |
uint256
|
amountIn
Promise.<uint256>
# async swapRouter() → {Promise.<address>}
Promise.<address>
# swapToHigherSqrtPrice(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pool |
address
|
|
sqrtPriceX96 |
uint160
|
|
recipient |
address
|
Promise.<void>
# swapToLowerSqrtPrice(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pool |
address
|
|
sqrtPriceX96 |
uint160
|
|
recipient |
address
|
Promise.<void>
# sweepToken(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
token |
address
|
|
amountMinimum |
uint256
|
|
recipient |
address
|
Promise.<void>
# sweepTokenWithFee(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
token |
address
|
|
amountMinimum |
uint256
|
|
recipient |
address
|
|
feeBips |
uint256
|
|
feeRecipient |
address
|
Promise.<void>
# symbol(tokenAddress) → {Promise.<string>}
Get token symbol given token address
Parameters:
Name | Type | Description |
---|---|---|
tokenAddress |
address
|
Promise.<string>
# async takeEarnings(params) → {Promise.<void>}
Withdraws the earnings for the given token address.
Throws if amount
exceeds the available balance.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tokenAddress |
address
|
The address of the token to withdraw earnings for. |
amount |
uint256
|
The amount of tokens to withdraw. |
Promise.<void>
# async ticks(i) → {Promise.<UniswapV3Pool~ticks>}
Parameters:
Name | Type | Description |
---|---|---|
i |
int24
|
Promise.<UniswapV3Pool~ticks>
# tickSpacing() → {Promise.<int24>}
Promise.<int24>
# token0() → {Promise.<address>}
Promise.<address>
# token1() → {Promise.<address>}
Promise.<address>
# totalAllocPoint() → {Promise.<uint256>}
Promise.<uint256>
# unwrapWETH9(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
amountMinimum |
uint256
|
|
recipient |
address
|
Promise.<void>
# unwrapWETH9WithFee(params) → {Promise.<void>}
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
amountMinimum |
uint256
|
|
recipient |
address
|
|
feeBips |
uint256
|
|
feeRecipient |
address
|
Promise.<void>
# updateFee(params) → {Promise.<void>}
Updates the Sablier fee. Throws if the caller is not the owner of the contract.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
feePercentage |
uint256
|
The new fee as a percentage, for example 75 means 75%. |
Promise.<void>
# updatePool(params) → {Promise.<void>}
Update pool to trigger LP tokens reward since last reward mining block
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
Promise.<void>
# async updatePoolCall(params) → {Promise.<uint256>|Promise.<uint256>|Promise.<uint256>}
Update pool to trigger LP tokens reward since last reward mining block, function call for results and no transaction
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
pid |
uint256
|
Pool id |
blocksElapsed Blocks elapsed since last reward block
Promise.<uint256>
lpTokensReward Amount of LP tokens reward since last reward block
Promise.<uint256>
accLPtokensPerShare Pool accumulated LP tokens per pool token (per share)
Promise.<uint256>
# async withdrawFromStream(params) → {Promise.<bool>}
Withdraws from the contract to the recipient's account. Throws if the id does not point to a valid stream. Throws if the caller is not the sender or the recipient of the stream. Throws if the amount exceeds the available balance. Throws if there is a token transfer failure.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
streamId |
uint256
|
The id of the stream to withdraw tokens from. |
amount |
uint256
|
The amount of tokens to withdraw. |
True if success, otherwise false.
Promise.<bool>