/* 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 CatalogResponse,
    CatalogResponseFromJSON,
    CatalogResponseToJSON,
} from '../models/CatalogResponse';
import {
    type HTTPValidationError,
    HTTPValidationErrorFromJSON,
    HTTPValidationErrorToJSON,
} from '../models/HTTPValidationError';
import {
    type ReceiptResponse,
    ReceiptResponseFromJSON,
    ReceiptResponseToJSON,
} from '../models/ReceiptResponse';
import {
    type UsageResponse,
    UsageResponseFromJSON,
    UsageResponseToJSON,
} from '../models/UsageResponse';

export interface ReceiptApiV1X402ReceiptsTxHashGetRequest {
    txHash: string;
}

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

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

        const headerParameters: runtime.HTTPHeaders = {};


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

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

    /**
     * List all paid tools with pricing tiers.
     * Catalog
     */
    async catalogApiV1X402CatalogGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CatalogResponse>> {
        const requestOptions = await this.catalogApiV1X402CatalogGetRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * List all paid tools with pricing tiers.
     * Catalog
     */
    async catalogApiV1X402CatalogGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CatalogResponse> {
        const response = await this.catalogApiV1X402CatalogGetRaw(initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/x402/receipts/{tx_hash}`;
        urlPath = urlPath.replace('{tx_hash}', encodeURIComponent(String(requestParameters['txHash'])));

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

    /**
     * Payment receipt for a specific on-chain tx.
     * Receipt
     */
    async receiptApiV1X402ReceiptsTxHashGetRaw(requestParameters: ReceiptApiV1X402ReceiptsTxHashGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReceiptResponse>> {
        const requestOptions = await this.receiptApiV1X402ReceiptsTxHashGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Payment receipt for a specific on-chain tx.
     * Receipt
     */
    async receiptApiV1X402ReceiptsTxHashGet(requestParameters: ReceiptApiV1X402ReceiptsTxHashGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReceiptResponse> {
        const response = await this.receiptApiV1X402ReceiptsTxHashGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/x402/usage`;

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

    /**
     * Per-agent usage stats: calls made, $ spent, top tools.
     * Usage
     */
    async usageApiV1X402UsageGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UsageResponse>> {
        const requestOptions = await this.usageApiV1X402UsageGetRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Per-agent usage stats: calls made, $ spent, top tools.
     * Usage
     */
    async usageApiV1X402UsageGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsageResponse> {
        const response = await this.usageApiV1X402UsageGetRaw(initOverrides);
        return await response.value();
    }

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

        const headerParameters: runtime.HTTPHeaders = {};


        let urlPath = `/api/v1/x402/verify`;

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

    /**
     * Verify an X-Payment header for a given tool.
     * Verify Payment
     */
    async verifyPaymentApiV1X402VerifyPostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
        const requestOptions = await this.verifyPaymentApiV1X402VerifyPostRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Verify an X-Payment header for a given tool.
     * Verify Payment
     */
    async verifyPaymentApiV1X402VerifyPost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
        const response = await this.verifyPaymentApiV1X402VerifyPostRaw(initOverrides);
        return await response.value();
    }

}
