Skip to content

Commit bf1ef20

Browse files
committed
A first version of the interfaces
1 parent 16100ea commit bf1ef20

File tree

3 files changed

+37
-33
lines changed

3 files changed

+37
-33
lines changed

src/Client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ export class Client {
1111
if (!account.get(action)) {
1212
throw new Error('unknown action')
1313
}
14+
return
1415
}
1516
}

src/interfaces/Account.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Address } from '../entities/Address'
2+
import { IClientRequest } from './Entity'
3+
4+
export interface IClientAccountBalanceRequest extends IClientRequest {
5+
address: Address
6+
tag: string
7+
}
8+
9+
export interface IClientAccountBalanceMultiRequest extends IClientRequest {
10+
address: Address
11+
tag: string
12+
}
13+
14+
export interface IClientAccountTxlistRequest extends IClientRequest {
15+
address: Address
16+
startblock: string
17+
endblock: string
18+
page?: string
19+
offset?: string
20+
sort?: string
21+
}
22+
export interface IClientAccountTxlistInternalRequest extends IClientAccountTxlistRequest {
23+
txhash: string
24+
}
25+
26+
export interface IClientAccountTokentx extends IClientRequest {
27+
contractaddress: string
28+
startblock?: string
29+
endblock?: string
30+
page?: string
31+
offset?: string
32+
sort?: string
33+
}

src/interfaces/Entity.ts

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ApiKey } from '../entities/Apikey'
2+
13
export interface IEntity {
24
validate(): void
35
valid(): boolean
@@ -6,37 +8,5 @@ export interface IEntity {
68
export interface IClientRequest {
79
module: string
810
action: string
9-
}
10-
11-
export interface IClientAccountBalanceRequest extends IClientRequest {
12-
address: string
13-
tag: string
14-
apiKey: string
15-
}
16-
17-
export interface IClientAccountBalanceMultiRequest extends IClientRequest {
18-
address: string
19-
tag: string
20-
apiKey: string
21-
}
22-
23-
export interface IClientAccountTxlistRequest extends IClientRequest {
24-
address: string
25-
startblock: string
26-
endblock: string
27-
page?: string
28-
offset?: string
29-
sort?: string
30-
}
31-
export interface IClientAccountTxlistInternalRequest extends IClientAccountTxlistRequest {
32-
txhash: string
33-
}
34-
35-
export interface IClientAccountTokentx extends IClientRequest {
36-
contractaddress: string
37-
startblock?: string
38-
endblock?: string
39-
page?: string
40-
offset?: string
41-
sort?: string
11+
apiKey: ApiKey
4212
}

0 commit comments

Comments
 (0)