Class: BiatecClammPoolClient
A client to make calls to the BiatecClammPool smart contract
Constructors
Constructor
new BiatecClammPoolClient(
appClient):BiatecClammPoolClient
Creates a new instance of BiatecClammPoolClient
Parameters
appClient
_AppClient
An AppClient instance which has been created with the BiatecClammPool app spec
Returns
BiatecClammPoolClient
Constructor
new BiatecClammPoolClient(
params):BiatecClammPoolClient
Creates a new instance of BiatecClammPoolClient
Parameters
params
Omit<AppClientParams, "appSpec">
The parameters to initialise the app client with
Returns
BiatecClammPoolClient
Properties
appClient
readonlyappClient:_AppClient
The underlying AppClient for when you want to have more flexibility
params
readonlyparams:object
Get parameters to create transactions for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.
update
update:
object
Gets available update methods
update.updateApplication()
updateApplication: (
params) =>any
Updates an existing instance of the BiatecClammPool smart contract using the updateApplication(uint64,byte[])void ABI method.
addressUdpater from global biatec configuration is allowed to update application
Parameters
params
any
The params for the smart contract call
Returns
any
The update params
clearState()
clearState: (
params?) =>any
Makes a clear_state call to an existing instance of the BiatecClammPool smart contract.
Parameters
params?
any
The params for the bare (raw) call
Returns
any
The clearState result
getCurrentPrice()
getCurrentPrice: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the getCurrentPrice()uint64 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Parameters
params
object & object = ...
The params for the smart contract call
Returns
any
The call params
getPriceDivider()
getPriceDivider: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the getPriceDivider()uint64 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Parameters
params
object & object = ...
The params for the smart contract call
Returns
any
The call params
getLpTokenId()
getLpTokenId: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the getLPTokenId()uint64 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Parameters
params
object & object = ...
The params for the smart contract call
Returns
any
The call params
bootstrap()
bootstrap: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the bootstrap(uint64,uint64,uint64,uint64,pay,uint64,uint64,uint64,uint64,uint64)uint64 ABI method.
Only Biatec Pool Provider can deploy and bootsrap this smart contract
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: LP token ID
bootstrapStep2()
bootstrapStep2: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the bootstrapStep2()void ABI method.
When we know the app id of this pool, we can register it properly at the pool provider
Parameters
params
object & object = ...
The params for the smart contract call
Returns
any
The call params
addLiquidity()
addLiquidity: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the addLiquidity(uint64,uint64,txn,txn,uint64,uint64,uint64)uint64 ABI method.
This method adds Asset A and Asset B to the Automated Market Maker Concentrated Liqudidity Pool and send to the liqudidty provider the liquidity token
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: LP Token quantity distributed
removeLiquidity()
removeLiquidity: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the removeLiquidity(uint64,uint64,axfer,uint64,uint64,uint64)uint256 ABI method.
This method retrieves from the liquidity provider LP token and returns Asset A and Asset B from the Automated Market Maker Concentrated Liqudidity Pool
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: LP position reduced
removeLiquidityAdmin()
removeLiquidityAdmin: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the removeLiquidityAdmin(uint64,uint64,uint64,uint64,uint256)uint256 ABI method.
This method allows biatec admin to reduce the lp position created by lp fees allocation.
Only addressExecutiveFee is allowed to execute this method.
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: LP position reduced
swap()
swap: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the swap(uint64,uint64,uint64,txn,uint64,uint64,uint64)uint256 ABI method.
Swap Asset A to Asset B or Asset B to Asst A
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
distributeExcessAssets()
distributeExcessAssets: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the distributeExcessAssets(uint64,uint64,uint64,uint256,uint256)uint256 ABI method.
If someone deposits excess assets to the LP pool, addressExecutiveFee can either distribute them to the lp tokens or withdraw it, depending on the use case. If someone sent there assets in fault, the withrawing can be use to return them back. If the pool received assets for example for having its algo stake online and recieved rewards it is prefered to distribute them to the current LP holders.
This method is used to distribute amount a and amount b of asset a and asset b to holders as the fee income.
Amount for A or B which is equal exactly to 1 is special usecase and means full distribution which is possible for the specific asset.
Only addressExecutiveFee is allowed to execute this method.
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
withdrawExcessAssets()
withdrawExcessAssets: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the withdrawExcessAssets(uint64,uint64,uint64,uint64,uint64)uint64 ABI method.
If someone deposits excess assets to the LP pool, addressExecutiveFee can either distribute them to the lp tokens or withdraw it, depending on the use case. If someone sent there assets in fault, the withrawing can be use to return them back. If the pool received assets for example for having its algo stake online and recieved rewards it is prefered to distribute them to the current LP holders.
This method is used to distribute amount a and amount b of asset a and asset b to addressExecutiveFee account.
Only addressExecutiveFee is allowed to execute this method.
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
sendOnlineKeyRegistration()
sendOnlineKeyRegistration: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the sendOnlineKeyRegistration(uint64,byte[],byte[],byte[],uint64,uint64,uint64,uint64)void ABI method.
addressExecutiveFee can perfom key registration for this LP pool
Only addressExecutiveFee is allowed to execute this method.
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
sendOfflineKeyRegistration()
sendOfflineKeyRegistration: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the sendOfflineKeyRegistration(uint64)void ABI method.
addressExecutiveFee can perform key unregistration for this LP pool
Only addressExecutiveFee is allowed to execute this method.
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
doAppCall()
doAppCall: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the doAppCall(uint64,(uint64,byte[32],uint64,uint64,string),uint64[],uint64[],address[],byte[][])void ABI method.
doAppCall can call any other smart contract. mainly created for the xgov calls.
Only addressExecutiveFee is allowed to execute this method.
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
calculateDistributedLiquidity()
calculateDistributedLiquidity: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateDistributedLiquidity(uint64,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Calculates the number of LP tokens issued to users
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
calculateLiquidityFlatPrice()
calculateLiquidityFlatPrice: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateLiquidityFlatPrice(uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
calculateLiquidityD()
calculateLiquidityD: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateLiquidityD(uint256,uint256,uint256,uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Calculates the liquidity from the x - Asset A position and y - Asset B position This method calculates discriminant - first part of the calculation. It is divided so that the readonly method does not need to charge fees
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: Liquidity is constant in swapping each direction. On deposit the diff between the liquidity is number of LP tokens received by user.
calculateLiquidityWithD()
calculateLiquidityWithD: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateLiquidityWithD(uint256,uint256,uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Calculates the liquidity from the x - Asset A position and y - Asset B position
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: Liquidity is constant in swapping each direction. On deposit the diff between the liquidity is number of LP tokens received by user.
calculatePrice()
calculatePrice: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculatePrice(uint256,uint256,uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Get the current price when asset a has x
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: the price with specified quantity with the price range set in the contract
calculateAssetBWithdrawOnAssetADeposit()
calculateAssetBWithdrawOnAssetADeposit: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateAssetBWithdrawOnAssetADeposit(uint256,uint256,uint256,uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Calculates how much asset B will be taken from the smart contract on asset A deposit
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: Amount of asset B to be given to the caller before fees. The result is in Base decimals (9)
calculateAssetAWithdrawOnAssetBDeposit()
calculateAssetAWithdrawOnAssetBDeposit: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateAssetAWithdrawOnAssetBDeposit(uint256,uint256,uint256,uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Calculates how much asset A will be taken from the smart contract on asset B deposit
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: Amount of asset A to be given to the caller before fees. The result is in Base decimals (9)
calculateAssetAWithdrawOnLpDeposit()
calculateAssetAWithdrawOnLpDeposit: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateAssetAWithdrawOnLpDeposit(uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Calculates how much asset A will be taken from the smart contract on LP asset deposit
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: Amount of asset A to be given to the caller before fees. The result is in Base decimals (9)
calculateAssetBDepositOnAssetADeposit()
calculateAssetBDepositOnAssetADeposit: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateAssetBDepositOnAssetADeposit(uint256,uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Calculates how much asset B should be deposited when user deposit asset a and b.
On deposit min(calculateAssetBDepositOnAssetADeposit, calculateAssetADepositOnAssetBDeposit) should be considered for the real deposit and rest should be swapped or returned back to user
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: Amount of asset B to be given to the caller before fees. The result is in Base decimals (9)
calculateAssetADepositOnAssetBDeposit()
calculateAssetADepositOnAssetBDeposit: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the calculateAssetADepositOnAssetBDeposit(uint256,uint256,uint256,uint256)uint256 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Calculates how much asset A should be deposited when user deposit asset a and b
On deposit min(calculateAssetBDepositOnAssetADeposit, calculateAssetADepositOnAssetBDeposit) should be considered for the real deposit and rest should be swapped or returned back to user
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params: Amount of asset A to be deposited. The result is in Base decimals (9)
status()
status: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the status(uint64,uint64,uint64,uint64)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64) ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Parameters
params
object & object
The params for the smart contract call
Returns
any
The call params
createTransaction
readonlycreateTransaction:object
Create transactions for the current app
update
update:
object
Gets available update methods
update.updateApplication()
updateApplication: (
params) =>any
Updates an existing instance of the BiatecClammPool smart contract using the updateApplication(uint64,byte[])void ABI method.
addressUdpater from global biatec configuration is allowed to update application
Parameters
params
any
The params for the smart contract call
Returns
any
The update transaction
clearState()
clearState: (
params?) =>any
Makes a clear_state call to an existing instance of the BiatecClammPool smart contract.
Parameters
params?
any
The params for the bare (raw) call
Returns
any
The clearState result
getCurrentPrice()
getCurrentPrice: (
params) =>any
Makes a call to the BiatecClammPool smart contract using the getCurrentPrice()uint64 ABI method.
This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
Parameters
params
object & object = ...
The params for the smart contract call