Skip to content

Commit 97bb566

Browse files
author
awstools
committed
feat(client-managedblockchain-query): This release adds support for transactions that have not reached finality. It also removes support for the status property from the response of the GetTransaction operation. You can use the confirmationStatus and executionStatus properties to determine the status of the transaction.
1 parent ad41dca commit 97bb566

File tree

8 files changed

+2685
-2633
lines changed

8 files changed

+2685
-2633
lines changed

Diff for: clients/client-managedblockchain-query/src/commands/BatchGetTokenBalanceCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface BatchGetTokenBalanceCommandOutput extends BatchGetTokenBalanceO
3535
* <p>Gets the token balance for a batch of tokens by using the <code>BatchGetTokenBalance</code>
3636
* action for every token in the request.</p>
3737
* <note>
38-
* <p>Only the native tokens BTC,ETH, and the ERC-20,
38+
* <p>Only the native tokens BTC and ETH, and the ERC-20,
3939
* ERC-721, and ERC 1155 token standards are supported.</p>
4040
* </note>
4141
* @example

Diff for: clients/client-managedblockchain-query/src/commands/GetTokenBalanceCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface GetTokenBalanceCommandOutput extends GetTokenBalanceOutput, __M
3434
* @public
3535
* <p>Gets the balance of a specific token, including native tokens, for a given address (wallet or contract) on the blockchain.</p>
3636
* <note>
37-
* <p>Only the native tokens BTC,ETH, and the ERC-20,
37+
* <p>Only the native tokens BTC and ETH, and the ERC-20,
3838
* ERC-721, and ERC 1155 token standards are supported.</p>
3939
* </note>
4040
* @example

Diff for: clients/client-managedblockchain-query/src/commands/GetTransactionCommand.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ export interface GetTransactionCommandOutput extends GetTransactionOutput, __Met
3232

3333
/**
3434
* @public
35-
* <p>Get the details of a transaction.</p>
35+
* <p>Gets the details of a transaction.</p>
36+
* <note>
37+
* <p>This action will return transaction details for all transactions
38+
* that are <i>confirmed</i> on the blockchain, even if they have not reached
39+
* <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ambq-dg/key-concepts.html#finality">finality</a>.
40+
* </p>
41+
* </note>
3642
* @example
3743
* Use a bare-bones client and the command you need to make an API call.
3844
* ```javascript
@@ -54,7 +60,6 @@ export interface GetTransactionCommandOutput extends GetTransactionOutput, __Met
5460
* // transactionTimestamp: new Date("TIMESTAMP"), // required
5561
* // transactionIndex: Number("long"), // required
5662
* // numberOfTransactions: Number("long"), // required
57-
* // status: "STRING_VALUE",
5863
* // to: "STRING_VALUE", // required
5964
* // from: "STRING_VALUE",
6065
* // contractAddress: "STRING_VALUE",

Diff for: clients/client-managedblockchain-query/src/commands/ListTransactionEventsCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ export interface ListTransactionEventsCommandOutput extends ListTransactionEvent
3434
* @public
3535
* <p>An array of <code>TransactionEvent</code> objects. Each object contains details
3636
* about the transaction event.</p>
37+
* <note>
38+
* <p>This action will return transaction details for all transactions
39+
* that are <i>confirmed</i> on the blockchain, even if they have not reached
40+
* <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ambq-dg/key-concepts.html#finality">finality</a>.
41+
* </p>
42+
* </note>
3743
* @example
3844
* Use a bare-bones client and the command you need to make an API call.
3945
* ```javascript

Diff for: clients/client-managedblockchain-query/src/commands/ListTransactionsCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export interface ListTransactionsCommandOutput extends ListTransactionsOutput, _
5454
* },
5555
* nextToken: "STRING_VALUE",
5656
* maxResults: Number("int"),
57+
* confirmationStatusFilter: { // ConfirmationStatusFilter
58+
* include: [ // ConfirmationStatusIncludeList // required
59+
* "STRING_VALUE",
60+
* ],
61+
* },
5762
* };
5863
* const command = new ListTransactionsCommand(input);
5964
* const response = await client.send(command);
@@ -63,6 +68,7 @@ export interface ListTransactionsCommandOutput extends ListTransactionsOutput, _
6368
* // transactionHash: "STRING_VALUE", // required
6469
* // network: "STRING_VALUE", // required
6570
* // transactionTimestamp: new Date("TIMESTAMP"), // required
71+
* // confirmationStatus: "STRING_VALUE",
6672
* // },
6773
* // ],
6874
* // nextToken: "STRING_VALUE",

Diff for: clients/client-managedblockchain-query/src/models/models_0.ts

+64-52
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export interface OwnerIdentifier {
141141
* @public
142142
* <p>The container for the identifier for the token including the unique token ID and its blockchain network.</p>
143143
* <note>
144-
* <p>Only the native tokens BTC,ETH, and the ERC-20,
144+
* <p>Only the native tokens BTC and ETH, and the ERC-20,
145145
* ERC-721, and ERC 1155 token standards are supported.</p>
146146
* </note>
147147
*/
@@ -162,8 +162,8 @@ export interface TokenIdentifier {
162162
* @public
163163
* <p>The unique identifier of the token.</p>
164164
* <note>
165-
* <p>You must specify this container with <code>btc</code> for the native BTC token, and
166-
* <code>eth</code> for the native ETH token. For all other token types you must
165+
* <p>For native tokens, use the 3 character abbreviation that best matches your token.
166+
* For example, btc for Bitcoin, eth for Ether, etc. For all other token types you must
167167
* specify the <code>tokenId</code> in the 64 character hexadecimal <code>tokenid</code> format.</p>
168168
* </note>
169169
*/
@@ -179,7 +179,7 @@ export interface BatchGetTokenBalanceInputItem {
179179
* @public
180180
* <p>The container for the identifier for the token including the unique token ID and its blockchain network.</p>
181181
* <note>
182-
* <p>Only the native tokens BTC,ETH, and the ERC-20,
182+
* <p>Only the native tokens BTC and ETH, and the ERC-20,
183183
* ERC-721, and ERC 1155 token standards are supported.</p>
184184
* </note>
185185
*/
@@ -238,7 +238,7 @@ export interface BatchGetTokenBalanceErrorItem {
238238
* @public
239239
* <p>The container for the identifier for the token including the unique token ID and its blockchain network.</p>
240240
* <note>
241-
* <p>Only the native tokens BTC,ETH, and the ERC-20,
241+
* <p>Only the native tokens BTC and ETH, and the ERC-20,
242242
* ERC-721, and ERC 1155 token standards are supported.</p>
243243
* </note>
244244
*/
@@ -290,7 +290,7 @@ export interface BatchGetTokenBalanceOutputItem {
290290
* @public
291291
* <p>The container for the identifier for the token including the unique token ID and its blockchain network.</p>
292292
* <note>
293-
* <p>Only the native tokens BTC,ETH, and the ERC-20,
293+
* <p>Only the native tokens BTC and ETH, and the ERC-20,
294294
* ERC-721, and ERC 1155 token standards are supported.</p>
295295
* </note>
296296
*/
@@ -576,13 +576,31 @@ export class ValidationException extends __BaseException {
576576
*/
577577
export const ConfirmationStatus = {
578578
FINAL: "FINAL",
579+
NONFINAL: "NONFINAL",
579580
} as const;
580581

581582
/**
582583
* @public
583584
*/
584585
export type ConfirmationStatus = (typeof ConfirmationStatus)[keyof typeof ConfirmationStatus];
585586

587+
/**
588+
* @public
589+
* <p>The container for the <code>ConfirmationStatusFilter</code> that filters for the <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ambq-dg/key-concepts.html#finality">
590+
* <i>finality</i>
591+
* </a> of the results.</p>
592+
*/
593+
export interface ConfirmationStatusFilter {
594+
/**
595+
* @public
596+
* <p>The container to determine whether to list results that have only reached <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ambq-dg/key-concepts.html#finality">
597+
* <i>finality</i>
598+
* </a>. Transactions
599+
* that have reached finality are always part of the response.</p>
600+
*/
601+
include: ConfirmationStatus[] | undefined;
602+
}
603+
586604
/**
587605
* @public
588606
* <p>The contract or wallet address by which to filter the request.</p>
@@ -727,7 +745,7 @@ export interface GetTokenBalanceOutput {
727745
* @public
728746
* <p>The container for the identifier for the token including the unique token ID and its blockchain network.</p>
729747
* <note>
730-
* <p>Only the native tokens BTC,ETH, and the ERC-20,
748+
* <p>Only the native tokens BTC and ETH, and the ERC-20,
731749
* ERC-721, and ERC 1155 token standards are supported.</p>
732750
* </note>
733751
*/
@@ -769,26 +787,6 @@ export interface GetTransactionInput {
769787
network: QueryNetwork | undefined;
770788
}
771789

772-
/**
773-
* @public
774-
* @enum
775-
*/
776-
export const QueryTransactionStatus = {
777-
/**
778-
* The transaction completed on the blockchain, but failed
779-
*/
780-
FAILED: "FAILED",
781-
/**
782-
* The transaction has been confirmed and is final in the blockchain
783-
*/
784-
FINAL: "FINAL",
785-
} as const;
786-
787-
/**
788-
* @public
789-
*/
790-
export type QueryTransactionStatus = (typeof QueryTransactionStatus)[keyof typeof QueryTransactionStatus];
791-
792790
/**
793791
* @public
794792
* <p>There are two possible types of transactions used for this data type:</p>
@@ -850,29 +848,6 @@ export interface Transaction {
850848
*/
851849
numberOfTransactions: number | undefined;
852850

853-
/**
854-
* @public
855-
* @deprecated
856-
*
857-
* <p>The status of the transaction.</p>
858-
* <important>
859-
* <p>This property is deprecated. You must use the <code>confirmationStatus</code>
860-
* and the <code>executionStatus</code> properties to determine if the <code>status</code>
861-
* of the transaction is <code>FINAL</code> or <code>FAILED</code>.</p>
862-
* <ul>
863-
* <li>
864-
* <p>Transactions with a <code>status</code> of <code>FINAL</code> will now have the <code>confirmationStatus</code> set
865-
* to <code>FINAL</code> and the <code>executionStatus</code> set to <code>SUCCEEDED</code>.</p>
866-
* </li>
867-
* <li>
868-
* <p>Transactions with a <code>status</code> of <code>FAILED</code> will now have the <code>confirmationStatus</code> set
869-
* to <code>FINAL</code> and the <code>executionStatus</code> set to <code>FAILED</code>.</p>
870-
* </li>
871-
* </ul>
872-
* </important>
873-
*/
874-
status?: QueryTransactionStatus;
875-
876851
/**
877852
* @public
878853
* <p>The identifier of the transaction. It is generated whenever a transaction is verified and added to the blockchain.</p>
@@ -983,6 +958,15 @@ export interface ListAssetContractsInput {
983958
/**
984959
* @public
985960
* <p>The maximum number of contracts to list.</p>
961+
* <p>Default:<code>100</code>
962+
* </p>
963+
* <note>
964+
* <p>Even if additional results can be retrieved, the request can return less
965+
* results than <code>maxResults</code> or an empty array of results.</p>
966+
* <p>To retrieve the next set of results, make another request with the
967+
* returned <code>nextToken</code> value. The value of <code>nextToken</code> is
968+
* <code>null</code> when there are no more results to return</p>
969+
* </note>
986970
*/
987971
maxResults?: number;
988972
}
@@ -1079,6 +1063,15 @@ export interface ListTokenBalancesInput {
10791063
/**
10801064
* @public
10811065
* <p>The maximum number of token balances to return.</p>
1066+
* <p>Default:<code>100</code>
1067+
* </p>
1068+
* <note>
1069+
* <p>Even if additional results can be retrieved, the request can return less
1070+
* results than <code>maxResults</code> or an empty array of results.</p>
1071+
* <p>To retrieve the next set of results, make another request with the
1072+
* returned <code>nextToken</code> value. The value of <code>nextToken</code> is
1073+
* <code>null</code> when there are no more results to return</p>
1074+
* </note>
10821075
*/
10831076
maxResults?: number;
10841077
}
@@ -1166,6 +1159,8 @@ export interface ListTransactionEventsInput {
11661159
/**
11671160
* @public
11681161
* <p>The maximum number of transaction events to list.</p>
1162+
* <p>Default:<code>100</code>
1163+
* </p>
11691164
* <note>
11701165
* <p>Even if additional results can be retrieved, the request can return less
11711166
* results than <code>maxResults</code> or an empty array of results.</p>
@@ -1405,8 +1400,8 @@ export interface ListTransactionsInput {
14051400

14061401
/**
14071402
* @public
1408-
* <p>Sorts items in an ascending order if the first page starts at <code>fromTime</code>.
1409-
* Sorts items in a descending order if the first page starts at <code>toTime</code>.</p>
1403+
* <p>The order by which the results will be sorted. If <code>ASCENNDING</code> is selected, the results
1404+
* will be ordered by <code>fromTime</code>. </p>
14101405
*/
14111406
sort?: ListTransactionsSort;
14121407

@@ -1419,6 +1414,8 @@ export interface ListTransactionsInput {
14191414
/**
14201415
* @public
14211416
* <p>The maximum number of transactions to list.</p>
1417+
* <p>Default:<code>100</code>
1418+
* </p>
14221419
* <note>
14231420
* <p>Even if additional results can be retrieved, the request can return less
14241421
* results than <code>maxResults</code> or an empty array of results.</p>
@@ -1428,6 +1425,15 @@ export interface ListTransactionsInput {
14281425
* </note>
14291426
*/
14301427
maxResults?: number;
1428+
1429+
/**
1430+
* @public
1431+
* <p>This filter is used to include transactions in the response that haven't reached <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ambq-dg/key-concepts.html#finality">
1432+
* <i>finality</i>
1433+
* </a>. Transactions that have reached finiality are always
1434+
* part of the response.</p>
1435+
*/
1436+
confirmationStatusFilter?: ConfirmationStatusFilter;
14311437
}
14321438

14331439
/**
@@ -1452,6 +1458,12 @@ export interface TransactionOutputItem {
14521458
* <p>The time when the transaction occurred.</p>
14531459
*/
14541460
transactionTimestamp: Date | undefined;
1461+
1462+
/**
1463+
* @public
1464+
* <p>Specifies whether to list transactions that have not reached Finality.</p>
1465+
*/
1466+
confirmationStatus?: ConfirmationStatus;
14551467
}
14561468

14571469
/**

Diff for: clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ import {
4444
BatchGetTokenBalanceInputItem,
4545
BatchGetTokenBalanceOutputItem,
4646
BlockchainInstant,
47+
ConfirmationStatus,
48+
ConfirmationStatusFilter,
4749
ContractFilter,
4850
ContractIdentifier,
4951
InternalServerException,
@@ -242,6 +244,7 @@ export const se_ListTransactionsCommand = async (
242244
body = JSON.stringify(
243245
take(input, {
244246
address: [],
247+
confirmationStatusFilter: (_) => _json(_),
245248
fromBlockchainInstant: (_) => se_BlockchainInstant(_, context),
246249
maxResults: [],
247250
network: [],
@@ -899,6 +902,10 @@ const se_BlockchainInstant = (input: BlockchainInstant, context: __SerdeContext)
899902
});
900903
};
901904

905+
// se_ConfirmationStatusFilter omitted.
906+
907+
// se_ConfirmationStatusIncludeList omitted.
908+
902909
// se_ContractFilter omitted.
903910

904911
// se_ContractIdentifier omitted.
@@ -1040,7 +1047,6 @@ const de_Transaction = (output: any, context: __SerdeContext): Transaction => {
10401047
signatureR: __expectString,
10411048
signatureS: __expectString,
10421049
signatureV: __expectInt32,
1043-
status: __expectString,
10441050
to: __expectString,
10451051
transactionFee: __expectString,
10461052
transactionHash: __expectString,
@@ -1059,6 +1065,7 @@ const de_Transaction = (output: any, context: __SerdeContext): Transaction => {
10591065
*/
10601066
const de_TransactionOutputItem = (output: any, context: __SerdeContext): TransactionOutputItem => {
10611067
return take(output, {
1068+
confirmationStatus: __expectString,
10621069
network: __expectString,
10631070
transactionHash: __expectString,
10641071
transactionTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),

0 commit comments

Comments
 (0)