-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add support for new rpc * optimize for response types Co-authored-by: PanaW <[email protected]>
- Loading branch information
Showing
7 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package conflux.web3j.response; | ||
|
||
import org.web3j.utils.Numeric; | ||
|
||
import java.math.BigInteger; | ||
|
||
public class DepositInfo { | ||
public static class ListResponse extends CfxListResponse<DepositInfo> {} | ||
|
||
private String amount; | ||
private String depositTime; | ||
private String accumulatedInterestRate; | ||
|
||
public BigInteger getAmount() {return Numeric.decodeQuantity(amount);} | ||
|
||
public void setAmount(String amount) {this.amount = amount;} | ||
|
||
public long getDepositTime() {return Long.valueOf(depositTime);} | ||
|
||
public void setDepositTime(String time) {this.depositTime = time;} | ||
|
||
public BigInteger getAccumulatedInterestRate() {return Numeric.decodeQuantity(accumulatedInterestRate);} | ||
|
||
public void setAccumulatedInterestRate(String rate) {this.accumulatedInterestRate = rate;} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package conflux.web3j.response; | ||
|
||
import org.web3j.utils.Numeric; | ||
|
||
import java.math.BigInteger; | ||
|
||
public class StorageChange { | ||
// public static class Response extends CfxResponse<StorageChange> {} | ||
|
||
private String address; | ||
private String collaterals; | ||
|
||
public String getAddress() { | ||
return address; | ||
} | ||
|
||
public void setAddress(String address) { | ||
this.address = address; | ||
} | ||
|
||
public BigInteger getCollaterals () { | ||
return Numeric.decodeQuantity(collaterals); | ||
} | ||
|
||
public void setCollaterals(String collaterals) { | ||
this.collaterals = collaterals; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package conflux.web3j.response; | ||
|
||
import org.web3j.utils.Numeric; | ||
|
||
import java.math.BigInteger; | ||
|
||
public class SupplyInfo { | ||
public static class Response extends CfxResponse<SupplyInfo> {} | ||
|
||
private String totalIssued; | ||
private String totalStaking; | ||
private String totalCollateral; | ||
|
||
public BigInteger getTotalIssued() { | ||
return Numeric.decodeQuantity(totalIssued); | ||
} | ||
|
||
public void setTotalIssued(String totalIssued) { | ||
this.totalIssued = totalIssued; | ||
} | ||
|
||
public BigInteger getTotalStaking() { | ||
return Numeric.decodeQuantity(totalStaking); | ||
} | ||
|
||
public void setTotalStaking(String totalStaking) { | ||
this.totalStaking = totalStaking; | ||
} | ||
|
||
public BigInteger getTotalCollateral () { | ||
return Numeric.decodeQuantity(totalCollateral); | ||
} | ||
|
||
public void setTotalCollateral(String totalCollateral) { | ||
this.totalCollateral = totalCollateral; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format("{totalIssued = %s, totalStaking = %s, totalCollateral = %s}", this.getTotalIssued(), this.getTotalStaking(), this.getTotalCollateral()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package conflux.web3j.response; | ||
|
||
import org.web3j.utils.Numeric; | ||
|
||
import java.math.BigInteger; | ||
|
||
public class VoteStakeInfo { | ||
public static class ListResponse extends CfxListResponse<VoteStakeInfo> {} | ||
private String amount; | ||
private String unlockBlockNumber; | ||
|
||
public BigInteger getAmount() {return Numeric.decodeQuantity(amount);} | ||
|
||
public void setAmount(String amount) {this.amount = amount;} | ||
|
||
public BigInteger getUnlockBlockNumber() {return Numeric.decodeQuantity(unlockBlockNumber);} | ||
|
||
public void setUnlockBlockNumber(String blockNumber) {this.unlockBlockNumber = blockNumber;} | ||
} |