/* 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 AttachRagRequest,
    AttachRagRequestFromJSON,
    AttachRagRequestToJSON,
} from '../models/AttachRagRequest';
import {
    type FindRiskyTokensRequest,
    FindRiskyTokensRequestFromJSON,
    FindRiskyTokensRequestToJSON,
} from '../models/FindRiskyTokensRequest';
import {
    type HTTPValidationError,
    HTTPValidationErrorFromJSON,
    HTTPValidationErrorToJSON,
} from '../models/HTTPValidationError';
import {
    type RagIngestRequest,
    RagIngestRequestFromJSON,
    RagIngestRequestToJSON,
} from '../models/RagIngestRequest';
import {
    type RagSearchRequest,
    RagSearchRequestFromJSON,
    RagSearchRequestToJSON,
} from '../models/RagSearchRequest';
import {
    type ResolveEntityRequest,
    ResolveEntityRequestFromJSON,
    ResolveEntityRequestToJSON,
} from '../models/ResolveEntityRequest';

export interface AttachRagApiV1CatalogTokensChainAddressAttachRagPostRequest {
    chain: string;
    address: string;
    attachRagRequest: AttachRagRequest;
}

export interface GetTokenApiV1CatalogTokensChainAddressGetRequest {
    chain: string;
    address: string;
}

export interface GetTokenRiskApiV1CatalogTokensChainAddressRiskGetRequest {
    chain: string;
    address: string;
}

export interface GetWalletApiV1CatalogWalletsChainAddressGetRequest {
    chain: string;
    address: string;
}

export interface RagIngestApiV1CatalogRagIngestPostRequest {
    ragIngestRequest: RagIngestRequest;
}

export interface RagSearchApiV1CatalogRagSearchPostRequest {
    ragSearchRequest: RagSearchRequest;
}

export interface ResolveEntityApiV1CatalogEntitiesResolvePostRequest {
    resolveEntityRequest: ResolveEntityRequest;
}

export interface RiskyTokensApiV1CatalogTokensRiskyByDeployerPostRequest {
    findRiskyTokensRequest: FindRiskyTokensRequest;
}

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

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

        if (requestParameters['address'] == null) {
            throw new runtime.RequiredError(
                'address',
                'Required parameter "address" was null or undefined when calling attachRagApiV1CatalogTokensChainAddressAttachRagPost().'
            );
        }

        if (requestParameters['attachRagRequest'] == null) {
            throw new runtime.RequiredError(
                'attachRagRequest',
                'Required parameter "attachRagRequest" was null or undefined when calling attachRagApiV1CatalogTokensChainAddressAttachRagPost().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/catalog/tokens/{chain}/{address}/attach-rag`;
        urlPath = urlPath.replace('{chain}', encodeURIComponent(String(requestParameters['chain'])));
        urlPath = urlPath.replace('{address}', encodeURIComponent(String(requestParameters['address'])));

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

    /**
     * Link an existing RAG embedding (Qdrant point) to a Token row.
     * Attach Rag
     */
    async attachRagApiV1CatalogTokensChainAddressAttachRagPostRaw(requestParameters: AttachRagApiV1CatalogTokensChainAddressAttachRagPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.attachRagApiV1CatalogTokensChainAddressAttachRagPostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Link an existing RAG embedding (Qdrant point) to a Token row.
     * Attach Rag
     */
    async attachRagApiV1CatalogTokensChainAddressAttachRagPost(requestParameters: AttachRagApiV1CatalogTokensChainAddressAttachRagPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.attachRagApiV1CatalogTokensChainAddressAttachRagPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters['address'] == null) {
            throw new runtime.RequiredError(
                'address',
                'Required parameter "address" was null or undefined when calling getTokenApiV1CatalogTokensChainAddressGet().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


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

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

    /**
     * Get a token by chain+address. Returns full Token model + provenance.
     * Get Token
     */
    async getTokenApiV1CatalogTokensChainAddressGetRaw(requestParameters: GetTokenApiV1CatalogTokensChainAddressGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.getTokenApiV1CatalogTokensChainAddressGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a token by chain+address. Returns full Token model + provenance.
     * Get Token
     */
    async getTokenApiV1CatalogTokensChainAddressGet(requestParameters: GetTokenApiV1CatalogTokensChainAddressGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.getTokenApiV1CatalogTokensChainAddressGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters['address'] == null) {
            throw new runtime.RequiredError(
                'address',
                'Required parameter "address" was null or undefined when calling getTokenRiskApiV1CatalogTokensChainAddressRiskGet().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


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

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

    /**
     * Recipe 3 — Real-time risk score. Composes Redis + Postgres + Neo4j.
     * Get Token Risk
     */
    async getTokenRiskApiV1CatalogTokensChainAddressRiskGetRaw(requestParameters: GetTokenRiskApiV1CatalogTokensChainAddressRiskGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.getTokenRiskApiV1CatalogTokensChainAddressRiskGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Recipe 3 — Real-time risk score. Composes Redis + Postgres + Neo4j.
     * Get Token Risk
     */
    async getTokenRiskApiV1CatalogTokensChainAddressRiskGet(requestParameters: GetTokenRiskApiV1CatalogTokensChainAddressRiskGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.getTokenRiskApiV1CatalogTokensChainAddressRiskGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        if (requestParameters['address'] == null) {
            throw new runtime.RequiredError(
                'address',
                'Required parameter "address" was null or undefined when calling getWalletApiV1CatalogWalletsChainAddressGet().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


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

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

    /**
     * Get Wallet
     */
    async getWalletApiV1CatalogWalletsChainAddressGetRaw(requestParameters: GetWalletApiV1CatalogWalletsChainAddressGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.getWalletApiV1CatalogWalletsChainAddressGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get Wallet
     */
    async getWalletApiV1CatalogWalletsChainAddressGet(requestParameters: GetWalletApiV1CatalogWalletsChainAddressGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.getWalletApiV1CatalogWalletsChainAddressGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for probeApiV1CatalogProbeGet without sending the request
     */
    async probeApiV1CatalogProbeGetRequestOpts(): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/catalog/probe`;

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

    /**
     * Probe which stores are reachable from this container.
     * Probe
     */
    async probeApiV1CatalogProbeGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.probeApiV1CatalogProbeGetRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Probe which stores are reachable from this container.
     * Probe
     */
    async probeApiV1CatalogProbeGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.probeApiV1CatalogProbeGetRaw(initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/catalog/rag/ingest`;

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

    /**
     * Ingest content into RAG. Returns qdrant_point_id for cross-store linking.
     * Rag Ingest
     */
    async ragIngestApiV1CatalogRagIngestPostRaw(requestParameters: RagIngestApiV1CatalogRagIngestPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.ragIngestApiV1CatalogRagIngestPostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Ingest content into RAG. Returns qdrant_point_id for cross-store linking.
     * Rag Ingest
     */
    async ragIngestApiV1CatalogRagIngestPost(requestParameters: RagIngestApiV1CatalogRagIngestPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.ragIngestApiV1CatalogRagIngestPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/catalog/rag/search`;

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

    /**
     * Search the RAG system. Returns ranked hits with RRF scores.
     * Rag Search
     */
    async ragSearchApiV1CatalogRagSearchPostRaw(requestParameters: RagSearchApiV1CatalogRagSearchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.ragSearchApiV1CatalogRagSearchPostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Search the RAG system. Returns ranked hits with RRF scores.
     * Rag Search
     */
    async ragSearchApiV1CatalogRagSearchPost(requestParameters: RagSearchApiV1CatalogRagSearchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.ragSearchApiV1CatalogRagSearchPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/catalog/entities/resolve`;

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

    /**
     * Cross-chain entity resolution via Neo4j Cypher.
     * Resolve Entity
     */
    async resolveEntityApiV1CatalogEntitiesResolvePostRaw(requestParameters: ResolveEntityApiV1CatalogEntitiesResolvePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.resolveEntityApiV1CatalogEntitiesResolvePostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Cross-chain entity resolution via Neo4j Cypher.
     * Resolve Entity
     */
    async resolveEntityApiV1CatalogEntitiesResolvePost(requestParameters: ResolveEntityApiV1CatalogEntitiesResolvePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.resolveEntityApiV1CatalogEntitiesResolvePostRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


        let urlPath = `/api/v1/catalog/tokens/risky-by-deployer`;

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

    /**
     * Recipe 1 — Find tokens deployed by wallets with rug history.
     * Risky Tokens
     */
    async riskyTokensApiV1CatalogTokensRiskyByDeployerPostRaw(requestParameters: RiskyTokensApiV1CatalogTokensRiskyByDeployerPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.riskyTokensApiV1CatalogTokensRiskyByDeployerPostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Recipe 1 — Find tokens deployed by wallets with rug history.
     * Risky Tokens
     */
    async riskyTokensApiV1CatalogTokensRiskyByDeployerPost(requestParameters: RiskyTokensApiV1CatalogTokensRiskyByDeployerPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.riskyTokensApiV1CatalogTokensRiskyByDeployerPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for statsApiV1CatalogStatsGet without sending the request
     */
    async statsApiV1CatalogStatsGetRequestOpts(): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/catalog/stats`;

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

    /**
     * Catalog stats: which stores are reachable + entity counts.
     * Stats
     */
    async statsApiV1CatalogStatsGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.statsApiV1CatalogStatsGetRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Catalog stats: which stores are reachable + entity counts.
     * Stats
     */
    async statsApiV1CatalogStatsGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.statsApiV1CatalogStatsGetRaw(initOverrides);
        return await response.value();
    }

}
