@@ -49,7 +49,7 @@ API support all Ethereum [default networks](https://docs.etherscan.io/getting-st
49
49
- [ Sepolia] ( https://api-sepolia.etherscan.io/ )
50
50
51
51
``` java
52
- EtherScanAPI api = EtherScanAPI . build();
52
+ EtherScanAPI api = EtherScanAPI . builder() . build();
53
53
EtherScanAPI apiGoerli = EtherScanAPI . builder(). withNetwork(EthNetworks . GORLI ). build();
54
54
EtherScanAPI apiSepolia = EtherScanAPI . builder(). withNetwork(EthNetworks . SEPOLIA ). build();
55
55
```
@@ -97,30 +97,30 @@ Below are examples for each API category.
97
97
98
98
** Get Ether Balance for a single Address**
99
99
``` java
100
- EtherScanAPI api = EtherScanAPI . build();
100
+ EtherScanAPI api = EtherScanAPI . builder() . build();
101
101
Balance balance = api. account(). balance(" 0x8d4426f94e42f721C7116E81d6688cd935cB3b4F" );
102
102
```
103
103
104
104
### Block API
105
105
106
106
** Get uncles block for block height**
107
107
``` java
108
- EtherScanAPI api = EtherScanAPI . build();
108
+ EtherScanAPI api = EtherScanAPI . builder() . build();
109
109
Optional<UncleBlock > uncles = api. block(). uncles(200000 );
110
110
```
111
111
112
112
### Contract API
113
113
** Request contract ABI from [ verified codes] ( https://etherscan.io/contractsVerified ) **
114
114
``` java
115
- EtherScanAPI api = EtherScanAPI . build();
115
+ EtherScanAPI api = EtherScanAPI . builder() . build();
116
116
Abi abi = api. contract(). contractAbi(" 0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413" );
117
117
```
118
118
119
119
### Logs API
120
120
121
121
** Get event logs for single topic**
122
122
``` java
123
- EtherScanAPI api = EtherScanAPI . build();
123
+ EtherScanAPI api = EtherScanAPI . builder() . build();
124
124
LogQuery query = LogQuery . builder(" 0x33990122638b9132ca29c723bdf037f1a891a70c" )
125
125
.withTopic(" 0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545" )
126
126
.build();
@@ -129,7 +129,7 @@ List<Log> logs = api.logs().logs(query);
129
129
130
130
** Get event logs for 3 topics with respectful operations**
131
131
``` java
132
- EtherScanAPI api = EtherScanAPI . build();
132
+ EtherScanAPI api = EtherScanAPI . builder() . build();
133
133
LogQuery query = LogQuery . builder(" 0x33990122638b9132ca29c723bdf037f1a891a70c" )
134
134
.withBlockFrom(379224 )
135
135
.withBlockTo(400000 )
@@ -148,29 +148,29 @@ List<Log> logs = api.logs().logs(query);
148
148
149
149
** Get tx details with proxy endpoint**
150
150
``` java
151
- EtherScanAPI api = EtherScanAPI . build();
151
+ EtherScanAPI api = EtherScanAPI . builder() . build();
152
152
Optional<TxProxy > tx = api. proxy(). tx(" 0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" );
153
153
```
154
154
155
155
** Get block info with proxy endpoint**
156
156
``` java
157
- EtherScanAPI api = EtherScanAPI . build();
157
+ EtherScanAPI api = EtherScanAPI . builder() . build();
158
158
Optional<BlockProxy > block = api. proxy(). block(15215 );
159
159
```
160
160
161
161
### Stats API
162
162
163
163
** Statistic about last price**
164
164
``` java
165
- EtherScanAPI api = EtherScanAPI . build();
165
+ EtherScanAPI api = EtherScanAPI . builder() . build();
166
166
Price price = api. stats(). priceLast();
167
167
```
168
168
169
169
### Transaction API
170
170
171
171
** Request receipt status for tx**
172
172
``` java
173
- EtherScanAPI api = EtherScanAPI . build();
173
+ EtherScanAPI api = EtherScanAPI . builder() . build();
174
174
Optional<Boolean > status = api. txs(). receiptStatus(" 0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76" );
175
175
```
176
176
0 commit comments