Skip to content

Commit 487e1dd

Browse files
author
awstools
committed
feat(client-managedblockchain-query): Introduces a new API for Amazon Managed Blockchain Query: ListFilteredTransactionEvents.
1 parent 38c6f75 commit 487e1dd

12 files changed

+978
-158
lines changed

clients/client-managedblockchain-query/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@ ListAssetContracts
248248

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

251+
</details>
252+
<details>
253+
<summary>
254+
ListFilteredTransactionEvents
255+
</summary>
256+
257+
[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/)
258+
251259
</details>
252260
<details>
253261
<summary>

clients/client-managedblockchain-query/src/ManagedBlockchainQuery.ts

+23
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ import {
2727
ListAssetContractsCommandInput,
2828
ListAssetContractsCommandOutput,
2929
} from "./commands/ListAssetContractsCommand";
30+
import {
31+
ListFilteredTransactionEventsCommand,
32+
ListFilteredTransactionEventsCommandInput,
33+
ListFilteredTransactionEventsCommandOutput,
34+
} from "./commands/ListFilteredTransactionEventsCommand";
3035
import {
3136
ListTokenBalancesCommand,
3237
ListTokenBalancesCommandInput,
@@ -50,6 +55,7 @@ const commands = {
5055
GetTokenBalanceCommand,
5156
GetTransactionCommand,
5257
ListAssetContractsCommand,
58+
ListFilteredTransactionEventsCommand,
5359
ListTokenBalancesCommand,
5460
ListTransactionEventsCommand,
5561
ListTransactionsCommand,
@@ -136,6 +142,23 @@ export interface ManagedBlockchainQuery {
136142
cb: (err: any, data?: ListAssetContractsCommandOutput) => void
137143
): void;
138144

145+
/**
146+
* @see {@link ListFilteredTransactionEventsCommand}
147+
*/
148+
listFilteredTransactionEvents(
149+
args: ListFilteredTransactionEventsCommandInput,
150+
options?: __HttpHandlerOptions
151+
): Promise<ListFilteredTransactionEventsCommandOutput>;
152+
listFilteredTransactionEvents(
153+
args: ListFilteredTransactionEventsCommandInput,
154+
cb: (err: any, data?: ListFilteredTransactionEventsCommandOutput) => void
155+
): void;
156+
listFilteredTransactionEvents(
157+
args: ListFilteredTransactionEventsCommandInput,
158+
options: __HttpHandlerOptions,
159+
cb: (err: any, data?: ListFilteredTransactionEventsCommandOutput) => void
160+
): void;
161+
139162
/**
140163
* @see {@link ListTokenBalancesCommand}
141164
*/

clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ import { GetAssetContractCommandInput, GetAssetContractCommandOutput } from "./c
6161
import { GetTokenBalanceCommandInput, GetTokenBalanceCommandOutput } from "./commands/GetTokenBalanceCommand";
6262
import { GetTransactionCommandInput, GetTransactionCommandOutput } from "./commands/GetTransactionCommand";
6363
import { ListAssetContractsCommandInput, ListAssetContractsCommandOutput } from "./commands/ListAssetContractsCommand";
64+
import {
65+
ListFilteredTransactionEventsCommandInput,
66+
ListFilteredTransactionEventsCommandOutput,
67+
} from "./commands/ListFilteredTransactionEventsCommand";
6468
import { ListTokenBalancesCommandInput, ListTokenBalancesCommandOutput } from "./commands/ListTokenBalancesCommand";
6569
import {
6670
ListTransactionEventsCommandInput,
@@ -87,6 +91,7 @@ export type ServiceInputTypes =
8791
| GetTokenBalanceCommandInput
8892
| GetTransactionCommandInput
8993
| ListAssetContractsCommandInput
94+
| ListFilteredTransactionEventsCommandInput
9095
| ListTokenBalancesCommandInput
9196
| ListTransactionEventsCommandInput
9297
| ListTransactionsCommandInput;
@@ -100,6 +105,7 @@ export type ServiceOutputTypes =
100105
| GetTokenBalanceCommandOutput
101106
| GetTransactionCommandOutput
102107
| ListAssetContractsCommandOutput
108+
| ListFilteredTransactionEventsCommandOutput
103109
| ListTokenBalancesCommandOutput
104110
| ListTransactionEventsCommandOutput
105111
| ListTransactionsCommandOutput;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import {
9+
ManagedBlockchainQueryClientResolvedConfig,
10+
ServiceInputTypes,
11+
ServiceOutputTypes,
12+
} from "../ManagedBlockchainQueryClient";
13+
import { ListFilteredTransactionEventsInput, ListFilteredTransactionEventsOutput } from "../models/models_0";
14+
import {
15+
de_ListFilteredTransactionEventsCommand,
16+
se_ListFilteredTransactionEventsCommand,
17+
} from "../protocols/Aws_restJson1";
18+
19+
/**
20+
* @public
21+
*/
22+
export { __MetadataBearer, $Command };
23+
/**
24+
* @public
25+
*
26+
* The input for {@link ListFilteredTransactionEventsCommand}.
27+
*/
28+
export interface ListFilteredTransactionEventsCommandInput extends ListFilteredTransactionEventsInput {}
29+
/**
30+
* @public
31+
*
32+
* The output of {@link ListFilteredTransactionEventsCommand}.
33+
*/
34+
export interface ListFilteredTransactionEventsCommandOutput
35+
extends ListFilteredTransactionEventsOutput,
36+
__MetadataBearer {}
37+
38+
/**
39+
* <p>Lists all the transaction events for an address on the blockchain.</p>
40+
* <note>
41+
* <p>This operation is only supported on the Bitcoin networks.</p>
42+
* </note>
43+
* @example
44+
* Use a bare-bones client and the command you need to make an API call.
45+
* ```javascript
46+
* import { ManagedBlockchainQueryClient, ListFilteredTransactionEventsCommand } from "@aws-sdk/client-managedblockchain-query"; // ES Modules import
47+
* // const { ManagedBlockchainQueryClient, ListFilteredTransactionEventsCommand } = require("@aws-sdk/client-managedblockchain-query"); // CommonJS import
48+
* const client = new ManagedBlockchainQueryClient(config);
49+
* const input = { // ListFilteredTransactionEventsInput
50+
* network: "STRING_VALUE", // required
51+
* addressIdentifierFilter: { // AddressIdentifierFilter
52+
* transactionEventToAddress: [ // ChainAddresses // required
53+
* "STRING_VALUE",
54+
* ],
55+
* },
56+
* timeFilter: { // TimeFilter
57+
* from: { // BlockchainInstant
58+
* time: new Date("TIMESTAMP"),
59+
* },
60+
* to: {
61+
* time: new Date("TIMESTAMP"),
62+
* },
63+
* },
64+
* voutFilter: { // VoutFilter
65+
* voutSpent: true || false, // required
66+
* },
67+
* confirmationStatusFilter: { // ConfirmationStatusFilter
68+
* include: [ // ConfirmationStatusIncludeList // required
69+
* "STRING_VALUE",
70+
* ],
71+
* },
72+
* sort: { // ListFilteredTransactionEventsSort
73+
* sortBy: "STRING_VALUE",
74+
* sortOrder: "STRING_VALUE",
75+
* },
76+
* nextToken: "STRING_VALUE",
77+
* maxResults: Number("int"),
78+
* };
79+
* const command = new ListFilteredTransactionEventsCommand(input);
80+
* const response = await client.send(command);
81+
* // { // ListFilteredTransactionEventsOutput
82+
* // events: [ // TransactionEventList // required
83+
* // { // TransactionEvent
84+
* // network: "STRING_VALUE", // required
85+
* // transactionHash: "STRING_VALUE", // required
86+
* // eventType: "STRING_VALUE", // required
87+
* // from: "STRING_VALUE",
88+
* // to: "STRING_VALUE",
89+
* // value: "STRING_VALUE",
90+
* // contractAddress: "STRING_VALUE",
91+
* // tokenId: "STRING_VALUE",
92+
* // transactionId: "STRING_VALUE",
93+
* // voutIndex: Number("int"),
94+
* // voutSpent: true || false,
95+
* // spentVoutTransactionId: "STRING_VALUE",
96+
* // spentVoutTransactionHash: "STRING_VALUE",
97+
* // spentVoutIndex: Number("int"),
98+
* // blockchainInstant: { // BlockchainInstant
99+
* // time: new Date("TIMESTAMP"),
100+
* // },
101+
* // confirmationStatus: "STRING_VALUE",
102+
* // },
103+
* // ],
104+
* // nextToken: "STRING_VALUE",
105+
* // };
106+
*
107+
* ```
108+
*
109+
* @param ListFilteredTransactionEventsCommandInput - {@link ListFilteredTransactionEventsCommandInput}
110+
* @returns {@link ListFilteredTransactionEventsCommandOutput}
111+
* @see {@link ListFilteredTransactionEventsCommandInput} for command's `input` shape.
112+
* @see {@link ListFilteredTransactionEventsCommandOutput} for command's `response` shape.
113+
* @see {@link ManagedBlockchainQueryClientResolvedConfig | config} for ManagedBlockchainQueryClient's `config` shape.
114+
*
115+
* @throws {@link AccessDeniedException} (client fault)
116+
* <p>The Amazon Web Services account doesn’t have access to this resource. </p>
117+
*
118+
* @throws {@link InternalServerException} (server fault)
119+
* <p>The request processing has failed because of an internal error in the service.</p>
120+
*
121+
* @throws {@link ServiceQuotaExceededException} (client fault)
122+
* <p>The service quota has been exceeded for this resource.</p>
123+
*
124+
* @throws {@link ThrottlingException} (client fault)
125+
* <p>The request or operation couldn't be performed because a service is throttling
126+
* requests. The most common source of throttling errors is when you create resources
127+
* that exceed your service limit for this resource type. Request a limit increase or
128+
* delete unused resources, if possible.</p>
129+
*
130+
* @throws {@link ValidationException} (client fault)
131+
* <p>The resource passed is invalid.</p>
132+
*
133+
* @throws {@link ManagedBlockchainQueryServiceException}
134+
* <p>Base exception class for all service exceptions from ManagedBlockchainQuery service.</p>
135+
*
136+
* @public
137+
*/
138+
export class ListFilteredTransactionEventsCommand extends $Command
139+
.classBuilder<
140+
ListFilteredTransactionEventsCommandInput,
141+
ListFilteredTransactionEventsCommandOutput,
142+
ManagedBlockchainQueryClientResolvedConfig,
143+
ServiceInputTypes,
144+
ServiceOutputTypes
145+
>()
146+
.ep({
147+
...commonParams,
148+
})
149+
.m(function (this: any, Command: any, cs: any, config: ManagedBlockchainQueryClientResolvedConfig, o: any) {
150+
return [
151+
getSerdePlugin(config, this.serialize, this.deserialize),
152+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
153+
];
154+
})
155+
.s("TietonChainQueryService", "ListFilteredTransactionEvents", {})
156+
.n("ManagedBlockchainQueryClient", "ListFilteredTransactionEventsCommand")
157+
.f(void 0, void 0)
158+
.ser(se_ListFilteredTransactionEventsCommand)
159+
.de(de_ListFilteredTransactionEventsCommand)
160+
.build() {}

clients/client-managedblockchain-query/src/commands/ListTransactionEventsCommand.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ export interface ListTransactionEventsCommandInput extends ListTransactionEvents
3131
export interface ListTransactionEventsCommandOutput extends ListTransactionEventsOutput, __MetadataBearer {}
3232

3333
/**
34-
* <p>An array of <code>TransactionEvent</code> objects. Each object contains details
35-
* about the transaction event.</p>
34+
* <p>Lists all the transaction events for a transaction </p>
3635
* <note>
3736
* <p>This action will return transaction details for all transactions
3837
* that are <i>confirmed</i> on the blockchain, even if they have not reached
@@ -46,7 +45,8 @@ export interface ListTransactionEventsCommandOutput extends ListTransactionEvent
4645
* // const { ManagedBlockchainQueryClient, ListTransactionEventsCommand } = require("@aws-sdk/client-managedblockchain-query"); // CommonJS import
4746
* const client = new ManagedBlockchainQueryClient(config);
4847
* const input = { // ListTransactionEventsInput
49-
* transactionHash: "STRING_VALUE", // required
48+
* transactionHash: "STRING_VALUE",
49+
* transactionId: "STRING_VALUE",
5050
* network: "STRING_VALUE", // required
5151
* nextToken: "STRING_VALUE",
5252
* maxResults: Number("int"),
@@ -66,6 +66,14 @@ export interface ListTransactionEventsCommandOutput extends ListTransactionEvent
6666
* // tokenId: "STRING_VALUE",
6767
* // transactionId: "STRING_VALUE",
6868
* // voutIndex: Number("int"),
69+
* // voutSpent: true || false,
70+
* // spentVoutTransactionId: "STRING_VALUE",
71+
* // spentVoutTransactionHash: "STRING_VALUE",
72+
* // spentVoutIndex: Number("int"),
73+
* // blockchainInstant: { // BlockchainInstant
74+
* // time: new Date("TIMESTAMP"),
75+
* // },
76+
* // confirmationStatus: "STRING_VALUE",
6977
* // },
7078
* // ],
7179
* // nextToken: "STRING_VALUE",

clients/client-managedblockchain-query/src/commands/ListTransactionsCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface ListTransactionsCommandInput extends ListTransactionsInput {}
3131
export interface ListTransactionsCommandOutput extends ListTransactionsOutput, __MetadataBearer {}
3232

3333
/**
34-
* <p>Lists all of the transactions on a given wallet address or to a specific contract.</p>
34+
* <p>Lists all the transaction events for a transaction.</p>
3535
* @example
3636
* Use a bare-bones client and the command you need to make an API call.
3737
* ```javascript

clients/client-managedblockchain-query/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export * from "./GetAssetContractCommand";
44
export * from "./GetTokenBalanceCommand";
55
export * from "./GetTransactionCommand";
66
export * from "./ListAssetContractsCommand";
7+
export * from "./ListFilteredTransactionEventsCommand";
78
export * from "./ListTokenBalancesCommand";
89
export * from "./ListTransactionEventsCommand";
910
export * from "./ListTransactionsCommand";

0 commit comments

Comments
 (0)