File tree Expand file tree Collapse file tree 3 files changed +87
-0
lines changed Expand file tree Collapse file tree 3 files changed +87
-0
lines changed Original file line number Diff line number Diff line change
1
+ import * as request from 'request-promise-native'
2
+ import { Address } from '../entities/Address'
3
+ import { ApiKey } from '../entities/Apikey'
4
+ import { Contractaddress } from '../entities/Contractaddress'
5
+ import { IClientAccountGetminedblocks } from '../interfaces/Account'
6
+ import { requestBuilder } from '../requestBuilder'
7
+ import { ClientBase } from './ClientBase'
8
+
9
+ /**
10
+ * Client for the account balance
11
+ */
12
+ export class ClientGetminedblocks extends ClientBase implements IClientAccountGetminedblocks {
13
+
14
+ /**
15
+ * ApiKey to use the service
16
+ */
17
+ apiKey : ApiKey
18
+
19
+ /**
20
+ * module of the etherscan api to request
21
+ */
22
+ module : string
23
+
24
+ /**
25
+ * action of the etherscan api to request
26
+ */
27
+ action : string
28
+
29
+ /**
30
+ * Address to lookup the account balance
31
+ */
32
+ address : Address
33
+
34
+ /**
35
+ * tag to limit the results
36
+ */
37
+ type : string
38
+
39
+ constructor (
40
+ apiKey : ApiKey ,
41
+ module : string ,
42
+ action : string ,
43
+ address : Address ,
44
+ type : string ) {
45
+ super ( )
46
+ this . apiKey = apiKey
47
+ this . address = address
48
+ this . module = module
49
+ this . action = action
50
+ this . type = type
51
+ }
52
+ }
Original file line number Diff line number Diff line change @@ -113,3 +113,26 @@ export interface IClientAccountTokentx extends IClientRequest {
113
113
*/
114
114
sort ?: string
115
115
}
116
+
117
+ export interface IClientAccountGetminedblocks extends IClientRequest {
118
+ /**
119
+ * Ethereum address
120
+ */
121
+ address ?: Address | Contractaddress
122
+ /**
123
+ * Type of block (block/uncle)
124
+ */
125
+ type : string
126
+ /**
127
+ * Paging actual page
128
+ */
129
+ page ?: string
130
+ /**
131
+ * Paging start
132
+ */
133
+ offset ?: string
134
+ /**
135
+ * Sort Parameter
136
+ */
137
+ sort ?: string
138
+ }
Original file line number Diff line number Diff line change
1
+ import test from 'ava'
2
+ import { ClientAccountBalance } from '../../src/client/ClientAccountBalance'
3
+ // import { decode } from 'querystring'
4
+ // const nock = require('nock')
5
+ // import { parse } from 'url'
6
+ // import { readFile } from 'fs'
7
+ // import { promisify } from 'util'
8
+ //const _readFile = promisify(readFile)
9
+
10
+ test ( 'exists' , t => {
11
+ t . truthy ( ClientAccountBalance )
12
+ } )
You can’t perform that action at this time.
0 commit comments