UNPKG

@jup-ag/api

Version:

## Generate typescript types from swagger schema

89 lines (76 loc) 1.97 kB
/* eslint-disable */ // tslint:disable /** * Jupiter API v6 * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\> are base64 encoded strings * * OpenAPI spec version: 6.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator+. * https://github.com/karlvr/openapi-generator-plus * Do not edit the class manually. */ import "whatwg-fetch"; export const defaultFetch = window.fetch; import { Configuration } from "./configuration"; export const BASE_PATH = "https://quote-api.jup.ag/v6".replace(/\/+$/, ""); /** * * @export */ export const COLLECTION_FORMATS = { csv: ",", ssv: " ", tsv: "\t", pipes: "|", }; /** * * @export * @type FetchAPI */ export type FetchAPI = typeof defaultFetch; /** * * @export * @interface FetchArgs */ export interface FetchArgs { url: string; options: RequestInit; } /** * * @export * @class BaseAPI */ export class BaseAPI { protected configuration?: Configuration; constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected fetch: FetchAPI = defaultFetch) { if (configuration) { this.configuration = configuration; this.basePath = configuration.basePath || this.basePath; } } }; /** * * @export * @class RequiredError * @extends {Error} */ export class RequiredError extends Error { constructor(public field: string, msg?: string) { super(msg); Object.setPrototypeOf(this, RequiredError.prototype); this.name = "RequiredError"; } }