@aws-sdk/client-managedblockchain-query 3.428.0 → 3.429.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 (38) hide show
  1. package/README.md +16 -0
  2. package/dist-cjs/ManagedBlockchainQuery.js +4 -0
  3. package/dist-cjs/commands/GetAssetContractCommand.js +51 -0
  4. package/dist-cjs/commands/ListAssetContractsCommand.js +51 -0
  5. package/dist-cjs/commands/index.js +2 -0
  6. package/dist-cjs/models/models_0.js +7 -1
  7. package/dist-cjs/pagination/ListAssetContractsPaginator.js +29 -0
  8. package/dist-cjs/pagination/index.js +1 -0
  9. package/dist-cjs/protocols/Aws_restJson1.js +144 -1
  10. package/dist-es/ManagedBlockchainQuery.js +4 -0
  11. package/dist-es/commands/GetAssetContractCommand.js +47 -0
  12. package/dist-es/commands/ListAssetContractsCommand.js +47 -0
  13. package/dist-es/commands/index.js +2 -0
  14. package/dist-es/models/models_0.js +6 -0
  15. package/dist-es/pagination/ListAssetContractsPaginator.js +25 -0
  16. package/dist-es/pagination/index.js +1 -0
  17. package/dist-es/protocols/Aws_restJson1.js +139 -0
  18. package/dist-types/ManagedBlockchainQuery.d.ts +14 -0
  19. package/dist-types/ManagedBlockchainQueryClient.d.ts +4 -2
  20. package/dist-types/commands/BatchGetTokenBalanceCommand.d.ts +1 -1
  21. package/dist-types/commands/GetAssetContractCommand.d.ts +119 -0
  22. package/dist-types/commands/ListAssetContractsCommand.d.ts +110 -0
  23. package/dist-types/commands/ListTokenBalancesCommand.d.ts +2 -2
  24. package/dist-types/commands/index.d.ts +2 -0
  25. package/dist-types/models/models_0.d.ts +210 -38
  26. package/dist-types/pagination/ListAssetContractsPaginator.d.ts +7 -0
  27. package/dist-types/pagination/index.d.ts +1 -0
  28. package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
  29. package/dist-types/ts3.4/ManagedBlockchainQuery.d.ts +34 -0
  30. package/dist-types/ts3.4/ManagedBlockchainQueryClient.d.ts +12 -0
  31. package/dist-types/ts3.4/commands/GetAssetContractCommand.d.ts +38 -0
  32. package/dist-types/ts3.4/commands/ListAssetContractsCommand.d.ts +39 -0
  33. package/dist-types/ts3.4/commands/index.d.ts +2 -0
  34. package/dist-types/ts3.4/models/models_0.d.ts +66 -21
  35. package/dist-types/ts3.4/pagination/ListAssetContractsPaginator.d.ts +11 -0
  36. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  37. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +24 -0
  38. package/package.json +5 -5
package/README.md CHANGED
@@ -216,6 +216,14 @@ BatchGetTokenBalance
216
216
 
217
217
  [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/classes/batchgettokenbalancecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/interfaces/batchgettokenbalancecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/interfaces/batchgettokenbalancecommandoutput.html)
218
218
 
219
+ </details>
220
+ <details>
221
+ <summary>
222
+ GetAssetContract
223
+ </summary>
224
+
225
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/classes/getassetcontractcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/interfaces/getassetcontractcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/interfaces/getassetcontractcommandoutput.html)
226
+
219
227
  </details>
220
228
  <details>
221
229
  <summary>
@@ -232,6 +240,14 @@ GetTransaction
232
240
 
233
241
  [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/classes/gettransactioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/interfaces/gettransactioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/interfaces/gettransactioncommandoutput.html)
234
242
 
243
+ </details>
244
+ <details>
245
+ <summary>
246
+ ListAssetContracts
247
+ </summary>
248
+
249
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/classes/listassetcontractscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/interfaces/listassetcontractscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-managedblockchain-query/interfaces/listassetcontractscommandoutput.html)
250
+
235
251
  </details>
236
252
  <details>
237
253
  <summary>
@@ -3,16 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ManagedBlockchainQuery = void 0;
4
4
  const smithy_client_1 = require("@smithy/smithy-client");
5
5
  const BatchGetTokenBalanceCommand_1 = require("./commands/BatchGetTokenBalanceCommand");
6
+ const GetAssetContractCommand_1 = require("./commands/GetAssetContractCommand");
6
7
  const GetTokenBalanceCommand_1 = require("./commands/GetTokenBalanceCommand");
7
8
  const GetTransactionCommand_1 = require("./commands/GetTransactionCommand");
9
+ const ListAssetContractsCommand_1 = require("./commands/ListAssetContractsCommand");
8
10
  const ListTokenBalancesCommand_1 = require("./commands/ListTokenBalancesCommand");
9
11
  const ListTransactionEventsCommand_1 = require("./commands/ListTransactionEventsCommand");
10
12
  const ListTransactionsCommand_1 = require("./commands/ListTransactionsCommand");
11
13
  const ManagedBlockchainQueryClient_1 = require("./ManagedBlockchainQueryClient");
12
14
  const commands = {
13
15
  BatchGetTokenBalanceCommand: BatchGetTokenBalanceCommand_1.BatchGetTokenBalanceCommand,
16
+ GetAssetContractCommand: GetAssetContractCommand_1.GetAssetContractCommand,
14
17
  GetTokenBalanceCommand: GetTokenBalanceCommand_1.GetTokenBalanceCommand,
15
18
  GetTransactionCommand: GetTransactionCommand_1.GetTransactionCommand,
19
+ ListAssetContractsCommand: ListAssetContractsCommand_1.ListAssetContractsCommand,
16
20
  ListTokenBalancesCommand: ListTokenBalancesCommand_1.ListTokenBalancesCommand,
17
21
  ListTransactionEventsCommand: ListTransactionEventsCommand_1.ListTransactionEventsCommand,
18
22
  ListTransactionsCommand: ListTransactionsCommand_1.ListTransactionsCommand,
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetAssetContractCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
+ class GetAssetContractCommand extends smithy_client_1.Command {
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ constructor(input) {
20
+ super();
21
+ this.input = input;
22
+ }
23
+ resolveMiddleware(clientStack, configuration, options) {
24
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
25
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetAssetContractCommand.getEndpointParameterInstructions()));
26
+ const stack = clientStack.concat(this.middlewareStack);
27
+ const { logger } = configuration;
28
+ const clientName = "ManagedBlockchainQueryClient";
29
+ const commandName = "GetAssetContractCommand";
30
+ const handlerExecutionContext = {
31
+ logger,
32
+ clientName,
33
+ commandName,
34
+ inputFilterSensitiveLog: (_) => _,
35
+ outputFilterSensitiveLog: (_) => _,
36
+ [types_1.SMITHY_CONTEXT_KEY]: {
37
+ service: "TietonChainQueryService",
38
+ operation: "GetAssetContract",
39
+ },
40
+ };
41
+ const { requestHandler } = configuration;
42
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
43
+ }
44
+ serialize(input, context) {
45
+ return (0, Aws_restJson1_1.se_GetAssetContractCommand)(input, context);
46
+ }
47
+ deserialize(output, context) {
48
+ return (0, Aws_restJson1_1.de_GetAssetContractCommand)(output, context);
49
+ }
50
+ }
51
+ exports.GetAssetContractCommand = GetAssetContractCommand;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListAssetContractsCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
+ class ListAssetContractsCommand extends smithy_client_1.Command {
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ constructor(input) {
20
+ super();
21
+ this.input = input;
22
+ }
23
+ resolveMiddleware(clientStack, configuration, options) {
24
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
25
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListAssetContractsCommand.getEndpointParameterInstructions()));
26
+ const stack = clientStack.concat(this.middlewareStack);
27
+ const { logger } = configuration;
28
+ const clientName = "ManagedBlockchainQueryClient";
29
+ const commandName = "ListAssetContractsCommand";
30
+ const handlerExecutionContext = {
31
+ logger,
32
+ clientName,
33
+ commandName,
34
+ inputFilterSensitiveLog: (_) => _,
35
+ outputFilterSensitiveLog: (_) => _,
36
+ [types_1.SMITHY_CONTEXT_KEY]: {
37
+ service: "TietonChainQueryService",
38
+ operation: "ListAssetContracts",
39
+ },
40
+ };
41
+ const { requestHandler } = configuration;
42
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
43
+ }
44
+ serialize(input, context) {
45
+ return (0, Aws_restJson1_1.se_ListAssetContractsCommand)(input, context);
46
+ }
47
+ deserialize(output, context) {
48
+ return (0, Aws_restJson1_1.de_ListAssetContractsCommand)(output, context);
49
+ }
50
+ }
51
+ exports.ListAssetContractsCommand = ListAssetContractsCommand;
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./BatchGetTokenBalanceCommand"), exports);
5
+ tslib_1.__exportStar(require("./GetAssetContractCommand"), exports);
5
6
  tslib_1.__exportStar(require("./GetTokenBalanceCommand"), exports);
6
7
  tslib_1.__exportStar(require("./GetTransactionCommand"), exports);
8
+ tslib_1.__exportStar(require("./ListAssetContractsCommand"), exports);
7
9
  tslib_1.__exportStar(require("./ListTokenBalancesCommand"), exports);
8
10
  tslib_1.__exportStar(require("./ListTransactionEventsCommand"), exports);
9
11
  tslib_1.__exportStar(require("./ListTransactionsCommand"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SortOrder = exports.ListTransactionsSortBy = exports.QueryTransactionEventType = exports.QueryTransactionStatus = exports.ValidationException = exports.ValidationExceptionReason = exports.ThrottlingException = exports.ServiceQuotaExceededException = exports.ResourceNotFoundException = exports.ResourceType = exports.InternalServerException = exports.ErrorType = exports.QueryNetwork = exports.AccessDeniedException = void 0;
3
+ exports.SortOrder = exports.ListTransactionsSortBy = exports.QueryTransactionEventType = exports.QueryTransactionStatus = exports.ValidationException = exports.ValidationExceptionReason = exports.ThrottlingException = exports.ServiceQuotaExceededException = exports.ResourceNotFoundException = exports.ResourceType = exports.InternalServerException = exports.ErrorType = exports.QueryTokenStandard = exports.QueryNetwork = exports.AccessDeniedException = void 0;
4
4
  const ManagedBlockchainQueryServiceException_1 = require("./ManagedBlockchainQueryServiceException");
5
5
  class AccessDeniedException extends ManagedBlockchainQueryServiceException_1.ManagedBlockchainQueryServiceException {
6
6
  constructor(opts) {
@@ -17,8 +17,14 @@ class AccessDeniedException extends ManagedBlockchainQueryServiceException_1.Man
17
17
  exports.AccessDeniedException = AccessDeniedException;
18
18
  exports.QueryNetwork = {
19
19
  BITCOIN_MAINNET: "BITCOIN_MAINNET",
20
+ BITCOIN_TESTNET: "BITCOIN_TESTNET",
20
21
  ETHEREUM_MAINNET: "ETHEREUM_MAINNET",
21
22
  };
23
+ exports.QueryTokenStandard = {
24
+ ERC1155: "ERC1155",
25
+ ERC20: "ERC20",
26
+ ERC721: "ERC721",
27
+ };
22
28
  exports.ErrorType = {
23
29
  RESOURCE_NOT_FOUND_EXCEPTION: "RESOURCE_NOT_FOUND_EXCEPTION",
24
30
  VALIDATION_EXCEPTION: "VALIDATION_EXCEPTION",
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paginateListAssetContracts = void 0;
4
+ const ListAssetContractsCommand_1 = require("../commands/ListAssetContractsCommand");
5
+ const ManagedBlockchainQueryClient_1 = require("../ManagedBlockchainQueryClient");
6
+ const makePagedClientRequest = async (client, input, ...args) => {
7
+ return await client.send(new ListAssetContractsCommand_1.ListAssetContractsCommand(input), ...args);
8
+ };
9
+ async function* paginateListAssetContracts(config, input, ...additionalArguments) {
10
+ let token = config.startingToken || undefined;
11
+ let hasNext = true;
12
+ let page;
13
+ while (hasNext) {
14
+ input.nextToken = token;
15
+ input["maxResults"] = config.pageSize;
16
+ if (config.client instanceof ManagedBlockchainQueryClient_1.ManagedBlockchainQueryClient) {
17
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
+ }
19
+ else {
20
+ throw new Error("Invalid client, expected ManagedBlockchainQuery | ManagedBlockchainQueryClient");
21
+ }
22
+ yield page;
23
+ const prevToken = token;
24
+ token = page.nextToken;
25
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
+ }
27
+ return undefined;
28
+ }
29
+ exports.paginateListAssetContracts = paginateListAssetContracts;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./Interfaces"), exports);
5
+ tslib_1.__exportStar(require("./ListAssetContractsPaginator"), exports);
5
6
  tslib_1.__exportStar(require("./ListTokenBalancesPaginator"), exports);
6
7
  tslib_1.__exportStar(require("./ListTransactionEventsPaginator"), exports);
7
8
  tslib_1.__exportStar(require("./ListTransactionsPaginator"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ListTransactionsCommand = exports.de_ListTransactionEventsCommand = exports.de_ListTokenBalancesCommand = exports.de_GetTransactionCommand = exports.de_GetTokenBalanceCommand = exports.de_BatchGetTokenBalanceCommand = exports.se_ListTransactionsCommand = exports.se_ListTransactionEventsCommand = exports.se_ListTokenBalancesCommand = exports.se_GetTransactionCommand = exports.se_GetTokenBalanceCommand = exports.se_BatchGetTokenBalanceCommand = void 0;
3
+ exports.de_ListTransactionsCommand = exports.de_ListTransactionEventsCommand = exports.de_ListTokenBalancesCommand = exports.de_ListAssetContractsCommand = exports.de_GetTransactionCommand = exports.de_GetTokenBalanceCommand = exports.de_GetAssetContractCommand = exports.de_BatchGetTokenBalanceCommand = exports.se_ListTransactionsCommand = exports.se_ListTransactionEventsCommand = exports.se_ListTokenBalancesCommand = exports.se_ListAssetContractsCommand = exports.se_GetTransactionCommand = exports.se_GetTokenBalanceCommand = exports.se_GetAssetContractCommand = exports.se_BatchGetTokenBalanceCommand = void 0;
4
4
  const protocol_http_1 = require("@smithy/protocol-http");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const ManagedBlockchainQueryServiceException_1 = require("../models/ManagedBlockchainQueryServiceException");
@@ -26,6 +26,27 @@ const se_BatchGetTokenBalanceCommand = async (input, context) => {
26
26
  });
27
27
  };
28
28
  exports.se_BatchGetTokenBalanceCommand = se_BatchGetTokenBalanceCommand;
29
+ const se_GetAssetContractCommand = async (input, context) => {
30
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
31
+ const headers = {
32
+ "content-type": "application/json",
33
+ };
34
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/get-asset-contract";
35
+ let body;
36
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
37
+ contractIdentifier: (_) => (0, smithy_client_1._json)(_),
38
+ }));
39
+ return new protocol_http_1.HttpRequest({
40
+ protocol,
41
+ hostname,
42
+ port,
43
+ method: "POST",
44
+ headers,
45
+ path: resolvedPath,
46
+ body,
47
+ });
48
+ };
49
+ exports.se_GetAssetContractCommand = se_GetAssetContractCommand;
29
50
  const se_GetTokenBalanceCommand = async (input, context) => {
30
51
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
31
52
  const headers = {
@@ -71,6 +92,29 @@ const se_GetTransactionCommand = async (input, context) => {
71
92
  });
72
93
  };
73
94
  exports.se_GetTransactionCommand = se_GetTransactionCommand;
95
+ const se_ListAssetContractsCommand = async (input, context) => {
96
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
97
+ const headers = {
98
+ "content-type": "application/json",
99
+ };
100
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-asset-contracts";
101
+ let body;
102
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
103
+ contractFilter: (_) => (0, smithy_client_1._json)(_),
104
+ maxResults: [],
105
+ nextToken: [],
106
+ }));
107
+ return new protocol_http_1.HttpRequest({
108
+ protocol,
109
+ hostname,
110
+ port,
111
+ method: "POST",
112
+ headers,
113
+ path: resolvedPath,
114
+ body,
115
+ });
116
+ };
117
+ exports.se_ListAssetContractsCommand = se_ListAssetContractsCommand;
74
118
  const se_ListTokenBalancesCommand = async (input, context) => {
75
119
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
76
120
  const headers = {
@@ -196,6 +240,58 @@ const de_BatchGetTokenBalanceCommandError = async (output, context) => {
196
240
  });
197
241
  }
198
242
  };
243
+ const de_GetAssetContractCommand = async (output, context) => {
244
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
245
+ return de_GetAssetContractCommandError(output, context);
246
+ }
247
+ const contents = (0, smithy_client_1.map)({
248
+ $metadata: deserializeMetadata(output),
249
+ });
250
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
251
+ const doc = (0, smithy_client_1.take)(data, {
252
+ contractIdentifier: smithy_client_1._json,
253
+ deployerAddress: smithy_client_1.expectString,
254
+ metadata: smithy_client_1._json,
255
+ tokenStandard: smithy_client_1.expectString,
256
+ });
257
+ Object.assign(contents, doc);
258
+ return contents;
259
+ };
260
+ exports.de_GetAssetContractCommand = de_GetAssetContractCommand;
261
+ const de_GetAssetContractCommandError = async (output, context) => {
262
+ const parsedOutput = {
263
+ ...output,
264
+ body: await parseErrorBody(output.body, context),
265
+ };
266
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
267
+ switch (errorCode) {
268
+ case "AccessDeniedException":
269
+ case "com.amazonaws.managedblockchainquery#AccessDeniedException":
270
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
271
+ case "InternalServerException":
272
+ case "com.amazonaws.managedblockchainquery#InternalServerException":
273
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
274
+ case "ResourceNotFoundException":
275
+ case "com.amazonaws.managedblockchainquery#ResourceNotFoundException":
276
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
277
+ case "ServiceQuotaExceededException":
278
+ case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException":
279
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
280
+ case "ThrottlingException":
281
+ case "com.amazonaws.managedblockchainquery#ThrottlingException":
282
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
283
+ case "ValidationException":
284
+ case "com.amazonaws.managedblockchainquery#ValidationException":
285
+ throw await de_ValidationExceptionRes(parsedOutput, context);
286
+ default:
287
+ const parsedBody = parsedOutput.body;
288
+ return throwDefaultError({
289
+ output,
290
+ parsedBody,
291
+ errorCode,
292
+ });
293
+ }
294
+ };
199
295
  const de_GetTokenBalanceCommand = async (output, context) => {
200
296
  if (output.statusCode !== 200 && output.statusCode >= 300) {
201
297
  return de_GetTokenBalanceCommandError(output, context);
@@ -298,6 +394,53 @@ const de_GetTransactionCommandError = async (output, context) => {
298
394
  });
299
395
  }
300
396
  };
397
+ const de_ListAssetContractsCommand = async (output, context) => {
398
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
399
+ return de_ListAssetContractsCommandError(output, context);
400
+ }
401
+ const contents = (0, smithy_client_1.map)({
402
+ $metadata: deserializeMetadata(output),
403
+ });
404
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
405
+ const doc = (0, smithy_client_1.take)(data, {
406
+ contracts: smithy_client_1._json,
407
+ nextToken: smithy_client_1.expectString,
408
+ });
409
+ Object.assign(contents, doc);
410
+ return contents;
411
+ };
412
+ exports.de_ListAssetContractsCommand = de_ListAssetContractsCommand;
413
+ const de_ListAssetContractsCommandError = async (output, context) => {
414
+ const parsedOutput = {
415
+ ...output,
416
+ body: await parseErrorBody(output.body, context),
417
+ };
418
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
419
+ switch (errorCode) {
420
+ case "AccessDeniedException":
421
+ case "com.amazonaws.managedblockchainquery#AccessDeniedException":
422
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
423
+ case "InternalServerException":
424
+ case "com.amazonaws.managedblockchainquery#InternalServerException":
425
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
426
+ case "ServiceQuotaExceededException":
427
+ case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException":
428
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
429
+ case "ThrottlingException":
430
+ case "com.amazonaws.managedblockchainquery#ThrottlingException":
431
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
432
+ case "ValidationException":
433
+ case "com.amazonaws.managedblockchainquery#ValidationException":
434
+ throw await de_ValidationExceptionRes(parsedOutput, context);
435
+ default:
436
+ const parsedBody = parsedOutput.body;
437
+ return throwDefaultError({
438
+ output,
439
+ parsedBody,
440
+ errorCode,
441
+ });
442
+ }
443
+ };
301
444
  const de_ListTokenBalancesCommand = async (output, context) => {
302
445
  if (output.statusCode !== 200 && output.statusCode >= 300) {
303
446
  return de_ListTokenBalancesCommandError(output, context);
@@ -1,15 +1,19 @@
1
1
  import { createAggregatedClient } from "@smithy/smithy-client";
2
2
  import { BatchGetTokenBalanceCommand, } from "./commands/BatchGetTokenBalanceCommand";
3
+ import { GetAssetContractCommand, } from "./commands/GetAssetContractCommand";
3
4
  import { GetTokenBalanceCommand, } from "./commands/GetTokenBalanceCommand";
4
5
  import { GetTransactionCommand, } from "./commands/GetTransactionCommand";
6
+ import { ListAssetContractsCommand, } from "./commands/ListAssetContractsCommand";
5
7
  import { ListTokenBalancesCommand, } from "./commands/ListTokenBalancesCommand";
6
8
  import { ListTransactionEventsCommand, } from "./commands/ListTransactionEventsCommand";
7
9
  import { ListTransactionsCommand, } from "./commands/ListTransactionsCommand";
8
10
  import { ManagedBlockchainQueryClient } from "./ManagedBlockchainQueryClient";
9
11
  const commands = {
10
12
  BatchGetTokenBalanceCommand,
13
+ GetAssetContractCommand,
11
14
  GetTokenBalanceCommand,
12
15
  GetTransactionCommand,
16
+ ListAssetContractsCommand,
13
17
  ListTokenBalancesCommand,
14
18
  ListTransactionEventsCommand,
15
19
  ListTransactionsCommand,
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_GetAssetContractCommand, se_GetAssetContractCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class GetAssetContractCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, GetAssetContractCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "ManagedBlockchainQueryClient";
26
+ const commandName = "GetAssetContractCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "TietonChainQueryService",
35
+ operation: "GetAssetContract",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_GetAssetContractCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_GetAssetContractCommand(output, context);
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_ListAssetContractsCommand, se_ListAssetContractsCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class ListAssetContractsCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, ListAssetContractsCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "ManagedBlockchainQueryClient";
26
+ const commandName = "ListAssetContractsCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "TietonChainQueryService",
35
+ operation: "ListAssetContracts",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_ListAssetContractsCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_ListAssetContractsCommand(output, context);
46
+ }
47
+ }
@@ -1,6 +1,8 @@
1
1
  export * from "./BatchGetTokenBalanceCommand";
2
+ export * from "./GetAssetContractCommand";
2
3
  export * from "./GetTokenBalanceCommand";
3
4
  export * from "./GetTransactionCommand";
5
+ export * from "./ListAssetContractsCommand";
4
6
  export * from "./ListTokenBalancesCommand";
5
7
  export * from "./ListTransactionEventsCommand";
6
8
  export * from "./ListTransactionsCommand";
@@ -13,8 +13,14 @@ export class AccessDeniedException extends __BaseException {
13
13
  }
14
14
  export const QueryNetwork = {
15
15
  BITCOIN_MAINNET: "BITCOIN_MAINNET",
16
+ BITCOIN_TESTNET: "BITCOIN_TESTNET",
16
17
  ETHEREUM_MAINNET: "ETHEREUM_MAINNET",
17
18
  };
19
+ export const QueryTokenStandard = {
20
+ ERC1155: "ERC1155",
21
+ ERC20: "ERC20",
22
+ ERC721: "ERC721",
23
+ };
18
24
  export const ErrorType = {
19
25
  RESOURCE_NOT_FOUND_EXCEPTION: "RESOURCE_NOT_FOUND_EXCEPTION",
20
26
  VALIDATION_EXCEPTION: "VALIDATION_EXCEPTION",
@@ -0,0 +1,25 @@
1
+ import { ListAssetContractsCommand, } from "../commands/ListAssetContractsCommand";
2
+ import { ManagedBlockchainQueryClient } from "../ManagedBlockchainQueryClient";
3
+ const makePagedClientRequest = async (client, input, ...args) => {
4
+ return await client.send(new ListAssetContractsCommand(input), ...args);
5
+ };
6
+ export async function* paginateListAssetContracts(config, input, ...additionalArguments) {
7
+ let token = config.startingToken || undefined;
8
+ let hasNext = true;
9
+ let page;
10
+ while (hasNext) {
11
+ input.nextToken = token;
12
+ input["maxResults"] = config.pageSize;
13
+ if (config.client instanceof ManagedBlockchainQueryClient) {
14
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
+ }
16
+ else {
17
+ throw new Error("Invalid client, expected ManagedBlockchainQuery | ManagedBlockchainQueryClient");
18
+ }
19
+ yield page;
20
+ const prevToken = token;
21
+ token = page.nextToken;
22
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
+ }
24
+ return undefined;
25
+ }
@@ -1,4 +1,5 @@
1
1
  export * from "./Interfaces";
2
+ export * from "./ListAssetContractsPaginator";
2
3
  export * from "./ListTokenBalancesPaginator";
3
4
  export * from "./ListTransactionEventsPaginator";
4
5
  export * from "./ListTransactionsPaginator";