Skip to content

Commit 5b8b8ca

Browse files
committed
Adding ClientAccountGetMinedBlocks
1 parent 77c45e4 commit 5b8b8ca

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
}

src/interfaces/Account.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,26 @@ export interface IClientAccountTokentx extends IClientRequest {
113113
*/
114114
sort?: string
115115
}
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+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
})

0 commit comments

Comments
 (0)