Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b60b49

Browse files
committed
Other provider contracts introduced
Some models timestamp support improved
1 parent73fd165 commit0b60b49

14 files changed

+242
-5
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
packageio.api.core;
2+
3+
importio.api.model.UncleBlock;
4+
5+
/**
6+
* EtherScan - API Descriptions
7+
* https://etherscan.io/apis#blocks
8+
*
9+
* @author GoodforGod
10+
* @since 30.10.2018
11+
*/
12+
publicinterfaceIBlockProvider {
13+
14+
UncleBlockuncles(longblockNumber);
15+
}

‎src/main/java/io/api/core/IContractProvider.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
packageio.api.core;
22

33
/**
4-
* ! NO DESCRIPTION !
4+
* EtherScan - API Descriptions
5+
* https://etherscan.io/apis#contracts
56
*
67
* @author GoodforGod
78
* @since 28.10.2018
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
packageio.api.core;
2+
3+
/**
4+
* EtherScan - API Descriptions
5+
* https://etherscan.io/apis#logs
6+
*
7+
* @author GoodforGod
8+
* @since 30.10.2018
9+
*/
10+
publicinterfaceILogsProvider {
11+
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
packageio.api.core;
2+
3+
/**
4+
* EtherScan - API Descriptions
5+
* https://etherscan.io/apis#proxy
6+
*
7+
* @author GoodforGod
8+
* @since 30.10.2018
9+
*/
10+
publicinterfaceIParityProvider {
11+
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
packageio.api.core;
2+
3+
/**
4+
* EtherScan - API Descriptions
5+
* https://etherscan.io/apis#stats
6+
*
7+
* @author GoodforGod
8+
* @since 30.10.2018
9+
*/
10+
publicinterfaceIStatisticProvider {
11+
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
packageio.api.core;
2+
3+
/**
4+
* EtherScan - API Descriptions
5+
* https://etherscan.io/apis#tokens
6+
*
7+
* @author GoodforGod
8+
* @since 30.10.2018
9+
*/
10+
publicinterfaceITokenProvider {
11+
12+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
packageio.api.core;
2+
3+
importio.api.model.Status;
4+
5+
/**
6+
* EtherScan - API Descriptions
7+
* https://etherscan.io/apis#transactions
8+
*
9+
* @author GoodforGod
10+
* @since 30.10.2018
11+
*/
12+
publicinterfaceITransactionProvider {
13+
14+
StatusexecStatus(Stringtxhash);
15+
16+
booleanreceiptStatus(Stringtxhash);
17+
}

‎src/main/java/io/api/model/BaseTx.java‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
packageio.api.model;
22

3+
importio.api.util.BasicUtils;
4+
35
importjava.math.BigInteger;
6+
importjava.time.LocalDateTime;
7+
importjava.time.ZoneOffset;
48

59
/**
610
* ! NO DESCRIPTION !
@@ -12,6 +16,7 @@ abstract class BaseTx {
1216

1317
privatelongblockNumber;
1418
privateStringtimeStamp;
19+
privateLocalDateTime_timeStamp;
1520
privateStringhash;
1621
privateStringfrom;
1722
privateStringto;
@@ -26,8 +31,10 @@ public long getBlockNumber() {
2631
returnblockNumber;
2732
}
2833

29-
publicStringgetTimeStamp() {
30-
returntimeStamp;
34+
publicLocalDateTimegetTimeStamp() {
35+
if(_timeStamp ==null && !BasicUtils.isEmpty(timeStamp))
36+
_timeStamp =LocalDateTime.ofEpochSecond(Long.valueOf(timeStamp),0,ZoneOffset.UTC);
37+
return_timeStamp;
3138
}
3239

3340
publicStringgetHash() {

‎src/main/java/io/api/model/Block.java‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
packageio.api.model;
22

3+
importio.api.util.BasicUtils;
4+
5+
importjava.time.LocalDateTime;
6+
importjava.time.ZoneOffset;
7+
38
/**
49
* ! NO DESCRIPTION !
510
*
@@ -10,6 +15,7 @@ public class Block {
1015

1116
privateStringblockNumber;
1217
privateStringtimeStamp;
18+
privateLocalDateTime_timeStamp;
1319
privateStringblockReward;
1420

1521
publicBlock(StringblockNumber,StringtimeStamp,StringblockReward) {
@@ -23,8 +29,10 @@ public String getBlockNumber() {
2329
returnblockNumber;
2430
}
2531

26-
publicStringgetTimeStamp() {
27-
returntimeStamp;
32+
publicLocalDateTimegetTimeStamp() {
33+
if(_timeStamp ==null && !BasicUtils.isEmpty(timeStamp))
34+
_timeStamp =LocalDateTime.ofEpochSecond(Long.valueOf(timeStamp),0,ZoneOffset.UTC);
35+
return_timeStamp;
2836
}
2937

3038
publicStringgetBlockReward() {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
packageio.api.model;
2+
3+
/**
4+
* ! NO DESCRIPTION !
5+
*
6+
* @author GoodforGod
7+
* @since 30.10.2018
8+
*/
9+
publicclassStatus {
10+
11+
privateintisError;
12+
privateStringerrDescription;
13+
14+
publicintgetIsError() {
15+
returnisError;
16+
}
17+
18+
publicStringgetErrDescription() {
19+
returnerrDescription;
20+
}
21+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp