Skip to main content

getTokenDetails

Description

getTokenDetails is a function that returns the details of a token.

Pre-requisites

To use this function for local development, make sure that you have the following environment variables set:

CODEX_API_KEY=xxx

Usage

import { getTokenDetails } from "@moxie-protocol/moxie-agent-lib";

const tokenDetails = await getTokenDetails(tokenAddress);

Response

{
"tokenName": "ETH",
"tokenSymbol": "ETH",
"tokenAddress": "0x0000000000000000000000000000000000000000",
"networkId": 8453,
"priceUSD": "42000",
"liquidityTop3PoolsUSD": "1000000",
"fullyDilutedMarketCapUSD": "1000000",
"uniqueHolders": 1000000,
"uniqueBuysLast1Hour": 1000000,
"uniqueBuysLast4Hours": 1000000,
"uniqueBuysLast12Hours": 1000000,
"uniqueBuysLast24Hours": 1000000,
"uniqueSellsLast1Hour": 1000000,
"uniqueSellsLast4Hours": 1000000,
"uniqueSellsLast12Hours": 1000000,
"uniqueSellsLast24Hours": 1000000,
"changePercent1Hour": "1000000",
"changePercent4Hours": "1000000",
"changePercent12Hours": "1000000",
"changePercent24Hours": "1000000",
"high1Hour": "1000000",
"high4Hours": "1000000",
"high12Hours": "1000000",
"high24Hours": "1000000",
"low1Hour": "1000000",
"low4Hours": "1000000",
"low12Hours": "1000000",
"low24Hours": "1000000",
"volumeChange1Hour": "1000000",
"volumeChange4Hours": "1000000",
"volumeChange12Hours": "1000000",
"volumeChange24Hours": "1000000",
"liquidityPools": [
{
"poolAddress": "0x0000000000000000000000000000000000000000",
"poolName": "ETH/USD",
"liquidityUSD": 1000000
}
]
}

Type Signature

export async function getTokenDetails(
tokenAddresses: string[]
): Promise<TokenDetails[]>;

Parameters

ParameterTypeDescription
tokenAddressesstring[]The addresses of the tokens to get details for

Fields

FieldTypeDescription
tokenNamestringThe name of the token
tokenSymbolstringThe symbol of the token
tokenAddressstringThe address of the token
networkIdnumberThe network ID of the token
priceUSDstringThe price of the token in USD
liquidityTop3PoolsUSDstringThe liquidity of the token in USD
fullyDilutedMarketCapUSDstringThe fully diluted market cap of the token in USD
uniqueHoldersnumberThe number of unique holders of the token
uniqueBuysLast1HournumberThe number of unique buys in the last 1 hour
uniqueBuysLast4HoursnumberThe number of unique buys in the last 4 hours
uniqueBuysLast12HoursnumberThe number of unique buys in the last 12 hours
uniqueBuysLast24HoursnumberThe number of unique buys in the last 24 hours
uniqueSellsLast1HournumberThe number of unique sells in the last 1 hour
uniqueSellsLast4HoursnumberThe number of unique sells in the last 4 hours
uniqueSellsLast12HoursnumberThe number of unique sells in the last 12 hours
uniqueSellsLast24HoursnumberThe number of unique sells in the last 24 hours
changePercent1HourstringThe change percent in the last 1 hour
changePercent4HoursstringThe change percent in the last 4 hours
changePercent12HoursstringThe change percent in the last 12 hours
changePercent24HoursstringThe change percent in the last 24 hours
high1HourstringThe high price in the last 1 hour
high4HoursstringThe high price in the last 4 hours
high12HoursstringThe high price in the last 12 hours
high24HoursstringThe high price in the last 24 hours
low1HourstringThe low price in the last 1 hour
low4HoursstringThe low price in the last 4 hours
low12HoursstringThe low price in the last 12 hours
low24HoursstringThe low price in the last 24 hours
volumeChange1HourstringThe volume change in the last 1 hour
volumeChange4HoursstringThe volume change in the last 4 hours
volumeChange12HoursstringThe volume change in the last 12 hours
volumeChange24HoursstringThe volume change in the last 24 hours
liquidityPoolsLiquidityPool[]The liquidity pools of the token