Skip to main content
Version: 2.x

Staking

 License: MIT 

Installation

pom.xml
<dependency>
<groupId>{{groupId}}</groupId>
<artifactId>{{artifactId}}</artifactId>
<version>{{version}}</version>
</dependency>

Client instantiation

StakingClient client = new StakingClient(key, secret);

Features

Get products

try{
List<Product> res = client.getProducts(new ProductListParams(ProductType.STAKING)).sync();
}catch(ApiException e){
//...
}

Get staking history

try{
List<StakingRecord> res = client.getHistory(new HistoryParams(ProductType.STAKING, TransactionType.INTEREST, asset)).sync();
}catch(ApiException e){
//...
}

Get personal left quota of Staking product

try{
LeftQuota res = client.getLeftQuota(new LeftQuotaParams(ProductType.STAKING, productId)).sync();
}catch(ApiException e){
//...
}

Get Staking product position.

try{
List<ProductPosition> res = client.getPosition(new PositionParams(ProductType.STAKING)).sync();
}catch(ApiException e){
//...
}

Purchase Staking product

try{
PurchaseResponse res = client.purchase(new PurchaseParams(ProductType.STAKING, productId, amount)).sync();
}catch(ApiException e){
//...
}

Redeem Staking product

try{
RedeemResponse res = client.redeem(new RedeemParams(ProductType.STAKING, productId)).sync();
}catch(ApiException e){
//...
}

Set auto staking on Locked Staking or Locked DeFi Staking

try{
AutoStakingResponse res = client.setAutoStaking(new AutoStakingParams(ProductType.STAKING, productId, true/false)).sync();
}catch(ApiException e){
//...
}