Amazon Managed Blockchain Query

2024/03/20 - Amazon Managed Blockchain Query - 2 updated api methods

Changes  AMB Query: update GetTransaction to include transactionId as input

GetTransaction (updated) Link ¶
Changes (request)
{'transactionId': 'string'}

Gets the details of a transaction.

See also: AWS API Documentation

Request Syntax

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

string

param transactionHash:

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

type transactionId:

string

param transactionId:

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

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 a transaction. It is generated when a transaction is created.

      • 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 identifier of a Bitcoin transaction. It is generated when a transaction is created.

      • confirmationStatus (string) --

        Specifies whether the transaction has reached Finality.

      • executionStatus (string) --

        Identifies whether the transaction has succeeded or failed.

ListTransactions (updated) Link ¶
Changes (response)
{'transactions': {'transactionId': 'string'}}

Lists all the transaction events for a transaction.

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.

type toBlockchainInstant:

dict

param toBlockchainInstant:

The container for time.

  • time (datetime) --

    The container of the Timestamp of the blockchain instant.

type sort:

dict

param sort:

The order by which the results will be sorted.

  • 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

type confirmationStatusFilter:

dict

param confirmationStatusFilter:

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

  • include (list) -- [REQUIRED]

    The container to determine whether to list results that have only reached finality. Transactions that have reached finality are always part of the response.

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'transactions': [
        {
            'transactionHash': 'string',
            'transactionId': '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 a transaction. It is generated when a transaction is created.

        • transactionId (string) --

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

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