-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRewardUsage.java
57 lines (45 loc) · 2.07 KB
/
RewardUsage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.trueweb3j.sample;
import com.trueweb3j.TrueWeb3jRequest;
import com.trueweb3j.response.Reward.ChainRewardContent;
import com.trueweb3j.response.fast.FastBlock;
import com.trueweb3j.response.snail.SnailRewardContenet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigInteger;
import java.util.Map;
public class RewardUsage extends TrueWeb3jTestNet {
private static final Logger logger = LoggerFactory.getLogger(RewardUsage.class);
/**
* get snail reward address and the balance of the address
*/
public void getSnailBalanceChange() {
BigInteger snailNumber = new BigInteger("2");
Map<String, String> addrWithBalance = trueWeb3jRequest.getSnailBalanceChange(snailNumber);
logger.info("addrWithBalance=[{}]", addrWithBalance);
}
/**
* get snailReward content by snailNumber
* call etrue_getChainRewardContent by empty address
*/
public void getSnailRewardContent() {
BigInteger snailNumber = new BigInteger("55000");
ChainRewardContent snailChainRewardContent = trueWeb3jRequest.getSnailRewardContent(snailNumber);
System.out.println("snailChainRewardContent=" + snailChainRewardContent.toString());
}
public void getSnailRewardContent_Old() {
BigInteger snailNumber = new BigInteger("55000");
SnailRewardContenet snailRewardContenet = trueWeb3jRequest.getSnailRewardContent_Old(snailNumber);
System.out.println("snailRewardContenet=" + snailRewardContenet.toString());
}
public void getAddressesSnailReward() {
BigInteger snailNumber = new BigInteger("2");
Map<String, BigInteger> addressSnailReward = trueWeb3jRequest.getAddressesSnailReward(snailNumber);
logger.info("addressSnailReward=[{}]", addressSnailReward);
}
public void getFastBockOfReward() {
BigInteger snailNumber = new BigInteger("1");
FastBlock fastBlock = trueWeb3jRequest.getFastBockOfReward(snailNumber);
logger.info("fastBlock=[{}]", fastBlock);
System.out.println("fastBlock="+fastBlock);
}
}