From 487e1dd28054aeff22ebdd5c715d890c5ca827d8 Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 19 Mar 2024 18:14:00 +0000 Subject: [PATCH] feat(client-managedblockchain-query): Introduces a new API for Amazon Managed Blockchain Query: ListFilteredTransactionEvents. --- .../client-managedblockchain-query/README.md | 8 + .../src/ManagedBlockchainQuery.ts | 23 + .../src/ManagedBlockchainQueryClient.ts | 6 + .../ListFilteredTransactionEventsCommand.ts | 160 ++++++ .../commands/ListTransactionEventsCommand.ts | 14 +- .../src/commands/ListTransactionsCommand.ts | 2 +- .../src/commands/index.ts | 1 + .../src/models/models_0.ts | 485 +++++++++++++----- .../ListFilteredTransactionEventsPaginator.ts | 24 + .../src/pagination/index.ts | 1 + .../src/protocols/Aws_restJson1.ts | 118 ++++- .../aws-models/managedblockchain-query.json | 294 ++++++++++- 12 files changed, 978 insertions(+), 158 deletions(-) create mode 100644 clients/client-managedblockchain-query/src/commands/ListFilteredTransactionEventsCommand.ts create mode 100644 clients/client-managedblockchain-query/src/pagination/ListFilteredTransactionEventsPaginator.ts diff --git a/clients/client-managedblockchain-query/README.md b/clients/client-managedblockchain-query/README.md index 599abdc87773..76baa4432a1d 100644 --- a/clients/client-managedblockchain-query/README.md +++ b/clients/client-managedblockchain-query/README.md @@ -248,6 +248,14 @@ ListAssetContracts [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/managedblockchain-query/command/ListAssetContractsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-managedblockchain-query/Interface/ListAssetContractsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-managedblockchain-query/Interface/ListAssetContractsCommandOutput/) + +
+ +ListFilteredTransactionEvents + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/managedblockchain-query/command/ListFilteredTransactionEventsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-managedblockchain-query/Interface/ListFilteredTransactionEventsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-managedblockchain-query/Interface/ListFilteredTransactionEventsCommandOutput/) +
diff --git a/clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts b/clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts index e44e528a583c..002d7ef1b645 100644 --- a/clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts +++ b/clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts @@ -27,6 +27,11 @@ import { ListAssetContractsCommandInput, ListAssetContractsCommandOutput, } from "./commands/ListAssetContractsCommand"; +import { + ListFilteredTransactionEventsCommand, + ListFilteredTransactionEventsCommandInput, + ListFilteredTransactionEventsCommandOutput, +} from "./commands/ListFilteredTransactionEventsCommand"; import { ListTokenBalancesCommand, ListTokenBalancesCommandInput, @@ -50,6 +55,7 @@ const commands = { GetTokenBalanceCommand, GetTransactionCommand, ListAssetContractsCommand, + ListFilteredTransactionEventsCommand, ListTokenBalancesCommand, ListTransactionEventsCommand, ListTransactionsCommand, @@ -136,6 +142,23 @@ export interface ManagedBlockchainQuery { cb: (err: any, data?: ListAssetContractsCommandOutput) => void ): void; + /** + * @see {@link ListFilteredTransactionEventsCommand} + */ + listFilteredTransactionEvents( + args: ListFilteredTransactionEventsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listFilteredTransactionEvents( + args: ListFilteredTransactionEventsCommandInput, + cb: (err: any, data?: ListFilteredTransactionEventsCommandOutput) => void + ): void; + listFilteredTransactionEvents( + args: ListFilteredTransactionEventsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListFilteredTransactionEventsCommandOutput) => void + ): void; + /** * @see {@link ListTokenBalancesCommand} */ diff --git a/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts b/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts index 718c56aed124..528b07c861ea 100644 --- a/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts +++ b/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts @@ -61,6 +61,10 @@ import { GetAssetContractCommandInput, GetAssetContractCommandOutput } from "./c import { GetTokenBalanceCommandInput, GetTokenBalanceCommandOutput } from "./commands/GetTokenBalanceCommand"; import { GetTransactionCommandInput, GetTransactionCommandOutput } from "./commands/GetTransactionCommand"; import { ListAssetContractsCommandInput, ListAssetContractsCommandOutput } from "./commands/ListAssetContractsCommand"; +import { + ListFilteredTransactionEventsCommandInput, + ListFilteredTransactionEventsCommandOutput, +} from "./commands/ListFilteredTransactionEventsCommand"; import { ListTokenBalancesCommandInput, ListTokenBalancesCommandOutput } from "./commands/ListTokenBalancesCommand"; import { ListTransactionEventsCommandInput, @@ -87,6 +91,7 @@ export type ServiceInputTypes = | GetTokenBalanceCommandInput | GetTransactionCommandInput | ListAssetContractsCommandInput + | ListFilteredTransactionEventsCommandInput | ListTokenBalancesCommandInput | ListTransactionEventsCommandInput | ListTransactionsCommandInput; @@ -100,6 +105,7 @@ export type ServiceOutputTypes = | GetTokenBalanceCommandOutput | GetTransactionCommandOutput | ListAssetContractsCommandOutput + | ListFilteredTransactionEventsCommandOutput | ListTokenBalancesCommandOutput | ListTransactionEventsCommandOutput | ListTransactionsCommandOutput; diff --git a/clients/client-managedblockchain-query/src/commands/ListFilteredTransactionEventsCommand.ts b/clients/client-managedblockchain-query/src/commands/ListFilteredTransactionEventsCommand.ts new file mode 100644 index 000000000000..e636234c0274 --- /dev/null +++ b/clients/client-managedblockchain-query/src/commands/ListFilteredTransactionEventsCommand.ts @@ -0,0 +1,160 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + ManagedBlockchainQueryClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../ManagedBlockchainQueryClient"; +import { ListFilteredTransactionEventsInput, ListFilteredTransactionEventsOutput } from "../models/models_0"; +import { + de_ListFilteredTransactionEventsCommand, + se_ListFilteredTransactionEventsCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListFilteredTransactionEventsCommand}. + */ +export interface ListFilteredTransactionEventsCommandInput extends ListFilteredTransactionEventsInput {} +/** + * @public + * + * The output of {@link ListFilteredTransactionEventsCommand}. + */ +export interface ListFilteredTransactionEventsCommandOutput + extends ListFilteredTransactionEventsOutput, + __MetadataBearer {} + +/** + *

Lists all the transaction events for an address on the blockchain.

+ * + *

This operation is only supported on the Bitcoin networks.

+ *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ManagedBlockchainQueryClient, ListFilteredTransactionEventsCommand } from "@aws-sdk/client-managedblockchain-query"; // ES Modules import + * // const { ManagedBlockchainQueryClient, ListFilteredTransactionEventsCommand } = require("@aws-sdk/client-managedblockchain-query"); // CommonJS import + * const client = new ManagedBlockchainQueryClient(config); + * const input = { // ListFilteredTransactionEventsInput + * network: "STRING_VALUE", // required + * addressIdentifierFilter: { // AddressIdentifierFilter + * transactionEventToAddress: [ // ChainAddresses // required + * "STRING_VALUE", + * ], + * }, + * timeFilter: { // TimeFilter + * from: { // BlockchainInstant + * time: new Date("TIMESTAMP"), + * }, + * to: { + * time: new Date("TIMESTAMP"), + * }, + * }, + * voutFilter: { // VoutFilter + * voutSpent: true || false, // required + * }, + * confirmationStatusFilter: { // ConfirmationStatusFilter + * include: [ // ConfirmationStatusIncludeList // required + * "STRING_VALUE", + * ], + * }, + * sort: { // ListFilteredTransactionEventsSort + * sortBy: "STRING_VALUE", + * sortOrder: "STRING_VALUE", + * }, + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * }; + * const command = new ListFilteredTransactionEventsCommand(input); + * const response = await client.send(command); + * // { // ListFilteredTransactionEventsOutput + * // events: [ // TransactionEventList // required + * // { // TransactionEvent + * // network: "STRING_VALUE", // required + * // transactionHash: "STRING_VALUE", // required + * // eventType: "STRING_VALUE", // required + * // from: "STRING_VALUE", + * // to: "STRING_VALUE", + * // value: "STRING_VALUE", + * // contractAddress: "STRING_VALUE", + * // tokenId: "STRING_VALUE", + * // transactionId: "STRING_VALUE", + * // voutIndex: Number("int"), + * // voutSpent: true || false, + * // spentVoutTransactionId: "STRING_VALUE", + * // spentVoutTransactionHash: "STRING_VALUE", + * // spentVoutIndex: Number("int"), + * // blockchainInstant: { // BlockchainInstant + * // time: new Date("TIMESTAMP"), + * // }, + * // confirmationStatus: "STRING_VALUE", + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListFilteredTransactionEventsCommandInput - {@link ListFilteredTransactionEventsCommandInput} + * @returns {@link ListFilteredTransactionEventsCommandOutput} + * @see {@link ListFilteredTransactionEventsCommandInput} for command's `input` shape. + * @see {@link ListFilteredTransactionEventsCommandOutput} 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.

+ * + * @public + */ +export class ListFilteredTransactionEventsCommand extends $Command + .classBuilder< + ListFilteredTransactionEventsCommandInput, + ListFilteredTransactionEventsCommandOutput, + ManagedBlockchainQueryClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ManagedBlockchainQueryClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("TietonChainQueryService", "ListFilteredTransactionEvents", {}) + .n("ManagedBlockchainQueryClient", "ListFilteredTransactionEventsCommand") + .f(void 0, void 0) + .ser(se_ListFilteredTransactionEventsCommand) + .de(de_ListFilteredTransactionEventsCommand) + .build() {} diff --git a/clients/client-managedblockchain-query/src/commands/ListTransactionEventsCommand.ts b/clients/client-managedblockchain-query/src/commands/ListTransactionEventsCommand.ts index e008a840013a..29002a245676 100644 --- a/clients/client-managedblockchain-query/src/commands/ListTransactionEventsCommand.ts +++ b/clients/client-managedblockchain-query/src/commands/ListTransactionEventsCommand.ts @@ -31,8 +31,7 @@ export interface ListTransactionEventsCommandInput extends ListTransactionEvents export interface ListTransactionEventsCommandOutput extends ListTransactionEventsOutput, __MetadataBearer {} /** - *

An array of TransactionEvent objects. Each object contains details - * about the transaction event.

+ *

Lists all the transaction events for a transaction

* *

This action will return transaction details for all transactions * that are confirmed on the blockchain, even if they have not reached @@ -46,7 +45,8 @@ export interface ListTransactionEventsCommandOutput extends ListTransactionEvent * // const { ManagedBlockchainQueryClient, ListTransactionEventsCommand } = require("@aws-sdk/client-managedblockchain-query"); // CommonJS import * const client = new ManagedBlockchainQueryClient(config); * const input = { // ListTransactionEventsInput - * transactionHash: "STRING_VALUE", // required + * transactionHash: "STRING_VALUE", + * transactionId: "STRING_VALUE", * network: "STRING_VALUE", // required * nextToken: "STRING_VALUE", * maxResults: Number("int"), @@ -66,6 +66,14 @@ export interface ListTransactionEventsCommandOutput extends ListTransactionEvent * // tokenId: "STRING_VALUE", * // transactionId: "STRING_VALUE", * // voutIndex: Number("int"), + * // voutSpent: true || false, + * // spentVoutTransactionId: "STRING_VALUE", + * // spentVoutTransactionHash: "STRING_VALUE", + * // spentVoutIndex: Number("int"), + * // blockchainInstant: { // BlockchainInstant + * // time: new Date("TIMESTAMP"), + * // }, + * // confirmationStatus: "STRING_VALUE", * // }, * // ], * // nextToken: "STRING_VALUE", diff --git a/clients/client-managedblockchain-query/src/commands/ListTransactionsCommand.ts b/clients/client-managedblockchain-query/src/commands/ListTransactionsCommand.ts index 0c1b91aa79d7..6f4fc6c90004 100644 --- a/clients/client-managedblockchain-query/src/commands/ListTransactionsCommand.ts +++ b/clients/client-managedblockchain-query/src/commands/ListTransactionsCommand.ts @@ -31,7 +31,7 @@ export interface ListTransactionsCommandInput extends ListTransactionsInput {} export interface ListTransactionsCommandOutput extends ListTransactionsOutput, __MetadataBearer {} /** - *

Lists all of the transactions on a given wallet address or to a specific contract.

+ *

Lists all the transaction events for a transaction.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-managedblockchain-query/src/commands/index.ts b/clients/client-managedblockchain-query/src/commands/index.ts index f3b525369243..bec5e29f7093 100644 --- a/clients/client-managedblockchain-query/src/commands/index.ts +++ b/clients/client-managedblockchain-query/src/commands/index.ts @@ -4,6 +4,7 @@ export * from "./GetAssetContractCommand"; export * from "./GetTokenBalanceCommand"; export * from "./GetTransactionCommand"; export * from "./ListAssetContractsCommand"; +export * from "./ListFilteredTransactionEventsCommand"; 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 ac09916a6eb0..20de775906db 100644 --- a/clients/client-managedblockchain-query/src/models/models_0.ts +++ b/clients/client-managedblockchain-query/src/models/models_0.ts @@ -23,6 +23,18 @@ export class AccessDeniedException extends __BaseException { } } +/** + *

This is the container for the unique public address on the blockchain.

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

The container for the recipient address of the transaction.

+ * @public + */ + transactionEventToAddress: string[] | undefined; +} + /** * @public * @enum @@ -126,7 +138,7 @@ export interface BlockchainInstant { } /** - *

The container for the identifier of the owner.

+ *

The container for the owner identifier.

* @public */ export interface OwnerIdentifier { @@ -186,7 +198,7 @@ export interface BatchGetTokenBalanceInputItem { tokenIdentifier: TokenIdentifier | undefined; /** - *

The container for the identifier of the owner.

+ *

The container for the owner identifier.

* @public */ ownerIdentifier: OwnerIdentifier | undefined; @@ -245,7 +257,7 @@ export interface BatchGetTokenBalanceErrorItem { tokenIdentifier?: TokenIdentifier; /** - *

The container for the identifier of the owner.

+ *

The container for the owner identifier.

* @public */ ownerIdentifier?: OwnerIdentifier; @@ -281,7 +293,7 @@ export interface BatchGetTokenBalanceErrorItem { */ export interface BatchGetTokenBalanceOutputItem { /** - *

The container for the identifier of the owner.

+ *

The container for the owner identifier.

* @public */ ownerIdentifier?: OwnerIdentifier; @@ -341,7 +353,7 @@ export class InternalServerException extends __BaseException { readonly $fault: "server" = "server"; $retryable = {}; /** - *

The container of the retryAfterSeconds value.

+ *

Specifies the retryAfterSeconds value.

* @public */ retryAfterSeconds?: number; @@ -736,7 +748,7 @@ export interface GetTokenBalanceInput { */ export interface GetTokenBalanceOutput { /** - *

The container for the identifier of the owner.

+ *

The container for the owner identifier.

* @public */ ownerIdentifier?: OwnerIdentifier; @@ -775,7 +787,7 @@ export interface GetTokenBalanceOutput { */ export interface GetTransactionInput { /** - *

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

+ *

The hash of a transaction. It is generated when a transaction is created.

* @public */ transactionHash: string | undefined; @@ -819,7 +831,7 @@ export interface Transaction { blockHash?: string; /** - *

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

+ *

The hash of a transaction. It is generated when a transaction is created.

* @public */ transactionHash: string | undefined; @@ -910,7 +922,7 @@ export interface Transaction { transactionFee?: string; /** - *

The unique identifier of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

+ *

The identifier of a Bitcoin transaction. It is generated when a transaction is created.

* @public */ transactionId?: string; @@ -957,7 +969,7 @@ export interface ListAssetContractsInput { /** *

The maximum number of contracts to list.

- *

Default:100 + *

Default: 100 *

* *

Even if additional results can be retrieved, the request can return less @@ -989,166 +1001,139 @@ export interface ListAssetContractsOutput { } /** - *

The container for the owner information to filter by.

* @public + * @enum */ -export interface OwnerFilter { +export const ListFilteredTransactionEventsSortBy = { /** - *

The contract or wallet address.

- * @public + * Timestamp of a transaction */ - address: string | undefined; -} + blockchainInstant: "blockchainInstant", +} as const; /** - *

The container of the token filter like the contract address - * on a given blockchain network or a unique token identifier on a given - * blockchain network.

- * - *

You must always specify the network property of this - * container when using this operation.

- *
* @public */ -export interface TokenFilter { - /** - *

The blockchain network of the token.

- * @public - */ - network: QueryNetwork | undefined; +export type ListFilteredTransactionEventsSortBy = + (typeof ListFilteredTransactionEventsSortBy)[keyof typeof ListFilteredTransactionEventsSortBy]; +/** + * @public + * @enum + */ +export const SortOrder = { /** - *

This is the address of the contract.

- * @public + * Result sorted in ascending order */ - contractAddress?: string; - + ASCENDING: "ASCENDING", /** - *

The unique identifier of the token.

- * @public + * Result sorted in descending order */ - tokenId?: string; -} + DESCENDING: "DESCENDING", +} as const; /** * @public */ -export interface ListTokenBalancesInput { - /** - *

The contract or wallet address on the blockchain network by which to filter the - * request. You must specify the address property of the ownerFilter - * when listing balances of tokens owned by the address.

- * @public - */ - ownerFilter?: OwnerFilter; - - /** - *

The contract address or a token identifier on the - * 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 - * container when using this operation.

- *
- * @public - */ - tokenFilter: TokenFilter | undefined; +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]; +/** + *

Lists all the transaction events for an address on the blockchain.

+ * + *

This operation is only supported on the Bitcoin blockchain networks.

+ *
+ * @public + */ +export interface ListFilteredTransactionEventsSort { /** - *

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

+ *

Container on how the results will be sorted by?

* @public */ - nextToken?: string; + sortBy?: ListFilteredTransactionEventsSortBy; /** - *

The maximum number of token balances to return.

- *

Default:100 - *

- * - *

Even if additional results can be retrieved, the request can return less - * results than maxResults or an empty array of results.

- *

To retrieve the next set of results, make another request with the - * returned nextToken value. The value of nextToken is - * null when there are no more results to return

- *
+ *

The container for the sort order for ListFilteredTransactionEvents. + * The SortOrder field only accepts the values ASCENDING + * and DESCENDING. Not providing SortOrder will default + * to ASCENDING.

* @public */ - maxResults?: number; + sortOrder?: SortOrder; } /** - *

The balance of the token.

+ *

This container is used to specify a time frame.

* @public */ -export interface TokenBalance { +export interface TimeFilter { /** - *

The container for the identifier of the owner.

+ *

The container for time.

* @public */ - ownerIdentifier?: OwnerIdentifier; + from?: BlockchainInstant; /** - *

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

+ *

The container for time.

* @public */ - tokenIdentifier?: TokenIdentifier; + to?: BlockchainInstant; +} +/** + *

This container specifies filtering attributes related to BITCOIN_VOUT event types

+ * @public + */ +export interface VoutFilter { /** - *

The container of the token balance.

+ *

Specifies if the transaction output is spent or unspent.

* @public */ - balance: string | undefined; + voutSpent: boolean | undefined; +} +/** + * @public + */ +export interface ListFilteredTransactionEventsInput { /** - *

The time for when the TokenBalance is requested or - * the current time if a time is not provided in the request.

- * - *

This time will only be recorded up to the second.

- *
+ *

The blockchain network where the transaction occurred.

+ *

Valid Values: BITCOIN_MAINNET | BITCOIN_TESTNET + *

* @public */ - atBlockchainInstant: BlockchainInstant | undefined; + network: string | undefined; /** - *

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

+ *

This is the unique public address on the blockchain for which the transaction events are being requested.

* @public */ - lastUpdatedTime?: BlockchainInstant; -} + addressIdentifierFilter: AddressIdentifierFilter | undefined; -/** - * @public - */ -export interface ListTokenBalancesOutput { /** - *

An array of TokenBalance objects. Each object contains details about - * the token balance.

+ *

This container specifies the time frame for the transaction events returned in the response.

* @public */ - tokenBalances: TokenBalance[] | undefined; + timeFilter?: TimeFilter; /** - *

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

+ *

This container specifies filtering attributes related to BITCOIN_VOUT event types

* @public */ - nextToken?: string; -} + voutFilter?: VoutFilter; -/** - * @public - */ -export interface ListTransactionEventsInput { /** - *

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

+ *

The container for the ConfirmationStatusFilter that filters for the + * finality + * of the results.

* @public */ - transactionHash: string | undefined; + confirmationStatusFilter?: ConfirmationStatusFilter; /** - *

The blockchain network where the transaction events occurred.

+ *

The order by which the results will be sorted.

* @public */ - network: QueryNetwork | undefined; + sort?: ListFilteredTransactionEventsSort; /** *

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

@@ -1158,7 +1143,7 @@ export interface ListTransactionEventsInput { /** *

The maximum number of transaction events to list.

- *

Default:100 + *

Default: 100 *

* *

Even if additional results can be retrieved, the request can return less @@ -1240,7 +1225,7 @@ export interface TransactionEvent { network: QueryNetwork | undefined; /** - *

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

+ *

The hash of a transaction. It is generated when a transaction is created.

* @public */ transactionHash: string | undefined; @@ -1270,7 +1255,7 @@ export interface TransactionEvent { value?: string; /** - *

The blockchain address. for the contract

+ *

The blockchain address for the contract

* @public */ contractAddress?: string; @@ -1282,25 +1267,72 @@ export interface TransactionEvent { tokenId?: string; /** - *

The unique identifier of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

+ *

The identifier of a Bitcoin transaction. It is generated when a transaction is created.

* @public */ transactionId?: string; /** - *

The position of the vout in the transaction output list.

+ *

The position of the transaction output in the transaction output list.

* @public */ voutIndex?: number; + + /** + *

Specifies if the transaction output is spent or unspent. This is only returned for BITCOIN_VOUT event types.

+ * + *

This is only returned for BITCOIN_VOUT event types.

+ *
+ * @public + */ + voutSpent?: boolean; + + /** + *

The transactionId that created the spent transaction output.

+ * + *

This is only returned for BITCOIN_VIN event types.

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

The transactionHash that created the spent transaction output.

+ * + *

This is only returned for BITCOIN_VIN event types.

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

The position of the spent transaction output in the output list of the creating transaction.

+ * + *

This is only returned for BITCOIN_VIN event types.

+ *
+ * @public + */ + spentVoutIndex?: number; + + /** + *

The container for time.

+ * @public + */ + blockchainInstant?: BlockchainInstant; + + /** + *

This container specifies whether the transaction has reached Finality.

+ * @public + */ + confirmationStatus?: ConfirmationStatus; } /** * @public */ -export interface ListTransactionEventsOutput { +export interface ListFilteredTransactionEventsOutput { /** - *

An array of TransactionEvent objects. Each object contains details - * about the transaction events.

+ *

The transaction events returned by the request.

* @public */ events: TransactionEvent[] | undefined; @@ -1313,40 +1345,232 @@ export interface ListTransactionEventsOutput { } /** + *

The container for the owner information to filter by.

* @public - * @enum */ -export const ListTransactionsSortBy = { +export interface OwnerFilter { /** - * Timestamp of a transaction + *

The contract or wallet address.

+ * @public */ - TRANSACTION_TIMESTAMP: "TRANSACTION_TIMESTAMP", -} as const; + address: string | undefined; +} + +/** + *

The container of the token filter like the contract address + * on a given blockchain network or a unique token identifier on a given + * blockchain network.

+ * + *

You must always specify the network property of this + * container when using this operation.

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

The blockchain network of the token.

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

This is the address of the contract.

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

The unique identifier of the token.

+ * @public + */ + tokenId?: string; +} /** * @public */ -export type ListTransactionsSortBy = (typeof ListTransactionsSortBy)[keyof typeof ListTransactionsSortBy]; +export interface ListTokenBalancesInput { + /** + *

The contract or wallet address on the blockchain network by which to filter the + * request. You must specify the address property of the ownerFilter + * when listing balances of tokens owned by the address.

+ * @public + */ + ownerFilter?: OwnerFilter; + + /** + *

The contract address or a token identifier on the + * 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 + * container when using this operation.

+ *
+ * @public + */ + tokenFilter: TokenFilter | undefined; + + /** + *

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

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

The maximum number of token balances to return.

+ *

Default: 100 + *

+ * + *

Even if additional results can be retrieved, the request can return less + * results than maxResults or an empty array of results.

+ *

To retrieve the next set of results, make another request with the + * returned nextToken value. The value of nextToken is + * null when there are no more results to return

+ *
+ * @public + */ + maxResults?: number; +} /** + *

The balance of the token.

* @public - * @enum */ -export const SortOrder = { +export interface TokenBalance { /** - * Result sorted in ascending order + *

The container for the identifier of the owner.

+ * @public */ - ASCENDING: "ASCENDING", + ownerIdentifier?: OwnerIdentifier; + /** - * Result sorted in descending order + *

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

+ * @public */ - DESCENDING: "DESCENDING", + tokenIdentifier?: TokenIdentifier; + + /** + *

The container of the token balance.

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

The time for when the TokenBalance is requested or + * the current time if a time is not provided in the request.

+ * + *

This time will only be recorded up to the second.

+ *
+ * @public + */ + atBlockchainInstant: BlockchainInstant | undefined; + + /** + *

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

+ * @public + */ + lastUpdatedTime?: BlockchainInstant; +} + +/** + * @public + */ +export interface ListTokenBalancesOutput { + /** + *

An array of TokenBalance objects. Each object contains details about + * the token balance.

+ * @public + */ + tokenBalances: TokenBalance[] | undefined; + + /** + *

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

+ * @public + */ + nextToken?: string; +} + +/** + * @public + */ +export interface ListTransactionEventsInput { + /** + *

The hash of a transaction. It is generated when a transaction is created.

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

The identifier of a Bitcoin transaction. It is generated when a transaction is created.

+ * + *

+ * transactionId is only supported on the Bitcoin networks.

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

The blockchain network where the transaction events occurred.

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

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

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

The maximum number of transaction events to list.

+ *

Default: 100 + *

+ * + *

Even if additional results can be retrieved, the request can return less + * results than maxResults or an empty array of results.

+ *

To retrieve the next set of results, make another request with the + * returned nextToken value. The value of nextToken is + * null when there are no more results to return

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

An array of TransactionEvent objects. Each object contains details + * about the transaction events.

+ * @public + */ + events: TransactionEvent[] | undefined; + + /** + *

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

+ * @public + */ + nextToken?: string; +} + +/** + * @public + * @enum + */ +export const ListTransactionsSortBy = { + /** + * Timestamp of a transaction + */ + TRANSACTION_TIMESTAMP: "TRANSACTION_TIMESTAMP", } as const; /** * @public */ -export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]; +export type ListTransactionsSortBy = (typeof ListTransactionsSortBy)[keyof typeof ListTransactionsSortBy]; /** *

The container for determining how the list transaction result will @@ -1399,8 +1623,7 @@ export interface ListTransactionsInput { toBlockchainInstant?: BlockchainInstant; /** - *

The order by which the results will be sorted. If ASCENNDING is selected, the results - * will be ordered by fromTime.

+ *

The order by which the results will be sorted.

* @public */ sort?: ListTransactionsSort; @@ -1413,7 +1636,7 @@ export interface ListTransactionsInput { /** *

The maximum number of transactions to list.

- *

Default:100 + *

Default: 100 *

* *

Even if additional results can be retrieved, the request can return less @@ -1429,7 +1652,7 @@ export interface ListTransactionsInput { /** *

This filter is used to include transactions in the response that haven't reached * finality - * . Transactions that have reached finiality are always + * . Transactions that have reached finality are always * part of the response.

* @public */ @@ -1442,7 +1665,7 @@ export interface ListTransactionsInput { */ export interface TransactionOutputItem { /** - *

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

+ *

The hash of a transaction. It is generated when a transaction is created.

* @public */ transactionHash: string | undefined; diff --git a/clients/client-managedblockchain-query/src/pagination/ListFilteredTransactionEventsPaginator.ts b/clients/client-managedblockchain-query/src/pagination/ListFilteredTransactionEventsPaginator.ts new file mode 100644 index 000000000000..4bf6646f83a8 --- /dev/null +++ b/clients/client-managedblockchain-query/src/pagination/ListFilteredTransactionEventsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + ListFilteredTransactionEventsCommand, + ListFilteredTransactionEventsCommandInput, + ListFilteredTransactionEventsCommandOutput, +} from "../commands/ListFilteredTransactionEventsCommand"; +import { ManagedBlockchainQueryClient } from "../ManagedBlockchainQueryClient"; +import { ManagedBlockchainQueryPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListFilteredTransactionEvents: ( + config: ManagedBlockchainQueryPaginationConfiguration, + input: ListFilteredTransactionEventsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ManagedBlockchainQueryPaginationConfiguration, + ListFilteredTransactionEventsCommandInput, + ListFilteredTransactionEventsCommandOutput +>(ManagedBlockchainQueryClient, ListFilteredTransactionEventsCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-managedblockchain-query/src/pagination/index.ts b/clients/client-managedblockchain-query/src/pagination/index.ts index 533cc8e114ad..a42d9eee0a27 100644 --- a/clients/client-managedblockchain-query/src/pagination/index.ts +++ b/clients/client-managedblockchain-query/src/pagination/index.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code export * from "./Interfaces"; export * from "./ListAssetContractsPaginator"; +export * from "./ListFilteredTransactionEventsPaginator"; 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 164b380d5d0b..109dbffab929 100644 --- a/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts +++ b/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts @@ -6,6 +6,7 @@ import { _json, collectBody, decorateServiceException as __decorateServiceException, + expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -32,6 +33,10 @@ import { GetAssetContractCommandInput, GetAssetContractCommandOutput } from "../ import { GetTokenBalanceCommandInput, GetTokenBalanceCommandOutput } from "../commands/GetTokenBalanceCommand"; import { GetTransactionCommandInput, GetTransactionCommandOutput } from "../commands/GetTransactionCommand"; import { ListAssetContractsCommandInput, ListAssetContractsCommandOutput } from "../commands/ListAssetContractsCommand"; +import { + ListFilteredTransactionEventsCommandInput, + ListFilteredTransactionEventsCommandOutput, +} from "../commands/ListFilteredTransactionEventsCommand"; import { ListTokenBalancesCommandInput, ListTokenBalancesCommandOutput } from "../commands/ListTokenBalancesCommand"; import { ListTransactionEventsCommandInput, @@ -41,6 +46,7 @@ import { ListTransactionsCommandInput, ListTransactionsCommandOutput } from "../ import { ManagedBlockchainQueryServiceException as __BaseException } from "../models/ManagedBlockchainQueryServiceException"; import { AccessDeniedException, + AddressIdentifierFilter, BatchGetTokenBalanceErrorItem, BatchGetTokenBalanceInputItem, BatchGetTokenBalanceOutputItem, @@ -50,18 +56,22 @@ import { ContractFilter, ContractIdentifier, InternalServerException, + ListFilteredTransactionEventsSort, ListTransactionsSort, OwnerFilter, OwnerIdentifier, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, + TimeFilter, TokenBalance, TokenFilter, TokenIdentifier, Transaction, + TransactionEvent, TransactionOutputItem, ValidationException, + VoutFilter, } from "../models/models_0"; /** @@ -179,6 +189,35 @@ export const se_ListAssetContractsCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1ListFilteredTransactionEventsCommand + */ +export const se_ListFilteredTransactionEventsCommand = async ( + input: ListFilteredTransactionEventsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/list-filtered-transaction-events"); + let body: any; + body = JSON.stringify( + take(input, { + addressIdentifierFilter: (_) => _json(_), + confirmationStatusFilter: (_) => _json(_), + maxResults: [], + network: [], + nextToken: [], + sort: (_) => _json(_), + timeFilter: (_) => se_TimeFilter(_, context), + voutFilter: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1ListTokenBalancesCommand */ @@ -223,6 +262,7 @@ export const se_ListTransactionEventsCommand = async ( network: [], nextToken: [], transactionHash: [], + transactionId: [], }) ); b.m("POST").h(headers).b(body); @@ -372,6 +412,28 @@ export const de_ListAssetContractsCommand = async ( return contents; }; +/** + * deserializeAws_restJson1ListFilteredTransactionEventsCommand + */ +export const de_ListFilteredTransactionEventsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + events: (_) => de_TransactionEventList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1ListTokenBalancesCommand */ @@ -409,7 +471,7 @@ export const de_ListTransactionEventsCommand = async ( }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - events: _json, + events: (_) => de_TransactionEventList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -605,6 +667,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont return __decorateServiceException(exception, parsedOutput.body); }; +// se_AddressIdentifierFilter omitted. + /** * serializeAws_restJson1BatchGetTokenBalanceInputItem */ @@ -625,6 +689,8 @@ const se_BlockchainInstant = (input: BlockchainInstant, context: __SerdeContext) }); }; +// se_ChainAddresses omitted. + // se_ConfirmationStatusFilter omitted. // se_ConfirmationStatusIncludeList omitted. @@ -644,16 +710,30 @@ const se_GetTokenBalanceInputList = (input: BatchGetTokenBalanceInputItem[], con }); }; +// se_ListFilteredTransactionEventsSort omitted. + // se_ListTransactionsSort omitted. // se_OwnerFilter omitted. // se_OwnerIdentifier omitted. +/** + * serializeAws_restJson1TimeFilter + */ +const se_TimeFilter = (input: TimeFilter, context: __SerdeContext): any => { + return take(input, { + from: (_) => se_BlockchainInstant(_, context), + to: (_) => se_BlockchainInstant(_, context), + }); +}; + // se_TokenFilter omitted. // se_TokenIdentifier omitted. +// se_VoutFilter omitted. + // de_AssetContract omitted. // de_AssetContractList omitted. @@ -779,9 +859,41 @@ const de_Transaction = (output: any, context: __SerdeContext): Transaction => { }) as any; }; -// de_TransactionEvent omitted. +/** + * deserializeAws_restJson1TransactionEvent + */ +const de_TransactionEvent = (output: any, context: __SerdeContext): TransactionEvent => { + return take(output, { + blockchainInstant: (_: any) => de_BlockchainInstant(_, context), + confirmationStatus: __expectString, + contractAddress: __expectString, + eventType: __expectString, + from: __expectString, + network: __expectString, + spentVoutIndex: __expectInt32, + spentVoutTransactionHash: __expectString, + spentVoutTransactionId: __expectString, + to: __expectString, + tokenId: __expectString, + transactionHash: __expectString, + transactionId: __expectString, + value: __expectString, + voutIndex: __expectInt32, + voutSpent: __expectBoolean, + }) as any; +}; -// de_TransactionEventList omitted. +/** + * deserializeAws_restJson1TransactionEventList + */ +const de_TransactionEventList = (output: any, context: __SerdeContext): TransactionEvent[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_TransactionEvent(entry, context); + }); + return retVal; +}; /** * deserializeAws_restJson1TransactionOutputItem diff --git a/codegen/sdk-codegen/aws-models/managedblockchain-query.json b/codegen/sdk-codegen/aws-models/managedblockchain-query.json index bcdab443f05d..c414b6eea5f0 100644 --- a/codegen/sdk-codegen/aws-models/managedblockchain-query.json +++ b/codegen/sdk-codegen/aws-models/managedblockchain-query.json @@ -18,6 +18,25 @@ "smithy.api#httpError": 403 } }, + "com.amazonaws.managedblockchainquery#AddressIdentifierFilter": { + "type": "structure", + "members": { + "transactionEventToAddress": { + "target": "com.amazonaws.managedblockchainquery#ChainAddresses", + "traits": { + "smithy.api#documentation": "

The container for the recipient address of the transaction.

", + "smithy.api#length": { + "min": 1, + "max": 1 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

This is the container for the unique public address on the blockchain.

" + } + }, "com.amazonaws.managedblockchainquery#AssetContract": { "type": "structure", "members": { @@ -274,6 +293,12 @@ "smithy.api#pattern": "^[-A-Za-z0-9]{13,74}$" } }, + "com.amazonaws.managedblockchainquery#ChainAddresses": { + "type": "list", + "member": { + "target": "com.amazonaws.managedblockchainquery#ChainAddress" + } + }, "com.amazonaws.managedblockchainquery#ConfirmationStatus": { "type": "string", "traits": { @@ -669,7 +694,7 @@ "transactionHash": { "target": "com.amazonaws.managedblockchainquery#QueryTransactionHash", "traits": { - "smithy.api#documentation": "

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

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

The hash of a transaction. It is generated when a transaction is created.

", "smithy.api#required": {} } }, @@ -713,7 +738,7 @@ "retryAfterSeconds": { "target": "smithy.api#Integer", "traits": { - "smithy.api#documentation": "

The container of the retryAfterSeconds value.

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

Specifies the retryAfterSeconds value.

", "smithy.api#httpHeader": "Retry-After" } } @@ -785,7 +810,7 @@ "maxResults": { "target": "smithy.api#Integer", "traits": { - "smithy.api#documentation": "

The maximum number of contracts to list.

\n

Default:100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

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

The maximum number of contracts to list.

\n

Default: 100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

\n
", "smithy.api#range": { "min": 1, "max": 250 @@ -818,6 +843,159 @@ "smithy.api#output": {} } }, + "com.amazonaws.managedblockchainquery#ListFilteredTransactionEvents": { + "type": "operation", + "input": { + "target": "com.amazonaws.managedblockchainquery#ListFilteredTransactionEventsInput" + }, + "output": { + "target": "com.amazonaws.managedblockchainquery#ListFilteredTransactionEventsOutput" + }, + "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 retrieve events on the blockchain with additional filters", + "smithy.api#documentation": "

Lists all the transaction events for an address on the blockchain.

\n \n

This operation is only supported on the Bitcoin networks.

\n
", + "smithy.api#http": { + "uri": "/list-filtered-transaction-events", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "events", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.managedblockchainquery#ListFilteredTransactionEventsInput": { + "type": "structure", + "members": { + "network": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The blockchain network where the transaction occurred.

\n

Valid Values: BITCOIN_MAINNET | BITCOIN_TESTNET\n

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

This is the unique public address on the blockchain for which the transaction events are being requested.

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

This container specifies the time frame for the transaction events returned in the response.

" + } + }, + "voutFilter": { + "target": "com.amazonaws.managedblockchainquery#VoutFilter", + "traits": { + "smithy.api#documentation": "

This container specifies filtering attributes related to BITCOIN_VOUT event types

" + } + }, + "confirmationStatusFilter": { + "target": "com.amazonaws.managedblockchainquery#ConfirmationStatusFilter" + }, + "sort": { + "target": "com.amazonaws.managedblockchainquery#ListFilteredTransactionEventsSort", + "traits": { + "smithy.api#documentation": "

The order by which the results will be sorted.

" + } + }, + "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 transaction events to list.

\n

Default: 100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

\n
", + "smithy.api#range": { + "min": 1, + "max": 250 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.managedblockchainquery#ListFilteredTransactionEventsOutput": { + "type": "structure", + "members": { + "events": { + "target": "com.amazonaws.managedblockchainquery#TransactionEventList", + "traits": { + "smithy.api#documentation": "

The transaction events returned by 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.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.managedblockchainquery#ListFilteredTransactionEventsSort": { + "type": "structure", + "members": { + "sortBy": { + "target": "com.amazonaws.managedblockchainquery#ListFilteredTransactionEventsSortBy", + "traits": { + "smithy.api#documentation": "

Container on how the results will be sorted by?

" + } + }, + "sortOrder": { + "target": "com.amazonaws.managedblockchainquery#SortOrder", + "traits": { + "smithy.api#documentation": "

The container for the sort order for ListFilteredTransactionEvents. \n The SortOrder field only accepts the values ASCENDING \n and DESCENDING. Not providing SortOrder will default \n to ASCENDING.

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

Lists all the transaction events for an address on the blockchain.

\n \n

This operation is only supported on the Bitcoin blockchain networks.

\n
" + } + }, + "com.amazonaws.managedblockchainquery#ListFilteredTransactionEventsSortBy": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "blockchainInstant", + "name": "blockchainInstant", + "documentation": "Timestamp of a transaction" + } + ] + } + }, "com.amazonaws.managedblockchainquery#ListTokenBalances": { "type": "operation", "input": { @@ -884,7 +1062,7 @@ "maxResults": { "target": "smithy.api#Integer", "traits": { - "smithy.api#documentation": "

The maximum number of token balances to return.

\n

Default:100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

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

The maximum number of token balances to return.

\n

Default: 100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

\n
", "smithy.api#range": { "min": 1, "max": 250 @@ -944,7 +1122,7 @@ ], "traits": { "aws.iam#actionPermissionDescription": "Grants permission to retrieve events in a transaction on the blockchain", - "smithy.api#documentation": "

An array of TransactionEvent objects. Each object contains details \n about the transaction event.

\n \n

This action will return transaction details for all transactions \n that are confirmed on the blockchain, even if they have not reached \n finality.\n

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

Lists all the transaction events for a transaction

\n \n

This action will return transaction details for all transactions \n that are confirmed on the blockchain, even if they have not reached \n finality.\n

\n
", "smithy.api#http": { "uri": "/list-transaction-events", "method": "POST" @@ -964,8 +1142,13 @@ "transactionHash": { "target": "com.amazonaws.managedblockchainquery#QueryTransactionHash", "traits": { - "smithy.api#documentation": "

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

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

The hash of a transaction. It is generated when a transaction is created.

" + } + }, + "transactionId": { + "target": "com.amazonaws.managedblockchainquery#QueryTransactionId", + "traits": { + "smithy.api#documentation": "

The identifier of a Bitcoin transaction. It is generated when a transaction is created.

\n \n

\n transactionId is only supported on the Bitcoin networks.

\n
" } }, "network": { @@ -984,7 +1167,7 @@ "maxResults": { "target": "smithy.api#Integer", "traits": { - "smithy.api#documentation": "

The maximum number of transaction events to list.

\n

Default:100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

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

The maximum number of transaction events to list.

\n

Default: 100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

\n
", "smithy.api#range": { "min": 1, "max": 250 @@ -1044,7 +1227,7 @@ ], "traits": { "aws.iam#actionPermissionDescription": "Grants permission to retrieve a multiple transactions on a blockchain", - "smithy.api#documentation": "

Lists all of the transactions on a given wallet address or to a specific contract.

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

Lists all the transaction events for a transaction.

", "smithy.api#http": { "uri": "/list-transactions", "method": "POST" @@ -1084,7 +1267,7 @@ "sort": { "target": "com.amazonaws.managedblockchainquery#ListTransactionsSort", "traits": { - "smithy.api#documentation": "

The order by which the results will be sorted. If ASCENNDING is selected, the results \n will be ordered by fromTime.

" + "smithy.api#documentation": "

The order by which the results will be sorted.

" } }, "nextToken": { @@ -1096,7 +1279,7 @@ "maxResults": { "target": "smithy.api#Integer", "traits": { - "smithy.api#documentation": "

The maximum number of transactions to list.

\n

Default:100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

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

The maximum number of transactions to list.

\n

Default: 100\n

\n \n

Even if additional results can be retrieved, the request can return less \n results than maxResults or an empty array of results.

\n

To retrieve the next set of results, make another request with the \n returned nextToken value. The value of nextToken is \n null when there are no more results to return

\n
", "smithy.api#range": { "min": 1, "max": 250 @@ -1106,7 +1289,7 @@ "confirmationStatusFilter": { "target": "com.amazonaws.managedblockchainquery#ConfirmationStatusFilter", "traits": { - "smithy.api#documentation": "

This filter is used to include transactions in the response that haven't reached \n finality\n . Transactions that have reached finiality are always \n part of the response.

" + "smithy.api#documentation": "

This filter is used to include transactions in the response that haven't reached \n finality\n . Transactions that have reached finality are always \n part of the response.

" } } }, @@ -1203,7 +1386,7 @@ } }, "traits": { - "smithy.api#documentation": "

The container for the identifier of the owner.

" + "smithy.api#documentation": "

The container for the owner identifier.

" } }, "com.amazonaws.managedblockchainquery#QueryNetwork": { @@ -1326,6 +1509,12 @@ "smithy.api#pattern": "^(0x[A-Fa-f0-9]{64}|[A-Fa-f0-9]{64})$" } }, + "com.amazonaws.managedblockchainquery#QueryTransactionId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^(0x[A-Fa-f0-9]{64}|[A-Fa-f0-9]{64})$" + } + }, "com.amazonaws.managedblockchainquery#QuotaCode": { "type": "string" }, @@ -1499,6 +1688,9 @@ { "target": "com.amazonaws.managedblockchainquery#ListAssetContracts" }, + { + "target": "com.amazonaws.managedblockchainquery#ListFilteredTransactionEvents" + }, { "target": "com.amazonaws.managedblockchainquery#ListTokenBalances" }, @@ -2210,6 +2402,20 @@ } } }, + "com.amazonaws.managedblockchainquery#TimeFilter": { + "type": "structure", + "members": { + "from": { + "target": "com.amazonaws.managedblockchainquery#BlockchainInstant" + }, + "to": { + "target": "com.amazonaws.managedblockchainquery#BlockchainInstant" + } + }, + "traits": { + "smithy.api#documentation": "

This container is used to specify a time frame.

" + } + }, "com.amazonaws.managedblockchainquery#TokenBalance": { "type": "structure", "members": { @@ -2335,7 +2541,7 @@ "transactionHash": { "target": "com.amazonaws.managedblockchainquery#QueryTransactionHash", "traits": { - "smithy.api#documentation": "

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

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

The hash of a transaction. It is generated when a transaction is created.

", "smithy.api#required": {} } }, @@ -2430,7 +2636,7 @@ "transactionId": { "target": "smithy.api#String", "traits": { - "smithy.api#documentation": "

The unique identifier of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

" + "smithy.api#documentation": "

The identifier of a Bitcoin transaction. It is generated when a transaction is created.

" } }, "confirmationStatus": { @@ -2463,7 +2669,7 @@ "transactionHash": { "target": "com.amazonaws.managedblockchainquery#QueryTransactionHash", "traits": { - "smithy.api#documentation": "

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

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

The hash of a transaction. It is generated when a transaction is created.

", "smithy.api#required": {} } }, @@ -2495,7 +2701,7 @@ "contractAddress": { "target": "com.amazonaws.managedblockchainquery#ChainAddress", "traits": { - "smithy.api#documentation": "

The blockchain address. for the contract

" + "smithy.api#documentation": "

The blockchain address for the contract

" } }, "tokenId": { @@ -2507,13 +2713,46 @@ "transactionId": { "target": "smithy.api#String", "traits": { - "smithy.api#documentation": "

The unique identifier of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

" + "smithy.api#documentation": "

The identifier of a Bitcoin transaction. It is generated when a transaction is created.

" } }, "voutIndex": { "target": "smithy.api#Integer", "traits": { - "smithy.api#documentation": "

The position of the vout in the transaction output list.

" + "smithy.api#documentation": "

The position of the transaction output in the transaction output list.

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

Specifies if the transaction output is spent or unspent. This is only returned for BITCOIN_VOUT event types.

\n \n

This is only returned for BITCOIN_VOUT event types.

\n
" + } + }, + "spentVoutTransactionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The transactionId that created the spent transaction output.

\n \n

This is only returned for BITCOIN_VIN event types.

\n
" + } + }, + "spentVoutTransactionHash": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The transactionHash that created the spent transaction output.

\n \n

This is only returned for BITCOIN_VIN event types.

\n
" + } + }, + "spentVoutIndex": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The position of the spent transaction output in the output list of the creating transaction.

\n \n

This is only returned for BITCOIN_VIN event types.

\n
" + } + }, + "blockchainInstant": { + "target": "com.amazonaws.managedblockchainquery#BlockchainInstant" + }, + "confirmationStatus": { + "target": "com.amazonaws.managedblockchainquery#ConfirmationStatus", + "traits": { + "smithy.api#documentation": "

This container specifies whether the transaction has reached Finality.

" } } }, @@ -2539,7 +2778,7 @@ "transactionHash": { "target": "com.amazonaws.managedblockchainquery#QueryTransactionHash", "traits": { - "smithy.api#documentation": "

The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

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

The hash of a transaction. It is generated when a transaction is created.

", "smithy.api#required": {} } }, @@ -2660,6 +2899,21 @@ } ] } + }, + "com.amazonaws.managedblockchainquery#VoutFilter": { + "type": "structure", + "members": { + "voutSpent": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Specifies if the transaction output is spent or unspent.

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

This container specifies filtering attributes related to BITCOIN_VOUT event types

" + } } } }