Skip to content

aws.managedblockchain_query.list_token_balances

Example SQL Queries

SELECT * FROM
aws.managedblockchain_query.list_token_balances
WHERE
"token_filter" = 'VALUE';

Description

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.

Table Definition

Column NameColumn Data Type
token_filter Required Input Column

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.

STRUCT(
"network" VARCHAR,
"contract_address" VARCHAR,
"token_id" VARCHAR
)
Show child fields
token_filter.contract_address

This is the address of the contract.

token_filter.network

The blockchain network of the token.

token_filter.token_id

The unique identifier of the token.

owner_filter Input Column

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.

STRUCT(
"address" VARCHAR
)
Show child fields
owner_filter.address

The contract or wallet address.

_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
at_blockchain_instant

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.

STRUCT(
"time" TIMESTAMP_S
)
Show child fields
at_blockchain_instant.time

The container of the Timestamp of the blockchain instant.

This timestamp will only be recorded up to the second.

balance

The container of the token balance.

VARCHAR
last_updated_time

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

STRUCT(
"time" TIMESTAMP_S
)
Show child fields
last_updated_time.time

The container of the Timestamp of the blockchain instant.

This timestamp will only be recorded up to the second.

owner_identifier

The container for the identifier of the owner.

STRUCT(
"address" VARCHAR
)
Show child fields
owner_identifier.address

The contract or wallet address for the owner.

token_identifier

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

STRUCT(
"network" VARCHAR,
"contract_address" VARCHAR,
"token_id" VARCHAR
)
Show child fields
token_identifier.contract_address

This is the token's contract address.

token_identifier.network

The blockchain network of the token.

token_identifier.token_id

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.