/* tslint:disable */
/* eslint-disable */
/**
 * RMI Backend
 * Rug Munch Intelligence — institutional-grade crypto intelligence API. 13+ chains, 96 data providers, 8 MCP tools, x402 paid tier, sovereign-first FOSS.
 *
 * The version of the OpenAPI document: 2026.06.21
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
/**
 * Full token details — metadata + supply + verification.
 * @export
 * @interface TokenDetail
 */
export interface TokenDetail {
    /**
     * 
     * @type {string}
     * @memberof TokenDetail
     */
    address: string;
    /**
     * 
     * @type {string}
     * @memberof TokenDetail
     */
    chain: string;
    /**
     * 
     * @type {string}
     * @memberof TokenDetail
     */
    name?: string;
    /**
     * 
     * @type {string}
     * @memberof TokenDetail
     */
    symbol?: string;
    /**
     * 
     * @type {number}
     * @memberof TokenDetail
     */
    decimals?: number;
    /**
     * 
     * @type {number}
     * @memberof TokenDetail
     */
    totalSupply?: number;
    /**
     * 
     * @type {number}
     * @memberof TokenDetail
     */
    circulatingSupply?: number;
    /**
     * 
     * @type {number}
     * @memberof TokenDetail
     */
    holders?: number;
    /**
     * 
     * @type {boolean}
     * @memberof TokenDetail
     */
    verified?: boolean;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof TokenDetail
     */
    metadata?: { [key: string]: any; };
    /**
     * 
     * @type {Date}
     * @memberof TokenDetail
     */
    fetchedAt?: Date;
}

/**
 * Check if a given object implements the TokenDetail interface.
 */
export function instanceOfTokenDetail(value: object): value is TokenDetail {
    if (!('address' in value) || value['address'] === undefined) return false;
    if (!('chain' in value) || value['chain'] === undefined) return false;
    return true;
}

export function TokenDetailFromJSON(json: any): TokenDetail {
    return TokenDetailFromJSONTyped(json, false);
}

export function TokenDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenDetail {
    if (json == null) {
        return json;
    }
    return {
        
        'address': json['address'],
        'chain': json['chain'],
        'name': json['name'] == null ? undefined : json['name'],
        'symbol': json['symbol'] == null ? undefined : json['symbol'],
        'decimals': json['decimals'] == null ? undefined : json['decimals'],
        'totalSupply': json['total_supply'] == null ? undefined : json['total_supply'],
        'circulatingSupply': json['circulating_supply'] == null ? undefined : json['circulating_supply'],
        'holders': json['holders'] == null ? undefined : json['holders'],
        'verified': json['verified'] == null ? undefined : json['verified'],
        'metadata': json['metadata'] == null ? undefined : json['metadata'],
        'fetchedAt': json['fetched_at'] == null ? undefined : (new Date(json['fetched_at'])),
    };
}

export function TokenDetailToJSON(json: any): TokenDetail {
    return TokenDetailToJSONTyped(json, false);
}

export function TokenDetailToJSONTyped(value?: TokenDetail | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'address': value['address'],
        'chain': value['chain'],
        'name': value['name'],
        'symbol': value['symbol'],
        'decimals': value['decimals'],
        'total_supply': value['totalSupply'],
        'circulating_supply': value['circulatingSupply'],
        'holders': value['holders'],
        'verified': value['verified'],
        'metadata': value['metadata'],
        'fetched_at': value['fetchedAt'] == null ? value['fetchedAt'] : value['fetchedAt'].toISOString(),
    };
}

