任意のウォレットやコントラクトアドレスにおけるネイティブトークン、ERC20、ERC721、ERC1155トークンの一覧と残高、メタデータを取得します。
Sequence IndexerGetTokenBalances
Method:
- Request: POST /rpc/Indexer/GetTokenBalances
- Content-Type: application/json
- ボディ(JSON形式):
accountAddress
(string) — the wallet account addressincludeMetadata
(boolean - optional - default: false) — toggle token metadata to be included in the responsemetadataOptions
(object - optional) — additional options for metadataverifiedOnly
(boolean - optional) — return only contracts which are ‘verified’ to help reduce spamincludeContracts
([]string - optional) — list of specific contract addresses to always be included, even if verifiedOnly is enabled.
includeCollectionTokens
(boolean - optional - default: true) — toggle to represent ERC721 / ERC1155 tokens as a single summary item in the response
PRO TIP: fetching ERC721/1155 token IDsデフォルトでは、
GetTokenBalances
は各コントラクトごとに最大1つのトークンインスタンスのみ返します。
ERC721/1155トークン残高を取得するには、contractAddress
をGetTokenBalances
メソッドに渡す必要があります。
これにより、指定したcontractAddress
からaccountAddress
が所有するすべてのトークンが返されます。
詳細は下記のセクションをご覧ください。ERC721およびERC1155コレクションのトークンID、残高、メタデータを取得します。
Sequence IndexerGetTokenBalances
Method:
- Request: POST /rpc/Indexer/GetTokenBalances
- Content-Type: application/json
- ボディ(JSON形式):
accountAddress
(string) — the wallet account addresscontractAddress
(string) — the contract address of the ERC721 / ERC1155 collectionincludeMetadata
(boolean - optional - default: false) — toggle token metadata to be included in the responsemetadataOptions
(object - optional) — additional options for metadataverifiedOnly
(boolean - optional) — return only contracts which are ‘verified’ to help reduce spamincludeContracts
([]string - optional) — list of specific contract addresses to always be included, even if verifiedOnly is enabled.
Example:
GetTokenBalances
of a contract + account address on Polygon using an PROJECT_ACCESS_KEY