1
1
import { AxiosRequestConfig } from 'axios' ;
2
2
import { BaseAPI } from '../../base' ;
3
3
import { AccountsApiFp } from './helpers' ;
4
+ import {
5
+ AccountAddressesQueryParams ,
6
+ AccountAssetsQueryParams ,
7
+ AccountHistoryQueryParams ,
8
+ AccountRewardsQueryParams ,
9
+ AccountUpdatesQueryParams ,
10
+ } from './type' ;
4
11
5
12
/**
6
13
* AccountsApi - object-oriented interface
@@ -13,66 +20,48 @@ export class AccountsApi extends BaseAPI {
13
20
* Returns a list of addresses seen on-chain which use the specified stake key
14
21
* @summary Stake account addresses
15
22
* @param {string } stakeAddr Bech32 encoded stake/reward address (\'stake1...\')
16
- * @param {number | null } [count] The max number of results per page
17
- * @param {string | null } [cursor] Pagination cursor string, use the cursor included in a page of results to fetch the next page
23
+ * @param {AccountAddressesQueryParams } [queryParams] Query parameters.
18
24
* @param {* } [options] Override http request option.
19
25
* @throws {RequiredError }
20
26
* @memberof AccountsApi
21
27
*/
22
28
public accountAddresses (
23
29
stakeAddr : string ,
24
- count ?: number | null ,
25
- cursor ?: string | null ,
30
+ queryParams ?: AccountAddressesQueryParams ,
26
31
options ?: AxiosRequestConfig ,
27
32
) {
28
33
return AccountsApiFp ( this . configuration )
29
- . accountAddresses ( stakeAddr , count , cursor , options )
34
+ . accountAddresses ( stakeAddr , queryParams , options )
30
35
. then ( ( request ) => request ( this . axios ) ) ;
31
36
}
32
37
33
38
/**
34
39
* Returns a list of native assets which are owned by addresses with the specified stake key
35
40
* @summary Stake account assets
36
41
* @param {string } stakeAddr Bech32 encoded reward/stake address (\'stake1...\')
37
- * @param {string | null } [policy] Filter results to only show assets of the specified policy
38
- * @param {number | null } [count] The max number of results per page
39
- * @param {string | null } [cursor] Pagination cursor string, use the cursor included in a page of results to fetch the next page
42
+ * @param {AccountAssetsQueryParams } [queryParams] Query parameters.
40
43
* @param {* } [options] Override http request option.
41
44
* @throws {RequiredError }
42
45
* @memberof AccountsApi
43
46
*/
44
- public accountAssets (
45
- stakeAddr : string ,
46
- policy ?: string | null ,
47
- count ?: number | null ,
48
- cursor ?: string | null ,
49
- options ?: AxiosRequestConfig ,
50
- ) {
47
+ public accountAssets ( stakeAddr : string , queryParams ?: AccountAssetsQueryParams , options ?: AxiosRequestConfig ) {
51
48
return AccountsApiFp ( this . configuration )
52
- . accountAssets ( stakeAddr , policy , count , cursor , options )
49
+ . accountAssets ( stakeAddr , queryParams , options )
53
50
. then ( ( request ) => request ( this . axios ) ) ;
54
51
}
55
52
56
53
/**
57
54
* Returns per-epoch history for the specified stake key
58
55
* @summary Stake account history
59
56
* @param {string } stakeAddr Bech32 encoded stake/reward address (\'stake1...\')
60
- * @param {number | null } [epochNo] Fetch result for only a specific epoch
61
- * @param {number | null } [count] The max number of results per page
62
- * @param {string | null } [cursor] Pagination cursor string, use the cursor included in a page of results to fetch the next page
57
+ * @param {AccountHistoryQueryParams } [queryParams] Query parameters.
63
58
* @param {* } [options] Override http request option.
64
59
* @throws {RequiredError }
65
60
* @memberof AccountsApi
66
61
*/
67
- public accountHistory (
68
- stakeAddr : string ,
69
- epochNo ?: number | null ,
70
- count ?: number | null ,
71
- cursor ?: string | null ,
72
- options ?: AxiosRequestConfig ,
73
- ) {
62
+ public accountHistory ( stakeAddr : string , queryParams ?: AccountHistoryQueryParams , options ?: AxiosRequestConfig ) {
74
63
return AccountsApiFp ( this . configuration )
75
- . accountHistory ( stakeAddr , epochNo , count , cursor , options )
64
+ . accountHistory ( stakeAddr , queryParams , options )
76
65
. then ( ( request ) => request ( this . axios ) ) ;
77
66
}
78
67
@@ -94,41 +83,31 @@ export class AccountsApi extends BaseAPI {
94
83
* Returns a list of staking-related rewards for the specified stake key (pool `member` or `leader` rewards, deposit `refund`)
95
84
* @summary Stake account rewards
96
85
* @param {string } stakeAddr Bech32 encoded stake/reward address (\'stake1...\')
97
- * @param {number | null } [count] The max number of results per page
98
- * @param {string | null } [cursor] Pagination cursor string, use the cursor included in a page of results to fetch the next page
86
+ * @param {AccountRewardsQueryParams } [queryParams] Query parameters.
99
87
* @param {* } [options] Override http request option.
100
88
* @throws {RequiredError }
101
89
* @memberof AccountsApi
102
90
*/
103
- public accountRewards (
104
- stakeAddr : string ,
105
- count ?: number | null ,
106
- cursor ?: string | null ,
107
- options ?: AxiosRequestConfig ,
108
- ) {
91
+ public accountRewards ( stakeAddr : string , queryParams ?: AccountRewardsQueryParams , options ?: AxiosRequestConfig ) {
109
92
return AccountsApiFp ( this . configuration )
110
- . accountRewards ( stakeAddr , count , cursor , options )
93
+ . accountRewards ( stakeAddr , queryParams , options )
111
94
. then ( ( request ) => request ( this . axios ) ) ;
112
95
}
113
96
114
97
/**
115
98
* Returns a list of updates relating to the specified stake key ( `registration`, `deregistration`, `delegation`, `withdrawal`)
116
99
* @summary Stake account updates
117
100
* @param {string } stakeAddr Bech32 encoded stake/reward address (\'stake1...\')
118
- * @param {number | null } [count] The max number of results per page
119
- * @param {string | null } [cursor] Pagination cursor string, use the cursor included in a page of results to fetch the next page
101
+ * @param {AccountUpdatesQueryParams } [queryParams] Query parameters.
120
102
* @param {* } [options] Override http request option.
121
103
* @throws {RequiredError }
122
104
* @memberof AccountsApi
123
105
*/
124
- public accountUpdates (
125
- stakeAddr : string ,
126
- count ?: number | null ,
127
- cursor ?: string | null ,
128
- options ?: AxiosRequestConfig ,
129
- ) {
106
+ public accountUpdates ( stakeAddr : string , queryParams ?: AccountUpdatesQueryParams , options ?: AxiosRequestConfig ) {
130
107
return AccountsApiFp ( this . configuration )
131
- . accountUpdates ( stakeAddr , count , cursor , options )
108
+ . accountUpdates ( stakeAddr , queryParams , options )
132
109
. then ( ( request ) => request ( this . axios ) ) ;
133
110
}
134
111
}
112
+
113
+ export * from './type' ;
0 commit comments