API Reference

To get the details of an asset by its unique id in the Map3 database send a GET request to /v1/asset?id=, and the response will be an Asset object.

Request

id - The unique asset id in the Map3 database

Responses
200 - Success

An Asset object.

404 - Not Found

If an asset with the given id cannot be found in the database.

401 - Unauthorized

If the API server has been configured to authenticate and a valid access token has not been provided in the request.

Example
curl -H "Authorization: Bearer \<AUTH TOKEN>" <https://api.map3.xyz/v1/asset>
fetch("<https://api.map3.xyz/v1/asset">, { "headers": {  
    "Authorization": "Bearer \<AUTH TOKEN>" } })

Get asset by network code and address

To get the details of an asset on a specific network by network code and address, send a GET request to /v1/asset?network_code=<code>&address=<address>. The response will be an Asset object.

Request

code - The network code (e.g. ethereum)

address - the address of the asset on the network

Responses
200 - Success

An Asset object.

404 - Not Found

If the asset does not exist on the given network with the specified address.

401 - Unauthorized

If the API server has been configured to authenticate and a valid access token has not been provided in the request.

Example
curl -H "Authorization: Bearer &lt;AUTH TOKEN&gt;" https://api.map3.xyz/v1/asset?network_code=ethereum&address=0x0000000000085d4780B73119b644AE5ecd22b376 
fetch("https://api.map3.xyz/v1/asset?network_code=ethereum&address=0x0000000000085d4780B73119b644AE5ecd22b376", &#123; "headers": &#123;
    "Authorization": "Bearer &lt;AUTH TOKEN&gt;" &#125; &#125;)

Network Schema

type locales = 'en' | 'es' | 'fr' | 'de' | 'it' | 'ja' | 'ko' | 'pt' | 'ru' | 'zh';

export type Description = {
    [locale in locales]?: string
}

export interface Links {
    explorer?: string;
    research?: string;
    website?: string;
    github?: string;
    medium?: string;
    twitter?: string;
    reddit?: string;
    whitepaper?: string;
}

export interface Verification {
    verified: boolean;
    type: string; 
    timestamp: string;
    proof: VerificationProof; 
}

// TODO extend VerificationProof to include different types 
type VerificationProof = AdminVerificationProof;

interface AdminVerificationProof  {
    signature: string;
    assertion: string;
}

enum TagName {
    STABLECOIN = 'stablecoin',
    STAKING = 'staking',
    WRAPPED = 'wrapped',
    LEVERAGED = 'leveraged',
    BULL = 'bull',
    BEAR = 'bear'
}

interface Tag {
    name: TagName;
    description: string;
}

type TokenListTagInfo = {
    [key in TagName]: Tag
}

interface Asset {
    id: string;
    type: 'asset';
    address: string;
    networkCode: string;
    active: boolean;
    color: string | null;
    decimals: number;
    description: Description | null;// foreign keys
    links: Links | null; // foreign keys
    logo: Logos | null; // foreign keys
    name: string;
    spam: boolean;
    symbol: string;
    tags: TagName[] | []; // foreign keys
    type: ObjectType; // not persisted
    verifications: Verification[] | [] // foreign keys
    version: Version | string;
}

Example

{
    "active": true,
    "address": "0x0000000000085d4780B73119b644AE5ecd22b376",
    "color": null,
    "decimals": 18,
    "description": null,
    "id": "41178fe4-51ba-457f-a18c-7f763fad96fa",
    "links": null,
    "logo": {
        "png": "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0x0000000000085d4780B73119b644AE5ecd22b376/logo.png"
    },
    "name": "TrueUSD",
    "networkId": "ethereum",
    "spam": false,
    "symbol": "TUSD",
    "tags": [
        "stablecoin"
    ],
    "type": "asset",
    "verifications": [],
    "version": "0.0.1"
}