@avalabs/glacier-sdk 2.8.0-canary.ca01c76.0 → 2.8.0-canary.df4401e.0

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.
Files changed (57) hide show
  1. package/dist/index.d.ts +455 -219
  2. package/dist/index.js +201 -65
  3. package/esm/generated/Glacier.d.ts +4 -0
  4. package/esm/generated/Glacier.js +30 -10
  5. package/esm/generated/core/ApiError.js +5 -0
  6. package/esm/generated/core/CancelablePromise.js +11 -6
  7. package/esm/generated/core/request.js +14 -31
  8. package/esm/generated/models/ActiveDelegatorDetails.d.ts +7 -3
  9. package/esm/generated/models/ActiveDelegatorDetails.js +8 -0
  10. package/esm/generated/models/ActiveValidatorDetails.d.ts +13 -6
  11. package/esm/generated/models/ActiveValidatorDetails.js +8 -0
  12. package/esm/generated/models/ChainInfo.d.ts +1 -0
  13. package/esm/generated/models/CompletedDelegatorDetails.d.ts +7 -3
  14. package/esm/generated/models/CompletedDelegatorDetails.js +8 -0
  15. package/esm/generated/models/CompletedValidatorDetails.d.ts +8 -3
  16. package/esm/generated/models/CompletedValidatorDetails.js +8 -0
  17. package/esm/generated/models/ContractSubmissionBody.d.ts +10 -0
  18. package/esm/generated/models/ContractSubmissionErc1155.d.ts +31 -0
  19. package/esm/generated/models/ContractSubmissionErc1155.js +8 -0
  20. package/esm/generated/models/ContractSubmissionErc20.d.ts +31 -0
  21. package/esm/generated/models/ContractSubmissionErc20.js +8 -0
  22. package/esm/generated/models/ContractSubmissionErc721.d.ts +29 -0
  23. package/esm/generated/models/ContractSubmissionErc721.js +8 -0
  24. package/esm/generated/models/ContractSubmissionUnknown.d.ts +25 -0
  25. package/esm/generated/models/ContractSubmissionUnknown.js +8 -0
  26. package/esm/generated/models/Erc20Contract.d.ts +1 -1
  27. package/esm/generated/models/GetChainResponse.d.ts +1 -0
  28. package/esm/generated/models/ListContractsResponse.d.ts +1 -1
  29. package/esm/generated/models/ListValidatorDetailsResponse.d.ts +1 -1
  30. package/esm/generated/models/PChainTransaction.d.ts +1 -0
  31. package/esm/generated/models/PChainTransactionType.d.ts +1 -0
  32. package/esm/generated/models/PChainTransactionType.js +1 -0
  33. package/esm/generated/models/PendingDelegatorDetails.d.ts +7 -3
  34. package/esm/generated/models/PendingDelegatorDetails.js +8 -0
  35. package/esm/generated/models/PendingValidatorDetails.d.ts +8 -4
  36. package/esm/generated/models/PendingValidatorDetails.js +8 -0
  37. package/esm/generated/models/PrimaryNetworkTxType.d.ts +1 -0
  38. package/esm/generated/models/PrimaryNetworkTxType.js +1 -0
  39. package/esm/generated/models/RewardType.d.ts +2 -1
  40. package/esm/generated/models/RewardType.js +1 -0
  41. package/esm/generated/models/Rewards.d.ts +2 -0
  42. package/esm/generated/models/UpdateContractResponse.d.ts +10 -0
  43. package/esm/generated/models/ValidatorHealthDetails.d.ts +20 -0
  44. package/esm/generated/services/DefaultService.d.ts +14 -0
  45. package/esm/generated/services/DefaultService.js +13 -0
  46. package/esm/generated/services/EvmContractsService.d.ts +48 -0
  47. package/esm/generated/services/EvmContractsService.js +36 -0
  48. package/esm/generated/services/EvmTransactionsService.js +1 -1
  49. package/esm/generated/services/NfTsService.d.ts +0 -18
  50. package/esm/generated/services/NfTsService.js +0 -13
  51. package/esm/generated/services/PrimaryNetworkRewardsService.d.ts +10 -2
  52. package/esm/generated/services/PrimaryNetworkRewardsService.js +4 -0
  53. package/esm/generated/services/PrimaryNetworkService.d.ts +32 -8
  54. package/esm/generated/services/PrimaryNetworkService.js +16 -4
  55. package/esm/index.d.ts +9 -0
  56. package/esm/index.js +12 -0
  57. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -7,6 +7,11 @@ class BaseHttpRequest {
7
7
  }
8
8
 
9
9
  class ApiError extends Error {
10
+ url;
11
+ status;
12
+ statusText;
13
+ body;
14
+ request;
10
15
  constructor(request, response, message) {
11
16
  super(message);
12
17
  this.name = "ApiError";
@@ -28,6 +33,14 @@ class CancelError extends Error {
28
33
  }
29
34
  }
30
35
  class CancelablePromise {
36
+ [Symbol.toStringTag];
37
+ _isResolved;
38
+ _isRejected;
39
+ _isCancelled;
40
+ _cancelHandlers;
41
+ _promise;
42
+ _resolve;
43
+ _reject;
31
44
  constructor(executor) {
32
45
  this._isResolved = false;
33
46
  this._isRejected = false;
@@ -37,20 +50,18 @@ class CancelablePromise {
37
50
  this._resolve = resolve;
38
51
  this._reject = reject;
39
52
  const onResolve = (value) => {
40
- var _a;
41
53
  if (this._isResolved || this._isRejected || this._isCancelled) {
42
54
  return;
43
55
  }
44
56
  this._isResolved = true;
45
- (_a = this._resolve) == null ? void 0 : _a.call(this, value);
57
+ this._resolve?.(value);
46
58
  };
47
59
  const onReject = (reason) => {
48
- var _a;
49
60
  if (this._isResolved || this._isRejected || this._isCancelled) {
50
61
  return;
51
62
  }
52
63
  this._isRejected = true;
53
- (_a = this._reject) == null ? void 0 : _a.call(this, reason);
64
+ this._reject?.(reason);
54
65
  };
55
66
  const onCancel = (cancelHandler) => {
56
67
  if (this._isResolved || this._isRejected || this._isCancelled) {
@@ -80,7 +91,6 @@ class CancelablePromise {
80
91
  return this._promise.finally(onFinally);
81
92
  }
82
93
  cancel() {
83
- var _a;
84
94
  if (this._isResolved || this._isRejected || this._isCancelled) {
85
95
  return;
86
96
  }
@@ -96,32 +106,13 @@ class CancelablePromise {
96
106
  }
97
107
  }
98
108
  this._cancelHandlers.length = 0;
99
- (_a = this._reject) == null ? void 0 : _a.call(this, new CancelError("Request aborted"));
109
+ this._reject?.(new CancelError("Request aborted"));
100
110
  }
101
111
  get isCancelled() {
102
112
  return this._isCancelled;
103
113
  }
104
114
  }
105
115
 
106
- var __defProp = Object.defineProperty;
107
- var __defProps = Object.defineProperties;
108
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
109
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
110
- var __hasOwnProp = Object.prototype.hasOwnProperty;
111
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
112
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
113
- var __spreadValues = (a, b) => {
114
- for (var prop in b || (b = {}))
115
- if (__hasOwnProp.call(b, prop))
116
- __defNormalProp(a, prop, b[prop]);
117
- if (__getOwnPropSymbols)
118
- for (var prop of __getOwnPropSymbols(b)) {
119
- if (__propIsEnum.call(b, prop))
120
- __defNormalProp(a, prop, b[prop]);
121
- }
122
- return a;
123
- };
124
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
125
116
  const isDefined = (value) => {
126
117
  return value !== void 0 && value !== null;
127
118
  };
@@ -175,8 +166,7 @@ const getQueryString = (params) => {
175
166
  const getUrl = (config, options) => {
176
167
  const encoder = config.ENCODE_PATH || encodeURI;
177
168
  const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
178
- var _a;
179
- if ((_a = options.path) == null ? void 0 : _a.hasOwnProperty(group)) {
169
+ if (options.path?.hasOwnProperty(group)) {
180
170
  return encoder(String(options.path[group]));
181
171
  }
182
172
  return substring;
@@ -219,9 +209,12 @@ const getHeaders = async (config, options) => {
219
209
  const username = await resolve(options, config.USERNAME);
220
210
  const password = await resolve(options, config.PASSWORD);
221
211
  const additionalHeaders = await resolve(options, config.HEADERS);
222
- const headers = Object.entries(__spreadValues(__spreadValues({
223
- Accept: "application/json"
224
- }, additionalHeaders), options.headers)).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => __spreadProps(__spreadValues({}, headers2), {
212
+ const headers = Object.entries({
213
+ Accept: "application/json",
214
+ ...additionalHeaders,
215
+ ...options.headers
216
+ }).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
217
+ ...headers2,
225
218
  [key]: String(value)
226
219
  }), {});
227
220
  if (isStringWithValue(token)) {
@@ -245,9 +238,8 @@ const getHeaders = async (config, options) => {
245
238
  return new Headers(headers);
246
239
  };
247
240
  const getRequestBody = (options) => {
248
- var _a;
249
241
  if (options.body) {
250
- if ((_a = options.mediaType) == null ? void 0 : _a.includes("/json")) {
242
+ if (options.mediaType?.includes("/json")) {
251
243
  return JSON.stringify(options.body);
252
244
  } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
253
245
  return options.body;
@@ -261,7 +253,7 @@ const sendRequest = async (config, options, url, body, formData, headers, onCanc
261
253
  const controller = new AbortController();
262
254
  const request2 = {
263
255
  headers,
264
- body: body != null ? body : formData,
256
+ body: body ?? formData,
265
257
  method: options.method,
266
258
  signal: controller.signal
267
259
  };
@@ -299,15 +291,16 @@ const getResponseBody = async (response) => {
299
291
  return void 0;
300
292
  };
301
293
  const catchErrorCodes = (options, result) => {
302
- const errors = __spreadValues({
294
+ const errors = {
303
295
  400: "Bad Request",
304
296
  401: "Unauthorized",
305
297
  403: "Forbidden",
306
298
  404: "Not Found",
307
299
  500: "Internal Server Error",
308
300
  502: "Bad Gateway",
309
- 503: "Service Unavailable"
310
- }, options.errors);
301
+ 503: "Service Unavailable",
302
+ ...options.errors
303
+ };
311
304
  const error = errors[result.status];
312
305
  if (error) {
313
306
  throw new ApiError(options, result, error);
@@ -332,7 +325,7 @@ const request = (config, options) => {
332
325
  ok: response.ok,
333
326
  status: response.status,
334
327
  statusText: response.statusText,
335
- body: responseHeader != null ? responseHeader : responseBody
328
+ body: responseHeader ?? responseBody
336
329
  };
337
330
  catchErrorCodes(options, result);
338
331
  resolve2(result.body);
@@ -352,6 +345,18 @@ class FetchHttpRequest extends BaseHttpRequest {
352
345
  }
353
346
  }
354
347
 
348
+ class DefaultService {
349
+ constructor(httpRequest) {
350
+ this.httpRequest = httpRequest;
351
+ }
352
+ mediaControllerUploadImage() {
353
+ return this.httpRequest.request({
354
+ method: "POST",
355
+ url: "/v1/media/uploadImage"
356
+ });
357
+ }
358
+ }
359
+
355
360
  class EvmBalancesService {
356
361
  constructor(httpRequest) {
357
362
  this.httpRequest = httpRequest;
@@ -531,6 +536,41 @@ class EvmChainsService {
531
536
  }
532
537
  }
533
538
 
539
+ class EvmContractsService {
540
+ constructor(httpRequest) {
541
+ this.httpRequest = httpRequest;
542
+ }
543
+ getContractMetadata({
544
+ chainId,
545
+ address
546
+ }) {
547
+ return this.httpRequest.request({
548
+ method: "GET",
549
+ url: "/v1/chains/{chainId}/addresses/{address}",
550
+ path: {
551
+ "chainId": chainId,
552
+ "address": address
553
+ }
554
+ });
555
+ }
556
+ updateContractInfo({
557
+ chainId,
558
+ address,
559
+ requestBody
560
+ }) {
561
+ return this.httpRequest.request({
562
+ method: "PATCH",
563
+ url: "/v1/chains/{chainId}/contracts/{address}",
564
+ path: {
565
+ "chainId": chainId,
566
+ "address": address
567
+ },
568
+ body: requestBody,
569
+ mediaType: "application/json"
570
+ });
571
+ }
572
+ }
573
+
534
574
  class EvmTransactionsService {
535
575
  constructor(httpRequest) {
536
576
  this.httpRequest = httpRequest;
@@ -560,7 +600,7 @@ class EvmTransactionsService {
560
600
  }) {
561
601
  return this.httpRequest.request({
562
602
  method: "GET",
563
- url: "/v1/chains/{chainId}/addresses/{address}/deployments",
603
+ url: "/v1/chains/{chainId}/contracts/{address}/deployments",
564
604
  path: {
565
605
  "chainId": chainId,
566
606
  "address": address
@@ -830,19 +870,6 @@ class NfTsService {
830
870
  }
831
871
  });
832
872
  }
833
- getCollection({
834
- chainId,
835
- address
836
- }) {
837
- return this.httpRequest.request({
838
- method: "GET",
839
- url: "/v1/chains/{chainId}/nfts/collections/{address}",
840
- path: {
841
- "chainId": chainId,
842
- "address": address
843
- }
844
- });
845
- }
846
873
  }
847
874
 
848
875
  class OperationsService {
@@ -959,10 +986,16 @@ class PrimaryNetworkService {
959
986
  network,
960
987
  pageSize = 10,
961
988
  pageToken,
989
+ minTimeRemaining,
990
+ maxTimeRemaining,
991
+ minDelegationCapacity,
992
+ maxDelegationCapacity,
993
+ minFeePercentage,
994
+ maxFeePercentage,
962
995
  nodeIds,
963
996
  sortOrder,
964
997
  validationStatus,
965
- minDelegationCapacity
998
+ subnetId
966
999
  }) {
967
1000
  return this.httpRequest.request({
968
1001
  method: "GET",
@@ -973,10 +1006,16 @@ class PrimaryNetworkService {
973
1006
  query: {
974
1007
  "pageSize": pageSize,
975
1008
  "pageToken": pageToken,
1009
+ "minTimeRemaining": minTimeRemaining,
1010
+ "maxTimeRemaining": maxTimeRemaining,
1011
+ "minDelegationCapacity": minDelegationCapacity,
1012
+ "maxDelegationCapacity": maxDelegationCapacity,
1013
+ "minFeePercentage": minFeePercentage,
1014
+ "maxFeePercentage": maxFeePercentage,
976
1015
  "nodeIds": nodeIds,
977
1016
  "sortOrder": sortOrder,
978
1017
  "validationStatus": validationStatus,
979
- "minDelegationCapacity": minDelegationCapacity
1018
+ "subnetId": subnetId
980
1019
  }
981
1020
  });
982
1021
  }
@@ -1007,9 +1046,9 @@ class PrimaryNetworkService {
1007
1046
  network,
1008
1047
  pageSize = 10,
1009
1048
  pageToken,
1049
+ rewardAddresses,
1010
1050
  sortOrder,
1011
1051
  delegationStatus,
1012
- rewardAddresses,
1013
1052
  nodeIds
1014
1053
  }) {
1015
1054
  return this.httpRequest.request({
@@ -1021,9 +1060,9 @@ class PrimaryNetworkService {
1021
1060
  query: {
1022
1061
  "pageSize": pageSize,
1023
1062
  "pageToken": pageToken,
1063
+ "rewardAddresses": rewardAddresses,
1024
1064
  "sortOrder": sortOrder,
1025
1065
  "delegationStatus": delegationStatus,
1026
- "rewardAddresses": rewardAddresses,
1027
1066
  "nodeIds": nodeIds
1028
1067
  }
1029
1068
  });
@@ -1125,6 +1164,7 @@ class PrimaryNetworkRewardsService {
1125
1164
  addresses,
1126
1165
  pageSize = 10,
1127
1166
  pageToken,
1167
+ nodeIds,
1128
1168
  sortOrder
1129
1169
  }) {
1130
1170
  return this.httpRequest.request({
@@ -1137,6 +1177,7 @@ class PrimaryNetworkRewardsService {
1137
1177
  "addresses": addresses,
1138
1178
  "pageSize": pageSize,
1139
1179
  "pageToken": pageToken,
1180
+ "nodeIds": nodeIds,
1140
1181
  "sortOrder": sortOrder
1141
1182
  }
1142
1183
  });
@@ -1146,6 +1187,7 @@ class PrimaryNetworkRewardsService {
1146
1187
  addresses,
1147
1188
  pageSize = 10,
1148
1189
  pageToken,
1190
+ nodeIds,
1149
1191
  sortOrder
1150
1192
  }) {
1151
1193
  return this.httpRequest.request({
@@ -1158,6 +1200,7 @@ class PrimaryNetworkRewardsService {
1158
1200
  "addresses": addresses,
1159
1201
  "pageSize": pageSize,
1160
1202
  "pageToken": pageToken,
1203
+ "nodeIds": nodeIds,
1161
1204
  "sortOrder": sortOrder
1162
1205
  }
1163
1206
  });
@@ -1367,22 +1410,40 @@ class PrimaryNetworkVerticesService {
1367
1410
  }
1368
1411
 
1369
1412
  class Glacier {
1413
+ default;
1414
+ evmBalances;
1415
+ evmBlocks;
1416
+ evmChains;
1417
+ evmContracts;
1418
+ evmTransactions;
1419
+ healthCheck;
1420
+ nfTs;
1421
+ operations;
1422
+ primaryNetwork;
1423
+ primaryNetworkBalances;
1424
+ primaryNetworkBlocks;
1425
+ primaryNetworkRewards;
1426
+ primaryNetworkTransactions;
1427
+ primaryNetworkUtxOs;
1428
+ primaryNetworkVertices;
1429
+ request;
1370
1430
  constructor(config, HttpRequest = FetchHttpRequest) {
1371
- var _a, _b, _c, _d;
1372
1431
  this.request = new HttpRequest({
1373
- BASE: (_a = config == null ? void 0 : config.BASE) != null ? _a : "https://glacier-api-dev.avax.network",
1374
- VERSION: (_b = config == null ? void 0 : config.VERSION) != null ? _b : "Beta",
1375
- WITH_CREDENTIALS: (_c = config == null ? void 0 : config.WITH_CREDENTIALS) != null ? _c : false,
1376
- CREDENTIALS: (_d = config == null ? void 0 : config.CREDENTIALS) != null ? _d : "include",
1377
- TOKEN: config == null ? void 0 : config.TOKEN,
1378
- USERNAME: config == null ? void 0 : config.USERNAME,
1379
- PASSWORD: config == null ? void 0 : config.PASSWORD,
1380
- HEADERS: config == null ? void 0 : config.HEADERS,
1381
- ENCODE_PATH: config == null ? void 0 : config.ENCODE_PATH
1432
+ BASE: config?.BASE ?? "https://glacier-api-dev.avax.network",
1433
+ VERSION: config?.VERSION ?? "Beta",
1434
+ WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
1435
+ CREDENTIALS: config?.CREDENTIALS ?? "include",
1436
+ TOKEN: config?.TOKEN,
1437
+ USERNAME: config?.USERNAME,
1438
+ PASSWORD: config?.PASSWORD,
1439
+ HEADERS: config?.HEADERS,
1440
+ ENCODE_PATH: config?.ENCODE_PATH
1382
1441
  });
1442
+ this.default = new DefaultService(this.request);
1383
1443
  this.evmBalances = new EvmBalancesService(this.request);
1384
1444
  this.evmBlocks = new EvmBlocksService(this.request);
1385
1445
  this.evmChains = new EvmChainsService(this.request);
1446
+ this.evmContracts = new EvmContractsService(this.request);
1386
1447
  this.evmTransactions = new EvmTransactionsService(this.request);
1387
1448
  this.healthCheck = new HealthCheckService(this.request);
1388
1449
  this.nfTs = new NfTsService(this.request);
@@ -1409,6 +1470,20 @@ const OpenAPI = {
1409
1470
  ENCODE_PATH: void 0
1410
1471
  };
1411
1472
 
1473
+ exports.ActiveDelegatorDetails = void 0;
1474
+ ((ActiveDelegatorDetails2) => {
1475
+ ((delegationStatus2) => {
1476
+ delegationStatus2["ACTIVE"] = "active";
1477
+ })(ActiveDelegatorDetails2.delegationStatus || (ActiveDelegatorDetails2.delegationStatus = {}));
1478
+ })(exports.ActiveDelegatorDetails || (exports.ActiveDelegatorDetails = {}));
1479
+
1480
+ exports.ActiveValidatorDetails = void 0;
1481
+ ((ActiveValidatorDetails2) => {
1482
+ ((validationStatus2) => {
1483
+ validationStatus2["ACTIVE"] = "active";
1484
+ })(ActiveValidatorDetails2.validationStatus || (ActiveValidatorDetails2.validationStatus = {}));
1485
+ })(exports.ActiveValidatorDetails || (exports.ActiveValidatorDetails = {}));
1486
+
1412
1487
  var BlockchainId = /* @__PURE__ */ ((BlockchainId2) => {
1413
1488
  BlockchainId2["_11111111111111111111111111111111LPO_YY"] = "11111111111111111111111111111111LpoYY";
1414
1489
  BlockchainId2["_2O_YMBNV4E_NHYQK2FJJ_V5N_VQLDBTM_NJZQ5S3QS3LO6FTN_C6FBY_M"] = "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM";
@@ -1450,6 +1525,48 @@ var ChainStatus = /* @__PURE__ */ ((ChainStatus2) => {
1450
1525
  return ChainStatus2;
1451
1526
  })(ChainStatus || {});
1452
1527
 
1528
+ exports.CompletedDelegatorDetails = void 0;
1529
+ ((CompletedDelegatorDetails2) => {
1530
+ ((delegationStatus2) => {
1531
+ delegationStatus2["COMPLETED"] = "completed";
1532
+ })(CompletedDelegatorDetails2.delegationStatus || (CompletedDelegatorDetails2.delegationStatus = {}));
1533
+ })(exports.CompletedDelegatorDetails || (exports.CompletedDelegatorDetails = {}));
1534
+
1535
+ exports.CompletedValidatorDetails = void 0;
1536
+ ((CompletedValidatorDetails2) => {
1537
+ ((validationStatus2) => {
1538
+ validationStatus2["COMPLETED"] = "completed";
1539
+ })(CompletedValidatorDetails2.validationStatus || (CompletedValidatorDetails2.validationStatus = {}));
1540
+ })(exports.CompletedValidatorDetails || (exports.CompletedValidatorDetails = {}));
1541
+
1542
+ exports.ContractSubmissionErc1155 = void 0;
1543
+ ((ContractSubmissionErc11552) => {
1544
+ ((ercType2) => {
1545
+ ercType2["ERC_1155"] = "ERC-1155";
1546
+ })(ContractSubmissionErc11552.ercType || (ContractSubmissionErc11552.ercType = {}));
1547
+ })(exports.ContractSubmissionErc1155 || (exports.ContractSubmissionErc1155 = {}));
1548
+
1549
+ exports.ContractSubmissionErc20 = void 0;
1550
+ ((ContractSubmissionErc202) => {
1551
+ ((ercType2) => {
1552
+ ercType2["ERC_20"] = "ERC-20";
1553
+ })(ContractSubmissionErc202.ercType || (ContractSubmissionErc202.ercType = {}));
1554
+ })(exports.ContractSubmissionErc20 || (exports.ContractSubmissionErc20 = {}));
1555
+
1556
+ exports.ContractSubmissionErc721 = void 0;
1557
+ ((ContractSubmissionErc7212) => {
1558
+ ((ercType2) => {
1559
+ ercType2["ERC_721"] = "ERC-721";
1560
+ })(ContractSubmissionErc7212.ercType || (ContractSubmissionErc7212.ercType = {}));
1561
+ })(exports.ContractSubmissionErc721 || (exports.ContractSubmissionErc721 = {}));
1562
+
1563
+ exports.ContractSubmissionUnknown = void 0;
1564
+ ((ContractSubmissionUnknown2) => {
1565
+ ((ercType2) => {
1566
+ ercType2["UNKNOWN"] = "UNKNOWN";
1567
+ })(ContractSubmissionUnknown2.ercType || (ContractSubmissionUnknown2.ercType = {}));
1568
+ })(exports.ContractSubmissionUnknown || (exports.ContractSubmissionUnknown = {}));
1569
+
1453
1570
  exports.CreateEvmTransactionExportRequest = void 0;
1454
1571
  ((CreateEvmTransactionExportRequest2) => {
1455
1572
  ((type2) => {
@@ -1621,6 +1738,7 @@ var PChainTransactionType = /* @__PURE__ */ ((PChainTransactionType2) => {
1621
1738
  PChainTransactionType2["ADD_VALIDATOR_TX"] = "AddValidatorTx";
1622
1739
  PChainTransactionType2["ADD_DELEGATOR_TX"] = "AddDelegatorTx";
1623
1740
  PChainTransactionType2["ADD_PERMISSIONLESS_VALIDATOR_TX"] = "AddPermissionlessValidatorTx";
1741
+ PChainTransactionType2["ADD_PERMISSIONLESS_DELEGATOR_TX"] = "AddPermissionlessDelegatorTx";
1624
1742
  PChainTransactionType2["ADD_SUBNET_VALIDATOR_TX"] = "AddSubnetValidatorTx";
1625
1743
  PChainTransactionType2["REMOVE_SUBNET_VALIDATOR_TX"] = "RemoveSubnetValidatorTx";
1626
1744
  PChainTransactionType2["REWARD_VALIDATOR_TX"] = "RewardValidatorTx";
@@ -1633,6 +1751,20 @@ var PChainTransactionType = /* @__PURE__ */ ((PChainTransactionType2) => {
1633
1751
  return PChainTransactionType2;
1634
1752
  })(PChainTransactionType || {});
1635
1753
 
1754
+ exports.PendingDelegatorDetails = void 0;
1755
+ ((PendingDelegatorDetails2) => {
1756
+ ((delegationStatus2) => {
1757
+ delegationStatus2["PENDING"] = "pending";
1758
+ })(PendingDelegatorDetails2.delegationStatus || (PendingDelegatorDetails2.delegationStatus = {}));
1759
+ })(exports.PendingDelegatorDetails || (exports.PendingDelegatorDetails = {}));
1760
+
1761
+ exports.PendingValidatorDetails = void 0;
1762
+ ((PendingValidatorDetails2) => {
1763
+ ((validationStatus2) => {
1764
+ validationStatus2["PENDING"] = "pending";
1765
+ })(PendingValidatorDetails2.validationStatus || (PendingValidatorDetails2.validationStatus = {}));
1766
+ })(exports.PendingValidatorDetails || (exports.PendingValidatorDetails = {}));
1767
+
1636
1768
  var PrimaryNetwork = /* @__PURE__ */ ((PrimaryNetwork2) => {
1637
1769
  PrimaryNetwork2["MAINNET"] = "mainnet";
1638
1770
  PrimaryNetwork2["FUJI"] = "fuji";
@@ -1650,6 +1782,7 @@ var PrimaryNetworkTxType = /* @__PURE__ */ ((PrimaryNetworkTxType2) => {
1650
1782
  PrimaryNetworkTxType2["ADD_VALIDATOR_TX"] = "AddValidatorTx";
1651
1783
  PrimaryNetworkTxType2["ADD_DELEGATOR_TX"] = "AddDelegatorTx";
1652
1784
  PrimaryNetworkTxType2["ADD_PERMISSIONLESS_VALIDATOR_TX"] = "AddPermissionlessValidatorTx";
1785
+ PrimaryNetworkTxType2["ADD_PERMISSIONLESS_DELEGATOR_TX"] = "AddPermissionlessDelegatorTx";
1653
1786
  PrimaryNetworkTxType2["ADD_SUBNET_VALIDATOR_TX"] = "AddSubnetValidatorTx";
1654
1787
  PrimaryNetworkTxType2["REMOVE_SUBNET_VALIDATOR_TX"] = "RemoveSubnetValidatorTx";
1655
1788
  PrimaryNetworkTxType2["REWARD_VALIDATOR_TX"] = "RewardValidatorTx";
@@ -1690,6 +1823,7 @@ var ResourceLinkType = /* @__PURE__ */ ((ResourceLinkType2) => {
1690
1823
  var RewardType = /* @__PURE__ */ ((RewardType2) => {
1691
1824
  RewardType2["VALIDATOR"] = "VALIDATOR";
1692
1825
  RewardType2["DELEGATOR"] = "DELEGATOR";
1826
+ RewardType2["VALIDATOR_FEE"] = "VALIDATOR_FEE";
1693
1827
  return RewardType2;
1694
1828
  })(RewardType || {});
1695
1829
 
@@ -1770,10 +1904,12 @@ exports.CancelError = CancelError;
1770
1904
  exports.CancelablePromise = CancelablePromise;
1771
1905
  exports.ChainStatus = ChainStatus;
1772
1906
  exports.CurrencyCode = CurrencyCode;
1907
+ exports.DefaultService = DefaultService;
1773
1908
  exports.DelegationStatusType = DelegationStatusType;
1774
1909
  exports.EvmBalancesService = EvmBalancesService;
1775
1910
  exports.EvmBlocksService = EvmBlocksService;
1776
1911
  exports.EvmChainsService = EvmChainsService;
1912
+ exports.EvmContractsService = EvmContractsService;
1777
1913
  exports.EvmTransactionsService = EvmTransactionsService;
1778
1914
  exports.Glacier = Glacier;
1779
1915
  exports.HealthCheckService = HealthCheckService;
@@ -1,8 +1,10 @@
1
1
  import { BaseHttpRequest } from './core/BaseHttpRequest.js';
2
2
  import { OpenAPIConfig } from './core/OpenAPI.js';
3
+ import { DefaultService } from './services/DefaultService.js';
3
4
  import { EvmBalancesService } from './services/EvmBalancesService.js';
4
5
  import { EvmBlocksService } from './services/EvmBlocksService.js';
5
6
  import { EvmChainsService } from './services/EvmChainsService.js';
7
+ import { EvmContractsService } from './services/EvmContractsService.js';
6
8
  import { EvmTransactionsService } from './services/EvmTransactionsService.js';
7
9
  import { HealthCheckService } from './services/HealthCheckService.js';
8
10
  import { NfTsService } from './services/NfTsService.js';
@@ -17,9 +19,11 @@ import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVertices
17
19
 
18
20
  type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
19
21
  declare class Glacier {
22
+ readonly default: DefaultService;
20
23
  readonly evmBalances: EvmBalancesService;
21
24
  readonly evmBlocks: EvmBlocksService;
22
25
  readonly evmChains: EvmChainsService;
26
+ readonly evmContracts: EvmContractsService;
23
27
  readonly evmTransactions: EvmTransactionsService;
24
28
  readonly healthCheck: HealthCheckService;
25
29
  readonly nfTs: NfTsService;
@@ -1,7 +1,9 @@
1
1
  import { FetchHttpRequest } from './core/FetchHttpRequest.js';
2
+ import { DefaultService } from './services/DefaultService.js';
2
3
  import { EvmBalancesService } from './services/EvmBalancesService.js';
3
4
  import { EvmBlocksService } from './services/EvmBlocksService.js';
4
5
  import { EvmChainsService } from './services/EvmChainsService.js';
6
+ import { EvmContractsService } from './services/EvmContractsService.js';
5
7
  import { EvmTransactionsService } from './services/EvmTransactionsService.js';
6
8
  import { HealthCheckService } from './services/HealthCheckService.js';
7
9
  import { NfTsService } from './services/NfTsService.js';
@@ -15,22 +17,40 @@ import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsServic
15
17
  import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
16
18
 
17
19
  class Glacier {
20
+ default;
21
+ evmBalances;
22
+ evmBlocks;
23
+ evmChains;
24
+ evmContracts;
25
+ evmTransactions;
26
+ healthCheck;
27
+ nfTs;
28
+ operations;
29
+ primaryNetwork;
30
+ primaryNetworkBalances;
31
+ primaryNetworkBlocks;
32
+ primaryNetworkRewards;
33
+ primaryNetworkTransactions;
34
+ primaryNetworkUtxOs;
35
+ primaryNetworkVertices;
36
+ request;
18
37
  constructor(config, HttpRequest = FetchHttpRequest) {
19
- var _a, _b, _c, _d;
20
38
  this.request = new HttpRequest({
21
- BASE: (_a = config == null ? void 0 : config.BASE) != null ? _a : "https://glacier-api-dev.avax.network",
22
- VERSION: (_b = config == null ? void 0 : config.VERSION) != null ? _b : "Beta",
23
- WITH_CREDENTIALS: (_c = config == null ? void 0 : config.WITH_CREDENTIALS) != null ? _c : false,
24
- CREDENTIALS: (_d = config == null ? void 0 : config.CREDENTIALS) != null ? _d : "include",
25
- TOKEN: config == null ? void 0 : config.TOKEN,
26
- USERNAME: config == null ? void 0 : config.USERNAME,
27
- PASSWORD: config == null ? void 0 : config.PASSWORD,
28
- HEADERS: config == null ? void 0 : config.HEADERS,
29
- ENCODE_PATH: config == null ? void 0 : config.ENCODE_PATH
39
+ BASE: config?.BASE ?? "https://glacier-api-dev.avax.network",
40
+ VERSION: config?.VERSION ?? "Beta",
41
+ WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
42
+ CREDENTIALS: config?.CREDENTIALS ?? "include",
43
+ TOKEN: config?.TOKEN,
44
+ USERNAME: config?.USERNAME,
45
+ PASSWORD: config?.PASSWORD,
46
+ HEADERS: config?.HEADERS,
47
+ ENCODE_PATH: config?.ENCODE_PATH
30
48
  });
49
+ this.default = new DefaultService(this.request);
31
50
  this.evmBalances = new EvmBalancesService(this.request);
32
51
  this.evmBlocks = new EvmBlocksService(this.request);
33
52
  this.evmChains = new EvmChainsService(this.request);
53
+ this.evmContracts = new EvmContractsService(this.request);
34
54
  this.evmTransactions = new EvmTransactionsService(this.request);
35
55
  this.healthCheck = new HealthCheckService(this.request);
36
56
  this.nfTs = new NfTsService(this.request);
@@ -1,4 +1,9 @@
1
1
  class ApiError extends Error {
2
+ url;
3
+ status;
4
+ statusText;
5
+ body;
6
+ request;
2
7
  constructor(request, response, message) {
3
8
  super(message);
4
9
  this.name = "ApiError";
@@ -8,6 +8,14 @@ class CancelError extends Error {
8
8
  }
9
9
  }
10
10
  class CancelablePromise {
11
+ [Symbol.toStringTag];
12
+ _isResolved;
13
+ _isRejected;
14
+ _isCancelled;
15
+ _cancelHandlers;
16
+ _promise;
17
+ _resolve;
18
+ _reject;
11
19
  constructor(executor) {
12
20
  this._isResolved = false;
13
21
  this._isRejected = false;
@@ -17,20 +25,18 @@ class CancelablePromise {
17
25
  this._resolve = resolve;
18
26
  this._reject = reject;
19
27
  const onResolve = (value) => {
20
- var _a;
21
28
  if (this._isResolved || this._isRejected || this._isCancelled) {
22
29
  return;
23
30
  }
24
31
  this._isResolved = true;
25
- (_a = this._resolve) == null ? void 0 : _a.call(this, value);
32
+ this._resolve?.(value);
26
33
  };
27
34
  const onReject = (reason) => {
28
- var _a;
29
35
  if (this._isResolved || this._isRejected || this._isCancelled) {
30
36
  return;
31
37
  }
32
38
  this._isRejected = true;
33
- (_a = this._reject) == null ? void 0 : _a.call(this, reason);
39
+ this._reject?.(reason);
34
40
  };
35
41
  const onCancel = (cancelHandler) => {
36
42
  if (this._isResolved || this._isRejected || this._isCancelled) {
@@ -60,7 +66,6 @@ class CancelablePromise {
60
66
  return this._promise.finally(onFinally);
61
67
  }
62
68
  cancel() {
63
- var _a;
64
69
  if (this._isResolved || this._isRejected || this._isCancelled) {
65
70
  return;
66
71
  }
@@ -76,7 +81,7 @@ class CancelablePromise {
76
81
  }
77
82
  }
78
83
  this._cancelHandlers.length = 0;
79
- (_a = this._reject) == null ? void 0 : _a.call(this, new CancelError("Request aborted"));
84
+ this._reject?.(new CancelError("Request aborted"));
80
85
  }
81
86
  get isCancelled() {
82
87
  return this._isCancelled;