File tree 2 files changed +36
-0
lines changed
library/src/main/java/foundation/icon/icx/data
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 21
21
import foundation .icon .icx .transport .jsonrpc .RpcObject ;
22
22
23
23
import java .math .BigInteger ;
24
+ import java .util .ArrayList ;
25
+ import java .util .List ;
24
26
25
27
public class BlockNotification {
26
28
private final RpcObject properties ;
@@ -85,4 +87,20 @@ public static BigInteger[] asIntegerArray(RpcItem item) {
85
87
public static BigInteger asInteger (RpcItem item ) {
86
88
return item != null ? item .asInteger () : null ;
87
89
}
90
+
91
+ public List <TransactionResult .EventLog > getLogs () {
92
+ RpcItem item = properties .getItem ("logs" );
93
+ List <TransactionResult .EventLog > eventLogs = new ArrayList <>();
94
+ if (item != null ) {
95
+ for (RpcItem rpcItem : item .asArray ()) {
96
+ eventLogs .add (new TransactionResult .EventLog (rpcItem .asObject ()));
97
+ }
98
+ }
99
+ return eventLogs ;
100
+ }
101
+
102
+ @ Override
103
+ public String toString () {
104
+ return "BlockNotification{Properties=" +properties +"}" ;
105
+ }
88
106
}
Original file line number Diff line number Diff line change 21
21
import foundation .icon .icx .transport .jsonrpc .RpcObject ;
22
22
23
23
import java .math .BigInteger ;
24
+ import java .util .ArrayList ;
25
+ import java .util .List ;
24
26
25
27
public class EventNotification {
26
28
private final RpcObject properties ;
@@ -59,4 +61,20 @@ public BigInteger[] getEvents() {
59
61
public static BigInteger asInteger (RpcItem item ) {
60
62
return item != null ? item .asInteger () : null ;
61
63
}
64
+
65
+ public List <TransactionResult .EventLog > getLogs () {
66
+ RpcItem item = properties .getItem ("logs" );
67
+ List <TransactionResult .EventLog > eventLogs = new ArrayList <>();
68
+ if (item != null ) {
69
+ for (RpcItem rpcItem : item .asArray ()) {
70
+ eventLogs .add (new TransactionResult .EventLog (rpcItem .asObject ()));
71
+ }
72
+ }
73
+ return eventLogs ;
74
+ }
75
+
76
+ @ Override
77
+ public String toString () {
78
+ return "EventNotification{Properties=" +properties +"}" ;
79
+ }
62
80
}
You can’t perform that action at this time.
0 commit comments