@avalabs/glacier-sdk 2.8.0-alpha.121 → 2.8.0-alpha.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2244 -2021
- package/dist/index.js +355 -198
- package/esm/generated/Glacier.d.ts +24 -2
- package/esm/generated/Glacier.js +25 -3
- package/esm/generated/core/OpenAPI.js +1 -1
- package/esm/generated/models/CompletedDelegatorDetails.d.ts +15 -0
- package/esm/generated/models/Contract.d.ts +37 -0
- package/esm/generated/models/ContractDeploymentDetails.d.ts +13 -0
- package/esm/generated/models/DelegationStatusType.d.ts +5 -0
- package/esm/generated/models/DelegationStatusType.js +6 -0
- package/esm/generated/models/ListContractsResponse.d.ts +11 -0
- package/esm/generated/models/ListDelegatorDetailsResponse.d.ts +11 -0
- package/esm/generated/models/PrimaryNetwork.d.ts +6 -0
- package/esm/generated/models/PrimaryNetwork.js +7 -0
- package/esm/generated/models/PrimaryNetworkChainInfo.d.ts +5 -2
- package/esm/generated/models/PrimaryNetworkChainName.d.ts +7 -0
- package/esm/generated/models/PrimaryNetworkChainName.js +8 -0
- package/esm/generated/models/StakingDistribution.d.ts +1 -0
- package/esm/generated/models/ValidatorsDetails.d.ts +1 -0
- package/esm/generated/services/DefaultService.d.ts +52 -0
- package/esm/generated/services/DefaultService.js +34 -0
- package/esm/generated/services/EvmBalancesService.d.ts +177 -0
- package/esm/generated/services/EvmBalancesService.js +116 -0
- package/esm/generated/services/EvmBlocksService.d.ts +47 -0
- package/esm/generated/services/EvmBlocksService.js +37 -0
- package/esm/generated/services/EvmChainsService.d.ts +36 -0
- package/esm/generated/services/EvmChainsService.js +29 -0
- package/esm/generated/services/{EvmService.d.ts → EvmTransactionsService.d.ts} +9 -314
- package/esm/generated/services/{EvmService.js → EvmTransactionsService.js} +7 -219
- package/esm/generated/services/NfTsService.d.ts +108 -0
- package/esm/generated/services/NfTsService.js +77 -0
- package/esm/generated/services/PrimaryNetworkBalancesService.d.ts +40 -0
- package/esm/generated/services/PrimaryNetworkBalancesService.js +26 -0
- package/esm/generated/services/PrimaryNetworkBlocksService.d.ts +85 -0
- package/esm/generated/services/PrimaryNetworkBlocksService.js +62 -0
- package/esm/generated/services/PrimaryNetworkRewardsService.d.ts +69 -0
- package/esm/generated/services/PrimaryNetworkRewardsService.js +49 -0
- package/esm/generated/services/PrimaryNetworkService.d.ts +0 -436
- package/esm/generated/services/PrimaryNetworkService.js +0 -298
- package/esm/generated/services/PrimaryNetworkTransactionsService.d.ts +171 -0
- package/esm/generated/services/PrimaryNetworkTransactionsService.js +107 -0
- package/esm/generated/services/PrimaryNetworkUtxOsService.d.ts +54 -0
- package/esm/generated/services/PrimaryNetworkUtxOsService.js +34 -0
- package/esm/generated/services/PrimaryNetworkVerticesService.d.ts +90 -0
- package/esm/generated/services/PrimaryNetworkVerticesService.js +64 -0
- package/esm/index.d.ts +20 -1
- package/esm/index.js +15 -1
- package/package.json +2 -2
|
@@ -1,146 +1,7 @@
|
|
|
1
|
-
class
|
|
1
|
+
class EvmTransactionsService {
|
|
2
2
|
constructor(httpRequest) {
|
|
3
3
|
this.httpRequest = httpRequest;
|
|
4
4
|
}
|
|
5
|
-
getNativeBalance({
|
|
6
|
-
chainId,
|
|
7
|
-
address,
|
|
8
|
-
blockNumber,
|
|
9
|
-
currency
|
|
10
|
-
}) {
|
|
11
|
-
return this.httpRequest.request({
|
|
12
|
-
method: "GET",
|
|
13
|
-
url: "/v1/chains/{chainId}/addresses/{address}/balances:getNative",
|
|
14
|
-
path: {
|
|
15
|
-
"chainId": chainId,
|
|
16
|
-
"address": address
|
|
17
|
-
},
|
|
18
|
-
query: {
|
|
19
|
-
"blockNumber": blockNumber,
|
|
20
|
-
"currency": currency
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
listErc20Balances({
|
|
25
|
-
chainId,
|
|
26
|
-
address,
|
|
27
|
-
blockNumber,
|
|
28
|
-
pageSize = 10,
|
|
29
|
-
pageToken,
|
|
30
|
-
contractAddresses,
|
|
31
|
-
currency
|
|
32
|
-
}) {
|
|
33
|
-
return this.httpRequest.request({
|
|
34
|
-
method: "GET",
|
|
35
|
-
url: "/v1/chains/{chainId}/addresses/{address}/balances:listErc20",
|
|
36
|
-
path: {
|
|
37
|
-
"chainId": chainId,
|
|
38
|
-
"address": address
|
|
39
|
-
},
|
|
40
|
-
query: {
|
|
41
|
-
"blockNumber": blockNumber,
|
|
42
|
-
"pageSize": pageSize,
|
|
43
|
-
"pageToken": pageToken,
|
|
44
|
-
"contractAddresses": contractAddresses,
|
|
45
|
-
"currency": currency
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
listErc721Balances({
|
|
50
|
-
chainId,
|
|
51
|
-
address,
|
|
52
|
-
pageSize = 10,
|
|
53
|
-
pageToken,
|
|
54
|
-
contractAddress
|
|
55
|
-
}) {
|
|
56
|
-
return this.httpRequest.request({
|
|
57
|
-
method: "GET",
|
|
58
|
-
url: "/v1/chains/{chainId}/addresses/{address}/balances:listErc721",
|
|
59
|
-
path: {
|
|
60
|
-
"chainId": chainId,
|
|
61
|
-
"address": address
|
|
62
|
-
},
|
|
63
|
-
query: {
|
|
64
|
-
"pageSize": pageSize,
|
|
65
|
-
"pageToken": pageToken,
|
|
66
|
-
"contractAddress": contractAddress
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
listErc1155Balances({
|
|
71
|
-
chainId,
|
|
72
|
-
address,
|
|
73
|
-
blockNumber,
|
|
74
|
-
pageSize = 10,
|
|
75
|
-
pageToken,
|
|
76
|
-
contractAddress
|
|
77
|
-
}) {
|
|
78
|
-
return this.httpRequest.request({
|
|
79
|
-
method: "GET",
|
|
80
|
-
url: "/v1/chains/{chainId}/addresses/{address}/balances:listErc1155",
|
|
81
|
-
path: {
|
|
82
|
-
"chainId": chainId,
|
|
83
|
-
"address": address
|
|
84
|
-
},
|
|
85
|
-
query: {
|
|
86
|
-
"blockNumber": blockNumber,
|
|
87
|
-
"pageSize": pageSize,
|
|
88
|
-
"pageToken": pageToken,
|
|
89
|
-
"contractAddress": contractAddress
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
listCollectibleBalances({
|
|
94
|
-
chainId,
|
|
95
|
-
address,
|
|
96
|
-
pageSize = 10,
|
|
97
|
-
pageToken,
|
|
98
|
-
contractAddress
|
|
99
|
-
}) {
|
|
100
|
-
return this.httpRequest.request({
|
|
101
|
-
method: "GET",
|
|
102
|
-
url: "/v1/chains/{chainId}/addresses/{address}/balances:listCollectibles",
|
|
103
|
-
path: {
|
|
104
|
-
"chainId": chainId,
|
|
105
|
-
"address": address
|
|
106
|
-
},
|
|
107
|
-
query: {
|
|
108
|
-
"pageSize": pageSize,
|
|
109
|
-
"pageToken": pageToken,
|
|
110
|
-
"contractAddress": contractAddress
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
getLatestBlocks({
|
|
115
|
-
chainId,
|
|
116
|
-
pageSize = 10,
|
|
117
|
-
pageToken
|
|
118
|
-
}) {
|
|
119
|
-
return this.httpRequest.request({
|
|
120
|
-
method: "GET",
|
|
121
|
-
url: "/v1/chains/{chainId}/blocks",
|
|
122
|
-
path: {
|
|
123
|
-
"chainId": chainId
|
|
124
|
-
},
|
|
125
|
-
query: {
|
|
126
|
-
"pageSize": pageSize,
|
|
127
|
-
"pageToken": pageToken
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
getBlock({
|
|
132
|
-
chainId,
|
|
133
|
-
blockId
|
|
134
|
-
}) {
|
|
135
|
-
return this.httpRequest.request({
|
|
136
|
-
method: "GET",
|
|
137
|
-
url: "/v1/chains/{chainId}/blocks/{blockId}",
|
|
138
|
-
path: {
|
|
139
|
-
"chainId": chainId,
|
|
140
|
-
"blockId": blockId
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
5
|
getDeploymentTransaction({
|
|
145
6
|
chainId,
|
|
146
7
|
address,
|
|
@@ -158,95 +19,22 @@ class EvmService {
|
|
|
158
19
|
}
|
|
159
20
|
});
|
|
160
21
|
}
|
|
161
|
-
|
|
162
|
-
network
|
|
163
|
-
}) {
|
|
164
|
-
return this.httpRequest.request({
|
|
165
|
-
method: "GET",
|
|
166
|
-
url: "/v1/chains",
|
|
167
|
-
query: {
|
|
168
|
-
"network": network
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
getChainInfo({
|
|
173
|
-
chainId
|
|
174
|
-
}) {
|
|
175
|
-
return this.httpRequest.request({
|
|
176
|
-
method: "GET",
|
|
177
|
-
url: "/v1/chains/{chainId}",
|
|
178
|
-
path: {
|
|
179
|
-
"chainId": chainId
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
reindexNft({
|
|
22
|
+
listContractDeployments({
|
|
184
23
|
chainId,
|
|
185
24
|
address,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return this.httpRequest.request({
|
|
189
|
-
method: "POST",
|
|
190
|
-
url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}:reindex",
|
|
191
|
-
path: {
|
|
192
|
-
"chainId": chainId,
|
|
193
|
-
"address": address,
|
|
194
|
-
"tokenId": tokenId
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
getCollection({
|
|
199
|
-
chainId,
|
|
200
|
-
address,
|
|
201
|
-
timeframe
|
|
25
|
+
pageSize = 10,
|
|
26
|
+
pageToken
|
|
202
27
|
}) {
|
|
203
28
|
return this.httpRequest.request({
|
|
204
29
|
method: "GET",
|
|
205
|
-
url: "/v1/chains/{chainId}/
|
|
30
|
+
url: "/v1/chains/{chainId}/addresses/{address}/deployments",
|
|
206
31
|
path: {
|
|
207
32
|
"chainId": chainId,
|
|
208
33
|
"address": address
|
|
209
34
|
},
|
|
210
|
-
query: {
|
|
211
|
-
"timeframe": timeframe
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
listCollections({
|
|
216
|
-
chainId,
|
|
217
|
-
pageSize = 10,
|
|
218
|
-
pageToken,
|
|
219
|
-
timeframe,
|
|
220
|
-
sortBy,
|
|
221
|
-
sortOrder
|
|
222
|
-
}) {
|
|
223
|
-
return this.httpRequest.request({
|
|
224
|
-
method: "GET",
|
|
225
|
-
url: "/v1/chains/{chainId}/nfts/collections",
|
|
226
|
-
path: {
|
|
227
|
-
"chainId": chainId
|
|
228
|
-
},
|
|
229
35
|
query: {
|
|
230
36
|
"pageSize": pageSize,
|
|
231
|
-
"pageToken": pageToken
|
|
232
|
-
"timeframe": timeframe,
|
|
233
|
-
"sortBy": sortBy,
|
|
234
|
-
"sortOrder": sortOrder
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
getTokenDetails({
|
|
239
|
-
chainId,
|
|
240
|
-
address,
|
|
241
|
-
tokenId
|
|
242
|
-
}) {
|
|
243
|
-
return this.httpRequest.request({
|
|
244
|
-
method: "GET",
|
|
245
|
-
url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}",
|
|
246
|
-
path: {
|
|
247
|
-
"chainId": chainId,
|
|
248
|
-
"address": address,
|
|
249
|
-
"tokenId": tokenId
|
|
37
|
+
"pageToken": pageToken
|
|
250
38
|
}
|
|
251
39
|
});
|
|
252
40
|
}
|
|
@@ -460,4 +248,4 @@ class EvmService {
|
|
|
460
248
|
}
|
|
461
249
|
}
|
|
462
250
|
|
|
463
|
-
export {
|
|
251
|
+
export { EvmTransactionsService };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { CollectionSortByOption } from '../models/CollectionSortByOption.js';
|
|
2
|
+
import { Erc1155Token } from '../models/Erc1155Token.js';
|
|
3
|
+
import { Erc721Token } from '../models/Erc721Token.js';
|
|
4
|
+
import { ListNftCollectionWithMetricsResponse } from '../models/ListNftCollectionWithMetricsResponse.js';
|
|
5
|
+
import { NftCollectionWithMetrics } from '../models/NftCollectionWithMetrics.js';
|
|
6
|
+
import { SortOrder } from '../models/SortOrder.js';
|
|
7
|
+
import { TrendingTimeframe } from '../models/TrendingTimeframe.js';
|
|
8
|
+
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
9
|
+
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
10
|
+
|
|
11
|
+
declare class NfTsService {
|
|
12
|
+
readonly httpRequest: BaseHttpRequest;
|
|
13
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
14
|
+
/**
|
|
15
|
+
* Reindex NFT metadata
|
|
16
|
+
* Triggers reindexing of token metadata for NFT contracts. Will return 400 if the NFT has been indexed within the last hour.
|
|
17
|
+
* @returns any
|
|
18
|
+
* @throws ApiError
|
|
19
|
+
*/
|
|
20
|
+
reindexNft({ chainId, address, tokenId, }: {
|
|
21
|
+
/**
|
|
22
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
23
|
+
*/
|
|
24
|
+
chainId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Contract address on the relevant chain.
|
|
27
|
+
*/
|
|
28
|
+
address: string;
|
|
29
|
+
/**
|
|
30
|
+
* TokenId on the contract
|
|
31
|
+
*/
|
|
32
|
+
tokenId: string;
|
|
33
|
+
}): CancelablePromise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* Get collection details
|
|
36
|
+
* Get collection details for a specific contract.
|
|
37
|
+
* @returns NftCollectionWithMetrics
|
|
38
|
+
* @throws ApiError
|
|
39
|
+
*/
|
|
40
|
+
getCollection({ chainId, address, timeframe, }: {
|
|
41
|
+
/**
|
|
42
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
43
|
+
*/
|
|
44
|
+
chainId: string;
|
|
45
|
+
/**
|
|
46
|
+
* Contract address on the relevant chain.
|
|
47
|
+
*/
|
|
48
|
+
address: string;
|
|
49
|
+
/**
|
|
50
|
+
* The timeframe to use for trending listings. Use "DAY" for 24 hours, "WEEK" for 7 days, "MONTH" for 30 days.
|
|
51
|
+
*/
|
|
52
|
+
timeframe?: TrendingTimeframe;
|
|
53
|
+
}): CancelablePromise<NftCollectionWithMetrics>;
|
|
54
|
+
/**
|
|
55
|
+
* List collections
|
|
56
|
+
* Lists details and metrics for collections.
|
|
57
|
+
* @returns ListNftCollectionWithMetricsResponse
|
|
58
|
+
* @throws ApiError
|
|
59
|
+
*/
|
|
60
|
+
listCollections({ chainId, pageSize, pageToken, timeframe, sortBy, sortOrder, }: {
|
|
61
|
+
/**
|
|
62
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
63
|
+
*/
|
|
64
|
+
chainId: string;
|
|
65
|
+
/**
|
|
66
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
67
|
+
*/
|
|
68
|
+
pageSize?: number;
|
|
69
|
+
/**
|
|
70
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
71
|
+
*/
|
|
72
|
+
pageToken?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The timeframe to use for trending listings. Use "DAY" for 24 hours, "WEEK" for 7 days, "MONTH" for 30 days.
|
|
75
|
+
*/
|
|
76
|
+
timeframe?: TrendingTimeframe;
|
|
77
|
+
/**
|
|
78
|
+
* Which property to sort by, in conjunction with sortOrder.
|
|
79
|
+
*/
|
|
80
|
+
sortBy?: CollectionSortByOption;
|
|
81
|
+
/**
|
|
82
|
+
* The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided.
|
|
83
|
+
*/
|
|
84
|
+
sortOrder?: SortOrder;
|
|
85
|
+
}): CancelablePromise<ListNftCollectionWithMetricsResponse>;
|
|
86
|
+
/**
|
|
87
|
+
* Get token details
|
|
88
|
+
* Get token details for a specific token of a contract.
|
|
89
|
+
* @returns any
|
|
90
|
+
* @throws ApiError
|
|
91
|
+
*/
|
|
92
|
+
getTokenDetails({ chainId, address, tokenId, }: {
|
|
93
|
+
/**
|
|
94
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
95
|
+
*/
|
|
96
|
+
chainId: string;
|
|
97
|
+
/**
|
|
98
|
+
* Contract address on the relevant chain.
|
|
99
|
+
*/
|
|
100
|
+
address: string;
|
|
101
|
+
/**
|
|
102
|
+
* TokenId on the contract
|
|
103
|
+
*/
|
|
104
|
+
tokenId: string;
|
|
105
|
+
}): CancelablePromise<(Erc721Token | Erc1155Token)>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { NfTsService };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
class NfTsService {
|
|
2
|
+
constructor(httpRequest) {
|
|
3
|
+
this.httpRequest = httpRequest;
|
|
4
|
+
}
|
|
5
|
+
reindexNft({
|
|
6
|
+
chainId,
|
|
7
|
+
address,
|
|
8
|
+
tokenId
|
|
9
|
+
}) {
|
|
10
|
+
return this.httpRequest.request({
|
|
11
|
+
method: "POST",
|
|
12
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}:reindex",
|
|
13
|
+
path: {
|
|
14
|
+
"chainId": chainId,
|
|
15
|
+
"address": address,
|
|
16
|
+
"tokenId": tokenId
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
getCollection({
|
|
21
|
+
chainId,
|
|
22
|
+
address,
|
|
23
|
+
timeframe
|
|
24
|
+
}) {
|
|
25
|
+
return this.httpRequest.request({
|
|
26
|
+
method: "GET",
|
|
27
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}",
|
|
28
|
+
path: {
|
|
29
|
+
"chainId": chainId,
|
|
30
|
+
"address": address
|
|
31
|
+
},
|
|
32
|
+
query: {
|
|
33
|
+
"timeframe": timeframe
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
listCollections({
|
|
38
|
+
chainId,
|
|
39
|
+
pageSize = 10,
|
|
40
|
+
pageToken,
|
|
41
|
+
timeframe,
|
|
42
|
+
sortBy,
|
|
43
|
+
sortOrder
|
|
44
|
+
}) {
|
|
45
|
+
return this.httpRequest.request({
|
|
46
|
+
method: "GET",
|
|
47
|
+
url: "/v1/chains/{chainId}/nfts/collections",
|
|
48
|
+
path: {
|
|
49
|
+
"chainId": chainId
|
|
50
|
+
},
|
|
51
|
+
query: {
|
|
52
|
+
"pageSize": pageSize,
|
|
53
|
+
"pageToken": pageToken,
|
|
54
|
+
"timeframe": timeframe,
|
|
55
|
+
"sortBy": sortBy,
|
|
56
|
+
"sortOrder": sortOrder
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
getTokenDetails({
|
|
61
|
+
chainId,
|
|
62
|
+
address,
|
|
63
|
+
tokenId
|
|
64
|
+
}) {
|
|
65
|
+
return this.httpRequest.request({
|
|
66
|
+
method: "GET",
|
|
67
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}",
|
|
68
|
+
path: {
|
|
69
|
+
"chainId": chainId,
|
|
70
|
+
"address": address,
|
|
71
|
+
"tokenId": tokenId
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { NfTsService };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BlockchainId } from '../models/BlockchainId.js';
|
|
2
|
+
import { ListCChainAtomicBalancesResponse } from '../models/ListCChainAtomicBalancesResponse.js';
|
|
3
|
+
import { ListPChainBalancesResponse } from '../models/ListPChainBalancesResponse.js';
|
|
4
|
+
import { ListXChainBalancesResponse } from '../models/ListXChainBalancesResponse.js';
|
|
5
|
+
import { Network } from '../models/Network.js';
|
|
6
|
+
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
7
|
+
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
8
|
+
|
|
9
|
+
declare class PrimaryNetworkBalancesService {
|
|
10
|
+
readonly httpRequest: BaseHttpRequest;
|
|
11
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
12
|
+
/**
|
|
13
|
+
* Get balances
|
|
14
|
+
* Gets primary network balances for one of the Primary Network chains for the supplied addresses.
|
|
15
|
+
*
|
|
16
|
+
* C-Chain balances returned are only the shared atomic memory balance. For EVM balance, use the `/v1/chains/:chainId/addresses/:addressId/balances:getNative` endpoint.
|
|
17
|
+
* @returns any
|
|
18
|
+
* @throws ApiError
|
|
19
|
+
*/
|
|
20
|
+
getBalancesByAddresses({ blockchainId, network, blockTimestamp, addresses, }: {
|
|
21
|
+
/**
|
|
22
|
+
* A primary network blockchain id or alias.
|
|
23
|
+
*/
|
|
24
|
+
blockchainId: BlockchainId;
|
|
25
|
+
/**
|
|
26
|
+
* Either mainnet or a testnet.
|
|
27
|
+
*/
|
|
28
|
+
network: Network;
|
|
29
|
+
/**
|
|
30
|
+
* An epoch timestamp in seconds. Balance will be calculated at this timestamp.
|
|
31
|
+
*/
|
|
32
|
+
blockTimestamp?: number;
|
|
33
|
+
/**
|
|
34
|
+
* A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji".
|
|
35
|
+
*/
|
|
36
|
+
addresses?: string;
|
|
37
|
+
}): CancelablePromise<(ListPChainBalancesResponse | ListXChainBalancesResponse | ListCChainAtomicBalancesResponse)>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { PrimaryNetworkBalancesService };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
class PrimaryNetworkBalancesService {
|
|
2
|
+
constructor(httpRequest) {
|
|
3
|
+
this.httpRequest = httpRequest;
|
|
4
|
+
}
|
|
5
|
+
getBalancesByAddresses({
|
|
6
|
+
blockchainId,
|
|
7
|
+
network,
|
|
8
|
+
blockTimestamp,
|
|
9
|
+
addresses
|
|
10
|
+
}) {
|
|
11
|
+
return this.httpRequest.request({
|
|
12
|
+
method: "GET",
|
|
13
|
+
url: "/v1/networks/{network}/blockchains/{blockchainId}/balances",
|
|
14
|
+
path: {
|
|
15
|
+
"blockchainId": blockchainId,
|
|
16
|
+
"network": network
|
|
17
|
+
},
|
|
18
|
+
query: {
|
|
19
|
+
"blockTimestamp": blockTimestamp,
|
|
20
|
+
"addresses": addresses
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { PrimaryNetworkBalancesService };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { BlockchainId } from '../models/BlockchainId.js';
|
|
2
|
+
import { GetPrimaryNetworkBlockResponse } from '../models/GetPrimaryNetworkBlockResponse.js';
|
|
3
|
+
import { ListPrimaryNetworkBlocksResponse } from '../models/ListPrimaryNetworkBlocksResponse.js';
|
|
4
|
+
import { Network } from '../models/Network.js';
|
|
5
|
+
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
6
|
+
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
7
|
+
|
|
8
|
+
declare class PrimaryNetworkBlocksService {
|
|
9
|
+
readonly httpRequest: BaseHttpRequest;
|
|
10
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
11
|
+
/**
|
|
12
|
+
* Get block
|
|
13
|
+
* Gets a block by block height or block hash on one of the Primary Network chains.
|
|
14
|
+
* @returns GetPrimaryNetworkBlockResponse
|
|
15
|
+
* @throws ApiError
|
|
16
|
+
*/
|
|
17
|
+
getBlockById({ blockchainId, network, blockId, }: {
|
|
18
|
+
/**
|
|
19
|
+
* A primary network blockchain id or alias.
|
|
20
|
+
*/
|
|
21
|
+
blockchainId: BlockchainId;
|
|
22
|
+
/**
|
|
23
|
+
* Either mainnet or a testnet.
|
|
24
|
+
*/
|
|
25
|
+
network: Network;
|
|
26
|
+
/**
|
|
27
|
+
* A block identifier which is either a block number or the block hash.
|
|
28
|
+
*/
|
|
29
|
+
blockId: string;
|
|
30
|
+
}): CancelablePromise<GetPrimaryNetworkBlockResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* List blocks proposed by node
|
|
33
|
+
* Lists the latest blocks proposed by a given NodeID on one of the Primary Network chains.
|
|
34
|
+
* @returns ListPrimaryNetworkBlocksResponse
|
|
35
|
+
* @throws ApiError
|
|
36
|
+
*/
|
|
37
|
+
listPrimaryNetworkBlocksByNodeId({ blockchainId, network, nodeId, pageSize, pageToken, }: {
|
|
38
|
+
/**
|
|
39
|
+
* A primary network blockchain id or alias.
|
|
40
|
+
*/
|
|
41
|
+
blockchainId: BlockchainId;
|
|
42
|
+
/**
|
|
43
|
+
* Either mainnet or a testnet.
|
|
44
|
+
*/
|
|
45
|
+
network: Network;
|
|
46
|
+
/**
|
|
47
|
+
* A primary network (P or X chain) nodeId.
|
|
48
|
+
*/
|
|
49
|
+
nodeId: string;
|
|
50
|
+
/**
|
|
51
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
52
|
+
*/
|
|
53
|
+
pageSize?: number;
|
|
54
|
+
/**
|
|
55
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
56
|
+
*/
|
|
57
|
+
pageToken?: string;
|
|
58
|
+
}): CancelablePromise<ListPrimaryNetworkBlocksResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* List latest blocks
|
|
61
|
+
* Lists latest blocks on one of the Primary Network chains.
|
|
62
|
+
* @returns ListPrimaryNetworkBlocksResponse
|
|
63
|
+
* @throws ApiError
|
|
64
|
+
*/
|
|
65
|
+
listLatestPrimaryNetworkBlocks({ blockchainId, network, pageSize, pageToken, }: {
|
|
66
|
+
/**
|
|
67
|
+
* A primary network blockchain id or alias.
|
|
68
|
+
*/
|
|
69
|
+
blockchainId: BlockchainId;
|
|
70
|
+
/**
|
|
71
|
+
* Either mainnet or a testnet.
|
|
72
|
+
*/
|
|
73
|
+
network: Network;
|
|
74
|
+
/**
|
|
75
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
76
|
+
*/
|
|
77
|
+
pageSize?: number;
|
|
78
|
+
/**
|
|
79
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
80
|
+
*/
|
|
81
|
+
pageToken?: string;
|
|
82
|
+
}): CancelablePromise<ListPrimaryNetworkBlocksResponse>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { PrimaryNetworkBlocksService };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
class PrimaryNetworkBlocksService {
|
|
2
|
+
constructor(httpRequest) {
|
|
3
|
+
this.httpRequest = httpRequest;
|
|
4
|
+
}
|
|
5
|
+
getBlockById({
|
|
6
|
+
blockchainId,
|
|
7
|
+
network,
|
|
8
|
+
blockId
|
|
9
|
+
}) {
|
|
10
|
+
return this.httpRequest.request({
|
|
11
|
+
method: "GET",
|
|
12
|
+
url: "/v1/networks/{network}/blockchains/{blockchainId}/blocks/{blockId}",
|
|
13
|
+
path: {
|
|
14
|
+
"blockchainId": blockchainId,
|
|
15
|
+
"network": network,
|
|
16
|
+
"blockId": blockId
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
listPrimaryNetworkBlocksByNodeId({
|
|
21
|
+
blockchainId,
|
|
22
|
+
network,
|
|
23
|
+
nodeId,
|
|
24
|
+
pageSize = 10,
|
|
25
|
+
pageToken
|
|
26
|
+
}) {
|
|
27
|
+
return this.httpRequest.request({
|
|
28
|
+
method: "GET",
|
|
29
|
+
url: "/v1/networks/{network}/blockchains/{blockchainId}/nodes/{nodeId}/blocks",
|
|
30
|
+
path: {
|
|
31
|
+
"blockchainId": blockchainId,
|
|
32
|
+
"network": network,
|
|
33
|
+
"nodeId": nodeId
|
|
34
|
+
},
|
|
35
|
+
query: {
|
|
36
|
+
"pageSize": pageSize,
|
|
37
|
+
"pageToken": pageToken
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
listLatestPrimaryNetworkBlocks({
|
|
42
|
+
blockchainId,
|
|
43
|
+
network,
|
|
44
|
+
pageSize = 10,
|
|
45
|
+
pageToken
|
|
46
|
+
}) {
|
|
47
|
+
return this.httpRequest.request({
|
|
48
|
+
method: "GET",
|
|
49
|
+
url: "/v1/networks/{network}/blockchains/{blockchainId}/blocks",
|
|
50
|
+
path: {
|
|
51
|
+
"blockchainId": blockchainId,
|
|
52
|
+
"network": network
|
|
53
|
+
},
|
|
54
|
+
query: {
|
|
55
|
+
"pageSize": pageSize,
|
|
56
|
+
"pageToken": pageToken
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { PrimaryNetworkBlocksService };
|