Retrieve positions
1. Retrieve all positions of one pool by ownerAddress
Method: sdk.Position.getPositionList()
Params:
accountAddress
: The user account address.assignPoolIDs
: An array of pool ID.showDisplay
: When some testnet rpc nodes can't return object's display data, you can set this option to false, avoid returning errors. Default set true.
Example
2. Retrieve all positions of one pool
Method: sdk.Pool.getPositionList()
Params:
positionHandle
: The position handle of pool.
Example
3. Retrieve one position
Method: sdk.Position.getPositionById()
Params
positionID
: The position object ID.calculateRewarder
: Whether to calculate the rewarder of the position.showDisplay
: When some testnet rpc nodes can't return object's display data, you can set this option to false, avoid returning errors. default set true.
Exmaple
4. Batch retrieval of position fee
Method sdk.Position.batchFetchPositionFees()
Params:
positionIDs
: An array of position ID.
Example
Last updated