/* eslint-disable */
/* tslint:disable */
/*
 * ---------------------------------------------------------------
 * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API        ##
 * ##                                                           ##
 * ## AUTHOR: acacode                                           ##
 * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
 * ---------------------------------------------------------------
 */
export var RarimocoreopType;
(function (RarimocoreopType) {
    RarimocoreopType["TRANSFER"] = "TRANSFER";
    RarimocoreopType["CHANGE_KEY"] = "CHANGE_KEY";
})(RarimocoreopType || (RarimocoreopType = {}));
export var Tokenmanagertype;
(function (Tokenmanagertype) {
    Tokenmanagertype["NATIVE"] = "NATIVE";
    Tokenmanagertype["ERC20"] = "ERC20";
    Tokenmanagertype["ERC721"] = "ERC721";
    Tokenmanagertype["ERC1155"] = "ERC1155";
    Tokenmanagertype["METAPLEX_NFT"] = "METAPLEX_NFT";
    Tokenmanagertype["METAPLEX_FT"] = "METAPLEX_FT";
    Tokenmanagertype["NEAR_FT"] = "NEAR_FT";
    Tokenmanagertype["NEAR_NFT"] = "NEAR_NFT";
})(Tokenmanagertype || (Tokenmanagertype = {}));
import axios from "axios";
export var ContentType;
(function (ContentType) {
    ContentType["Json"] = "application/json";
    ContentType["FormData"] = "multipart/form-data";
    ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
})(ContentType || (ContentType = {}));
export class HttpClient {
    instance;
    securityData = null;
    securityWorker;
    secure;
    format;
    constructor({ securityWorker, secure, format, ...axiosConfig } = {}) {
        this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" });
        this.secure = secure;
        this.format = format;
        this.securityWorker = securityWorker;
    }
    setSecurityData = (data) => {
        this.securityData = data;
    };
    mergeRequestParams(params1, params2) {
        return {
            ...this.instance.defaults,
            ...params1,
            ...(params2 || {}),
            headers: {
                ...(this.instance.defaults.headers || {}),
                ...(params1.headers || {}),
                ...((params2 && params2.headers) || {}),
            },
        };
    }
    createFormData(input) {
        return Object.keys(input || {}).reduce((formData, key) => {
            const property = input[key];
            formData.append(key, property instanceof Blob
                ? property
                : typeof property === "object" && property !== null
                    ? JSON.stringify(property)
                    : `${property}`);
            return formData;
        }, new FormData());
    }
    request = async ({ secure, path, type, query, format, body, ...params }) => {
        const secureParams = ((typeof secure === "boolean" ? secure : this.secure) &&
            this.securityWorker &&
            (await this.securityWorker(this.securityData))) ||
            {};
        const requestParams = this.mergeRequestParams(params, secureParams);
        const responseFormat = (format && this.format) || void 0;
        if (type === ContentType.FormData && body && body !== null && typeof body === "object") {
            requestParams.headers.common = { Accept: "*/*" };
            requestParams.headers.post = {};
            requestParams.headers.put = {};
            body = this.createFormData(body);
        }
        return this.instance.request({
            ...requestParams,
            headers: {
                ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
                ...(requestParams.headers || {}),
            },
            params: query,
            responseType: responseFormat,
            data: body,
            url: path,
        });
    };
}
/**
 * @title rarimocore/confirmation.proto
 * @version version not set
 */
export class Api extends HttpClient {
    /**
     * No description
     *
     * @tags Query
     * @name QueryConfirmationAll
     * @summary Queries a list of Confirmation items.
     * @request GET:/rarimo/rarimo-core/rarimocore/confirmation
     */
    queryConfirmationAll = (query, params = {}) => this.request({
        path: `/rarimo/rarimo-core/rarimocore/confirmation`,
        method: "GET",
        query: query,
        format: "json",
        ...params,
    });
    /**
     * No description
     *
     * @tags Query
     * @name QueryConfirmation
     * @summary Queries a Confirmation by index.
     * @request GET:/rarimo/rarimo-core/rarimocore/confirmation/{root}
     */
    queryConfirmation = (root, params = {}) => this.request({
        path: `/rarimo/rarimo-core/rarimocore/confirmation/${root}`,
        method: "GET",
        format: "json",
        ...params,
    });
    /**
     * No description
     *
     * @tags Query
     * @name QueryOperationAll
     * @summary Queries a list of Deposit items.
     * @request GET:/rarimo/rarimo-core/rarimocore/operation
     */
    queryOperationAll = (query, params = {}) => this.request({
        path: `/rarimo/rarimo-core/rarimocore/operation`,
        method: "GET",
        query: query,
        format: "json",
        ...params,
    });
    /**
     * No description
     *
     * @tags Query
     * @name QueryOperation
     * @summary Queries a Deposit by index.
     * @request GET:/rarimo/rarimo-core/rarimocore/operation/{index}
     */
    queryOperation = (index, params = {}) => this.request({
        path: `/rarimo/rarimo-core/rarimocore/operation/${index}`,
        method: "GET",
        format: "json",
        ...params,
    });
    /**
     * No description
     *
     * @tags Query
     * @name QueryParams
     * @summary Parameters queries the parameters of the module.
     * @request GET:/rarimo/rarimo-core/rarimocore/params
     */
    queryParams = (params = {}) => this.request({
        path: `/rarimo/rarimo-core/rarimocore/params`,
        method: "GET",
        format: "json",
        ...params,
    });
}
//# sourceMappingURL=rest.js.map