This microservice is used to provide ultimately simple API for fetching token metadata for FA1.2 and FA2 tokens. Metadata fetching algorithm relies on Taquito's TZIP-12/TZIP-16 libraries.
The service can accept the following ENV
variables:
Variable | Default | Description |
---|---|---|
PORT |
3000 |
Expected server port |
RPC_URL |
"https://mainnet-tezos.giganode.io/" |
RPC URL to be used |
READ_ONLY_SIGNER_PK |
edpkvWbk81uh1DEvdWKR4g1bjyTGhdu1mDvznPUFE2zDwNsLXrEb9K |
Public key of account with balance used for dry-running |
READ_ONLY_SIGNER_PK_HASH |
tz1fVQangAfb9J1hRRMP2bSB6LvASD6KpY8A |
Public key hash of account with balance used for dry-running |
For default mainnet configuration, they might be left unchanged.
The following endpoints are currently available:
/healthz
{ "message": "OK" }
/metadata/:address/:tokenId
, where:address
is a token contract address (e.g.KT1A5P4ejnLix13jtadsfV9GCnXLMNnab8UT
) and:tokenId
is a token ID for FA2 or always0
for FA1.2 tokens. Response is received in the following format:
{
"decimals": 10,
"symbol": "KALAM",
"name": "Kalamint",
"thumbnailUri": "ipfs://Qme9FX9M7o2PZt9h6rvkUbfXoLpQr1HsuMQi6sL5Y75g3A"
}
- [POST]
/
, wherebody
structure looks like:
[
"KT1VYsVfmobT7rsMVivvZ4J8i3bPiqz12NaH_0",
"KT1XPFjZqCULSnqfKaaYy8hJjeY63UNSGwXg_0"
]
- is an array of token slugs:
"{{token_contract_address}}_{{token_id}}"
for tokens. For FA1.2 tokenstoken_id
must be0
.
[
{
"decimals": 6,
"symbol": "wXTZ",
"name": "Wrapped Tezos"
},
{
"decimals": 8,
"symbol": "crDAO",
"name": "Crunchy DAO"
}
]
- NodeJS and yarn:
yarn && yarn start
- Docker:
docker build -t tez-metadata .
docker run -p 3000:3000 tez-metadata