/* 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';
import type { Transaction } from './Transaction';
import {
    TransactionFromJSON,
    TransactionFromJSONTyped,
    TransactionToJSON,
    TransactionToJSONTyped,
} from './Transaction';
import type { TokenHolding } from './TokenHolding';
import {
    TokenHoldingFromJSON,
    TokenHoldingFromJSONTyped,
    TokenHoldingToJSON,
    TokenHoldingToJSONTyped,
} from './TokenHolding';
import type { ScanFlag } from './ScanFlag';
import {
    ScanFlagFromJSON,
    ScanFlagFromJSONTyped,
    ScanFlagToJSON,
    ScanFlagToJSONTyped,
} from './ScanFlag';
import type { AppDomainTokenModelsRiskLevel } from './AppDomainTokenModelsRiskLevel';
import {
    AppDomainTokenModelsRiskLevelFromJSON,
    AppDomainTokenModelsRiskLevelFromJSONTyped,
    AppDomainTokenModelsRiskLevelToJSON,
    AppDomainTokenModelsRiskLevelToJSONTyped,
} from './AppDomainTokenModelsRiskLevel';

/**
 * Full wallet analysis — risk + tokens + recent activity.
 * @export
 * @interface WalletAnalysis
 */
export interface WalletAnalysis {
    /**
     * 
     * @type {string}
     * @memberof WalletAnalysis
     */
    address: string;
    /**
     * 
     * @type {string}
     * @memberof WalletAnalysis
     */
    chain: string;
    /**
     * 
     * @type {string}
     * @memberof WalletAnalysis
     */
    truncatedAddress: string;
    /**
     * 
     * @type {number}
     * @memberof WalletAnalysis
     */
    riskScore?: number;
    /**
     * 
     * @type {AppDomainTokenModelsRiskLevel}
     * @memberof WalletAnalysis
     */
    riskLevel: AppDomainTokenModelsRiskLevel;
    /**
     * 
     * @type {Array<TokenHolding>}
     * @memberof WalletAnalysis
     */
    tokens?: Array<TokenHolding>;
    /**
     * 
     * @type {Array<Transaction>}
     * @memberof WalletAnalysis
     */
    recentTransactions?: Array<Transaction>;
    /**
     * Known labels (e.g. 'Binance', 'Vitalik')
     * @type {Array<string>}
     * @memberof WalletAnalysis
     */
    labels?: Array<string>;
    /**
     * 
     * @type {Array<ScanFlag>}
     * @memberof WalletAnalysis
     */
    flags?: Array<ScanFlag>;
    /**
     * 
     * @type {number}
     * @memberof WalletAnalysis
     */
    totalValueUsd?: number;
    /**
     * 
     * @type {Date}
     * @memberof WalletAnalysis
     */
    analyzedAt?: Date;
}



/**
 * Check if a given object implements the WalletAnalysis interface.
 */
export function instanceOfWalletAnalysis(value: object): value is WalletAnalysis {
    if (!('address' in value) || value['address'] === undefined) return false;
    if (!('chain' in value) || value['chain'] === undefined) return false;
    if ((!('truncatedAddress' in value) && !('truncated_address' in value)) || (value['truncatedAddress'] === undefined && value['truncated_address'] === undefined)) return false;
    if ((!('riskLevel' in value) && !('risk_level' in value)) || (value['riskLevel'] === undefined && value['risk_level'] === undefined)) return false;
    return true;
}

export function WalletAnalysisFromJSON(json: any): WalletAnalysis {
    return WalletAnalysisFromJSONTyped(json, false);
}

export function WalletAnalysisFromJSONTyped(json: any, ignoreDiscriminator: boolean): WalletAnalysis {
    if (json == null) {
        return json;
    }
    return {
        
        'address': json['address'],
        'chain': json['chain'],
        'truncatedAddress': json['truncated_address'],
        'riskScore': json['risk_score'] == null ? undefined : json['risk_score'],
        'riskLevel': AppDomainTokenModelsRiskLevelFromJSON(json['risk_level']),
        'tokens': json['tokens'] == null ? undefined : ((json['tokens'] as Array<any>).map(TokenHoldingFromJSON)),
        'recentTransactions': json['recent_transactions'] == null ? undefined : ((json['recent_transactions'] as Array<any>).map(TransactionFromJSON)),
        'labels': json['labels'] == null ? undefined : json['labels'],
        'flags': json['flags'] == null ? undefined : ((json['flags'] as Array<any>).map(ScanFlagFromJSON)),
        'totalValueUsd': json['total_value_usd'] == null ? undefined : json['total_value_usd'],
        'analyzedAt': json['analyzed_at'] == null ? undefined : (new Date(json['analyzed_at'])),
    };
}

export function WalletAnalysisToJSON(json: any): WalletAnalysis {
    return WalletAnalysisToJSONTyped(json, false);
}

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

    return {
        
        'address': value['address'],
        'chain': value['chain'],
        'truncated_address': value['truncatedAddress'],
        'risk_score': value['riskScore'],
        'risk_level': AppDomainTokenModelsRiskLevelToJSON(value['riskLevel']),
        'tokens': value['tokens'] == null ? undefined : ((value['tokens'] as Array<any>).map(TokenHoldingToJSON)),
        'recent_transactions': value['recentTransactions'] == null ? undefined : ((value['recentTransactions'] as Array<any>).map(TransactionToJSON)),
        'labels': value['labels'],
        'flags': value['flags'] == null ? undefined : ((value['flags'] as Array<any>).map(ScanFlagToJSON)),
        'total_value_usd': value['totalValueUsd'],
        'analyzed_at': value['analyzedAt'] == null ? value['analyzedAt'] : value['analyzedAt'].toISOString(),
    };
}

