@avalabs/glacier-sdk 2.8.0-canary.f6c173d.0 → 2.8.0-canary.f701e46.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 (136) hide show
  1. package/dist/index.d.ts +1013 -423
  2. package/dist/index.js +463 -176
  3. package/esm/generated/Glacier.d.ts +6 -0
  4. package/esm/generated/Glacier.js +9 -0
  5. package/esm/generated/core/CancelablePromise.d.ts +2 -8
  6. package/esm/generated/core/CancelablePromise.js +41 -36
  7. package/esm/generated/core/OpenAPI.d.ts +5 -5
  8. package/esm/generated/core/request.js +25 -9
  9. package/esm/generated/models/AddressActivityMetadata.d.ts +12 -0
  10. package/esm/generated/models/{XChainAssetBalance.d.ts → AggregatedAssetAmount.d.ts} +5 -6
  11. package/esm/generated/models/{Asset.d.ts → AssetAmount.d.ts} +5 -6
  12. package/esm/generated/models/AssetWithPriceInfo.d.ts +32 -0
  13. package/esm/generated/models/CChainExportTransaction.d.ts +3 -3
  14. package/esm/generated/models/CChainImportTransaction.d.ts +3 -3
  15. package/esm/generated/models/CChainSharedAssetBalance.d.ts +3 -4
  16. package/esm/generated/models/ChainInfo.d.ts +1 -3
  17. package/esm/generated/models/ChainStatus.d.ts +3 -0
  18. package/esm/generated/models/CreateEvmTransactionExportRequest.d.ts +2 -6
  19. package/esm/generated/models/CreatePrimaryNetworkTransactionExportRequest.d.ts +2 -6
  20. package/esm/generated/models/CurrencyCode.d.ts +3 -0
  21. package/esm/generated/models/DeliveredSourceNotIndexedTeleporterMessage.d.ts +27 -0
  22. package/esm/generated/models/DeliveredSourceNotIndexedTeleporterMessage.js +8 -0
  23. package/esm/generated/models/DeliveredTeleporterMessage.d.ts +29 -0
  24. package/esm/generated/models/DeliveredTeleporterMessage.js +8 -0
  25. package/esm/generated/models/EVMInput.d.ts +3 -3
  26. package/esm/generated/models/EVMOperationType.d.ts +5 -0
  27. package/esm/generated/models/EVMOperationType.js +6 -0
  28. package/esm/generated/models/EVMOutput.d.ts +3 -3
  29. package/esm/generated/models/Erc1155TokenMetadata.d.ts +0 -3
  30. package/esm/generated/models/Erc721TokenMetadata.d.ts +0 -3
  31. package/esm/generated/models/EventType.d.ts +5 -0
  32. package/esm/generated/models/EventType.js +6 -0
  33. package/esm/generated/models/GetChainResponse.d.ts +1 -3
  34. package/esm/generated/models/GetPrimaryNetworkBlockResponse.d.ts +1 -0
  35. package/esm/generated/models/GlacierApiFeature.d.ts +5 -0
  36. package/esm/generated/models/GlacierApiFeature.js +6 -0
  37. package/esm/generated/models/HistoricalReward.d.ts +2 -5
  38. package/esm/generated/models/ListNftTokens.d.ts +12 -0
  39. package/esm/generated/models/ListTransfersResponse.d.ts +1 -1
  40. package/esm/generated/models/ListValidatorDetailsResponse.d.ts +2 -1
  41. package/esm/generated/models/ListWebhooksResponse.d.ts +11 -0
  42. package/esm/generated/models/Method.d.ts +0 -3
  43. package/esm/generated/models/Money.d.ts +0 -3
  44. package/esm/generated/models/NextPageToken.d.ts +8 -0
  45. package/esm/generated/models/NftTokenMetadataStatus.d.ts +3 -0
  46. package/esm/generated/models/OperationType.d.ts +4 -2
  47. package/esm/generated/models/OperationType.js +3 -1
  48. package/esm/generated/models/PChainBalance.d.ts +15 -15
  49. package/esm/generated/models/PChainSharedAsset.d.ts +22 -0
  50. package/esm/generated/models/PChainTransaction.d.ts +12 -7
  51. package/esm/generated/models/PChainTransactionType.d.ts +8 -5
  52. package/esm/generated/models/PChainTransactionType.js +8 -5
  53. package/esm/generated/models/PChainUtxo.d.ts +34 -14
  54. package/esm/generated/models/PendingReward.d.ts +3 -3
  55. package/esm/generated/models/PendingTeleporterMessage.d.ts +27 -0
  56. package/esm/generated/models/PendingTeleporterMessage.js +8 -0
  57. package/esm/generated/models/PrimaryNetworkAssetCap.d.ts +9 -0
  58. package/esm/generated/models/PrimaryNetworkAssetCap.js +7 -0
  59. package/esm/generated/models/PrimaryNetworkAssetType.d.ts +9 -0
  60. package/esm/generated/models/PrimaryNetworkAssetType.js +7 -0
  61. package/esm/generated/models/PrimaryNetworkBlock.d.ts +1 -0
  62. package/esm/generated/models/PrimaryNetworkOperationType.d.ts +7 -0
  63. package/esm/generated/models/PrimaryNetworkOperationType.js +8 -0
  64. package/esm/generated/models/PrimaryNetworkOptions.d.ts +1 -1
  65. package/esm/generated/models/PrimaryNetworkTxType.d.ts +8 -6
  66. package/esm/generated/models/PrimaryNetworkTxType.js +8 -6
  67. package/esm/generated/models/RegisterWebhookRequest.d.ts +19 -0
  68. package/esm/generated/models/RemovedValidatorDetails.d.ts +19 -0
  69. package/esm/generated/models/RemovedValidatorDetails.js +8 -0
  70. package/esm/generated/models/RpcErrorDto.d.ts +7 -0
  71. package/esm/generated/models/RpcErrorResponseDto.d.ts +9 -0
  72. package/esm/generated/models/RpcRequestBodyDto.d.ts +8 -0
  73. package/esm/generated/models/RpcSuccessResponseDto.d.ts +7 -0
  74. package/esm/generated/models/SharedSecretsResponse.d.ts +5 -0
  75. package/esm/generated/models/Subnet.d.ts +17 -0
  76. package/esm/generated/models/SubnetOwnershipInfo.d.ts +16 -0
  77. package/esm/generated/models/TeleporterDestinationTransaction.d.ts +9 -0
  78. package/esm/generated/models/TeleporterReceipt.d.ts +6 -0
  79. package/esm/generated/models/TeleporterRewardDetails.d.ts +37 -0
  80. package/esm/generated/models/TeleporterRewardDetails.js +8 -0
  81. package/esm/generated/models/TeleporterSourceTransaction.d.ts +7 -0
  82. package/esm/generated/models/TransactionMethodType.d.ts +3 -0
  83. package/esm/generated/models/UpdateWebhookRequest.d.ts +12 -0
  84. package/esm/generated/models/Utxo.d.ts +30 -30
  85. package/esm/generated/models/UtxoCredential.d.ts +2 -2
  86. package/esm/generated/models/ValidationStatusType.d.ts +2 -1
  87. package/esm/generated/models/ValidationStatusType.js +1 -0
  88. package/esm/generated/models/WebhookResponse.d.ts +25 -0
  89. package/esm/generated/models/WebhookStatus.d.ts +6 -0
  90. package/esm/generated/models/WebhookStatus.js +7 -0
  91. package/esm/generated/models/WebhookStatusType.d.ts +6 -0
  92. package/esm/generated/models/WebhookStatusType.js +7 -0
  93. package/esm/generated/models/XChainAssetDetails.d.ts +5 -8
  94. package/esm/generated/models/XChainBalances.d.ts +3 -3
  95. package/esm/generated/models/XChainLinearTransaction.d.ts +6 -8
  96. package/esm/generated/models/XChainNonLinearTransaction.d.ts +6 -8
  97. package/esm/generated/models/XChainSharedAssetBalance.d.ts +3 -4
  98. package/esm/generated/models/XChainTransactionType.d.ts +13 -0
  99. package/esm/generated/models/XChainTransactionType.js +11 -0
  100. package/esm/generated/services/EvmBalancesService.d.ts +25 -25
  101. package/esm/generated/services/EvmBalancesService.js +8 -8
  102. package/esm/generated/services/EvmBlocksService.d.ts +7 -7
  103. package/esm/generated/services/EvmBlocksService.js +4 -4
  104. package/esm/generated/services/EvmChainsService.d.ts +7 -2
  105. package/esm/generated/services/EvmChainsService.js +4 -2
  106. package/esm/generated/services/EvmContractsService.d.ts +2 -2
  107. package/esm/generated/services/EvmTransactionsService.d.ts +91 -49
  108. package/esm/generated/services/EvmTransactionsService.js +32 -32
  109. package/esm/generated/services/NfTsService.d.ts +27 -2
  110. package/esm/generated/services/NfTsService.js +19 -0
  111. package/esm/generated/services/OperationsService.d.ts +11 -11
  112. package/esm/generated/services/OperationsService.js +10 -10
  113. package/esm/generated/services/PrimaryNetworkBlocksService.d.ts +10 -10
  114. package/esm/generated/services/PrimaryNetworkBlocksService.js +8 -8
  115. package/esm/generated/services/PrimaryNetworkRewardsService.d.ts +19 -14
  116. package/esm/generated/services/PrimaryNetworkRewardsService.js +8 -6
  117. package/esm/generated/services/PrimaryNetworkService.d.ts +42 -42
  118. package/esm/generated/services/PrimaryNetworkService.js +20 -20
  119. package/esm/generated/services/PrimaryNetworkTransactionsService.d.ts +16 -16
  120. package/esm/generated/services/PrimaryNetworkTransactionsService.js +8 -8
  121. package/esm/generated/services/PrimaryNetworkUtxOsService.d.ts +5 -5
  122. package/esm/generated/services/PrimaryNetworkUtxOsService.js +2 -2
  123. package/esm/generated/services/PrimaryNetworkVerticesService.d.ts +10 -10
  124. package/esm/generated/services/PrimaryNetworkVerticesService.js +6 -6
  125. package/esm/generated/services/RpcService.d.ts +25 -0
  126. package/esm/generated/services/RpcService.js +24 -0
  127. package/esm/generated/services/TeleporterService.d.ts +57 -0
  128. package/esm/generated/services/TeleporterService.js +39 -0
  129. package/esm/generated/services/WebhooksService.d.ts +95 -0
  130. package/esm/generated/services/WebhooksService.js +80 -0
  131. package/esm/index.d.ts +36 -3
  132. package/esm/index.js +17 -2
  133. package/package.json +3 -3
  134. package/esm/generated/models/CreateEvmTransactionExportRequest.js +0 -8
  135. package/esm/generated/models/CreatePrimaryNetworkTransactionExportRequest.js +0 -8
  136. package/esm/generated/models/PChainAsset.d.ts +0 -6
@@ -16,6 +16,9 @@ import { PrimaryNetworkRewardsService } from './services/PrimaryNetworkRewardsSe
16
16
  import { PrimaryNetworkTransactionsService } from './services/PrimaryNetworkTransactionsService.js';
17
17
  import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsService.js';
18
18
  import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
19
+ import { RpcService } from './services/RpcService.js';
20
+ import { TeleporterService } from './services/TeleporterService.js';
21
+ import { WebhooksService } from './services/WebhooksService.js';
19
22
 
20
23
  type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
21
24
  declare class Glacier {
@@ -35,6 +38,9 @@ declare class Glacier {
35
38
  readonly primaryNetworkTransactions: PrimaryNetworkTransactionsService;
36
39
  readonly primaryNetworkUtxOs: PrimaryNetworkUtxOsService;
37
40
  readonly primaryNetworkVertices: PrimaryNetworkVerticesService;
41
+ readonly rpc: RpcService;
42
+ readonly teleporter: TeleporterService;
43
+ readonly webhooks: WebhooksService;
38
44
  readonly request: BaseHttpRequest;
39
45
  constructor(config?: Partial<OpenAPIConfig>, HttpRequest?: HttpRequestConstructor);
40
46
  }
@@ -15,6 +15,9 @@ import { PrimaryNetworkRewardsService } from './services/PrimaryNetworkRewardsSe
15
15
  import { PrimaryNetworkTransactionsService } from './services/PrimaryNetworkTransactionsService.js';
16
16
  import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsService.js';
17
17
  import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
18
+ import { RpcService } from './services/RpcService.js';
19
+ import { TeleporterService } from './services/TeleporterService.js';
20
+ import { WebhooksService } from './services/WebhooksService.js';
18
21
 
19
22
  class Glacier {
20
23
  default;
@@ -33,6 +36,9 @@ class Glacier {
33
36
  primaryNetworkTransactions;
34
37
  primaryNetworkUtxOs;
35
38
  primaryNetworkVertices;
39
+ rpc;
40
+ teleporter;
41
+ webhooks;
36
42
  request;
37
43
  constructor(config, HttpRequest = FetchHttpRequest) {
38
44
  this.request = new HttpRequest({
@@ -62,6 +68,9 @@ class Glacier {
62
68
  this.primaryNetworkTransactions = new PrimaryNetworkTransactionsService(this.request);
63
69
  this.primaryNetworkUtxOs = new PrimaryNetworkUtxOsService(this.request);
64
70
  this.primaryNetworkVertices = new PrimaryNetworkVerticesService(this.request);
71
+ this.rpc = new RpcService(this.request);
72
+ this.teleporter = new TeleporterService(this.request);
73
+ this.webhooks = new WebhooksService(this.request);
65
74
  }
66
75
  }
67
76
 
@@ -9,15 +9,9 @@ interface OnCancel {
9
9
  (cancelHandler: () => void): void;
10
10
  }
11
11
  declare class CancelablePromise<T> implements Promise<T> {
12
- readonly [Symbol.toStringTag]: string;
13
- private _isResolved;
14
- private _isRejected;
15
- private _isCancelled;
16
- private readonly _cancelHandlers;
17
- private readonly _promise;
18
- private _resolve?;
19
- private _reject?;
12
+ #private;
20
13
  constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
14
+ get [Symbol.toStringTag](): string;
21
15
  then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
22
16
  catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
23
17
  finally(onFinally?: (() => void) | null): Promise<T>;
@@ -8,71 +8,75 @@ 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
+ #isResolved;
12
+ #isRejected;
13
+ #isCancelled;
14
+ #cancelHandlers;
15
+ #promise;
16
+ #resolve;
17
+ #reject;
19
18
  constructor(executor) {
20
- this._isResolved = false;
21
- this._isRejected = false;
22
- this._isCancelled = false;
23
- this._cancelHandlers = [];
24
- this._promise = new Promise((resolve, reject) => {
25
- this._resolve = resolve;
26
- this._reject = reject;
19
+ this.#isResolved = false;
20
+ this.#isRejected = false;
21
+ this.#isCancelled = false;
22
+ this.#cancelHandlers = [];
23
+ this.#promise = new Promise((resolve, reject) => {
24
+ this.#resolve = resolve;
25
+ this.#reject = reject;
27
26
  const onResolve = (value) => {
28
- if (this._isResolved || this._isRejected || this._isCancelled) {
27
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
29
28
  return;
30
29
  }
31
- this._isResolved = true;
32
- this._resolve?.(value);
30
+ this.#isResolved = true;
31
+ if (this.#resolve)
32
+ this.#resolve(value);
33
33
  };
34
34
  const onReject = (reason) => {
35
- if (this._isResolved || this._isRejected || this._isCancelled) {
35
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
36
36
  return;
37
37
  }
38
- this._isRejected = true;
39
- this._reject?.(reason);
38
+ this.#isRejected = true;
39
+ if (this.#reject)
40
+ this.#reject(reason);
40
41
  };
41
42
  const onCancel = (cancelHandler) => {
42
- if (this._isResolved || this._isRejected || this._isCancelled) {
43
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
43
44
  return;
44
45
  }
45
- this._cancelHandlers.push(cancelHandler);
46
+ this.#cancelHandlers.push(cancelHandler);
46
47
  };
47
48
  Object.defineProperty(onCancel, "isResolved", {
48
- get: () => this._isResolved
49
+ get: () => this.#isResolved
49
50
  });
50
51
  Object.defineProperty(onCancel, "isRejected", {
51
- get: () => this._isRejected
52
+ get: () => this.#isRejected
52
53
  });
53
54
  Object.defineProperty(onCancel, "isCancelled", {
54
- get: () => this._isCancelled
55
+ get: () => this.#isCancelled
55
56
  });
56
57
  return executor(onResolve, onReject, onCancel);
57
58
  });
58
59
  }
60
+ get [Symbol.toStringTag]() {
61
+ return "Cancellable Promise";
62
+ }
59
63
  then(onFulfilled, onRejected) {
60
- return this._promise.then(onFulfilled, onRejected);
64
+ return this.#promise.then(onFulfilled, onRejected);
61
65
  }
62
66
  catch(onRejected) {
63
- return this._promise.catch(onRejected);
67
+ return this.#promise.catch(onRejected);
64
68
  }
65
69
  finally(onFinally) {
66
- return this._promise.finally(onFinally);
70
+ return this.#promise.finally(onFinally);
67
71
  }
68
72
  cancel() {
69
- if (this._isResolved || this._isRejected || this._isCancelled) {
73
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
70
74
  return;
71
75
  }
72
- this._isCancelled = true;
73
- if (this._cancelHandlers.length) {
76
+ this.#isCancelled = true;
77
+ if (this.#cancelHandlers.length) {
74
78
  try {
75
- for (const cancelHandler of this._cancelHandlers) {
79
+ for (const cancelHandler of this.#cancelHandlers) {
76
80
  cancelHandler();
77
81
  }
78
82
  } catch (error) {
@@ -80,11 +84,12 @@ class CancelablePromise {
80
84
  return;
81
85
  }
82
86
  }
83
- this._cancelHandlers.length = 0;
84
- this._reject?.(new CancelError("Request aborted"));
87
+ this.#cancelHandlers.length = 0;
88
+ if (this.#reject)
89
+ this.#reject(new CancelError("Request aborted"));
85
90
  }
86
91
  get isCancelled() {
87
- return this._isCancelled;
92
+ return this.#isCancelled;
88
93
  }
89
94
  }
90
95
 
@@ -7,11 +7,11 @@ type OpenAPIConfig = {
7
7
  VERSION: string;
8
8
  WITH_CREDENTIALS: boolean;
9
9
  CREDENTIALS: 'include' | 'omit' | 'same-origin';
10
- TOKEN?: string | Resolver<string>;
11
- USERNAME?: string | Resolver<string>;
12
- PASSWORD?: string | Resolver<string>;
13
- HEADERS?: Headers | Resolver<Headers>;
14
- ENCODE_PATH?: (path: string) => string;
10
+ TOKEN?: string | Resolver<string> | undefined;
11
+ USERNAME?: string | Resolver<string> | undefined;
12
+ PASSWORD?: string | Resolver<string> | undefined;
13
+ HEADERS?: Headers | Resolver<Headers> | undefined;
14
+ ENCODE_PATH?: ((path: string) => string) | undefined;
15
15
  };
16
16
  declare const OpenAPI: OpenAPIConfig;
17
17
 
@@ -93,10 +93,12 @@ const resolve = async (options, resolver) => {
93
93
  return resolver;
94
94
  };
95
95
  const getHeaders = async (config, options) => {
96
- const token = await resolve(options, config.TOKEN);
97
- const username = await resolve(options, config.USERNAME);
98
- const password = await resolve(options, config.PASSWORD);
99
- const additionalHeaders = await resolve(options, config.HEADERS);
96
+ const [token, username, password, additionalHeaders] = await Promise.all([
97
+ resolve(options, config.TOKEN),
98
+ resolve(options, config.USERNAME),
99
+ resolve(options, config.PASSWORD),
100
+ resolve(options, config.HEADERS)
101
+ ]);
100
102
  const headers = Object.entries({
101
103
  Accept: "application/json",
102
104
  ...additionalHeaders,
@@ -112,7 +114,7 @@ const getHeaders = async (config, options) => {
112
114
  const credentials = base64(`${username}:${password}`);
113
115
  headers["Authorization"] = `Basic ${credentials}`;
114
116
  }
115
- if (options.body) {
117
+ if (options.body !== void 0) {
116
118
  if (options.mediaType) {
117
119
  headers["Content-Type"] = options.mediaType;
118
120
  } else if (isBlob(options.body)) {
@@ -126,7 +128,7 @@ const getHeaders = async (config, options) => {
126
128
  return new Headers(headers);
127
129
  };
128
130
  const getRequestBody = (options) => {
129
- if (options.body) {
131
+ if (options.body !== void 0) {
130
132
  if (options.mediaType?.includes("/json")) {
131
133
  return JSON.stringify(options.body);
132
134
  } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
@@ -165,7 +167,8 @@ const getResponseBody = async (response) => {
165
167
  try {
166
168
  const contentType = response.headers.get("Content-Type");
167
169
  if (contentType) {
168
- const isJSON = contentType.toLowerCase().startsWith("application/json");
170
+ const jsonTypes = ["application/json", "application/problem+json"];
171
+ const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type));
169
172
  if (isJSON) {
170
173
  return await response.json();
171
174
  } else {
@@ -194,7 +197,20 @@ const catchErrorCodes = (options, result) => {
194
197
  throw new ApiError(options, result, error);
195
198
  }
196
199
  if (!result.ok) {
197
- throw new ApiError(options, result, "Generic Error");
200
+ const errorStatus = result.status ?? "unknown";
201
+ const errorStatusText = result.statusText ?? "unknown";
202
+ const errorBody = (() => {
203
+ try {
204
+ return JSON.stringify(result.body, null, 2);
205
+ } catch (e) {
206
+ return void 0;
207
+ }
208
+ })();
209
+ throw new ApiError(
210
+ options,
211
+ result,
212
+ `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
213
+ );
198
214
  }
199
215
  };
200
216
  const request = (config, options) => {
@@ -224,4 +240,4 @@ const request = (config, options) => {
224
240
  });
225
241
  };
226
242
 
227
- export { request, sendRequest };
243
+ export { base64, catchErrorCodes, getFormData, getHeaders, getQueryString, getRequestBody, getResponseBody, getResponseHeader, isBlob, isDefined, isFormData, isString, isStringWithValue, request, resolve, sendRequest };
@@ -0,0 +1,12 @@
1
+ type AddressActivityMetadata = {
2
+ /**
3
+ * Ethereum address for the address_activity event type
4
+ */
5
+ address: string;
6
+ /**
7
+ * Array of hexadecimal strings of the event signatures.
8
+ */
9
+ eventSignatures?: Array<string>;
10
+ };
11
+
12
+ export { AddressActivityMetadata };
@@ -1,4 +1,6 @@
1
- type XChainAssetBalance = {
1
+ import { PrimaryNetworkAssetType } from './PrimaryNetworkAssetType.js';
2
+
3
+ type AggregatedAssetAmount = {
2
4
  /**
3
5
  * Unique ID for an asset.
4
6
  */
@@ -15,10 +17,7 @@ type XChainAssetBalance = {
15
17
  * Denomination of this asset to represent fungibility.
16
18
  */
17
19
  denomination: number;
18
- /**
19
- * Type of asset like SECP256K1 or NFT.
20
- */
21
- type: string;
20
+ type: PrimaryNetworkAssetType;
22
21
  /**
23
22
  * Amount of the asset.
24
23
  */
@@ -26,4 +25,4 @@ type XChainAssetBalance = {
26
25
  utxoCount: number;
27
26
  };
28
27
 
29
- export { XChainAssetBalance };
28
+ export { AggregatedAssetAmount };
@@ -1,4 +1,6 @@
1
- type Asset = {
1
+ import { PrimaryNetworkAssetType } from './PrimaryNetworkAssetType.js';
2
+
3
+ type AssetAmount = {
2
4
  /**
3
5
  * Unique ID for an asset.
4
6
  */
@@ -15,14 +17,11 @@ type Asset = {
15
17
  * Denomination of this asset to represent fungibility.
16
18
  */
17
19
  denomination: number;
18
- /**
19
- * Type of asset like SECP256K1 or NFT.
20
- */
21
- type: string;
20
+ type: PrimaryNetworkAssetType;
22
21
  /**
23
22
  * Amount of the asset.
24
23
  */
25
24
  amount: string;
26
25
  };
27
26
 
28
- export { Asset };
27
+ export { AssetAmount };
@@ -0,0 +1,32 @@
1
+ import { Money } from './Money.js';
2
+ import { PrimaryNetworkAssetType } from './PrimaryNetworkAssetType.js';
3
+
4
+ type AssetWithPriceInfo = {
5
+ /**
6
+ * Unique ID for an asset.
7
+ */
8
+ assetId: string;
9
+ /**
10
+ * Name of this asset.
11
+ */
12
+ name: string;
13
+ /**
14
+ * Symbol for this asset (max 4 characters).
15
+ */
16
+ symbol: string;
17
+ /**
18
+ * Denomination of this asset to represent fungibility.
19
+ */
20
+ denomination: number;
21
+ type: PrimaryNetworkAssetType;
22
+ /**
23
+ * Amount of the asset.
24
+ */
25
+ amount: string;
26
+ /**
27
+ * The historical asset price at the time the reward was granted, if available. Note, this is only provided if the reward occured more than 24 hours ago.
28
+ */
29
+ historicalPrice?: Money;
30
+ };
31
+
32
+ export { AssetWithPriceInfo };
@@ -1,4 +1,4 @@
1
- import { Asset } from './Asset.js';
1
+ import { AssetAmount } from './AssetAmount.js';
2
2
  import { EVMInput } from './EVMInput.js';
3
3
  import { Utxo } from './Utxo.js';
4
4
 
@@ -26,11 +26,11 @@ type CChainExportTransaction = {
26
26
  /**
27
27
  * Assets unlocked by inputs of this transaction.
28
28
  */
29
- amountUnlocked: Array<Asset>;
29
+ amountUnlocked: Array<AssetAmount>;
30
30
  /**
31
31
  * Assets created by outputs of this transaction.
32
32
  */
33
- amountCreated: Array<Asset>;
33
+ amountCreated: Array<AssetAmount>;
34
34
  /**
35
35
  * Source chain for an atomic transaction.
36
36
  */
@@ -1,4 +1,4 @@
1
- import { Asset } from './Asset.js';
1
+ import { AssetAmount } from './AssetAmount.js';
2
2
  import { EVMOutput } from './EVMOutput.js';
3
3
  import { Utxo } from './Utxo.js';
4
4
 
@@ -26,11 +26,11 @@ type CChainImportTransaction = {
26
26
  /**
27
27
  * Assets unlocked by inputs of this transaction.
28
28
  */
29
- amountUnlocked: Array<Asset>;
29
+ amountUnlocked: Array<AssetAmount>;
30
30
  /**
31
31
  * Assets created by outputs of this transaction.
32
32
  */
33
- amountCreated: Array<Asset>;
33
+ amountCreated: Array<AssetAmount>;
34
34
  /**
35
35
  * Source chain for an atomic transaction.
36
36
  */
@@ -1,3 +1,5 @@
1
+ import { PrimaryNetworkAssetType } from './PrimaryNetworkAssetType.js';
2
+
1
3
  type CChainSharedAssetBalance = {
2
4
  /**
3
5
  * Unique ID for an asset.
@@ -15,10 +17,7 @@ type CChainSharedAssetBalance = {
15
17
  * Denomination of this asset to represent fungibility.
16
18
  */
17
19
  denomination: number;
18
- /**
19
- * Type of asset like SECP256K1 or NFT.
20
- */
21
- type: string;
20
+ type: PrimaryNetworkAssetType;
22
21
  /**
23
22
  * Amount of the asset.
24
23
  */
@@ -5,9 +5,6 @@ import { VmName } from './VmName.js';
5
5
 
6
6
  type ChainInfo = {
7
7
  chainId: string;
8
- /**
9
- * Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors.
10
- */
11
8
  status: ChainStatus;
12
9
  chainName: string;
13
10
  description: string;
@@ -23,6 +20,7 @@ type ChainInfo = {
23
20
  networkToken: NetworkToken;
24
21
  chainLogoUri?: string;
25
22
  private?: boolean;
23
+ enabledFeatures?: Array<'nftIndexing'>;
26
24
  };
27
25
 
28
26
  export { ChainInfo };
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors.
3
+ */
1
4
  declare enum ChainStatus {
2
5
  OK = "OK",
3
6
  UNAVAILABLE = "UNAVAILABLE"
@@ -1,7 +1,8 @@
1
1
  import { EvmNetworkOptions } from './EvmNetworkOptions.js';
2
+ import { EVMOperationType } from './EVMOperationType.js';
2
3
 
3
4
  type CreateEvmTransactionExportRequest = {
4
- type: CreateEvmTransactionExportRequest.type;
5
+ type: EVMOperationType;
5
6
  firstDate: string;
6
7
  lastDate: string;
7
8
  /**
@@ -14,10 +15,5 @@ type CreateEvmTransactionExportRequest = {
14
15
  endDate: string;
15
16
  options: EvmNetworkOptions;
16
17
  };
17
- declare namespace CreateEvmTransactionExportRequest {
18
- enum type {
19
- TRANSACTION_EXPORT_EVM = "TRANSACTION_EXPORT_EVM"
20
- }
21
- }
22
18
 
23
19
  export { CreateEvmTransactionExportRequest };
@@ -1,7 +1,8 @@
1
+ import { PrimaryNetworkOperationType } from './PrimaryNetworkOperationType.js';
1
2
  import { PrimaryNetworkOptions } from './PrimaryNetworkOptions.js';
2
3
 
3
4
  type CreatePrimaryNetworkTransactionExportRequest = {
4
- type: CreatePrimaryNetworkTransactionExportRequest.type;
5
+ type: PrimaryNetworkOperationType;
5
6
  firstDate: string;
6
7
  lastDate: string;
7
8
  /**
@@ -14,10 +15,5 @@ type CreatePrimaryNetworkTransactionExportRequest = {
14
15
  endDate: string;
15
16
  options: PrimaryNetworkOptions;
16
17
  };
17
- declare namespace CreatePrimaryNetworkTransactionExportRequest {
18
- enum type {
19
- TRANSACTION_EXPORT_PRIMARY_NETWORK = "TRANSACTION_EXPORT_PRIMARY_NETWORK"
20
- }
21
- }
22
18
 
23
19
  export { CreatePrimaryNetworkTransactionExportRequest };
@@ -1,3 +1,6 @@
1
+ /**
2
+ * ISO 4217 currency code.
3
+ */
1
4
  declare enum CurrencyCode {
2
5
  USD = "usd",
3
6
  EUR = "eur",
@@ -0,0 +1,27 @@
1
+ import { TeleporterDestinationTransaction } from './TeleporterDestinationTransaction.js';
2
+ import { TeleporterReceipt } from './TeleporterReceipt.js';
3
+ import { TeleporterRewardDetails } from './TeleporterRewardDetails.js';
4
+
5
+ type DeliveredSourceNotIndexedTeleporterMessage = {
6
+ messageId: string;
7
+ teleporterContractAddress: string;
8
+ sourceBlockchainId: string;
9
+ destinationBlockchainId: string;
10
+ messageNonce: string;
11
+ from: string;
12
+ to: string;
13
+ data?: string;
14
+ messageExecuted: boolean;
15
+ receipts: Array<TeleporterReceipt>;
16
+ receiptDelivered: boolean;
17
+ rewardDetails: TeleporterRewardDetails;
18
+ destinationTransaction: TeleporterDestinationTransaction;
19
+ status: DeliveredSourceNotIndexedTeleporterMessage.status;
20
+ };
21
+ declare namespace DeliveredSourceNotIndexedTeleporterMessage {
22
+ enum status {
23
+ DELIVERED_SOURCE_NOT_INDEXED = "delivered_source_not_indexed"
24
+ }
25
+ }
26
+
27
+ export { DeliveredSourceNotIndexedTeleporterMessage };
@@ -0,0 +1,8 @@
1
+ var DeliveredSourceNotIndexedTeleporterMessage;
2
+ ((DeliveredSourceNotIndexedTeleporterMessage2) => {
3
+ ((status2) => {
4
+ status2["DELIVERED_SOURCE_NOT_INDEXED"] = "delivered_source_not_indexed";
5
+ })(DeliveredSourceNotIndexedTeleporterMessage2.status || (DeliveredSourceNotIndexedTeleporterMessage2.status = {}));
6
+ })(DeliveredSourceNotIndexedTeleporterMessage || (DeliveredSourceNotIndexedTeleporterMessage = {}));
7
+
8
+ export { DeliveredSourceNotIndexedTeleporterMessage };
@@ -0,0 +1,29 @@
1
+ import { TeleporterDestinationTransaction } from './TeleporterDestinationTransaction.js';
2
+ import { TeleporterReceipt } from './TeleporterReceipt.js';
3
+ import { TeleporterRewardDetails } from './TeleporterRewardDetails.js';
4
+ import { TeleporterSourceTransaction } from './TeleporterSourceTransaction.js';
5
+
6
+ type DeliveredTeleporterMessage = {
7
+ messageId: string;
8
+ teleporterContractAddress: string;
9
+ sourceBlockchainId: string;
10
+ destinationBlockchainId: string;
11
+ messageNonce: string;
12
+ from: string;
13
+ to: string;
14
+ data?: string;
15
+ messageExecuted: boolean;
16
+ receipts: Array<TeleporterReceipt>;
17
+ receiptDelivered: boolean;
18
+ rewardDetails: TeleporterRewardDetails;
19
+ sourceTransaction: TeleporterSourceTransaction;
20
+ destinationTransaction: TeleporterDestinationTransaction;
21
+ status: DeliveredTeleporterMessage.status;
22
+ };
23
+ declare namespace DeliveredTeleporterMessage {
24
+ enum status {
25
+ DELIVERED = "delivered"
26
+ }
27
+ }
28
+
29
+ export { DeliveredTeleporterMessage };
@@ -0,0 +1,8 @@
1
+ var DeliveredTeleporterMessage;
2
+ ((DeliveredTeleporterMessage2) => {
3
+ ((status2) => {
4
+ status2["DELIVERED"] = "delivered";
5
+ })(DeliveredTeleporterMessage2.status || (DeliveredTeleporterMessage2.status = {}));
6
+ })(DeliveredTeleporterMessage || (DeliveredTeleporterMessage = {}));
7
+
8
+ export { DeliveredTeleporterMessage };
@@ -1,4 +1,4 @@
1
- import { Asset } from './Asset.js';
1
+ import { AssetAmount } from './AssetAmount.js';
2
2
  import { UtxoCredential } from './UtxoCredential.js';
3
3
 
4
4
  type EVMInput = {
@@ -7,9 +7,9 @@ type EVMInput = {
7
7
  */
8
8
  fromAddress: string;
9
9
  /**
10
- * Asset details for the asset being transferred.
10
+ * AssetAmount details for the asset being transferred.
11
11
  */
12
- asset: Asset;
12
+ asset: AssetAmount;
13
13
  /**
14
14
  * Credentials that signed this transaction.
15
15
  */
@@ -0,0 +1,5 @@
1
+ declare enum EVMOperationType {
2
+ TRANSACTION_EXPORT_EVM = "TRANSACTION_EXPORT_EVM"
3
+ }
4
+
5
+ export { EVMOperationType };
@@ -0,0 +1,6 @@
1
+ var EVMOperationType = /* @__PURE__ */ ((EVMOperationType2) => {
2
+ EVMOperationType2["TRANSACTION_EXPORT_EVM"] = "TRANSACTION_EXPORT_EVM";
3
+ return EVMOperationType2;
4
+ })(EVMOperationType || {});
5
+
6
+ export { EVMOperationType };
@@ -1,4 +1,4 @@
1
- import { Asset } from './Asset.js';
1
+ import { AssetAmount } from './AssetAmount.js';
2
2
 
3
3
  type EVMOutput = {
4
4
  /**
@@ -6,9 +6,9 @@ type EVMOutput = {
6
6
  */
7
7
  toAddress: string;
8
8
  /**
9
- * Asset details for the asset being transferred.
9
+ * AssetAmount details for the asset being transferred.
10
10
  */
11
- asset: Asset;
11
+ asset: AssetAmount;
12
12
  };
13
13
 
14
14
  export { EVMOutput };
@@ -1,9 +1,6 @@
1
1
  import { NftTokenMetadataStatus } from './NftTokenMetadataStatus.js';
2
2
 
3
3
  type Erc1155TokenMetadata = {
4
- /**
5
- * The metadata indexing status of the nft.
6
- */
7
4
  indexStatus: NftTokenMetadataStatus;
8
5
  metadataLastUpdatedTimestamp?: number;
9
6
  name?: string;