Skip to content

Commit 97d4839

Browse files
committed
Added get_transaction_schedule plus fixes.
1 parent 7113521 commit 97d4839

8 files changed

+158
-9
lines changed

src/main/java/client/EosApiRestClient.java

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import client.domain.common.transaction.PackedTransaction;
1111
import client.domain.response.chain.currencystats.CurrencyStats;
1212
import client.domain.response.chain.transaction.PushedTransaction;
13+
import client.domain.response.chain.transaction.ScheduledTransactionResponse;
1314
import client.domain.response.history.action.Actions;
1415
import client.domain.response.history.controlledaccounts.ControlledAccounts;
1516
import client.domain.response.history.keyaccounts.KeyAccounts;
@@ -80,4 +81,5 @@ public interface EosApiRestClient {
8081

8182
ControlledAccounts getControlledAccounts(String controllingAccountName);
8283

84+
ScheduledTransactionResponse getScheduledtransactions(String lowerBound, String limit);
8385
}

src/main/java/client/domain/common/transaction/PackedTransaction.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package client.domain.common.transaction;
22

3+
34
import com.fasterxml.jackson.annotation.JsonInclude;
45
import com.fasterxml.jackson.annotation.JsonProperty;
56

67

78
import java.util.List;
89

10+
911
@JsonInclude(JsonInclude.Include.NON_NULL)
1012
public class PackedTransaction {
1113

@@ -29,8 +31,7 @@ public class PackedTransaction {
2931

3032
private List<TransactionAction> actions;
3133

32-
private Integer delaySec;
33-
34+
private Long delaySec;
3435

3536
public String getRegion() {
3637
return region;
@@ -111,12 +112,12 @@ public void setActions(List<TransactionAction> actions) {
111112
this.actions = actions;
112113
}
113114

114-
public Integer getDelaySec() {
115+
public Long getDelaySec() {
115116
return delaySec;
116117
}
117118

118119
@JsonProperty("delay_sec")
119-
public void setDelaySec(Integer delaySec) {
120+
public void setDelaySec(Long delaySec) {
120121
this.delaySec = delaySec;
121122
}
122123

src/main/java/client/domain/common/transaction/TransactionAction.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
55

66
import java.util.List;
7+
import java.util.Objects;
78

89
@JsonIgnoreProperties(ignoreUnknown = true)
910
public class TransactionAction {
@@ -14,7 +15,9 @@ public class TransactionAction {
1415

1516
private List<TransactionAuthorization> authorization;
1617

17-
private String data;
18+
/*TODO Dynamically Unpack JSON Data */
19+
20+
private String hex_data;
1821

1922
public TransactionAction() {
2023

@@ -44,11 +47,12 @@ public void setAuthorization(List<TransactionAuthorization> authorization) {
4447
this.authorization = authorization;
4548
}
4649

47-
public String getData() {
48-
return data;
50+
public String getHex_data() {
51+
return hex_data;
4952
}
5053

51-
public void setData(String data) {
52-
this.data = data;
54+
public void setHex_data(String hex_data) {
55+
this.hex_data = hex_data;
5356
}
57+
5458
}

src/main/java/client/domain/common/transaction/TransactionAuthorization.java

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
44

5+
import java.util.Objects;
6+
57
@JsonIgnoreProperties(ignoreUnknown = true)
68
public class TransactionAuthorization {
79

@@ -24,4 +26,5 @@ public String getPermission() {
2426
public void setPermission(String permission) {
2527
this.permission = permission;
2628
}
29+
2730
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package client.domain.response.chain.transaction;
2+
3+
import client.domain.common.transaction.PackedTransaction;
4+
5+
6+
import java.util.List;
7+
import java.util.Objects;
8+
9+
public class ScheduledTransaction {
10+
11+
private String trx_id;
12+
13+
private String sender;
14+
15+
private String sender_id;
16+
17+
private String payer;
18+
19+
private String delay_until;
20+
21+
private String expiration;
22+
23+
private String published;
24+
25+
private PackedTransaction transaction;
26+
27+
public String getTrx_id() {
28+
return trx_id;
29+
}
30+
31+
public void setTrx_id(String trx_id) {
32+
this.trx_id = trx_id;
33+
}
34+
35+
public String getSender() {
36+
return sender;
37+
}
38+
39+
public void setSender(String sender) {
40+
this.sender = sender;
41+
}
42+
43+
public String getSender_id() {
44+
return sender_id;
45+
}
46+
47+
public void setSender_id(String sender_id) {
48+
this.sender_id = sender_id;
49+
}
50+
51+
public String getPayer() {
52+
return payer;
53+
}
54+
55+
public void setPayer(String payer) {
56+
this.payer = payer;
57+
}
58+
59+
public String getDelay_until() {
60+
return delay_until;
61+
}
62+
63+
public void setDelay_until(String delay_until) {
64+
this.delay_until = delay_until;
65+
}
66+
67+
public String getExpiration() {
68+
return expiration;
69+
}
70+
71+
public void setExpiration(String expiration) {
72+
this.expiration = expiration;
73+
}
74+
75+
public String getPublished() {
76+
return published;
77+
}
78+
79+
public void setPublished(String published) {
80+
this.published = published;
81+
}
82+
83+
public PackedTransaction getTransaction() {
84+
return transaction;
85+
}
86+
87+
public void setTransaction(PackedTransaction transaction) {
88+
this.transaction = transaction;
89+
}
90+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package client.domain.response.chain.transaction;
2+
3+
import java.util.ArrayList;
4+
import java.util.Objects;
5+
6+
public class ScheduledTransactionResponse {
7+
8+
private ArrayList<ScheduledTransaction> transactions;
9+
10+
private String more;
11+
12+
13+
public String getMore() {
14+
return more;
15+
}
16+
17+
public void setMore(String more) {
18+
this.more = more;
19+
}
20+
21+
public ArrayList<ScheduledTransaction> getTransactions() {
22+
return transactions;
23+
}
24+
25+
public void setTransactions(ArrayList<ScheduledTransaction> transactions) {
26+
this.transactions = transactions;
27+
}
28+
29+
}

src/main/java/client/impl/EosApiRestClientImpl.java

+15
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import client.domain.common.transaction.PackedTransaction;
1616
import client.domain.response.chain.currencystats.CurrencyStats;
1717
import client.domain.response.chain.transaction.PushedTransaction;
18+
import client.domain.response.chain.transaction.ScheduledTransactionResponse;
1819
import client.domain.response.history.action.Actions;
1920
import client.domain.response.history.controlledaccounts.ControlledAccounts;
2021
import client.domain.response.history.keyaccounts.KeyAccounts;
@@ -245,4 +246,18 @@ public ControlledAccounts getControlledAccounts(String controllingAccountName){
245246
return EosApiServiceGenerator.executeSync(eosHistoryApiService.getControlledAccounts(requestParameters));
246247
}
247248

249+
@Override
250+
public ScheduledTransactionResponse getScheduledtransactions(String lowerBound, String limit){
251+
LinkedHashMap<String, String> requestParameters = new LinkedHashMap<>(2);
252+
253+
requestParameters.put("json", "true");
254+
255+
if(lowerBound != null)
256+
requestParameters.put("lower_bound", lowerBound);
257+
258+
requestParameters.put("limit", limit);
259+
260+
return EosApiServiceGenerator.executeSync(eosChainApiService.getScheduledtransaction(requestParameters));
261+
}
262+
248263
}

src/main/java/client/impl/EosChainApiService.java

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import client.domain.response.chain.code.Code;
1010
import client.domain.response.chain.currencystats.CurrencyStats;
1111
import client.domain.response.chain.transaction.PushedTransaction;
12+
import client.domain.response.chain.transaction.ScheduledTransaction;
13+
import client.domain.response.chain.transaction.ScheduledTransactionResponse;
1214
import retrofit2.Call;
1315
import retrofit2.http.Body;
1416
import retrofit2.http.GET;
@@ -58,4 +60,7 @@ public interface EosChainApiService {
5860
@POST("/v1/chain/get_currency_stats")
5961
Call<Map<String, CurrencyStats>> getCurrencyStats(@Body Map<String, String> requestFields);
6062

63+
@POST("/v1/chain/get_scheduled_transactions")
64+
Call<ScheduledTransactionResponse> getScheduledtransaction(@Body Map<String, String> requestFields);
65+
6166
}

0 commit comments

Comments
 (0)