Skip to main content

getTokenMetadata

Description

getTokenMetadata is a function that returns the metadata of a token.

Pre-requisites

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

ZAPPER_API_KEY=xxx
ZAPPER_API_URL=https://public.zapper.xyz/graphql

Usage

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

const tokenMetadata = await getTokenMetadata(tokenAddress, runtime);

Response

{
"name": "ETH",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH"
}

Type Signatures

export async function getTokenMetadata(
tokenAddress: string,
runtime: IAgentRuntime
): Promise<ZapperTokenDetails>;

Parameters

ParameterTypeDescription
tokenAddressstringThe address of the token
runtimeIAgentRuntimeThe runtime to use

Fields

FieldTypeDescription
namestringThe name of the token
addressstringThe address of the token
symbolstringThe symbol of the token