/* eslint-disable */ /* tslint:disable */ /* * --------------------------------------------------------------- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## * ## ## * ## AUTHOR: acacode ## * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## * --------------------------------------------------------------- */ export interface ProtobufAny { "@type"?: string; } export interface RpcStatus { /** @format int32 */ code?: number; message?: string; details?: ProtobufAny[]; } /** * Params defines the set of on-chain interchain accounts parameters. The following parameters may be used to disable the controller submodule. */ export interface V1Params { /** controller_enabled enables or disables the controller submodule. */ controller_enabled?: boolean; } /** * QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. */ export interface V1QueryInterchainAccountResponse { address?: string; } /** * QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface V1QueryParamsResponse { /** params defines the parameters of the module. */ params?: V1Params; } import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; export type QueryParamsType = Record; export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ path: string; /** content type of request body */ type?: ContentType; /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ format?: ResponseType; /** request body */ body?: unknown; } export type RequestParams = Omit; export interface ApiConfig extends Omit { securityWorker?: ( securityData: SecurityDataType | null, ) => Promise | AxiosRequestConfig | void; secure?: boolean; format?: ResponseType; } export enum ContentType { Json = "application/json", FormData = "multipart/form-data", UrlEncoded = "application/x-www-form-urlencoded", } export class HttpClient { public instance: AxiosInstance; private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private secure?: boolean; private format?: ResponseType; constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); this.secure = secure; this.format = format; this.securityWorker = securityWorker; } public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } private createFormData(input: Record): FormData { 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()); } public request = async ({ secure, path, type, query, format, body, ...params }: FullRequestParams): Promise> => { 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 as Record); } return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, params: query, responseType: responseFormat, data: body, url: path, }); }; } /** * @title ibc/applications/interchain_accounts/controller/v1/controller.proto * @version version not set */ export class Api extends HttpClient { /** * No description * * @tags Query * @name QueryInterchainAccount * @summary InterchainAccount returns the interchain account address for a given owner address on a given connection * @request GET:/ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id} */ queryInterchainAccount = (owner: string, connectionId: string, params: RequestParams = {}) => this.request({ path: `/ibc/apps/interchain_accounts/controller/v1/owners/${owner}/connections/${connectionId}`, method: "GET", format: "json", ...params, }); /** * No description * * @tags Query * @name QueryParams * @summary Params queries all parameters of the ICA controller submodule. * @request GET:/ibc/apps/interchain_accounts/controller/v1/params */ queryParams = (params: RequestParams = {}) => this.request({ path: `/ibc/apps/interchain_accounts/controller/v1/params`, method: "GET", format: "json", ...params, }); }