Amazon Managed Blockchain Query

2024/02/01 - Amazon Managed Blockchain Query - 2 updated api methods

Changes  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.

GetTransaction (updated) Link ¶
Changes (response)
{'transaction': {'confirmationStatus': {'NONFINAL'}}}

Gets the details of a transaction.

Note

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

See also: AWS API Documentation

Request Syntax

client.get_transaction(
    transactionHash='string',
    network='ETHEREUM_MAINNET'|'ETHEREUM_SEPOLIA_TESTNET'|'BITCOIN_MAINNET'|'BITCOIN_TESTNET'
)
type transactionHash

string

param transactionHash

[REQUIRED]

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

type network

string

param network

[REQUIRED]

The blockchain network where the transaction occurred.

rtype

dict

returns

Response Syntax

{
    'transaction': {
        'network': 'ETHEREUM_MAINNET'|'ETHEREUM_SEPOLIA_TESTNET'|'BITCOIN_MAINNET'|'BITCOIN_TESTNET',
        'blockHash': 'string',
        'transactionHash': 'string',
        'blockNumber': 'string',
        'transactionTimestamp': datetime(2015, 1, 1),
        'transactionIndex': 123,
        'numberOfTransactions': 123,
        'to': 'string',
        'from': 'string',
        'contractAddress': 'string',
        'gasUsed': 'string',
        'cumulativeGasUsed': 'string',
        'effectiveGasPrice': 'string',
        'signatureV': 123,
        'signatureR': 'string',
        'signatureS': 'string',
        'transactionFee': 'string',
        'transactionId': 'string',
        'confirmationStatus': 'FINAL'|'NONFINAL',
        'executionStatus': 'FAILED'|'SUCCEEDED'
    }
}

Response Structure

  • (dict) --

    • transaction (dict) --

      Contains the details of the transaction.

      • network (string) --

        The blockchain network where the transaction occurred.

      • blockHash (string) --

        The block hash is a unique identifier for a block. It is a fixed-size string that is calculated by using the information in the block. The block hash is used to verify the integrity of the data in the block.

      • transactionHash (string) --

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

      • blockNumber (string) --

        The block number in which the transaction is recorded.

      • transactionTimestamp (datetime) --

        The Timestamp of the transaction.

      • transactionIndex (integer) --

        The index of the transaction within a blockchain.

      • numberOfTransactions (integer) --

        The number of transactions in the block.

      • to (string) --

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

      • from (string) --

        The initiator of the transaction. It is either in the form a public key or a contract address.

      • contractAddress (string) --

        The blockchain address for the contract.

      • gasUsed (string) --

        The amount of gas used for the transaction.

      • cumulativeGasUsed (string) --

        The amount of gas used up to the specified point in the block.

      • effectiveGasPrice (string) --

        The effective gas price.

      • signatureV (integer) --

        The signature of the transaction. The Z coordinate of a point V.

      • signatureR (string) --

        The signature of the transaction. The X coordinate of a point R.

      • signatureS (string) --

        The signature of the transaction. The Y coordinate of a point S.

      • transactionFee (string) --

        The transaction fee.

      • transactionId (string) --

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

      • confirmationStatus (string) --

        Specifies whether the transaction has reached Finality.

      • executionStatus (string) --

        Identifies whether the transaction has succeeded or failed.

ListTransactions (updated) Link ¶
Changes (request, response)
Request
{'confirmationStatusFilter': {'include': ['FINAL | NONFINAL']}}
Response
{'transactions': {'confirmationStatus': 'FINAL | NONFINAL'}}

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

See also: AWS API Documentation

Request Syntax

client.list_transactions(
    address='string',
    network='ETHEREUM_MAINNET'|'ETHEREUM_SEPOLIA_TESTNET'|'BITCOIN_MAINNET'|'BITCOIN_TESTNET',
    fromBlockchainInstant={
        'time': datetime(2015, 1, 1)
    },
    toBlockchainInstant={
        'time': datetime(2015, 1, 1)
    },
    sort={
        'sortBy': 'TRANSACTION_TIMESTAMP',
        'sortOrder': 'ASCENDING'|'DESCENDING'
    },
    nextToken='string',
    maxResults=123,
    confirmationStatusFilter={
        'include': [
            'FINAL'|'NONFINAL',
        ]
    }
)
type address

string

param address

[REQUIRED]

The address (either a contract or wallet), whose transactions are being requested.

type network

string

param network

[REQUIRED]

The blockchain network where the transactions occurred.

type fromBlockchainInstant

dict

param fromBlockchainInstant

The container for time.

  • time (datetime) --

    The container of the Timestamp of the blockchain instant.

    Note

    This timestamp will only be recorded up to the second.

type toBlockchainInstant

dict

param toBlockchainInstant

The container for time.

  • time (datetime) --

    The container of the Timestamp of the blockchain instant.

    Note

    This timestamp will only be recorded up to the second.

type sort

dict

param sort

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

  • sortBy (string) --

    Defaults to the value TRANSACTION_TIMESTAMP .

  • sortOrder (string) --

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

type nextToken

string

param nextToken

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

type maxResults

integer

param maxResults

The maximum number of transactions to list.

Default:100

Note

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

type confirmationStatusFilter

dict

param confirmationStatusFilter

This filter is used to include transactions in the response that haven't reached ` finality https://docs.aws.amazon.com/managed-blockchain/latest/ambq-dg/key-concepts.html#finality`__ . Transactions that have reached finiality are always part of the response.

rtype

dict

returns

Response Syntax

{
    'transactions': [
        {
            'transactionHash': 'string',
            'network': 'ETHEREUM_MAINNET'|'ETHEREUM_SEPOLIA_TESTNET'|'BITCOIN_MAINNET'|'BITCOIN_TESTNET',
            'transactionTimestamp': datetime(2015, 1, 1),
            'confirmationStatus': 'FINAL'|'NONFINAL'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • transactions (list) --

      The array of transactions returned by the request.

      • (dict) --

        The container of the transaction output.

        • transactionHash (string) --

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

        • network (string) --

          The blockchain network where the transaction occurred.

        • transactionTimestamp (datetime) --

          The time when the transaction occurred.

        • confirmationStatus (string) --

          Specifies whether to list transactions that have not reached Finality.

    • nextToken (string) --

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