/* 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';
/**
 * A single token holding within a wallet's portfolio.
 * @export
 * @interface TokenHolding
 */
export interface TokenHolding {
    /**
     * 
     * @type {string}
     * @memberof TokenHolding
     */
    symbol: string;
    /**
     * 
     * @type {string}
     * @memberof TokenHolding
     */
    address?: string;
    /**
     * 
     * @type {number}
     * @memberof TokenHolding
     */
    amount?: number;
    /**
     * 
     * @type {number}
     * @memberof TokenHolding
     */
    priceUsd?: number;
    /**
     * 
     * @type {number}
     * @memberof TokenHolding
     */
    valueUsd?: number;
}

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

export function TokenHoldingFromJSON(json: any): TokenHolding {
    return TokenHoldingFromJSONTyped(json, false);
}

export function TokenHoldingFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenHolding {
    if (json == null) {
        return json;
    }
    return {
        
        'symbol': json['symbol'],
        'address': json['address'] == null ? undefined : json['address'],
        'amount': json['amount'] == null ? undefined : json['amount'],
        'priceUsd': json['price_usd'] == null ? undefined : json['price_usd'],
        'valueUsd': json['value_usd'] == null ? undefined : json['value_usd'],
    };
}

export function TokenHoldingToJSON(json: any): TokenHolding {
    return TokenHoldingToJSONTyped(json, false);
}

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

    return {
        
        'symbol': value['symbol'],
        'address': value['address'],
        'amount': value['amount'],
        'price_usd': value['priceUsd'],
        'value_usd': value['valueUsd'],
    };
}

