/* 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 AppDomainWalletModelsScanRequest,
    AppDomainWalletModelsScanRequestFromJSON,
    AppDomainWalletModelsScanRequestToJSON,
} from '../models/AppDomainWalletModelsScanRequest';
import {
    type Balance,
    BalanceFromJSON,
    BalanceToJSON,
} from '../models/Balance';
import {
    type HTTPValidationError,
    HTTPValidationErrorFromJSON,
    HTTPValidationErrorToJSON,
} from '../models/HTTPValidationError';
import {
    type PaginatedResponse,
    PaginatedResponseFromJSON,
    PaginatedResponseToJSON,
} from '../models/PaginatedResponse';
import {
    type ScanResult,
    ScanResultFromJSON,
    ScanResultToJSON,
} from '../models/ScanResult';
import {
    type WalletAnalysis,
    WalletAnalysisFromJSON,
    WalletAnalysisToJSON,
} from '../models/WalletAnalysis';

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

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

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

export interface ScanApiV1WalletScanPostRequest {
    appDomainWalletModelsScanRequest: AppDomainWalletModelsScanRequest;
}

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

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

        const queryParameters: any = {};

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

        const headerParameters: runtime.HTTPHeaders = {};


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

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

    /**
     * Full wallet analysis: risk score + tokens + recent transactions.
     * Get Analysis
     */
    async getAnalysisApiV1WalletAddressAnalysisGetRaw(requestParameters: GetAnalysisApiV1WalletAddressAnalysisGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WalletAnalysis>> {
        const requestOptions = await this.getAnalysisApiV1WalletAddressAnalysisGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Full wallet analysis: risk score + tokens + recent transactions.
     * Get Analysis
     */
    async getAnalysisApiV1WalletAddressAnalysisGet(requestParameters: GetAnalysisApiV1WalletAddressAnalysisGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WalletAnalysis> {
        const response = await this.getAnalysisApiV1WalletAddressAnalysisGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

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

        const headerParameters: runtime.HTTPHeaders = {};


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

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

    /**
     * Wallet balance + token holdings.
     * Get Balance
     */
    async getBalanceApiV1WalletAddressBalanceGetRaw(requestParameters: GetBalanceApiV1WalletAddressBalanceGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Balance>> {
        const requestOptions = await this.getBalanceApiV1WalletAddressBalanceGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Wallet balance + token holdings.
     * Get Balance
     */
    async getBalanceApiV1WalletAddressBalanceGet(requestParameters: GetBalanceApiV1WalletAddressBalanceGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Balance> {
        const response = await this.getBalanceApiV1WalletAddressBalanceGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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/wallet/{address}/transactions`;
        urlPath = urlPath.replace('{address}', encodeURIComponent(String(requestParameters['address'])));

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

    /**
     * Recent transactions for a wallet.
     * Get Transactions
     */
    async getTransactionsApiV1WalletAddressTransactionsGetRaw(requestParameters: GetTransactionsApiV1WalletAddressTransactionsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponse>> {
        const requestOptions = await this.getTransactionsApiV1WalletAddressTransactionsGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Recent transactions for a wallet.
     * Get Transactions
     */
    async getTransactionsApiV1WalletAddressTransactionsGet(requestParameters: GetTransactionsApiV1WalletAddressTransactionsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponse> {
        const response = await this.getTransactionsApiV1WalletAddressTransactionsGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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


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

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

    /**
     * Multi-chain threat scan. Auth optional — freemium rate-limit applied in legacy router.
     * Scan
     */
    async scanApiV1WalletScanPostRaw(requestParameters: ScanApiV1WalletScanPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScanResult>> {
        const requestOptions = await this.scanApiV1WalletScanPostRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Multi-chain threat scan. Auth optional — freemium rate-limit applied in legacy router.
     * Scan
     */
    async scanApiV1WalletScanPost(requestParameters: ScanApiV1WalletScanPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScanResult> {
        const response = await this.scanApiV1WalletScanPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
