/* 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 * as runtime from '../runtime';
import {
    type HTTPValidationError,
    HTTPValidationErrorFromJSON,
    HTTPValidationErrorToJSON,
} from '../models/HTTPValidationError';
import {
    type PaginatedResponse,
    PaginatedResponseFromJSON,
    PaginatedResponseToJSON,
} from '../models/PaginatedResponse';
import {
    type TokenDetail,
    TokenDetailFromJSON,
    TokenDetailToJSON,
} from '../models/TokenDetail';
import {
    type TokenRisk,
    TokenRiskFromJSON,
    TokenRiskToJSON,
} from '../models/TokenRisk';
import {
    type TokenScanRequest,
    TokenScanRequestFromJSON,
    TokenScanRequestToJSON,
} from '../models/TokenScanRequest';
import {
    type TokenScanResult,
    TokenScanResultFromJSON,
    TokenScanResultToJSON,
} from '../models/TokenScanResult';

export interface GetDetailApiV1TokenAddressGetRequest {
    address: string;
    chain?: string;
}

export interface GetHoldersApiV1TokenAddressHoldersGetRequest {
    address: string;
    chain?: string;
    limit?: number;
}

export interface GetLiquidityApiV1TokenAddressLiquidityGetRequest {
    address: string;
    chain?: string;
}

export interface GetRiskApiV1TokenAddressRiskGetRequest {
    address: string;
    chain?: string;
}

export interface ScanApiV1TokenScanPostRequest {
    tokenScanRequest: TokenScanRequest;
}

/**
 * 
 */
export class TokenApi extends runtime.BaseAPI {

    /**
     * Creates request options for getDetailApiV1TokenAddressGet without sending the request
     */
    async getDetailApiV1TokenAddressGetRequestOpts(requestParameters: GetDetailApiV1TokenAddressGetRequest): Promise<runtime.RequestOpts> {
        if (requestParameters['address'] == null) {
            throw new runtime.RequiredError(
                'address',
                'Required parameter "address" was null or undefined when calling getDetailApiV1TokenAddressGet().'
            );
        }

        const queryParameters: any = {};

        if (requestParameters['chain'] != null) {
            queryParameters['chain'] = requestParameters['chain'];
        }

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/token/{address}`;
        urlPath = urlPath.replace('{address}', encodeURIComponent(String(requestParameters['address'])));

        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Token metadata + supply + verification.
     * Get Detail
     */
    async getDetailApiV1TokenAddressGetRaw(requestParameters: GetDetailApiV1TokenAddressGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenDetail>> {
        const requestOptions = await this.getDetailApiV1TokenAddressGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TokenDetailFromJSON(jsonValue));
    }

    /**
     * Token metadata + supply + verification.
     * Get Detail
     */
    async getDetailApiV1TokenAddressGet(requestParameters: GetDetailApiV1TokenAddressGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenDetail> {
        const response = await this.getDetailApiV1TokenAddressGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for getHoldersApiV1TokenAddressHoldersGet without sending the request
     */
    async getHoldersApiV1TokenAddressHoldersGetRequestOpts(requestParameters: GetHoldersApiV1TokenAddressHoldersGetRequest): Promise<runtime.RequestOpts> {
        if (requestParameters['address'] == null) {
            throw new runtime.RequiredError(
                'address',
                'Required parameter "address" was null or undefined when calling getHoldersApiV1TokenAddressHoldersGet().'
            );
        }

        const queryParameters: any = {};

        if (requestParameters['chain'] != null) {
            queryParameters['chain'] = requestParameters['chain'];
        }

        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/token/{address}/holders`;
        urlPath = urlPath.replace('{address}', encodeURIComponent(String(requestParameters['address'])));

        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Top token holders.
     * Get Holders
     */
    async getHoldersApiV1TokenAddressHoldersGetRaw(requestParameters: GetHoldersApiV1TokenAddressHoldersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponse>> {
        const requestOptions = await this.getHoldersApiV1TokenAddressHoldersGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseFromJSON(jsonValue));
    }

    /**
     * Top token holders.
     * Get Holders
     */
    async getHoldersApiV1TokenAddressHoldersGet(requestParameters: GetHoldersApiV1TokenAddressHoldersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponse> {
        const response = await this.getHoldersApiV1TokenAddressHoldersGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for getLiquidityApiV1TokenAddressLiquidityGet without sending the request
     */
    async getLiquidityApiV1TokenAddressLiquidityGetRequestOpts(requestParameters: GetLiquidityApiV1TokenAddressLiquidityGetRequest): Promise<runtime.RequestOpts> {
        if (requestParameters['address'] == null) {
            throw new runtime.RequiredError(
                'address',
                'Required parameter "address" was null or undefined when calling getLiquidityApiV1TokenAddressLiquidityGet().'
            );
        }

        const queryParameters: any = {};

        if (requestParameters['chain'] != null) {
            queryParameters['chain'] = requestParameters['chain'];
        }

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/token/{address}/liquidity`;
        urlPath = urlPath.replace('{address}', encodeURIComponent(String(requestParameters['address'])));

        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Token liquidity + pool info.
     * Get Liquidity
     */
    async getLiquidityApiV1TokenAddressLiquidityGetRaw(requestParameters: GetLiquidityApiV1TokenAddressLiquidityGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.getLiquidityApiV1TokenAddressLiquidityGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse<any>(response);
    }

    /**
     * Token liquidity + pool info.
     * Get Liquidity
     */
    async getLiquidityApiV1TokenAddressLiquidityGet(requestParameters: GetLiquidityApiV1TokenAddressLiquidityGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.getLiquidityApiV1TokenAddressLiquidityGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for getRiskApiV1TokenAddressRiskGet without sending the request
     */
    async getRiskApiV1TokenAddressRiskGetRequestOpts(requestParameters: GetRiskApiV1TokenAddressRiskGetRequest): Promise<runtime.RequestOpts> {
        if (requestParameters['address'] == null) {
            throw new runtime.RequiredError(
                'address',
                'Required parameter "address" was null or undefined when calling getRiskApiV1TokenAddressRiskGet().'
            );
        }

        const queryParameters: any = {};

        if (requestParameters['chain'] != null) {
            queryParameters['chain'] = requestParameters['chain'];
        }

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/token/{address}/risk`;
        urlPath = urlPath.replace('{address}', encodeURIComponent(String(requestParameters['address'])));

        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Combined risk: holders + liquidity + heuristics.
     * Get Risk
     */
    async getRiskApiV1TokenAddressRiskGetRaw(requestParameters: GetRiskApiV1TokenAddressRiskGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenRisk>> {
        const requestOptions = await this.getRiskApiV1TokenAddressRiskGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TokenRiskFromJSON(jsonValue));
    }

    /**
     * Combined risk: holders + liquidity + heuristics.
     * Get Risk
     */
    async getRiskApiV1TokenAddressRiskGet(requestParameters: GetRiskApiV1TokenAddressRiskGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenRisk> {
        const response = await this.getRiskApiV1TokenAddressRiskGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for scanApiV1TokenScanPost without sending the request
     */
    async scanApiV1TokenScanPostRequestOpts(requestParameters: ScanApiV1TokenScanPostRequest): Promise<runtime.RequestOpts> {
        if (requestParameters['tokenScanRequest'] == null) {
            throw new runtime.RequiredError(
                'tokenScanRequest',
                'Required parameter "tokenScanRequest" was null or undefined when calling scanApiV1TokenScanPost().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';


        let urlPath = `/api/v1/token/scan`;

        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TokenScanRequestToJSON(requestParameters['tokenScanRequest']),
        };
    }

    /**
     * Full token scan. Multi-module. Freemium rate-limit applied in legacy router.
     * Scan
     */
    async scanApiV1TokenScanPostRaw(requestParameters: ScanApiV1TokenScanPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenScanResult>> {
        const requestOptions = await this.scanApiV1TokenScanPostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TokenScanResultFromJSON(jsonValue));
    }

    /**
     * Full token scan. Multi-module. Freemium rate-limit applied in legacy router.
     * Scan
     */
    async scanApiV1TokenScanPost(requestParameters: ScanApiV1TokenScanPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenScanResult> {
        const response = await this.scanApiV1TokenScanPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
