From 6dc7cd7a51d9fbaa7c903776a6a82008dc6ff763 Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 16 Oct 2023 18:19:36 +0000 Subject: [PATCH] feat(client-managedblockchain-query): This release introduces two new APIs: GetAssetContract and ListAssetContracts. This release also adds support for Bitcoin Testnet. --- .../client-managedblockchain-query/README.md | 16 + .../src/ManagedBlockchainQuery.ts | 46 +++ .../src/ManagedBlockchainQueryClient.ts | 6 + .../commands/BatchGetTokenBalanceCommand.ts | 2 +- .../src/commands/GetAssetContractCommand.ts | 197 ++++++++++ .../src/commands/ListAssetContractsCommand.ts | 188 ++++++++++ .../src/commands/ListTokenBalancesCommand.ts | 4 +- .../src/commands/index.ts | 2 + .../src/models/models_0.ts | 243 +++++++++++-- .../pagination/ListAssetContractsPaginator.ts | 50 +++ .../src/pagination/index.ts | 1 + .../src/protocols/Aws_restJson1.ts | 201 ++++++++++ .../aws-models/managedblockchain-query.json | 342 +++++++++++++++++- 13 files changed, 1263 insertions(+), 35 deletions(-) create mode 100644 clients/client-managedblockchain-query/src/commands/GetAssetContractCommand.ts create mode 100644 clients/client-managedblockchain-query/src/commands/ListAssetContractsCommand.ts create mode 100644 clients/client-managedblockchain-query/src/pagination/ListAssetContractsPaginator.ts diff --git a/clients/client-managedblockchain-query/README.md b/clients/client-managedblockchain-query/README.md index 80b762a75937..767caa2d4dc6 100644 --- a/clients/client-managedblockchain-query/README.md +++ b/clients/client-managedblockchain-query/README.md @@ -216,6 +216,14 @@ BatchGetTokenBalance [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) + +
+ +GetAssetContract + + +[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) +
@@ -232,6 +240,14 @@ GetTransaction [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) +
+
+ +ListAssetContracts + + +[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) +
diff --git a/clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts b/clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts index 7f521b40a8b3..e4f770f44f51 100644 --- a/clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts +++ b/clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts @@ -7,6 +7,11 @@ import { BatchGetTokenBalanceCommandInput, BatchGetTokenBalanceCommandOutput, } from "./commands/BatchGetTokenBalanceCommand"; +import { + GetAssetContractCommand, + GetAssetContractCommandInput, + GetAssetContractCommandOutput, +} from "./commands/GetAssetContractCommand"; import { GetTokenBalanceCommand, GetTokenBalanceCommandInput, @@ -17,6 +22,11 @@ import { GetTransactionCommandInput, GetTransactionCommandOutput, } from "./commands/GetTransactionCommand"; +import { + ListAssetContractsCommand, + ListAssetContractsCommandInput, + ListAssetContractsCommandOutput, +} from "./commands/ListAssetContractsCommand"; import { ListTokenBalancesCommand, ListTokenBalancesCommandInput, @@ -36,8 +46,10 @@ import { ManagedBlockchainQueryClient, ManagedBlockchainQueryClientConfig } from const commands = { BatchGetTokenBalanceCommand, + GetAssetContractCommand, GetTokenBalanceCommand, GetTransactionCommand, + ListAssetContractsCommand, ListTokenBalancesCommand, ListTransactionEventsCommand, ListTransactionsCommand, @@ -61,6 +73,23 @@ export interface ManagedBlockchainQuery { cb: (err: any, data?: BatchGetTokenBalanceCommandOutput) => void ): void; + /** + * @see {@link GetAssetContractCommand} + */ + getAssetContract( + args: GetAssetContractCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getAssetContract( + args: GetAssetContractCommandInput, + cb: (err: any, data?: GetAssetContractCommandOutput) => void + ): void; + getAssetContract( + args: GetAssetContractCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAssetContractCommandOutput) => void + ): void; + /** * @see {@link GetTokenBalanceCommand} */ @@ -89,6 +118,23 @@ export interface ManagedBlockchainQuery { cb: (err: any, data?: GetTransactionCommandOutput) => void ): void; + /** + * @see {@link ListAssetContractsCommand} + */ + listAssetContracts( + args: ListAssetContractsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listAssetContracts( + args: ListAssetContractsCommandInput, + cb: (err: any, data?: ListAssetContractsCommandOutput) => void + ): void; + listAssetContracts( + args: ListAssetContractsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAssetContractsCommandOutput) => void + ): void; + /** * @see {@link ListTokenBalancesCommand} */ diff --git a/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts b/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts index f1957bafdce4..d03b40f1295e 100644 --- a/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts +++ b/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts @@ -54,8 +54,10 @@ import { BatchGetTokenBalanceCommandInput, BatchGetTokenBalanceCommandOutput, } from "./commands/BatchGetTokenBalanceCommand"; +import { GetAssetContractCommandInput, GetAssetContractCommandOutput } from "./commands/GetAssetContractCommand"; import { GetTokenBalanceCommandInput, GetTokenBalanceCommandOutput } from "./commands/GetTokenBalanceCommand"; import { GetTransactionCommandInput, GetTransactionCommandOutput } from "./commands/GetTransactionCommand"; +import { ListAssetContractsCommandInput, ListAssetContractsCommandOutput } from "./commands/ListAssetContractsCommand"; import { ListTokenBalancesCommandInput, ListTokenBalancesCommandOutput } from "./commands/ListTokenBalancesCommand"; import { ListTransactionEventsCommandInput, @@ -78,8 +80,10 @@ export { __Client }; */ export type ServiceInputTypes = | BatchGetTokenBalanceCommandInput + | GetAssetContractCommandInput | GetTokenBalanceCommandInput | GetTransactionCommandInput + | ListAssetContractsCommandInput | ListTokenBalancesCommandInput | ListTransactionEventsCommandInput | ListTransactionsCommandInput; @@ -89,8 +93,10 @@ export type ServiceInputTypes = */ export type ServiceOutputTypes = | BatchGetTokenBalanceCommandOutput + | GetAssetContractCommandOutput | GetTokenBalanceCommandOutput | GetTransactionCommandOutput + | ListAssetContractsCommandOutput | ListTokenBalancesCommandOutput | ListTransactionEventsCommandOutput | ListTransactionsCommandOutput; diff --git a/clients/client-managedblockchain-query/src/commands/BatchGetTokenBalanceCommand.ts b/clients/client-managedblockchain-query/src/commands/BatchGetTokenBalanceCommand.ts index 2563052a86ab..ebfec148033b 100644 --- a/clients/client-managedblockchain-query/src/commands/BatchGetTokenBalanceCommand.ts +++ b/clients/client-managedblockchain-query/src/commands/BatchGetTokenBalanceCommand.ts @@ -41,7 +41,7 @@ export interface BatchGetTokenBalanceCommandOutput extends BatchGetTokenBalanceO /** * @public - *

Gets the token balance for a batch of tokens by using the GetTokenBalance + *

Gets the token balance for a batch of tokens by using the BatchGetTokenBalance * action for every token in the request.

* *

Only the native tokens BTC,ETH, and the ERC-20, diff --git a/clients/client-managedblockchain-query/src/commands/GetAssetContractCommand.ts b/clients/client-managedblockchain-query/src/commands/GetAssetContractCommand.ts new file mode 100644 index 000000000000..4674d6a9a961 --- /dev/null +++ b/clients/client-managedblockchain-query/src/commands/GetAssetContractCommand.ts @@ -0,0 +1,197 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + ManagedBlockchainQueryClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../ManagedBlockchainQueryClient"; +import { GetAssetContractInput, GetAssetContractOutput } from "../models/models_0"; +import { de_GetAssetContractCommand, se_GetAssetContractCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetAssetContractCommand}. + */ +export interface GetAssetContractCommandInput extends GetAssetContractInput {} +/** + * @public + * + * The output of {@link GetAssetContractCommand}. + */ +export interface GetAssetContractCommandOutput extends GetAssetContractOutput, __MetadataBearer {} + +/** + * @public + *

Gets the information about a specific contract deployed on the blockchain.

+ * + *
    + *
  • + *

    The Bitcoin blockchain networks do not support this + * operation.

    + *
  • + *
  • + *

    Metadata is currently only available for some ERC-20 contracts. + * Metadata will be available for additional contracts in the future.

    + *
  • + *
+ *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ManagedBlockchainQueryClient, GetAssetContractCommand } from "@aws-sdk/client-managedblockchain-query"; // ES Modules import + * // const { ManagedBlockchainQueryClient, GetAssetContractCommand } = require("@aws-sdk/client-managedblockchain-query"); // CommonJS import + * const client = new ManagedBlockchainQueryClient(config); + * const input = { // GetAssetContractInput + * contractIdentifier: { // ContractIdentifier + * network: "STRING_VALUE", // required + * contractAddress: "STRING_VALUE", // required + * }, + * }; + * const command = new GetAssetContractCommand(input); + * const response = await client.send(command); + * // { // GetAssetContractOutput + * // contractIdentifier: { // ContractIdentifier + * // network: "STRING_VALUE", // required + * // contractAddress: "STRING_VALUE", // required + * // }, + * // tokenStandard: "STRING_VALUE", // required + * // deployerAddress: "STRING_VALUE", // required + * // metadata: { // ContractMetadata + * // name: "STRING_VALUE", + * // symbol: "STRING_VALUE", + * // decimals: Number("int"), + * // }, + * // }; + * + * ``` + * + * @param GetAssetContractCommandInput - {@link GetAssetContractCommandInput} + * @returns {@link GetAssetContractCommandOutput} + * @see {@link GetAssetContractCommandInput} for command's `input` shape. + * @see {@link GetAssetContractCommandOutput} for command's `response` shape. + * @see {@link ManagedBlockchainQueryClientResolvedConfig | config} for ManagedBlockchainQueryClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The Amazon Web Services account doesn’t have access to this resource.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an internal error in the service.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The resource was not found.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The service quota has been exceeded for this resource.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request or operation couldn't be performed because a service is throttling + * requests. The most common source of throttling errors is when you create resources + * that exceed your service limit for this resource type. Request a limit increase or + * delete unused resources, if possible.

+ * + * @throws {@link ValidationException} (client fault) + *

The resource passed is invalid.

+ * + * @throws {@link ManagedBlockchainQueryServiceException} + *

Base exception class for all service exceptions from ManagedBlockchainQuery service.

+ * + */ +export class GetAssetContractCommand extends $Command< + GetAssetContractCommandInput, + GetAssetContractCommandOutput, + ManagedBlockchainQueryClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetAssetContractCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ManagedBlockchainQueryClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetAssetContractCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "ManagedBlockchainQueryClient"; + const commandName = "GetAssetContractCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TietonChainQueryService", + operation: "GetAssetContract", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetAssetContractCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetAssetContractCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetAssetContractCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-managedblockchain-query/src/commands/ListAssetContractsCommand.ts b/clients/client-managedblockchain-query/src/commands/ListAssetContractsCommand.ts new file mode 100644 index 000000000000..251af31f5ec6 --- /dev/null +++ b/clients/client-managedblockchain-query/src/commands/ListAssetContractsCommand.ts @@ -0,0 +1,188 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + ManagedBlockchainQueryClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../ManagedBlockchainQueryClient"; +import { ListAssetContractsInput, ListAssetContractsOutput } from "../models/models_0"; +import { de_ListAssetContractsCommand, se_ListAssetContractsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListAssetContractsCommand}. + */ +export interface ListAssetContractsCommandInput extends ListAssetContractsInput {} +/** + * @public + * + * The output of {@link ListAssetContractsCommand}. + */ +export interface ListAssetContractsCommandOutput extends ListAssetContractsOutput, __MetadataBearer {} + +/** + * @public + *

Lists all the contracts for a given contract type deployed by an address + * (either a contract address or a wallet address).

+ *

The Bitcoin blockchain networks do not support this + * operation.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ManagedBlockchainQueryClient, ListAssetContractsCommand } from "@aws-sdk/client-managedblockchain-query"; // ES Modules import + * // const { ManagedBlockchainQueryClient, ListAssetContractsCommand } = require("@aws-sdk/client-managedblockchain-query"); // CommonJS import + * const client = new ManagedBlockchainQueryClient(config); + * const input = { // ListAssetContractsInput + * contractFilter: { // ContractFilter + * network: "STRING_VALUE", // required + * tokenStandard: "STRING_VALUE", // required + * deployerAddress: "STRING_VALUE", // required + * }, + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * }; + * const command = new ListAssetContractsCommand(input); + * const response = await client.send(command); + * // { // ListAssetContractsOutput + * // contracts: [ // AssetContractList // required + * // { // AssetContract + * // contractIdentifier: { // ContractIdentifier + * // network: "STRING_VALUE", // required + * // contractAddress: "STRING_VALUE", // required + * // }, + * // tokenStandard: "STRING_VALUE", // required + * // deployerAddress: "STRING_VALUE", // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListAssetContractsCommandInput - {@link ListAssetContractsCommandInput} + * @returns {@link ListAssetContractsCommandOutput} + * @see {@link ListAssetContractsCommandInput} for command's `input` shape. + * @see {@link ListAssetContractsCommandOutput} for command's `response` shape. + * @see {@link ManagedBlockchainQueryClientResolvedConfig | config} for ManagedBlockchainQueryClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The Amazon Web Services account doesn’t have access to this resource.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an internal error in the service.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The service quota has been exceeded for this resource.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request or operation couldn't be performed because a service is throttling + * requests. The most common source of throttling errors is when you create resources + * that exceed your service limit for this resource type. Request a limit increase or + * delete unused resources, if possible.

+ * + * @throws {@link ValidationException} (client fault) + *

The resource passed is invalid.

+ * + * @throws {@link ManagedBlockchainQueryServiceException} + *

Base exception class for all service exceptions from ManagedBlockchainQuery service.

+ * + */ +export class ListAssetContractsCommand extends $Command< + ListAssetContractsCommandInput, + ListAssetContractsCommandOutput, + ManagedBlockchainQueryClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListAssetContractsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ManagedBlockchainQueryClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListAssetContractsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "ManagedBlockchainQueryClient"; + const commandName = "ListAssetContractsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TietonChainQueryService", + operation: "ListAssetContracts", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListAssetContractsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListAssetContractsCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListAssetContractsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-managedblockchain-query/src/commands/ListTokenBalancesCommand.ts b/clients/client-managedblockchain-query/src/commands/ListTokenBalancesCommand.ts index ec5e15597648..24b174f74e36 100644 --- a/clients/client-managedblockchain-query/src/commands/ListTokenBalancesCommand.ts +++ b/clients/client-managedblockchain-query/src/commands/ListTokenBalancesCommand.ts @@ -41,10 +41,10 @@ export interface ListTokenBalancesCommandOutput extends ListTokenBalancesOutput, /** * @public - *

This action returns the following for a given a blockchain network:

+ *

This action returns the following for a given blockchain network:

*
    *
  • - *

    Lists all token balances owned by an address (either a contact + *

    Lists all token balances owned by an address (either a contract * address or a wallet address).

    *
  • *
  • diff --git a/clients/client-managedblockchain-query/src/commands/index.ts b/clients/client-managedblockchain-query/src/commands/index.ts index 7f675118527c..f3b525369243 100644 --- a/clients/client-managedblockchain-query/src/commands/index.ts +++ b/clients/client-managedblockchain-query/src/commands/index.ts @@ -1,7 +1,9 @@ // smithy-typescript generated code export * from "./BatchGetTokenBalanceCommand"; +export * from "./GetAssetContractCommand"; export * from "./GetTokenBalanceCommand"; export * from "./GetTransactionCommand"; +export * from "./ListAssetContractsCommand"; export * from "./ListTokenBalancesCommand"; export * from "./ListTransactionEventsCommand"; export * from "./ListTransactionsCommand"; diff --git a/clients/client-managedblockchain-query/src/models/models_0.ts b/clients/client-managedblockchain-query/src/models/models_0.ts index 8ff6aed2620e..4e61bfe6e261 100644 --- a/clients/client-managedblockchain-query/src/models/models_0.ts +++ b/clients/client-managedblockchain-query/src/models/models_0.ts @@ -23,6 +23,88 @@ export class AccessDeniedException extends __BaseException { } } +/** + * @public + * @enum + */ +export const QueryNetwork = { + /** + * Bitcoin main network + */ + BITCOIN_MAINNET: "BITCOIN_MAINNET", + /** + * Bitcoin test network + */ + BITCOIN_TESTNET: "BITCOIN_TESTNET", + /** + * Ethereum main network + */ + ETHEREUM_MAINNET: "ETHEREUM_MAINNET", +} as const; + +/** + * @public + */ +export type QueryNetwork = (typeof QueryNetwork)[keyof typeof QueryNetwork]; + +/** + * @public + *

    Container for the blockchain address and network information about a contract.

    + */ +export interface ContractIdentifier { + /** + * @public + *

    The blockchain network of the contract.

    + */ + network: QueryNetwork | undefined; + + /** + * @public + *

    Container for the blockchain address about a contract.

    + */ + contractAddress: string | undefined; +} + +/** + * @public + * @enum + */ +export const QueryTokenStandard = { + ERC1155: "ERC1155", + ERC20: "ERC20", + ERC721: "ERC721", +} as const; + +/** + * @public + */ +export type QueryTokenStandard = (typeof QueryTokenStandard)[keyof typeof QueryTokenStandard]; + +/** + * @public + *

    This container contains information about an contract.

    + */ +export interface AssetContract { + /** + * @public + *

    The container for the contract identifier containing its blockchain network + * and address.

    + */ + contractIdentifier: ContractIdentifier | undefined; + + /** + * @public + *

    The token standard of the contract.

    + */ + tokenStandard: QueryTokenStandard | undefined; + + /** + * @public + *

    The address of the contract deployer.

    + */ + deployerAddress: string | undefined; +} + /** * @public *

    The container for time.

    @@ -51,26 +133,6 @@ export interface OwnerIdentifier { address: string | undefined; } -/** - * @public - * @enum - */ -export const QueryNetwork = { - /** - * Bitcoin main network - */ - BITCOIN_MAINNET: "BITCOIN_MAINNET", - /** - * Ethereum main network - */ - ETHEREUM_MAINNET: "ETHEREUM_MAINNET", -} as const; - -/** - * @public - */ -export type QueryNetwork = (typeof QueryNetwork)[keyof typeof QueryNetwork]; - /** * @public *

    The container for the identifier for the token including the unique token ID and its blockchain network.

    @@ -95,6 +157,11 @@ export interface TokenIdentifier { /** * @public *

    The unique identifier of the token.

    + * + *

    You must specify this container with btc for the native BTC token, and + * eth for the native ETH token. For all other token types you must + * specify the tokenId in the 64 character hexadecimal tokenid format.

    + *
    */ tokenId?: string; } @@ -133,7 +200,7 @@ export interface BatchGetTokenBalanceInputItem { export interface BatchGetTokenBalanceInput { /** * @public - *

    An array of GetTokenBalanceInput objects whose balance is being requested.

    + *

    An array of BatchGetTokenBalanceInputItem objects whose balance is being requested.

    */ getTokenBalanceInputs?: BatchGetTokenBalanceInputItem[]; } @@ -499,6 +566,94 @@ export class ValidationException extends __BaseException { } } +/** + * @public + *

    The contract or wallet address by which to filter the request.

    + */ +export interface ContractFilter { + /** + * @public + *

    The blockchain network of the contract.

    + */ + network: QueryNetwork | undefined; + + /** + * @public + *

    The container for the token standard.

    + */ + tokenStandard: QueryTokenStandard | undefined; + + /** + * @public + *

    The network address of the deployer.

    + */ + deployerAddress: string | undefined; +} + +/** + * @public + *

    The metadata of the contract.

    + */ +export interface ContractMetadata { + /** + * @public + *

    The name of the token contract.

    + */ + name?: string; + + /** + * @public + *

    The symbol of the token contract.

    + */ + symbol?: string; + + /** + * @public + *

    The decimals used by the token contract.

    + */ + decimals?: number; +} + +/** + * @public + */ +export interface GetAssetContractInput { + /** + * @public + *

    Contains the blockchain address and network information about the contract.

    + */ + contractIdentifier: ContractIdentifier | undefined; +} + +/** + * @public + */ +export interface GetAssetContractOutput { + /** + * @public + *

    Contains the blockchain address and network information about the contract.

    + */ + contractIdentifier: ContractIdentifier | undefined; + + /** + * @public + *

    The token standard of the contract requested.

    + */ + tokenStandard: QueryTokenStandard | undefined; + + /** + * @public + *

    The address of the deployer of contract.

    + */ + deployerAddress: string | undefined; + + /** + * @public + *

    The metadata of the contract.

    + */ + metadata?: ContractMetadata; +} + /** * @public */ @@ -622,7 +777,7 @@ export type QueryTransactionStatus = (typeof QueryTransactionStatus)[keyof typeo export interface Transaction { /** * @public - *

    The blockchain network where the transaction occured.

    + *

    The blockchain network where the transaction occurred.

    */ network: QueryNetwork | undefined; @@ -749,6 +904,46 @@ export interface GetTransactionOutput { transaction: Transaction | undefined; } +/** + * @public + */ +export interface ListAssetContractsInput { + /** + * @public + *

    Contains the filter parameter for the request.

    + */ + contractFilter: ContractFilter | undefined; + + /** + * @public + *

    The pagination token that indicates the next set of results to retrieve.

    + */ + nextToken?: string; + + /** + * @public + *

    The maximum number of contracts to list.

    + */ + maxResults?: number; +} + +/** + * @public + */ +export interface ListAssetContractsOutput { + /** + * @public + *

    An array of contract objects that contain the properties for each contract.

    + */ + contracts: AssetContract[] | undefined; + + /** + * @public + *

    The pagination token that indicates the next set of results to retrieve.

    + */ + nextToken?: string; +} + /** * @public *

    The container for the owner information to filter by.

    @@ -806,7 +1001,7 @@ export interface ListTokenBalancesInput { /** * @public *

    The contract address or a token identifier on the - * blockchain network by which to filter the request. You must specify the contractAddress + * blockchain network by which to filter the request. You must specify the contractAddress * property of this container when listing tokens minted by a contract.

    * *

    You must always specify the network property of this @@ -863,7 +1058,7 @@ export interface TokenBalance { /** * @public - *

    The timestamp of the last transaction at which the balance for the token in the wallet was updated.

    + *

    The Timestamp of the last transaction at which the balance for the token in the wallet was updated.

    */ lastUpdatedTime?: BlockchainInstant; } diff --git a/clients/client-managedblockchain-query/src/pagination/ListAssetContractsPaginator.ts b/clients/client-managedblockchain-query/src/pagination/ListAssetContractsPaginator.ts new file mode 100644 index 000000000000..2537a8cb2948 --- /dev/null +++ b/clients/client-managedblockchain-query/src/pagination/ListAssetContractsPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + ListAssetContractsCommand, + ListAssetContractsCommandInput, + ListAssetContractsCommandOutput, +} from "../commands/ListAssetContractsCommand"; +import { ManagedBlockchainQueryClient } from "../ManagedBlockchainQueryClient"; +import { ManagedBlockchainQueryPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: ManagedBlockchainQueryClient, + input: ListAssetContractsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssetContractsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListAssetContracts( + config: ManagedBlockchainQueryPaginationConfiguration, + input: ListAssetContractsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListAssetContractsCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ManagedBlockchainQueryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ManagedBlockchainQuery | ManagedBlockchainQueryClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-managedblockchain-query/src/pagination/index.ts b/clients/client-managedblockchain-query/src/pagination/index.ts index 135cd46cddef..533cc8e114ad 100644 --- a/clients/client-managedblockchain-query/src/pagination/index.ts +++ b/clients/client-managedblockchain-query/src/pagination/index.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code export * from "./Interfaces"; +export * from "./ListAssetContractsPaginator"; export * from "./ListTokenBalancesPaginator"; export * from "./ListTransactionEventsPaginator"; export * from "./ListTransactionsPaginator"; diff --git a/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts b/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts index ba34588c2c9f..b233d1aa6da5 100644 --- a/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts +++ b/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts @@ -26,8 +26,10 @@ import { BatchGetTokenBalanceCommandInput, BatchGetTokenBalanceCommandOutput, } from "../commands/BatchGetTokenBalanceCommand"; +import { GetAssetContractCommandInput, GetAssetContractCommandOutput } from "../commands/GetAssetContractCommand"; import { GetTokenBalanceCommandInput, GetTokenBalanceCommandOutput } from "../commands/GetTokenBalanceCommand"; import { GetTransactionCommandInput, GetTransactionCommandOutput } from "../commands/GetTransactionCommand"; +import { ListAssetContractsCommandInput, ListAssetContractsCommandOutput } from "../commands/ListAssetContractsCommand"; import { ListTokenBalancesCommandInput, ListTokenBalancesCommandOutput } from "../commands/ListTokenBalancesCommand"; import { ListTransactionEventsCommandInput, @@ -41,6 +43,8 @@ import { BatchGetTokenBalanceInputItem, BatchGetTokenBalanceOutputItem, BlockchainInstant, + ContractFilter, + ContractIdentifier, InternalServerException, ListTransactionsSort, OwnerFilter, @@ -86,6 +90,35 @@ export const se_BatchGetTokenBalanceCommand = async ( }); }; +/** + * serializeAws_restJson1GetAssetContractCommand + */ +export const se_GetAssetContractCommand = async ( + input: GetAssetContractCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/get-asset-contract"; + let body: any; + body = JSON.stringify( + take(input, { + contractIdentifier: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1GetTokenBalanceCommand */ @@ -147,6 +180,37 @@ export const se_GetTransactionCommand = async ( }); }; +/** + * serializeAws_restJson1ListAssetContractsCommand + */ +export const se_ListAssetContractsCommand = async ( + input: ListAssetContractsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-asset-contracts"; + let body: any; + body = JSON.stringify( + take(input, { + contractFilter: (_) => _json(_), + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1ListTokenBalancesCommand */ @@ -310,6 +374,71 @@ const de_BatchGetTokenBalanceCommandError = async ( } }; +/** + * deserializeAws_restJson1GetAssetContractCommand + */ +export const de_GetAssetContractCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetAssetContractCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + contractIdentifier: _json, + deployerAddress: __expectString, + metadata: _json, + tokenStandard: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetAssetContractCommandError + */ +const de_GetAssetContractCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.managedblockchainquery#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.managedblockchainquery#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.managedblockchainquery#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.managedblockchainquery#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.managedblockchainquery#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1GetTokenBalanceCommand */ @@ -438,6 +567,66 @@ const de_GetTransactionCommandError = async ( } }; +/** + * deserializeAws_restJson1ListAssetContractsCommand + */ +export const de_ListAssetContractsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListAssetContractsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + contracts: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListAssetContractsCommandError + */ +const de_ListAssetContractsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.managedblockchainquery#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.managedblockchainquery#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.managedblockchainquery#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.managedblockchainquery#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1ListTokenBalancesCommand */ @@ -773,6 +962,10 @@ const se_BlockchainInstant = (input: BlockchainInstant, context: __SerdeContext) }); }; +// se_ContractFilter omitted. + +// se_ContractIdentifier omitted. + /** * serializeAws_restJson1GetTokenBalanceInputList */ @@ -794,6 +987,10 @@ const se_GetTokenBalanceInputList = (input: BatchGetTokenBalanceInputItem[], con // se_TokenIdentifier omitted. +// de_AssetContract omitted. + +// de_AssetContractList omitted. + /** * deserializeAws_restJson1BatchGetTokenBalanceErrorItem */ @@ -854,6 +1051,10 @@ const de_BlockchainInstant = (output: any, context: __SerdeContext): BlockchainI }) as any; }; +// de_ContractIdentifier omitted. + +// de_ContractMetadata omitted. + // de_OwnerIdentifier omitted. /** diff --git a/codegen/sdk-codegen/aws-models/managedblockchain-query.json b/codegen/sdk-codegen/aws-models/managedblockchain-query.json index e2c1a3cfa52c..c47ff8f9787c 100644 --- a/codegen/sdk-codegen/aws-models/managedblockchain-query.json +++ b/codegen/sdk-codegen/aws-models/managedblockchain-query.json @@ -18,6 +18,47 @@ "smithy.api#httpError": 403 } }, + "com.amazonaws.managedblockchainquery#AssetContract": { + "type": "structure", + "members": { + "contractIdentifier": { + "target": "com.amazonaws.managedblockchainquery#ContractIdentifier", + "traits": { + "smithy.api#documentation": "

    The container for the contract identifier containing its blockchain network \n and address.

    ", + "smithy.api#required": {} + } + }, + "tokenStandard": { + "target": "com.amazonaws.managedblockchainquery#QueryTokenStandard", + "traits": { + "smithy.api#documentation": "

    The token standard of the contract.

    ", + "smithy.api#required": {} + } + }, + "deployerAddress": { + "target": "com.amazonaws.managedblockchainquery#ChainAddress", + "traits": { + "smithy.api#documentation": "

    The address of the contract deployer.

    ", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

    This container contains information about an contract.

    " + } + }, + "com.amazonaws.managedblockchainquery#AssetContractList": { + "type": "list", + "member": { + "target": "com.amazonaws.managedblockchainquery#AssetContract" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 250 + } + } + }, "com.amazonaws.managedblockchainquery#BatchGetTokenBalance": { "type": "operation", "input": { @@ -48,7 +89,7 @@ ], "traits": { "aws.iam#actionPermissionDescription": "Grants permission to batch calls for GetTokenBalance API", - "smithy.api#documentation": "

    Gets the token balance for a batch of tokens by using the GetTokenBalance \n action for every token in the request.

    \n \n

    Only the native tokens BTC,ETH, and the ERC-20, \n ERC-721, and ERC 1155 token standards are supported.

    \n
    ", + "smithy.api#documentation": "

    Gets the token balance for a batch of tokens by using the BatchGetTokenBalance \n action for every token in the request.

    \n \n

    Only the native tokens BTC,ETH, and the ERC-20, \n ERC-721, and ERC 1155 token standards are supported.

    \n
    ", "smithy.api#http": { "uri": "/batch-get-token-balance", "method": "POST" @@ -112,7 +153,7 @@ "getTokenBalanceInputs": { "target": "com.amazonaws.managedblockchainquery#GetTokenBalanceInputList", "traits": { - "smithy.api#documentation": "

    An array of GetTokenBalanceInput objects whose balance is being requested.

    " + "smithy.api#documentation": "

    An array of BatchGetTokenBalanceInputItem objects whose balance is being requested.

    " } } }, @@ -233,6 +274,83 @@ "smithy.api#pattern": "^[-A-Za-z0-9]{13,74}$" } }, + "com.amazonaws.managedblockchainquery#ContractFilter": { + "type": "structure", + "members": { + "network": { + "target": "com.amazonaws.managedblockchainquery#QueryNetwork", + "traits": { + "smithy.api#documentation": "

    The blockchain network of the contract.

    ", + "smithy.api#required": {} + } + }, + "tokenStandard": { + "target": "com.amazonaws.managedblockchainquery#QueryTokenStandard", + "traits": { + "smithy.api#documentation": "

    The container for the token standard.

    ", + "smithy.api#required": {} + } + }, + "deployerAddress": { + "target": "com.amazonaws.managedblockchainquery#ChainAddress", + "traits": { + "smithy.api#documentation": "

    The network address of the deployer.

    ", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

    The contract or wallet address by which to filter the request.

    " + } + }, + "com.amazonaws.managedblockchainquery#ContractIdentifier": { + "type": "structure", + "members": { + "network": { + "target": "com.amazonaws.managedblockchainquery#QueryNetwork", + "traits": { + "smithy.api#documentation": "

    The blockchain network of the contract.

    ", + "smithy.api#required": {} + } + }, + "contractAddress": { + "target": "com.amazonaws.managedblockchainquery#ChainAddress", + "traits": { + "smithy.api#documentation": "

    Container for the blockchain address about a contract.

    ", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

    Container for the blockchain address and network information about a contract.

    " + } + }, + "com.amazonaws.managedblockchainquery#ContractMetadata": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

    The name of the token contract.

    " + } + }, + "symbol": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

    The symbol of the token contract.

    " + } + }, + "decimals": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

    The decimals used by the token contract.

    " + } + } + }, + "traits": { + "smithy.api#documentation": "

    The metadata of the contract.

    " + } + }, "com.amazonaws.managedblockchainquery#ErrorType": { "type": "string", "traits": { @@ -258,6 +376,91 @@ } } }, + "com.amazonaws.managedblockchainquery#GetAssetContract": { + "type": "operation", + "input": { + "target": "com.amazonaws.managedblockchainquery#GetAssetContractInput" + }, + "output": { + "target": "com.amazonaws.managedblockchainquery#GetAssetContractOutput" + }, + "errors": [ + { + "target": "com.amazonaws.managedblockchainquery#AccessDeniedException" + }, + { + "target": "com.amazonaws.managedblockchainquery#InternalServerException" + }, + { + "target": "com.amazonaws.managedblockchainquery#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.managedblockchainquery#ThrottlingException" + }, + { + "target": "com.amazonaws.managedblockchainquery#ValidationException" + } + ], + "traits": { + "aws.iam#actionPermissionDescription": "Grants permission to fetch information about a contract on the blockchain", + "smithy.api#documentation": "

    Gets the information about a specific contract deployed on the blockchain.

    \n \n
      \n
    • \n

      The Bitcoin blockchain networks do not support this \n operation.

      \n
    • \n
    • \n

      Metadata is currently only available for some ERC-20 contracts. \n Metadata will be available for additional contracts in the future.

      \n
    • \n
    \n
    ", + "smithy.api#http": { + "uri": "/get-asset-contract", + "method": "POST" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.managedblockchainquery#GetAssetContractInput": { + "type": "structure", + "members": { + "contractIdentifier": { + "target": "com.amazonaws.managedblockchainquery#ContractIdentifier", + "traits": { + "smithy.api#documentation": "

    Contains the blockchain address and network information about the contract.

    ", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.managedblockchainquery#GetAssetContractOutput": { + "type": "structure", + "members": { + "contractIdentifier": { + "target": "com.amazonaws.managedblockchainquery#ContractIdentifier", + "traits": { + "smithy.api#documentation": "

    Contains the blockchain address and network information about the contract.

    ", + "smithy.api#required": {} + } + }, + "tokenStandard": { + "target": "com.amazonaws.managedblockchainquery#QueryTokenStandard", + "traits": { + "smithy.api#documentation": "

    The token standard of the contract requested.

    ", + "smithy.api#required": {} + } + }, + "deployerAddress": { + "target": "com.amazonaws.managedblockchainquery#ChainAddress", + "traits": { + "smithy.api#documentation": "

    The address of the deployer of contract.

    ", + "smithy.api#required": {} + } + }, + "metadata": { + "target": "com.amazonaws.managedblockchainquery#ContractMetadata" + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.managedblockchainquery#GetTokenBalance": { "type": "operation", "input": { @@ -466,6 +669,99 @@ "smithy.api#retryable": {} } }, + "com.amazonaws.managedblockchainquery#ListAssetContracts": { + "type": "operation", + "input": { + "target": "com.amazonaws.managedblockchainquery#ListAssetContractsInput" + }, + "output": { + "target": "com.amazonaws.managedblockchainquery#ListAssetContractsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.managedblockchainquery#AccessDeniedException" + }, + { + "target": "com.amazonaws.managedblockchainquery#InternalServerException" + }, + { + "target": "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.managedblockchainquery#ThrottlingException" + }, + { + "target": "com.amazonaws.managedblockchainquery#ValidationException" + } + ], + "traits": { + "aws.iam#actionPermissionDescription": "Grants permission to fetch multiple contracts on the blockchain", + "smithy.api#documentation": "

    Lists all the contracts for a given contract type deployed by an address \n (either a contract address or a wallet address).

    \n

    The Bitcoin blockchain networks do not support this \n operation.

    ", + "smithy.api#http": { + "uri": "/list-asset-contracts", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "contracts", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.managedblockchainquery#ListAssetContractsInput": { + "type": "structure", + "members": { + "contractFilter": { + "target": "com.amazonaws.managedblockchainquery#ContractFilter", + "traits": { + "smithy.api#documentation": "

    Contains the filter parameter for the request.

    ", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.managedblockchainquery#NextToken", + "traits": { + "smithy.api#documentation": "

    The pagination token that indicates the next set of results to retrieve.

    " + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

    The maximum number of contracts to list.

    ", + "smithy.api#range": { + "min": 1, + "max": 250 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.managedblockchainquery#ListAssetContractsOutput": { + "type": "structure", + "members": { + "contracts": { + "target": "com.amazonaws.managedblockchainquery#AssetContractList", + "traits": { + "smithy.api#documentation": "

    An array of contract objects that contain the properties for each contract.

    ", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.managedblockchainquery#NextToken", + "traits": { + "smithy.api#documentation": "

    The pagination token that indicates the next set of results to retrieve.

    " + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.managedblockchainquery#ListTokenBalances": { "type": "operation", "input": { @@ -493,7 +789,7 @@ ], "traits": { "aws.iam#actionPermissionDescription": "Grants permission to retrieve multiple balances on the blockchain", - "smithy.api#documentation": "

    This action returns the following for a given a blockchain network:

    \n
      \n
    • \n

      Lists all token balances owned by an address (either a contact \n address or a wallet address).

      \n
    • \n
    • \n

      Lists all token balances for all tokens created by a contract.

      \n
    • \n
    • \n

      Lists all token balances for a given token.

      \n
    • \n
    \n \n

    You must always specify the network property of \n the tokenFilter when using this operation.

    \n
    ", + "smithy.api#documentation": "

    This action returns the following for a given blockchain network:

    \n
      \n
    • \n

      Lists all token balances owned by an address (either a contract \n address or a wallet address).

      \n
    • \n
    • \n

      Lists all token balances for all tokens created by a contract.

      \n
    • \n
    • \n

      Lists all token balances for a given token.

      \n
    • \n
    \n \n

    You must always specify the network property of \n the tokenFilter when using this operation.

    \n
    ", "smithy.api#http": { "uri": "/list-token-balances", "method": "POST" @@ -519,7 +815,7 @@ "tokenFilter": { "target": "com.amazonaws.managedblockchainquery#TokenFilter", "traits": { - "smithy.api#documentation": "

    The contract address or a token identifier on the \n blockchain network by which to filter the request. You must specify the contractAddress \n property of this container when listing tokens minted by a contract.

    \n \n

    You must always specify the network property of this \n container when using this operation.

    \n
    ", + "smithy.api#documentation": "

    The contract address or a token identifier on the \n blockchain network by which to filter the request. You must specify the contractAddress \n property of this container when listing tokens minted by a contract.

    \n \n

    You must always specify the network property of this \n container when using this operation.

    \n
    ", "smithy.api#required": {} } }, @@ -861,6 +1157,11 @@ "value": "BITCOIN_MAINNET", "name": "BITCOIN_MAINNET", "documentation": "Bitcoin main network" + }, + { + "value": "BITCOIN_TESTNET", + "name": "BITCOIN_TESTNET", + "documentation": "Bitcoin test network" } ] } @@ -871,6 +1172,25 @@ "smithy.api#pattern": "^[a-zA-Z0-9]{1,66}$" } }, + "com.amazonaws.managedblockchainquery#QueryTokenStandard": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ERC20", + "name": "ERC20" + }, + { + "value": "ERC721", + "name": "ERC721" + }, + { + "value": "ERC1155", + "name": "ERC1155" + } + ] + } + }, "com.amazonaws.managedblockchainquery#QueryTransactionEventType": { "type": "string", "traits": { @@ -1117,12 +1437,18 @@ { "target": "com.amazonaws.managedblockchainquery#BatchGetTokenBalance" }, + { + "target": "com.amazonaws.managedblockchainquery#GetAssetContract" + }, { "target": "com.amazonaws.managedblockchainquery#GetTokenBalance" }, { "target": "com.amazonaws.managedblockchainquery#GetTransaction" }, + { + "target": "com.amazonaws.managedblockchainquery#ListAssetContracts" + }, { "target": "com.amazonaws.managedblockchainquery#ListTokenBalances" }, @@ -1866,7 +2192,7 @@ "lastUpdatedTime": { "target": "com.amazonaws.managedblockchainquery#BlockchainInstant", "traits": { - "smithy.api#documentation": "

    The timestamp of the last transaction at which the balance for the token in the wallet was updated.

    " + "smithy.api#documentation": "

    The Timestamp of the last transaction at which the balance for the token in the wallet was updated.

    " } } }, @@ -1932,7 +2258,7 @@ "tokenId": { "target": "com.amazonaws.managedblockchainquery#QueryTokenId", "traits": { - "smithy.api#documentation": "

    The unique identifier of the token.

    " + "smithy.api#documentation": "

    The unique identifier of the token.

    \n \n

    You must specify this container with btc for the native BTC token, and \n eth for the native ETH token. For all other token types you must \n specify the tokenId in the 64 character hexadecimal tokenid format.

    \n
    " } } }, @@ -1946,7 +2272,7 @@ "network": { "target": "com.amazonaws.managedblockchainquery#QueryNetwork", "traits": { - "smithy.api#documentation": "

    The blockchain network where the transaction occured.

    ", + "smithy.api#documentation": "

    The blockchain network where the transaction occurred.

    ", "smithy.api#required": {} } }, @@ -2275,4 +2601,4 @@ } } } -} \ No newline at end of file +}