We're now supporting Polygon zkEVM!
Learn more here.

Contents

qn_getTokenMetadataByContractAddress (v2) RPC Method

The API credit value for this method is 4 . To learn more about API credits and each method's value, visit the API Credits page.

Please note that this RPC method requires the Token and NFT API v2 bundle add-on enabled on your QuickNode endpoint.

Parameters:

  1. array - An array with the first element being:

    object - A custom object with the following fields:

    contract - string - The ERC-20 contract address you'd like to get token details for

Returns:

  1. object - The custom response object, or null if no token details found:

    name - The name of this token

    symbol - The symbol for this token

    decimals - The number of decimals this token utilizes

    genesisBlock - The block number in which this contract was deployed

    genesisTransaction - The hash of the transaction in which this contract was deployed

Code Examples:

import requests
import json

url = "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/"

payload = json.dumps({
  "id": 67,
  "jsonrpc": "2.0",
  "method": "qn_getTokenMetadataByContractAddress",
  "params": [{
    "contract": "0x4d224452801ACEd8B2F0aebE155379bb5D594381"
  }]
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
Ready to get started? Create a free account