8
8
package etherscan
9
9
10
10
// AccountBalance gets ether balance for a single address
11
- func (c * Client ) AccountBalance (address string ) (balance * BigInt , err error ) {
11
+ func (c * Client ) AccountBalance (address string ) (balance string , err error ) {
12
12
param := M {
13
13
"tag" : "latest" ,
14
14
"address" : address ,
15
15
}
16
- balance = new (BigInt )
17
16
err = c .call ("account" , "balance" , param , balance )
18
17
return
19
18
}
@@ -29,6 +28,17 @@ func (c *Client) MultiAccountBalance(addresses ...string) (balances []AccountBal
29
28
return
30
29
}
31
30
31
+ // MultiAccountBalance gets ether balance for multiple addresses at specific block in a single call
32
+ func (c * Client ) MultiAccountBalanceAt (blockNo int , addresses []string ) (balances []AccountBalance , err error ) {
33
+ param := M {
34
+ "tag" : blockNo ,
35
+ "address" : addresses ,
36
+ }
37
+ balances = make ([]AccountBalance , 0 , len (addresses ))
38
+ err = c .call ("account" , "balancemulti" , param , & balances )
39
+ return
40
+ }
41
+
32
42
// NormalTxByAddress gets a list of "normal" transactions by address
33
43
//
34
44
// startBlock and endBlock can be nil
@@ -120,7 +130,7 @@ func (c *Client) UnclesMinedByAddress(address string, page int, offset int) (min
120
130
}
121
131
122
132
// TokenBalance get erc20-token account balance of address for contractAddress
123
- func (c * Client ) TokenBalance (contractAddress , address string ) (balance * BigInt , err error ) {
133
+ func (c * Client ) TokenBalance (contractAddress , address string ) (balance string , err error ) {
124
134
param := M {
125
135
"contractaddress" : contractAddress ,
126
136
"address" : address ,
0 commit comments