@avalabs/glacier-sdk 2.8.0-canary.b9648ce.0 → 2.8.0-canary.c69ce41.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 (51) hide show
  1. package/dist/index.d.ts +370 -211
  2. package/dist/index.js +181 -57
  3. package/esm/generated/Glacier.d.ts +4 -0
  4. package/esm/generated/Glacier.js +29 -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/Erc1155Contract.d.ts +2 -1
  18. package/esm/generated/models/Erc20Contract.d.ts +2 -1
  19. package/esm/generated/models/Erc721Contract.d.ts +0 -1
  20. package/esm/generated/models/GetChainResponse.d.ts +1 -0
  21. package/esm/generated/models/ImageAsset.d.ts +0 -3
  22. package/esm/generated/models/ListContractsResponse.d.ts +1 -1
  23. package/esm/generated/models/ListValidatorDetailsResponse.d.ts +1 -1
  24. package/esm/generated/models/PChainTransaction.d.ts +1 -0
  25. package/esm/generated/models/PChainTransactionType.d.ts +1 -0
  26. package/esm/generated/models/PChainTransactionType.js +1 -0
  27. package/esm/generated/models/PendingDelegatorDetails.d.ts +7 -3
  28. package/esm/generated/models/PendingDelegatorDetails.js +8 -0
  29. package/esm/generated/models/PendingValidatorDetails.d.ts +8 -4
  30. package/esm/generated/models/PendingValidatorDetails.js +8 -0
  31. package/esm/generated/models/PricingProviders.d.ts +5 -0
  32. package/esm/generated/models/PrimaryNetworkTxType.d.ts +1 -0
  33. package/esm/generated/models/PrimaryNetworkTxType.js +1 -0
  34. package/esm/generated/models/RewardType.d.ts +2 -1
  35. package/esm/generated/models/RewardType.js +1 -0
  36. package/esm/generated/models/Rewards.d.ts +2 -0
  37. package/esm/generated/models/UnknownContract.d.ts +0 -1
  38. package/esm/generated/models/ValidatorHealthDetails.d.ts +20 -0
  39. package/esm/generated/services/EvmContractsService.d.ts +29 -0
  40. package/esm/generated/services/EvmContractsService.js +20 -0
  41. package/esm/generated/services/EvmTransactionsService.js +1 -1
  42. package/esm/generated/services/NfTsService.d.ts +51 -0
  43. package/esm/generated/services/NfTsService.js +37 -0
  44. package/esm/generated/services/PrimaryNetworkRewardsService.d.ts +10 -2
  45. package/esm/generated/services/PrimaryNetworkRewardsService.js +4 -0
  46. package/esm/generated/services/PrimaryNetworkService.d.ts +30 -14
  47. package/esm/generated/services/PrimaryNetworkService.js +17 -9
  48. package/esm/generated/services/PrimaryNetworkTransactionsService.d.ts +5 -1
  49. package/esm/index.d.ts +4 -0
  50. package/esm/index.js +8 -0
  51. 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);
@@ -531,6 +524,25 @@ class EvmChainsService {
531
524
  }
532
525
  }
533
526
 
527
+ class EvmContractsService {
528
+ constructor(httpRequest) {
529
+ this.httpRequest = httpRequest;
530
+ }
531
+ getContractMetadata({
532
+ chainId,
533
+ address
534
+ }) {
535
+ return this.httpRequest.request({
536
+ method: "GET",
537
+ url: "/v1/chains/{chainId}/addresses/{address}",
538
+ path: {
539
+ "chainId": chainId,
540
+ "address": address
541
+ }
542
+ });
543
+ }
544
+ }
545
+
534
546
  class EvmTransactionsService {
535
547
  constructor(httpRequest) {
536
548
  this.httpRequest = httpRequest;
@@ -560,7 +572,7 @@ class EvmTransactionsService {
560
572
  }) {
561
573
  return this.httpRequest.request({
562
574
  method: "GET",
563
- url: "/v1/chains/{chainId}/addresses/{address}/deployments",
575
+ url: "/v1/chains/{chainId}/contracts/{address}/deployments",
564
576
  path: {
565
577
  "chainId": chainId,
566
578
  "address": address
@@ -796,6 +808,42 @@ class HealthCheckService {
796
808
  }
797
809
  }
798
810
 
811
+ class NfTsService {
812
+ constructor(httpRequest) {
813
+ this.httpRequest = httpRequest;
814
+ }
815
+ reindexNft({
816
+ chainId,
817
+ address,
818
+ tokenId
819
+ }) {
820
+ return this.httpRequest.request({
821
+ method: "POST",
822
+ url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}:reindex",
823
+ path: {
824
+ "chainId": chainId,
825
+ "address": address,
826
+ "tokenId": tokenId
827
+ }
828
+ });
829
+ }
830
+ getTokenDetails({
831
+ chainId,
832
+ address,
833
+ tokenId
834
+ }) {
835
+ return this.httpRequest.request({
836
+ method: "GET",
837
+ url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}",
838
+ path: {
839
+ "chainId": chainId,
840
+ "address": address,
841
+ "tokenId": tokenId
842
+ }
843
+ });
844
+ }
845
+ }
846
+
799
847
  class OperationsService {
800
848
  constructor(httpRequest) {
801
849
  this.httpRequest = httpRequest;
@@ -910,10 +958,15 @@ class PrimaryNetworkService {
910
958
  network,
911
959
  pageSize = 10,
912
960
  pageToken,
961
+ minTimeRemaining,
962
+ maxTimeRemaining,
963
+ minDelegationCapacity,
964
+ maxDelegationCapacity,
965
+ minFeePercentage,
966
+ maxFeePercentage,
913
967
  nodeIds,
914
968
  sortOrder,
915
- validationStatus,
916
- minDelegationCapacity
969
+ validationStatus
917
970
  }) {
918
971
  return this.httpRequest.request({
919
972
  method: "GET",
@@ -924,10 +977,15 @@ class PrimaryNetworkService {
924
977
  query: {
925
978
  "pageSize": pageSize,
926
979
  "pageToken": pageToken,
980
+ "minTimeRemaining": minTimeRemaining,
981
+ "maxTimeRemaining": maxTimeRemaining,
982
+ "minDelegationCapacity": minDelegationCapacity,
983
+ "maxDelegationCapacity": maxDelegationCapacity,
984
+ "minFeePercentage": minFeePercentage,
985
+ "maxFeePercentage": maxFeePercentage,
927
986
  "nodeIds": nodeIds,
928
987
  "sortOrder": sortOrder,
929
- "validationStatus": validationStatus,
930
- "minDelegationCapacity": minDelegationCapacity
988
+ "validationStatus": validationStatus
931
989
  }
932
990
  });
933
991
  }
@@ -956,27 +1014,25 @@ class PrimaryNetworkService {
956
1014
  }
957
1015
  listDelegators({
958
1016
  network,
959
- nodeId,
960
1017
  pageSize = 10,
961
1018
  pageToken,
1019
+ rewardAddresses,
962
1020
  sortOrder,
963
1021
  delegationStatus,
964
- rewardAddresses,
965
1022
  nodeIds
966
1023
  }) {
967
1024
  return this.httpRequest.request({
968
1025
  method: "GET",
969
1026
  url: "/v1/networks/{network}/delegators",
970
1027
  path: {
971
- "network": network,
972
- "nodeId": nodeId
1028
+ "network": network
973
1029
  },
974
1030
  query: {
975
1031
  "pageSize": pageSize,
976
1032
  "pageToken": pageToken,
1033
+ "rewardAddresses": rewardAddresses,
977
1034
  "sortOrder": sortOrder,
978
1035
  "delegationStatus": delegationStatus,
979
- "rewardAddresses": rewardAddresses,
980
1036
  "nodeIds": nodeIds
981
1037
  }
982
1038
  });
@@ -1078,6 +1134,7 @@ class PrimaryNetworkRewardsService {
1078
1134
  addresses,
1079
1135
  pageSize = 10,
1080
1136
  pageToken,
1137
+ nodeIds,
1081
1138
  sortOrder
1082
1139
  }) {
1083
1140
  return this.httpRequest.request({
@@ -1090,6 +1147,7 @@ class PrimaryNetworkRewardsService {
1090
1147
  "addresses": addresses,
1091
1148
  "pageSize": pageSize,
1092
1149
  "pageToken": pageToken,
1150
+ "nodeIds": nodeIds,
1093
1151
  "sortOrder": sortOrder
1094
1152
  }
1095
1153
  });
@@ -1099,6 +1157,7 @@ class PrimaryNetworkRewardsService {
1099
1157
  addresses,
1100
1158
  pageSize = 10,
1101
1159
  pageToken,
1160
+ nodeIds,
1102
1161
  sortOrder
1103
1162
  }) {
1104
1163
  return this.httpRequest.request({
@@ -1111,6 +1170,7 @@ class PrimaryNetworkRewardsService {
1111
1170
  "addresses": addresses,
1112
1171
  "pageSize": pageSize,
1113
1172
  "pageToken": pageToken,
1173
+ "nodeIds": nodeIds,
1114
1174
  "sortOrder": sortOrder
1115
1175
  }
1116
1176
  });
@@ -1320,24 +1380,41 @@ class PrimaryNetworkVerticesService {
1320
1380
  }
1321
1381
 
1322
1382
  class Glacier {
1383
+ evmBalances;
1384
+ evmBlocks;
1385
+ evmChains;
1386
+ evmContracts;
1387
+ evmTransactions;
1388
+ healthCheck;
1389
+ nfTs;
1390
+ operations;
1391
+ primaryNetwork;
1392
+ primaryNetworkBalances;
1393
+ primaryNetworkBlocks;
1394
+ primaryNetworkRewards;
1395
+ primaryNetworkTransactions;
1396
+ primaryNetworkUtxOs;
1397
+ primaryNetworkVertices;
1398
+ request;
1323
1399
  constructor(config, HttpRequest = FetchHttpRequest) {
1324
- var _a, _b, _c, _d;
1325
1400
  this.request = new HttpRequest({
1326
- BASE: (_a = config == null ? void 0 : config.BASE) != null ? _a : "https://glacier-api-dev.avax.network",
1327
- VERSION: (_b = config == null ? void 0 : config.VERSION) != null ? _b : "Beta",
1328
- WITH_CREDENTIALS: (_c = config == null ? void 0 : config.WITH_CREDENTIALS) != null ? _c : false,
1329
- CREDENTIALS: (_d = config == null ? void 0 : config.CREDENTIALS) != null ? _d : "include",
1330
- TOKEN: config == null ? void 0 : config.TOKEN,
1331
- USERNAME: config == null ? void 0 : config.USERNAME,
1332
- PASSWORD: config == null ? void 0 : config.PASSWORD,
1333
- HEADERS: config == null ? void 0 : config.HEADERS,
1334
- ENCODE_PATH: config == null ? void 0 : config.ENCODE_PATH
1401
+ BASE: config?.BASE ?? "https://glacier-api-dev.avax.network",
1402
+ VERSION: config?.VERSION ?? "Beta",
1403
+ WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
1404
+ CREDENTIALS: config?.CREDENTIALS ?? "include",
1405
+ TOKEN: config?.TOKEN,
1406
+ USERNAME: config?.USERNAME,
1407
+ PASSWORD: config?.PASSWORD,
1408
+ HEADERS: config?.HEADERS,
1409
+ ENCODE_PATH: config?.ENCODE_PATH
1335
1410
  });
1336
1411
  this.evmBalances = new EvmBalancesService(this.request);
1337
1412
  this.evmBlocks = new EvmBlocksService(this.request);
1338
1413
  this.evmChains = new EvmChainsService(this.request);
1414
+ this.evmContracts = new EvmContractsService(this.request);
1339
1415
  this.evmTransactions = new EvmTransactionsService(this.request);
1340
1416
  this.healthCheck = new HealthCheckService(this.request);
1417
+ this.nfTs = new NfTsService(this.request);
1341
1418
  this.operations = new OperationsService(this.request);
1342
1419
  this.primaryNetwork = new PrimaryNetworkService(this.request);
1343
1420
  this.primaryNetworkBalances = new PrimaryNetworkBalancesService(this.request);
@@ -1361,6 +1438,20 @@ const OpenAPI = {
1361
1438
  ENCODE_PATH: void 0
1362
1439
  };
1363
1440
 
1441
+ exports.ActiveDelegatorDetails = void 0;
1442
+ ((ActiveDelegatorDetails2) => {
1443
+ ((delegationStatus2) => {
1444
+ delegationStatus2["ACTIVE"] = "active";
1445
+ })(ActiveDelegatorDetails2.delegationStatus || (ActiveDelegatorDetails2.delegationStatus = {}));
1446
+ })(exports.ActiveDelegatorDetails || (exports.ActiveDelegatorDetails = {}));
1447
+
1448
+ exports.ActiveValidatorDetails = void 0;
1449
+ ((ActiveValidatorDetails2) => {
1450
+ ((validationStatus2) => {
1451
+ validationStatus2["ACTIVE"] = "active";
1452
+ })(ActiveValidatorDetails2.validationStatus || (ActiveValidatorDetails2.validationStatus = {}));
1453
+ })(exports.ActiveValidatorDetails || (exports.ActiveValidatorDetails = {}));
1454
+
1364
1455
  var BlockchainId = /* @__PURE__ */ ((BlockchainId2) => {
1365
1456
  BlockchainId2["_11111111111111111111111111111111LPO_YY"] = "11111111111111111111111111111111LpoYY";
1366
1457
  BlockchainId2["_2O_YMBNV4E_NHYQK2FJJ_V5N_VQLDBTM_NJZQ5S3QS3LO6FTN_C6FBY_M"] = "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM";
@@ -1402,6 +1493,20 @@ var ChainStatus = /* @__PURE__ */ ((ChainStatus2) => {
1402
1493
  return ChainStatus2;
1403
1494
  })(ChainStatus || {});
1404
1495
 
1496
+ exports.CompletedDelegatorDetails = void 0;
1497
+ ((CompletedDelegatorDetails2) => {
1498
+ ((delegationStatus2) => {
1499
+ delegationStatus2["COMPLETED"] = "completed";
1500
+ })(CompletedDelegatorDetails2.delegationStatus || (CompletedDelegatorDetails2.delegationStatus = {}));
1501
+ })(exports.CompletedDelegatorDetails || (exports.CompletedDelegatorDetails = {}));
1502
+
1503
+ exports.CompletedValidatorDetails = void 0;
1504
+ ((CompletedValidatorDetails2) => {
1505
+ ((validationStatus2) => {
1506
+ validationStatus2["COMPLETED"] = "completed";
1507
+ })(CompletedValidatorDetails2.validationStatus || (CompletedValidatorDetails2.validationStatus = {}));
1508
+ })(exports.CompletedValidatorDetails || (exports.CompletedValidatorDetails = {}));
1509
+
1405
1510
  exports.CreateEvmTransactionExportRequest = void 0;
1406
1511
  ((CreateEvmTransactionExportRequest2) => {
1407
1512
  ((type2) => {
@@ -1573,6 +1678,7 @@ var PChainTransactionType = /* @__PURE__ */ ((PChainTransactionType2) => {
1573
1678
  PChainTransactionType2["ADD_VALIDATOR_TX"] = "AddValidatorTx";
1574
1679
  PChainTransactionType2["ADD_DELEGATOR_TX"] = "AddDelegatorTx";
1575
1680
  PChainTransactionType2["ADD_PERMISSIONLESS_VALIDATOR_TX"] = "AddPermissionlessValidatorTx";
1681
+ PChainTransactionType2["ADD_PERMISSIONLESS_DELEGATOR_TX"] = "AddPermissionlessDelegatorTx";
1576
1682
  PChainTransactionType2["ADD_SUBNET_VALIDATOR_TX"] = "AddSubnetValidatorTx";
1577
1683
  PChainTransactionType2["REMOVE_SUBNET_VALIDATOR_TX"] = "RemoveSubnetValidatorTx";
1578
1684
  PChainTransactionType2["REWARD_VALIDATOR_TX"] = "RewardValidatorTx";
@@ -1585,6 +1691,20 @@ var PChainTransactionType = /* @__PURE__ */ ((PChainTransactionType2) => {
1585
1691
  return PChainTransactionType2;
1586
1692
  })(PChainTransactionType || {});
1587
1693
 
1694
+ exports.PendingDelegatorDetails = void 0;
1695
+ ((PendingDelegatorDetails2) => {
1696
+ ((delegationStatus2) => {
1697
+ delegationStatus2["PENDING"] = "pending";
1698
+ })(PendingDelegatorDetails2.delegationStatus || (PendingDelegatorDetails2.delegationStatus = {}));
1699
+ })(exports.PendingDelegatorDetails || (exports.PendingDelegatorDetails = {}));
1700
+
1701
+ exports.PendingValidatorDetails = void 0;
1702
+ ((PendingValidatorDetails2) => {
1703
+ ((validationStatus2) => {
1704
+ validationStatus2["PENDING"] = "pending";
1705
+ })(PendingValidatorDetails2.validationStatus || (PendingValidatorDetails2.validationStatus = {}));
1706
+ })(exports.PendingValidatorDetails || (exports.PendingValidatorDetails = {}));
1707
+
1588
1708
  var PrimaryNetwork = /* @__PURE__ */ ((PrimaryNetwork2) => {
1589
1709
  PrimaryNetwork2["MAINNET"] = "mainnet";
1590
1710
  PrimaryNetwork2["FUJI"] = "fuji";
@@ -1602,6 +1722,7 @@ var PrimaryNetworkTxType = /* @__PURE__ */ ((PrimaryNetworkTxType2) => {
1602
1722
  PrimaryNetworkTxType2["ADD_VALIDATOR_TX"] = "AddValidatorTx";
1603
1723
  PrimaryNetworkTxType2["ADD_DELEGATOR_TX"] = "AddDelegatorTx";
1604
1724
  PrimaryNetworkTxType2["ADD_PERMISSIONLESS_VALIDATOR_TX"] = "AddPermissionlessValidatorTx";
1725
+ PrimaryNetworkTxType2["ADD_PERMISSIONLESS_DELEGATOR_TX"] = "AddPermissionlessDelegatorTx";
1605
1726
  PrimaryNetworkTxType2["ADD_SUBNET_VALIDATOR_TX"] = "AddSubnetValidatorTx";
1606
1727
  PrimaryNetworkTxType2["REMOVE_SUBNET_VALIDATOR_TX"] = "RemoveSubnetValidatorTx";
1607
1728
  PrimaryNetworkTxType2["REWARD_VALIDATOR_TX"] = "RewardValidatorTx";
@@ -1642,6 +1763,7 @@ var ResourceLinkType = /* @__PURE__ */ ((ResourceLinkType2) => {
1642
1763
  var RewardType = /* @__PURE__ */ ((RewardType2) => {
1643
1764
  RewardType2["VALIDATOR"] = "VALIDATOR";
1644
1765
  RewardType2["DELEGATOR"] = "DELEGATOR";
1766
+ RewardType2["VALIDATOR_FEE"] = "VALIDATOR_FEE";
1645
1767
  return RewardType2;
1646
1768
  })(RewardType || {});
1647
1769
 
@@ -1726,12 +1848,14 @@ exports.DelegationStatusType = DelegationStatusType;
1726
1848
  exports.EvmBalancesService = EvmBalancesService;
1727
1849
  exports.EvmBlocksService = EvmBlocksService;
1728
1850
  exports.EvmChainsService = EvmChainsService;
1851
+ exports.EvmContractsService = EvmContractsService;
1729
1852
  exports.EvmTransactionsService = EvmTransactionsService;
1730
1853
  exports.Glacier = Glacier;
1731
1854
  exports.HealthCheckService = HealthCheckService;
1732
1855
  exports.InternalTransactionOpCall = InternalTransactionOpCall;
1733
1856
  exports.Network = Network;
1734
1857
  exports.NetworkType = NetworkType;
1858
+ exports.NfTsService = NfTsService;
1735
1859
  exports.NftTokenMetadataStatus = NftTokenMetadataStatus;
1736
1860
  exports.OpenAPI = OpenAPI;
1737
1861
  exports.OperationStatus = OperationStatus;
@@ -3,8 +3,10 @@ import { OpenAPIConfig } from './core/OpenAPI.js';
3
3
  import { EvmBalancesService } from './services/EvmBalancesService.js';
4
4
  import { EvmBlocksService } from './services/EvmBlocksService.js';
5
5
  import { EvmChainsService } from './services/EvmChainsService.js';
6
+ import { EvmContractsService } from './services/EvmContractsService.js';
6
7
  import { EvmTransactionsService } from './services/EvmTransactionsService.js';
7
8
  import { HealthCheckService } from './services/HealthCheckService.js';
9
+ import { NfTsService } from './services/NfTsService.js';
8
10
  import { OperationsService } from './services/OperationsService.js';
9
11
  import { PrimaryNetworkService } from './services/PrimaryNetworkService.js';
10
12
  import { PrimaryNetworkBalancesService } from './services/PrimaryNetworkBalancesService.js';
@@ -19,8 +21,10 @@ declare class Glacier {
19
21
  readonly evmBalances: EvmBalancesService;
20
22
  readonly evmBlocks: EvmBlocksService;
21
23
  readonly evmChains: EvmChainsService;
24
+ readonly evmContracts: EvmContractsService;
22
25
  readonly evmTransactions: EvmTransactionsService;
23
26
  readonly healthCheck: HealthCheckService;
27
+ readonly nfTs: NfTsService;
24
28
  readonly operations: OperationsService;
25
29
  readonly primaryNetwork: PrimaryNetworkService;
26
30
  readonly primaryNetworkBalances: PrimaryNetworkBalancesService;
@@ -2,8 +2,10 @@ import { FetchHttpRequest } from './core/FetchHttpRequest.js';
2
2
  import { EvmBalancesService } from './services/EvmBalancesService.js';
3
3
  import { EvmBlocksService } from './services/EvmBlocksService.js';
4
4
  import { EvmChainsService } from './services/EvmChainsService.js';
5
+ import { EvmContractsService } from './services/EvmContractsService.js';
5
6
  import { EvmTransactionsService } from './services/EvmTransactionsService.js';
6
7
  import { HealthCheckService } from './services/HealthCheckService.js';
8
+ import { NfTsService } from './services/NfTsService.js';
7
9
  import { OperationsService } from './services/OperationsService.js';
8
10
  import { PrimaryNetworkService } from './services/PrimaryNetworkService.js';
9
11
  import { PrimaryNetworkBalancesService } from './services/PrimaryNetworkBalancesService.js';
@@ -14,24 +16,41 @@ import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsServic
14
16
  import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
15
17
 
16
18
  class Glacier {
19
+ evmBalances;
20
+ evmBlocks;
21
+ evmChains;
22
+ evmContracts;
23
+ evmTransactions;
24
+ healthCheck;
25
+ nfTs;
26
+ operations;
27
+ primaryNetwork;
28
+ primaryNetworkBalances;
29
+ primaryNetworkBlocks;
30
+ primaryNetworkRewards;
31
+ primaryNetworkTransactions;
32
+ primaryNetworkUtxOs;
33
+ primaryNetworkVertices;
34
+ request;
17
35
  constructor(config, HttpRequest = FetchHttpRequest) {
18
- var _a, _b, _c, _d;
19
36
  this.request = new HttpRequest({
20
- BASE: (_a = config == null ? void 0 : config.BASE) != null ? _a : "https://glacier-api-dev.avax.network",
21
- VERSION: (_b = config == null ? void 0 : config.VERSION) != null ? _b : "Beta",
22
- WITH_CREDENTIALS: (_c = config == null ? void 0 : config.WITH_CREDENTIALS) != null ? _c : false,
23
- CREDENTIALS: (_d = config == null ? void 0 : config.CREDENTIALS) != null ? _d : "include",
24
- TOKEN: config == null ? void 0 : config.TOKEN,
25
- USERNAME: config == null ? void 0 : config.USERNAME,
26
- PASSWORD: config == null ? void 0 : config.PASSWORD,
27
- HEADERS: config == null ? void 0 : config.HEADERS,
28
- ENCODE_PATH: config == null ? void 0 : config.ENCODE_PATH
37
+ BASE: config?.BASE ?? "https://glacier-api-dev.avax.network",
38
+ VERSION: config?.VERSION ?? "Beta",
39
+ WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
40
+ CREDENTIALS: config?.CREDENTIALS ?? "include",
41
+ TOKEN: config?.TOKEN,
42
+ USERNAME: config?.USERNAME,
43
+ PASSWORD: config?.PASSWORD,
44
+ HEADERS: config?.HEADERS,
45
+ ENCODE_PATH: config?.ENCODE_PATH
29
46
  });
30
47
  this.evmBalances = new EvmBalancesService(this.request);
31
48
  this.evmBlocks = new EvmBlocksService(this.request);
32
49
  this.evmChains = new EvmChainsService(this.request);
50
+ this.evmContracts = new EvmContractsService(this.request);
33
51
  this.evmTransactions = new EvmTransactionsService(this.request);
34
52
  this.healthCheck = new HealthCheckService(this.request);
53
+ this.nfTs = new NfTsService(this.request);
35
54
  this.operations = new OperationsService(this.request);
36
55
  this.primaryNetwork = new PrimaryNetworkService(this.request);
37
56
  this.primaryNetworkBalances = new PrimaryNetworkBalancesService(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;