Skip to content

Commit

Permalink
feat(client-managedblockchain-query): Introduces a new API for Amazon…
Browse files Browse the repository at this point in the history
… Managed Blockchain Query: ListFilteredTransactionEvents.
  • Loading branch information
awstools committed Mar 19, 2024
1 parent 38c6f75 commit 487e1dd
Show file tree
Hide file tree
Showing 12 changed files with 978 additions and 158 deletions.
8 changes: 8 additions & 0 deletions clients/client-managedblockchain-query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

</details>
<details>
<summary>
ListFilteredTransactionEvents
</summary>

[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/)

</details>
<details>
<summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import {
ListAssetContractsCommandInput,
ListAssetContractsCommandOutput,
} from "./commands/ListAssetContractsCommand";
import {
ListFilteredTransactionEventsCommand,
ListFilteredTransactionEventsCommandInput,
ListFilteredTransactionEventsCommandOutput,
} from "./commands/ListFilteredTransactionEventsCommand";
import {
ListTokenBalancesCommand,
ListTokenBalancesCommandInput,
Expand All @@ -50,6 +55,7 @@ const commands = {
GetTokenBalanceCommand,
GetTransactionCommand,
ListAssetContractsCommand,
ListFilteredTransactionEventsCommand,
ListTokenBalancesCommand,
ListTransactionEventsCommand,
ListTransactionsCommand,
Expand Down Expand Up @@ -136,6 +142,23 @@ export interface ManagedBlockchainQuery {
cb: (err: any, data?: ListAssetContractsCommandOutput) => void
): void;

/**
* @see {@link ListFilteredTransactionEventsCommand}
*/
listFilteredTransactionEvents(
args: ListFilteredTransactionEventsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListFilteredTransactionEventsCommandOutput>;
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}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -87,6 +91,7 @@ export type ServiceInputTypes =
| GetTokenBalanceCommandInput
| GetTransactionCommandInput
| ListAssetContractsCommandInput
| ListFilteredTransactionEventsCommandInput
| ListTokenBalancesCommandInput
| ListTransactionEventsCommandInput
| ListTransactionsCommandInput;
Expand All @@ -100,6 +105,7 @@ export type ServiceOutputTypes =
| GetTokenBalanceCommandOutput
| GetTransactionCommandOutput
| ListAssetContractsCommandOutput
| ListFilteredTransactionEventsCommandOutput
| ListTokenBalancesCommandOutput
| ListTransactionEventsCommandOutput
| ListTransactionsCommandOutput;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}

/**
* <p>Lists all the transaction events for an address on the blockchain.</p>
* <note>
* <p>This operation is only supported on the Bitcoin networks.</p>
* </note>
* @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)
* <p>The Amazon Web Services account doesn’t have access to this resource. </p>
*
* @throws {@link InternalServerException} (server fault)
* <p>The request processing has failed because of an internal error in the service.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>The service quota has been exceeded for this resource.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>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.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The resource passed is invalid.</p>
*
* @throws {@link ManagedBlockchainQueryServiceException}
* <p>Base exception class for all service exceptions from ManagedBlockchainQuery service.</p>
*
* @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() {}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export interface ListTransactionEventsCommandInput extends ListTransactionEvents
export interface ListTransactionEventsCommandOutput extends ListTransactionEventsOutput, __MetadataBearer {}

/**
* <p>An array of <code>TransactionEvent</code> objects. Each object contains details
* about the transaction event.</p>
* <p>Lists all the transaction events for a transaction </p>
* <note>
* <p>This action will return transaction details for all transactions
* that are <i>confirmed</i> on the blockchain, even if they have not reached
Expand All @@ -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"),
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface ListTransactionsCommandInput extends ListTransactionsInput {}
export interface ListTransactionsCommandOutput extends ListTransactionsOutput, __MetadataBearer {}

/**
* <p>Lists all of the transactions on a given wallet address or to a specific contract.</p>
* <p>Lists all the transaction events for a transaction.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Loading

0 comments on commit 487e1dd

Please sign in to comment.