SDK for PHP 3.x

Client: Aws\ManagedBlockchainQuery\ManagedBlockchainQueryClient
Service ID: managedblockchain-query
Version: 2023-05-04

This page describes the parameters and results for the operations of the Amazon Managed Blockchain Query (2023-05-04), and shows how to use the Aws\ManagedBlockchainQuery\ManagedBlockchainQueryClient object to call the described operations. This documentation is specific to the 2023-05-04 API version of the service.

Operation Summary

Each of the following operations can be created from a client using $client->getCommand('CommandName'), where "CommandName" is the name of one of the following operations. Note: a command is a value that encapsulates an operation and the parameters used to create an HTTP request.

You can also create and send a command immediately using the magic methods available on a client object: $client->commandName(/* parameters */). You can send the command asynchronously (returning a promise) by appending the word "Async" to the operation name: $client->commandNameAsync(/* parameters */).

BatchGetTokenBalance ( array $params = [] )
Gets the token balance for a batch of tokens by using the BatchGetTokenBalance action for every token in the request.
GetAssetContract ( array $params = [] )
Gets the information about a specific contract deployed on the blockchain.
GetTokenBalance ( array $params = [] )
Gets the balance of a specific token, including native tokens, for a given address (wallet or contract) on the blockchain.
GetTransaction ( array $params = [] )
Gets the details of a transaction.
ListAssetContracts ( array $params = [] )
Lists all the contracts for a given contract type deployed by an address (either a contract address or a wallet address).
ListFilteredTransactionEvents ( array $params = [] )
Lists all the transaction events for an address on the blockchain.
ListTokenBalances ( array $params = [] )
This action returns the following for a given blockchain network: Lists all token balances owned by an address (either a contract address or a wallet address).
ListTransactionEvents ( array $params = [] )
Lists all the transaction events for a transaction This action will return transaction details for all transactions that are confirmed on the blockchain, even if they have not reached finality.
ListTransactions ( array $params = [] )
Lists all the transaction events for a transaction.

Paginators

Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:

ListAssetContracts
ListFilteredTransactionEvents
ListTokenBalances
ListTransactionEvents
ListTransactions

Operations

BatchGetTokenBalance

$result = $client->batchGetTokenBalance([/* ... */]);
$promise = $client->batchGetTokenBalanceAsync([/* ... */]);

Gets the token balance for a batch of tokens by using the BatchGetTokenBalance action for every token in the request.

Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.

Parameter Syntax

$result = $client->batchGetTokenBalance([
    'getTokenBalanceInputs' => [
        [
            'atBlockchainInstant' => [
                'time' => <integer || string || DateTime>,
            ],
            'ownerIdentifier' => [ // REQUIRED
                'address' => '<string>', // REQUIRED
            ],
            'tokenIdentifier' => [ // REQUIRED
                'contractAddress' => '<string>',
                'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET', // REQUIRED
                'tokenId' => '<string>',
            ],
        ],
        // ...
    ],
]);

Parameter Details

Members
getTokenBalanceInputs
Type: Array of BatchGetTokenBalanceInputItem structures

An array of BatchGetTokenBalanceInputItem objects whose balance is being requested.

Result Syntax

[
    'errors' => [
        [
            'atBlockchainInstant' => [
                'time' => <DateTime>,
            ],
            'errorCode' => '<string>',
            'errorMessage' => '<string>',
            'errorType' => 'VALIDATION_EXCEPTION|RESOURCE_NOT_FOUND_EXCEPTION',
            'ownerIdentifier' => [
                'address' => '<string>',
            ],
            'tokenIdentifier' => [
                'contractAddress' => '<string>',
                'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
                'tokenId' => '<string>',
            ],
        ],
        // ...
    ],
    'tokenBalances' => [
        [
            'atBlockchainInstant' => [
                'time' => <DateTime>,
            ],
            'balance' => '<string>',
            'lastUpdatedTime' => [
                'time' => <DateTime>,
            ],
            'ownerIdentifier' => [
                'address' => '<string>',
            ],
            'tokenIdentifier' => [
                'contractAddress' => '<string>',
                'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
                'tokenId' => '<string>',
            ],
        ],
        // ...
    ],
]

Result Details

Members
errors
Required: Yes
Type: Array of BatchGetTokenBalanceErrorItem structures

An array of BatchGetTokenBalanceErrorItem objects returned from the request.

tokenBalances
Required: Yes
Type: Array of BatchGetTokenBalanceOutputItem structures

An array of BatchGetTokenBalanceOutputItem objects returned by the response.

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

ResourceNotFoundException:

The resource was not found.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

GetAssetContract

$result = $client->getAssetContract([/* ... */]);
$promise = $client->getAssetContractAsync([/* ... */]);

Gets the information about a specific contract deployed on the blockchain.

  • The Bitcoin blockchain networks do not support this operation.

  • Metadata is currently only available for some ERC-20 contracts. Metadata will be available for additional contracts in the future.

Parameter Syntax

$result = $client->getAssetContract([
    'contractIdentifier' => [ // REQUIRED
        'contractAddress' => '<string>', // REQUIRED
        'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET', // REQUIRED
    ],
]);

Parameter Details

Members
contractIdentifier
Required: Yes
Type: ContractIdentifier structure

Contains the blockchain address and network information about the contract.

Result Syntax

[
    'contractIdentifier' => [
        'contractAddress' => '<string>',
        'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
    ],
    'deployerAddress' => '<string>',
    'metadata' => [
        'decimals' => <integer>,
        'name' => '<string>',
        'symbol' => '<string>',
    ],
    'tokenStandard' => 'ERC20|ERC721|ERC1155',
]

Result Details

Members
contractIdentifier
Required: Yes
Type: ContractIdentifier structure

Contains the blockchain address and network information about the contract.

deployerAddress
Required: Yes
Type: string

The address of the deployer of contract.

metadata
Type: ContractMetadata structure

The metadata of the contract.

tokenStandard
Required: Yes
Type: string

The token standard of the contract requested.

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

ResourceNotFoundException:

The resource was not found.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

GetTokenBalance

$result = $client->getTokenBalance([/* ... */]);
$promise = $client->getTokenBalanceAsync([/* ... */]);

Gets the balance of a specific token, including native tokens, for a given address (wallet or contract) on the blockchain.

Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.

Parameter Syntax

$result = $client->getTokenBalance([
    'atBlockchainInstant' => [
        'time' => <integer || string || DateTime>,
    ],
    'ownerIdentifier' => [ // REQUIRED
        'address' => '<string>', // REQUIRED
    ],
    'tokenIdentifier' => [ // REQUIRED
        'contractAddress' => '<string>',
        'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET', // REQUIRED
        'tokenId' => '<string>',
    ],
]);

Parameter Details

Members
atBlockchainInstant
Type: BlockchainInstant structure

The time for when the TokenBalance is requested or the current time if a time is not provided in the request.

This time will only be recorded up to the second.

ownerIdentifier
Required: Yes
Type: OwnerIdentifier structure

The container for the identifier for the owner.

tokenIdentifier
Required: Yes
Type: TokenIdentifier structure

The container for the identifier for the token, including the unique token ID and its blockchain network.

Result Syntax

[
    'atBlockchainInstant' => [
        'time' => <DateTime>,
    ],
    'balance' => '<string>',
    'lastUpdatedTime' => [
        'time' => <DateTime>,
    ],
    'ownerIdentifier' => [
        'address' => '<string>',
    ],
    'tokenIdentifier' => [
        'contractAddress' => '<string>',
        'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
        'tokenId' => '<string>',
    ],
]

Result Details

Members
atBlockchainInstant
Required: Yes
Type: BlockchainInstant structure

The container for time.

balance
Required: Yes
Type: string

The container for the token balance.

lastUpdatedTime
Type: BlockchainInstant structure

The container for time.

ownerIdentifier
Type: OwnerIdentifier structure

The container for the owner identifier.

tokenIdentifier
Type: TokenIdentifier structure

The container for the identifier for the token including the unique token ID and its blockchain network.

Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

ResourceNotFoundException:

The resource was not found.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

GetTransaction

$result = $client->getTransaction([/* ... */]);
$promise = $client->getTransactionAsync([/* ... */]);

Gets the details of a transaction.

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

Parameter Syntax

$result = $client->getTransaction([
    'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET', // REQUIRED
    'transactionHash' => '<string>',
    'transactionId' => '<string>',
]);

Parameter Details

Members
network
Required: Yes
Type: string

The blockchain network where the transaction occurred.

transactionHash
Type: string

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

transactionId
Type: string

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

transactionId is only supported on the Bitcoin networks.

Result Syntax

[
    'transaction' => [
        'blockHash' => '<string>',
        'blockNumber' => '<string>',
        'confirmationStatus' => 'FINAL|NONFINAL',
        'contractAddress' => '<string>',
        'cumulativeGasUsed' => '<string>',
        'effectiveGasPrice' => '<string>',
        'executionStatus' => 'FAILED|SUCCEEDED',
        'from' => '<string>',
        'gasUsed' => '<string>',
        'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
        'numberOfTransactions' => <integer>,
        'signatureR' => '<string>',
        'signatureS' => '<string>',
        'signatureV' => <integer>,
        'to' => '<string>',
        'transactionFee' => '<string>',
        'transactionHash' => '<string>',
        'transactionId' => '<string>',
        'transactionIndex' => <integer>,
        'transactionTimestamp' => <DateTime>,
    ],
]

Result Details

Members
transaction
Required: Yes
Type: Transaction structure

Contains the details of the transaction.

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

ResourceNotFoundException:

The resource was not found.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

ListAssetContracts

$result = $client->listAssetContracts([/* ... */]);
$promise = $client->listAssetContractsAsync([/* ... */]);

Lists all the contracts for a given contract type deployed by an address (either a contract address or a wallet address).

The Bitcoin blockchain networks do not support this operation.

Parameter Syntax

$result = $client->listAssetContracts([
    'contractFilter' => [ // REQUIRED
        'deployerAddress' => '<string>', // REQUIRED
        'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET', // REQUIRED
        'tokenStandard' => 'ERC20|ERC721|ERC1155', // REQUIRED
    ],
    'maxResults' => <integer>,
    'nextToken' => '<string>',
]);

Parameter Details

Members
contractFilter
Required: Yes
Type: ContractFilter structure

Contains the filter parameter for the request.

maxResults
Type: int

The maximum number of contracts to list.

Default: 100

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

nextToken
Type: string

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

Result Syntax

[
    'contracts' => [
        [
            'contractIdentifier' => [
                'contractAddress' => '<string>',
                'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
            ],
            'deployerAddress' => '<string>',
            'tokenStandard' => 'ERC20|ERC721|ERC1155',
        ],
        // ...
    ],
    'nextToken' => '<string>',
]

Result Details

Members
contracts
Required: Yes
Type: Array of AssetContract structures

An array of contract objects that contain the properties for each contract.

nextToken
Type: string

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

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

ListFilteredTransactionEvents

$result = $client->listFilteredTransactionEvents([/* ... */]);
$promise = $client->listFilteredTransactionEventsAsync([/* ... */]);

Lists all the transaction events for an address on the blockchain.

This operation is only supported on the Bitcoin networks.

Parameter Syntax

$result = $client->listFilteredTransactionEvents([
    'addressIdentifierFilter' => [ // REQUIRED
        'transactionEventToAddress' => ['<string>', ...], // REQUIRED
    ],
    'confirmationStatusFilter' => [
        'include' => ['<string>', ...], // REQUIRED
    ],
    'maxResults' => <integer>,
    'network' => '<string>', // REQUIRED
    'nextToken' => '<string>',
    'sort' => [
        'sortBy' => 'blockchainInstant',
        'sortOrder' => 'ASCENDING|DESCENDING',
    ],
    'timeFilter' => [
        'from' => [
            'time' => <integer || string || DateTime>,
        ],
        'to' => [
            'time' => <integer || string || DateTime>,
        ],
    ],
    'voutFilter' => [
        'voutSpent' => true || false, // REQUIRED
    ],
]);

Parameter Details

Members
addressIdentifierFilter
Required: Yes
Type: AddressIdentifierFilter structure

This is the unique public address on the blockchain for which the transaction events are being requested.

confirmationStatusFilter
Type: ConfirmationStatusFilter structure

The container for the ConfirmationStatusFilter that filters for the finality of the results.

maxResults
Type: int

The maximum number of transaction events to list.

Default: 100

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

network
Required: Yes
Type: string

The blockchain network where the transaction occurred.

Valid Values: BITCOIN_MAINNET | BITCOIN_TESTNET

nextToken
Type: string

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

sort

The order by which the results will be sorted.

timeFilter
Type: TimeFilter structure

This container specifies the time frame for the transaction events returned in the response.

voutFilter
Type: VoutFilter structure

This container specifies filtering attributes related to BITCOIN_VOUT event types

Result Syntax

[
    'events' => [
        [
            'blockchainInstant' => [
                'time' => <DateTime>,
            ],
            'confirmationStatus' => 'FINAL|NONFINAL',
            'contractAddress' => '<string>',
            'eventType' => 'ERC20_TRANSFER|ERC20_MINT|ERC20_BURN|ERC20_DEPOSIT|ERC20_WITHDRAWAL|ERC721_TRANSFER|ERC1155_TRANSFER|BITCOIN_VIN|BITCOIN_VOUT|INTERNAL_ETH_TRANSFER|ETH_TRANSFER',
            'from' => '<string>',
            'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
            'spentVoutIndex' => <integer>,
            'spentVoutTransactionHash' => '<string>',
            'spentVoutTransactionId' => '<string>',
            'to' => '<string>',
            'tokenId' => '<string>',
            'transactionHash' => '<string>',
            'transactionId' => '<string>',
            'value' => '<string>',
            'voutIndex' => <integer>,
            'voutSpent' => true || false,
        ],
        // ...
    ],
    'nextToken' => '<string>',
]

Result Details

Members
events
Required: Yes
Type: Array of TransactionEvent structures

The transaction events returned by the request.

nextToken
Type: string

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

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

ListTokenBalances

$result = $client->listTokenBalances([/* ... */]);
$promise = $client->listTokenBalancesAsync([/* ... */]);

This action returns the following for a given blockchain network:

  • Lists all token balances owned by an address (either a contract address or a wallet address).

  • Lists all token balances for all tokens created by a contract.

  • Lists all token balances for a given token.

You must always specify the network property of the tokenFilter when using this operation.

Parameter Syntax

$result = $client->listTokenBalances([
    'maxResults' => <integer>,
    'nextToken' => '<string>',
    'ownerFilter' => [
        'address' => '<string>', // REQUIRED
    ],
    'tokenFilter' => [ // REQUIRED
        'contractAddress' => '<string>',
        'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET', // REQUIRED
        'tokenId' => '<string>',
    ],
]);

Parameter Details

Members
maxResults
Type: int

The maximum number of token balances to return.

Default: 100

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

nextToken
Type: string

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

ownerFilter
Type: OwnerFilter structure

The contract or wallet address on the blockchain network by which to filter the request. You must specify the address property of the ownerFilter when listing balances of tokens owned by the address.

tokenFilter
Required: Yes
Type: TokenFilter structure

The contract address or a token identifier on the blockchain network by which to filter the request. You must specify the contractAddress property of this container when listing tokens minted by a contract.

You must always specify the network property of this container when using this operation.

Result Syntax

[
    'nextToken' => '<string>',
    'tokenBalances' => [
        [
            'atBlockchainInstant' => [
                'time' => <DateTime>,
            ],
            'balance' => '<string>',
            'lastUpdatedTime' => [
                'time' => <DateTime>,
            ],
            'ownerIdentifier' => [
                'address' => '<string>',
            ],
            'tokenIdentifier' => [
                'contractAddress' => '<string>',
                'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
                'tokenId' => '<string>',
            ],
        ],
        // ...
    ],
]

Result Details

Members
nextToken
Type: string

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

tokenBalances
Required: Yes
Type: Array of TokenBalance structures

An array of TokenBalance objects. Each object contains details about the token balance.

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

ListTransactionEvents

$result = $client->listTransactionEvents([/* ... */]);
$promise = $client->listTransactionEventsAsync([/* ... */]);

Lists all the transaction events for a transaction

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

Parameter Syntax

$result = $client->listTransactionEvents([
    'maxResults' => <integer>,
    'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET', // REQUIRED
    'nextToken' => '<string>',
    'transactionHash' => '<string>',
    'transactionId' => '<string>',
]);

Parameter Details

Members
maxResults
Type: int

The maximum number of transaction events to list.

Default: 100

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

network
Required: Yes
Type: string

The blockchain network where the transaction events occurred.

nextToken
Type: string

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

transactionHash
Type: string

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

transactionId
Type: string

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

transactionId is only supported on the Bitcoin networks.

Result Syntax

[
    'events' => [
        [
            'blockchainInstant' => [
                'time' => <DateTime>,
            ],
            'confirmationStatus' => 'FINAL|NONFINAL',
            'contractAddress' => '<string>',
            'eventType' => 'ERC20_TRANSFER|ERC20_MINT|ERC20_BURN|ERC20_DEPOSIT|ERC20_WITHDRAWAL|ERC721_TRANSFER|ERC1155_TRANSFER|BITCOIN_VIN|BITCOIN_VOUT|INTERNAL_ETH_TRANSFER|ETH_TRANSFER',
            'from' => '<string>',
            'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
            'spentVoutIndex' => <integer>,
            'spentVoutTransactionHash' => '<string>',
            'spentVoutTransactionId' => '<string>',
            'to' => '<string>',
            'tokenId' => '<string>',
            'transactionHash' => '<string>',
            'transactionId' => '<string>',
            'value' => '<string>',
            'voutIndex' => <integer>,
            'voutSpent' => true || false,
        ],
        // ...
    ],
    'nextToken' => '<string>',
]

Result Details

Members
events
Required: Yes
Type: Array of TransactionEvent structures

An array of TransactionEvent objects. Each object contains details about the transaction events.

nextToken
Type: string

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

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

ListTransactions

$result = $client->listTransactions([/* ... */]);
$promise = $client->listTransactionsAsync([/* ... */]);

Lists all the transaction events for a transaction.

Parameter Syntax

$result = $client->listTransactions([
    'address' => '<string>', // REQUIRED
    'confirmationStatusFilter' => [
        'include' => ['<string>', ...], // REQUIRED
    ],
    'fromBlockchainInstant' => [
        'time' => <integer || string || DateTime>,
    ],
    'maxResults' => <integer>,
    'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET', // REQUIRED
    'nextToken' => '<string>',
    'sort' => [
        'sortBy' => 'TRANSACTION_TIMESTAMP',
        'sortOrder' => 'ASCENDING|DESCENDING',
    ],
    'toBlockchainInstant' => [
        'time' => <integer || string || DateTime>,
    ],
]);

Parameter Details

Members
address
Required: Yes
Type: string

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

confirmationStatusFilter
Type: ConfirmationStatusFilter structure

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.

fromBlockchainInstant
Type: BlockchainInstant structure

The container for time.

maxResults
Type: int

The maximum number of transactions to list.

Default: 100

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

network
Required: Yes
Type: string

The blockchain network where the transactions occurred.

nextToken
Type: string

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

sort
Type: ListTransactionsSort structure

The order by which the results will be sorted.

toBlockchainInstant
Type: BlockchainInstant structure

The container for time.

Result Syntax

[
    'nextToken' => '<string>',
    'transactions' => [
        [
            'confirmationStatus' => 'FINAL|NONFINAL',
            'network' => 'ETHEREUM_MAINNET|ETHEREUM_SEPOLIA_TESTNET|BITCOIN_MAINNET|BITCOIN_TESTNET',
            'transactionHash' => '<string>',
            'transactionId' => '<string>',
            'transactionTimestamp' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
nextToken
Type: string

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

transactions
Required: Yes
Type: Array of TransactionOutputItem structures

The array of transactions returned by the request.

Errors

ThrottlingException:

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.

ValidationException:

The resource passed is invalid.

AccessDeniedException:

The Amazon Web Services account doesn’t have access to this resource.

InternalServerException:

The request processing has failed because of an internal error in the service.

ServiceQuotaExceededException:

The service quota has been exceeded for this resource.

Shapes

AccessDeniedException

Description

The Amazon Web Services account doesn’t have access to this resource.

Members
message
Required: Yes
Type: string

The container for the exception message.

AddressIdentifierFilter

Description

This is the container for the unique public address on the blockchain.

Members
transactionEventToAddress
Required: Yes
Type: Array of strings

The container for the recipient address of the transaction.

AssetContract

Description

This container contains information about an contract.

Members
contractIdentifier
Required: Yes
Type: ContractIdentifier structure

The container for the contract identifier containing its blockchain network and address.

deployerAddress
Required: Yes
Type: string

The address of the contract deployer.

tokenStandard
Required: Yes
Type: string

The token standard of the contract.

BatchGetTokenBalanceErrorItem

Description

Error generated from a failed BatchGetTokenBalance request.

Members
atBlockchainInstant
Type: BlockchainInstant structure

The container for time.

errorCode
Required: Yes
Type: string

The error code associated with the error.

errorMessage
Required: Yes
Type: string

The message associated with the error.

errorType
Required: Yes
Type: string

The type of error.

ownerIdentifier
Type: OwnerIdentifier structure

The container for the owner identifier.

tokenIdentifier
Type: TokenIdentifier structure

The container for the identifier for the token including the unique token ID and its blockchain network.

Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.

BatchGetTokenBalanceInputItem

Description

The container for the input for getting a token balance.

Members
atBlockchainInstant
Type: BlockchainInstant structure

The container for time.

ownerIdentifier
Required: Yes
Type: OwnerIdentifier structure

The container for the owner identifier.

tokenIdentifier
Required: Yes
Type: TokenIdentifier structure

The container for the identifier for the token including the unique token ID and its blockchain network.

Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.

BatchGetTokenBalanceOutputItem

Description

The container for the properties of a token balance output.

Members
atBlockchainInstant
Required: Yes
Type: BlockchainInstant structure

The container for time.

balance
Required: Yes
Type: string

The container for the token balance.

lastUpdatedTime
Type: BlockchainInstant structure

The container for time.

ownerIdentifier
Type: OwnerIdentifier structure

The container for the owner identifier.

tokenIdentifier
Type: TokenIdentifier structure

The container for the identifier for the token including the unique token ID and its blockchain network.

Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.

BlockchainInstant

Description

The container for time.

Members
time
Type: timestamp (string|DateTime or anything parsable by strtotime)

The container of the Timestamp of the blockchain instant.

This timestamp will only be recorded up to the second.

ConfirmationStatusFilter

Description

The container for the ConfirmationStatusFilter that filters for the finality of the results.

Members
include
Required: Yes
Type: Array of strings

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

ContractFilter

Description

The contract or wallet address by which to filter the request.

Members
deployerAddress
Required: Yes
Type: string

The network address of the deployer.

network
Required: Yes
Type: string

The blockchain network of the contract.

tokenStandard
Required: Yes
Type: string

The container for the token standard.

ContractIdentifier

Description

Container for the blockchain address and network information about a contract.

Members
contractAddress
Required: Yes
Type: string

Container for the blockchain address about a contract.

network
Required: Yes
Type: string

The blockchain network of the contract.

ContractMetadata

Description

The metadata of the contract.

Members
decimals
Type: int

The decimals used by the token contract.

name
Type: string

The name of the token contract.

symbol
Type: string

The symbol of the token contract.

InternalServerException

Description

The request processing has failed because of an internal error in the service.

Members
message
Required: Yes
Type: string

The container for the exception message.

retryAfterSeconds
Type: int

Specifies the retryAfterSeconds value.

ListFilteredTransactionEventsSort

Description

Lists all the transaction events for an address on the blockchain.

This operation is only supported on the Bitcoin blockchain networks.

Members
sortBy
Type: string

Container on how the results will be sorted by?

sortOrder
Type: string

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

ListTransactionsSort

Description

The container for determining how the list transaction result will be sorted.

Members
sortBy
Type: string

Defaults to the value TRANSACTION_TIMESTAMP.

sortOrder
Type: 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.

OwnerFilter

Description

The container for the owner information to filter by.

Members
address
Required: Yes
Type: string

The contract or wallet address.

OwnerIdentifier

Description

The container for the owner identifier.

Members
address
Required: Yes
Type: string

The contract or wallet address for the owner.

ResourceNotFoundException

Description

The resource was not found.

Members
message
Required: Yes
Type: string

The container for the exception message.

resourceId
Required: Yes
Type: string

The resourceId of the resource that caused the exception.

resourceType
Required: Yes
Type: string

The resourceType of the resource that caused the exception.

ServiceQuotaExceededException

Description

The service quota has been exceeded for this resource.

Members
message
Required: Yes
Type: string

The container for the exception message.

quotaCode
Required: Yes
Type: string

The container for the quotaCode.

resourceId
Required: Yes
Type: string

The resourceId of the resource that caused the exception.

resourceType
Required: Yes
Type: string

The resourceType of the resource that caused the exception.

serviceCode
Required: Yes
Type: string

The container for the serviceCode.

ThrottlingException

Description

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.

Members
message
Required: Yes
Type: string

The container for the exception message.

quotaCode
Required: Yes
Type: string

The container for the quotaCode.

retryAfterSeconds
Type: int

The container of the retryAfterSeconds value.

serviceCode
Required: Yes
Type: string

The container for the serviceCode.

TimeFilter

Description

This container is used to specify a time frame.

Members
from
Type: BlockchainInstant structure

The container for time.

to
Type: BlockchainInstant structure

The container for time.

TokenBalance

Description

The balance of the token.

Members
atBlockchainInstant
Required: Yes
Type: BlockchainInstant structure

The time for when the TokenBalance is requested or the current time if a time is not provided in the request.

This time will only be recorded up to the second.

balance
Required: Yes
Type: string

The container of the token balance.

lastUpdatedTime
Type: BlockchainInstant structure

The Timestamp of the last transaction at which the balance for the token in the wallet was updated.

ownerIdentifier
Type: OwnerIdentifier structure

The container for the identifier of the owner.

tokenIdentifier
Type: TokenIdentifier structure

The identifier for the token, including the unique token ID and its blockchain network.

TokenFilter

Description

The container of the token filter like the contract address on a given blockchain network or a unique token identifier on a given blockchain network.

You must always specify the network property of this container when using this operation.

Members
contractAddress
Type: string

This is the address of the contract.

network
Required: Yes
Type: string

The blockchain network of the token.

tokenId
Type: string

The unique identifier of the token.

TokenIdentifier

Description

The container for the identifier for the token including the unique token ID and its blockchain network.

Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.

Members
contractAddress
Type: string

This is the token's contract address.

network
Required: Yes
Type: string

The blockchain network of the token.

tokenId
Type: string

The unique identifier of the token.

For native tokens, use the 3 character abbreviation that best matches your token. For example, btc for Bitcoin, eth for Ether, etc. For all other token types you must specify the tokenId in the 64 character hexadecimal tokenid format.

Transaction

Description

There are two possible types of transactions used for this data type:

  • A Bitcoin transaction is a movement of BTC from one address to another.

  • An Ethereum transaction refers to an action initiated by an externally owned account, which is an account managed by a human, not a contract. For example, if Bob sends Alice 1 ETH, Bob's account must be debited and Alice's must be credited. This state-changing action occurs within a transaction.

Members
blockHash
Type: 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.

blockNumber
Type: string

The block number in which the transaction is recorded.

confirmationStatus
Type: string

Specifies whether the transaction has reached Finality.

contractAddress
Type: string

The blockchain address for the contract.

cumulativeGasUsed
Type: string

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

effectiveGasPrice
Type: string

The effective gas price.

executionStatus
Type: string

Identifies whether the transaction has succeeded or failed.

from
Type: string

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

gasUsed
Type: string

The amount of gas used for the transaction.

network
Required: Yes
Type: string

The blockchain network where the transaction occurred.

numberOfTransactions
Required: Yes
Type: long (int|float)

The number of transactions in the block.

signatureR
Type: string

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

signatureS
Type: string

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

signatureV
Type: int

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

to
Required: Yes
Type: string

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

transactionFee
Type: string

The transaction fee.

transactionHash
Required: Yes
Type: string

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

transactionId
Type: string

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

transactionIndex
Required: Yes
Type: long (int|float)

The index of the transaction within a blockchain.

transactionTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The Timestamp of the transaction.

TransactionEvent

Description

The container for the properties of a transaction event.

Members
blockchainInstant
Type: BlockchainInstant structure

The container for time.

confirmationStatus
Type: string

This container specifies whether the transaction has reached Finality.

contractAddress
Type: string

The blockchain address for the contract

eventType
Required: Yes
Type: string

The type of transaction event.

from
Type: string

The wallet address initiating the transaction. It can either be a public key or a contract.

network
Required: Yes
Type: string

The blockchain network where the transaction occurred.

spentVoutIndex
Type: int

The position of the spent transaction output in the output list of the creating transaction.

This is only returned for BITCOIN_VIN event types.

spentVoutTransactionHash
Type: string

The transactionHash that created the spent transaction output.

This is only returned for BITCOIN_VIN event types.

spentVoutTransactionId
Type: string

The transactionId that created the spent transaction output.

This is only returned for BITCOIN_VIN event types.

to
Type: string

The wallet address receiving the transaction. It can either be a public key or a contract.

tokenId
Type: string

The unique identifier for the token involved in the transaction.

transactionHash
Required: Yes
Type: string

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

transactionId
Type: string

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

value
Type: string

The value that was transacted.

voutIndex
Type: int

The position of the transaction output in the transaction output list.

voutSpent
Type: boolean

Specifies if the transaction output is spent or unspent. This is only returned for BITCOIN_VOUT event types.

This is only returned for BITCOIN_VOUT event types.

TransactionOutputItem

Description

The container of the transaction output.

Members
confirmationStatus
Type: string

Specifies whether to list transactions that have not reached Finality.

network
Required: Yes
Type: string

The blockchain network where the transaction occurred.

transactionHash
Required: Yes
Type: string

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

transactionId
Type: string

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

transactionTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The time when the transaction occurred.

ValidationException

Description

The resource passed is invalid.

Members
fieldList
Type: Array of ValidationExceptionField structures

The container for the fieldList of the exception.

message
Required: Yes
Type: string

The container for the exception message.

reason
Required: Yes
Type: string

The container for the reason for the exception

ValidationExceptionField

Description

The resource passed is invalid.

Members
message
Required: Yes
Type: string

The ValidationException message.

name
Required: Yes
Type: string

The name of the field that triggered the ValidationException.

VoutFilter

Description

This container specifies filtering attributes related to BITCOIN_VOUT event types

Members
voutSpent
Required: Yes
Type: boolean

Specifies if the transaction output is spent or unspent.