UNPKG

@circle-fin/circle-sdk

Version:
1,067 lines (1,012 loc) 51.6 kB
/* tslint:disable */ /* eslint-disable */ /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; import { Configuration } from "../configuration"; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from "../common"; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from "../base"; // @ts-ignore import { BadRequest } from "../models"; // @ts-ignore import { BusinessPayoutCreationRequest } from "../models"; // @ts-ignore import { CreateBusinessPayoutResponse } from "../models"; // @ts-ignore import { CreatePayoutResponse } from "../models"; // @ts-ignore import { CryptoPayoutCreationRequest } from "../models"; // @ts-ignore import { GetBusinessPayoutResponse } from "../models"; // @ts-ignore import { GetPayoutResponse } from "../models"; // @ts-ignore import { ListBusinessPayoutsResponse } from "../models"; // @ts-ignore import { ListPayoutsResponse } from "../models"; // @ts-ignore import { NotAuthorized } from "../models"; // @ts-ignore import { NotFound } from "../models"; // @ts-ignore import { PayoutDestinationType } from "../models"; // @ts-ignore import { PayoutStatus } from "../models"; /** * PayoutsApi - axios parameter creator * @export */ export const PayoutsApiAxiosParamCreator = function ( configuration?: Configuration ) { return { /** * * @summary Create a payout * @param {BusinessPayoutCreationRequest} [businessPayoutCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createBusinessPayout: async ( businessPayoutCreationRequest?: BusinessPayoutCreationRequest, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { const localVarPath = `/v1/businessAccount/payouts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter["Content-Type"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded( businessPayoutCreationRequest, localVarRequestOptions, configuration ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Create a crypto payout. The following table includes the supported pairs of amount.currency and toAmount.currency for address book payouts: | amount.currency | toAmount.currency | | ---------------- | ------------ | | USD | USD | | USD | BTC | | USD | ETH | | USD | MTC | | EUR | EUR | | BTC | USD | | BTC | BTC | | ETH | USD | | ETH | ETH | * @summary Create a payout * @param {CryptoPayoutCreationRequest} [cryptoPayoutCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPayout: async ( cryptoPayoutCreationRequest?: CryptoPayoutCreationRequest, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { const localVarPath = `/v1/payouts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter["Content-Type"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded( cryptoPayoutCreationRequest, localVarRequestOptions, configuration ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * * @summary Get a payout * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBusinessPayout: async ( id: string, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists("getBusinessPayout", "id", id); const localVarPath = `/v1/businessAccount/payouts/{id}`.replace( `{${"id"}}`, encodeURIComponent(String(id)) ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * * @summary Get a payout * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPayout: async ( id: string, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists("getPayout", "id", id); const localVarPath = `/v1/payouts/{id}`.replace( `{${"id"}}`, encodeURIComponent(String(id)) ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * * @summary List all payouts * @param {string} [destination] Universally unique identifier (UUID v4) for the destination bank account. Filters the results to fetch all payouts made to a destination bank account. * @param {'wire' | 'cbit'} [type] Destination bank account type. Filters the results to fetch all payouts made to a specified destination bank account type. This query parameter can be passed multiple times to fetch results matching multiple destination bank account types. * @param {Set<PayoutStatus>} [status] Queries items with the specified status. Matches any status if unspecified. * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listBusinessPayouts: async ( destination?: string, type?: "wire" | "cbit", status?: Set<PayoutStatus>, from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { const localVarPath = `/v1/businessAccount/payouts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); if (destination !== undefined) { localVarQueryParameter["destination"] = destination; } if (type !== undefined) { localVarQueryParameter["type"] = type; } if (status) { localVarQueryParameter["status"] = Array.from(status); } if (from !== undefined) { localVarQueryParameter["from"] = (from as any) instanceof Date ? (from as any).toISOString() : from; } if (to !== undefined) { localVarQueryParameter["to"] = (to as any) instanceof Date ? (to as any).toISOString() : to; } if (pageBefore !== undefined) { localVarQueryParameter["pageBefore"] = pageBefore; } if (pageAfter !== undefined) { localVarQueryParameter["pageAfter"] = pageAfter; } if (pageSize !== undefined) { localVarQueryParameter["pageSize"] = pageSize; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * * @summary List all payouts * @param {string} [source] Identifier for the source wallet. Filters the fetched payout results to only be from a specific source wallet. If not provided, payouts from all wallets will be returned. * @param {string} [destination] Universally unique identifier (UUID v4) for the destination. Filters the fetched payout results made to a specific destination. If not provided, payouts to all destinations will be returned. * @param {Set<PayoutDestinationType>} [type] Destination type. Filters the results to fetch all payouts made to a specified destination type. This query parameter can be passed multiple times to fetch results matching multiple destination types. The address_book destination type cannot be combined with other types. * @param {Set<PayoutStatus>} [status] Queries items with the specified status. Matches any status if unspecified. * @param {'USD' | 'EUR' | 'BTC' | 'ETH' | 'MTC' | 'FLW' | 'MAN'} [sourceCurrency] Queries items with the specified source currency &#x60;amount.currency&#x60;. Matches any source currency if unspecified. * @param {'USD' | 'EUR' | 'BTC' | 'ETH' | 'MTC' | 'FLW' | 'MAN'} [destinationCurrency] Queries items with the specified destination currency &#x60;toAmount.currency&#x60;. Matches any destination currency if unspecified. * @param {'ALGO' | 'ARB' | 'AVAX' | 'BASE' | 'BTC' | 'CELO' | 'ETH' | 'FLOW' | 'HBAR' | 'NEAR' | 'NOBLE' | 'OP' | 'PAH' | 'POLY' | 'SOL' | 'TRX' | 'XLM'} [chain] Queries items with the specified chain. Matches any chain if unspecified * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listPayouts: async ( source?: string, destination?: string, type?: Set<PayoutDestinationType>, status?: Set<PayoutStatus>, sourceCurrency?: "USD" | "EUR" | "BTC" | "ETH" | "MTC" | "FLW" | "MAN", destinationCurrency?: | "USD" | "EUR" | "BTC" | "ETH" | "MTC" | "FLW" | "MAN", chain?: | "ALGO" | "ARB" | "AVAX" | "BASE" | "BTC" | "CELO" | "ETH" | "FLOW" | "HBAR" | "NEAR" | "NOBLE" | "OP" | "PAH" | "POLY" | "SOL" | "TRX" | "XLM", from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { const localVarPath = `/v1/payouts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); if (source !== undefined) { localVarQueryParameter["source"] = source; } if (destination !== undefined) { localVarQueryParameter["destination"] = destination; } if (type) { localVarQueryParameter["type"] = Array.from(type); } if (status) { localVarQueryParameter["status"] = Array.from(status); } if (sourceCurrency !== undefined) { localVarQueryParameter["sourceCurrency"] = sourceCurrency; } if (destinationCurrency !== undefined) { localVarQueryParameter["destinationCurrency"] = destinationCurrency; } if (chain !== undefined) { localVarQueryParameter["chain"] = chain; } if (from !== undefined) { localVarQueryParameter["from"] = (from as any) instanceof Date ? (from as any).toISOString() : from; } if (to !== undefined) { localVarQueryParameter["to"] = (to as any) instanceof Date ? (to as any).toISOString() : to; } if (pageBefore !== undefined) { localVarQueryParameter["pageBefore"] = pageBefore; } if (pageAfter !== undefined) { localVarQueryParameter["pageAfter"] = pageAfter; } if (pageSize !== undefined) { localVarQueryParameter["pageSize"] = pageSize; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; } }; }; /** * PayoutsApi - functional programming interface * @export */ export const PayoutsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = PayoutsApiAxiosParamCreator(configuration); return { /** * * @summary Create a payout * @param {BusinessPayoutCreationRequest} [businessPayoutCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createBusinessPayout( businessPayoutCreationRequest?: BusinessPayoutCreationRequest, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<CreateBusinessPayoutResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.createBusinessPayout( businessPayoutCreationRequest, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * Create a crypto payout. The following table includes the supported pairs of amount.currency and toAmount.currency for address book payouts: | amount.currency | toAmount.currency | | ---------------- | ------------ | | USD | USD | | USD | BTC | | USD | ETH | | USD | MTC | | EUR | EUR | | BTC | USD | | BTC | BTC | | ETH | USD | | ETH | ETH | * @summary Create a payout * @param {CryptoPayoutCreationRequest} [cryptoPayoutCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createPayout( cryptoPayoutCreationRequest?: CryptoPayoutCreationRequest, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<CreatePayoutResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.createPayout( cryptoPayoutCreationRequest, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * * @summary Get a payout * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBusinessPayout( id: string, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<GetBusinessPayoutResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getBusinessPayout(id, options); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * * @summary Get a payout * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPayout( id: string, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<GetPayoutResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getPayout( id, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * * @summary List all payouts * @param {string} [destination] Universally unique identifier (UUID v4) for the destination bank account. Filters the results to fetch all payouts made to a destination bank account. * @param {'wire' | 'cbit'} [type] Destination bank account type. Filters the results to fetch all payouts made to a specified destination bank account type. This query parameter can be passed multiple times to fetch results matching multiple destination bank account types. * @param {Set<PayoutStatus>} [status] Queries items with the specified status. Matches any status if unspecified. * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listBusinessPayouts( destination?: string, type?: "wire" | "cbit", status?: Set<PayoutStatus>, from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<ListBusinessPayoutsResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.listBusinessPayouts( destination, type, status, from, to, pageBefore, pageAfter, pageSize, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * * @summary List all payouts * @param {string} [source] Identifier for the source wallet. Filters the fetched payout results to only be from a specific source wallet. If not provided, payouts from all wallets will be returned. * @param {string} [destination] Universally unique identifier (UUID v4) for the destination. Filters the fetched payout results made to a specific destination. If not provided, payouts to all destinations will be returned. * @param {Set<PayoutDestinationType>} [type] Destination type. Filters the results to fetch all payouts made to a specified destination type. This query parameter can be passed multiple times to fetch results matching multiple destination types. The address_book destination type cannot be combined with other types. * @param {Set<PayoutStatus>} [status] Queries items with the specified status. Matches any status if unspecified. * @param {'USD' | 'EUR' | 'BTC' | 'ETH' | 'MTC' | 'FLW' | 'MAN'} [sourceCurrency] Queries items with the specified source currency &#x60;amount.currency&#x60;. Matches any source currency if unspecified. * @param {'USD' | 'EUR' | 'BTC' | 'ETH' | 'MTC' | 'FLW' | 'MAN'} [destinationCurrency] Queries items with the specified destination currency &#x60;toAmount.currency&#x60;. Matches any destination currency if unspecified. * @param {'ALGO' | 'ARB' | 'AVAX' | 'BASE' | 'BTC' | 'CELO' | 'ETH' | 'FLOW' | 'HBAR' | 'NEAR' | 'NOBLE' | 'OP' | 'PAH' | 'POLY' | 'SOL' | 'TRX' | 'XLM'} [chain] Queries items with the specified chain. Matches any chain if unspecified * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listPayouts( source?: string, destination?: string, type?: Set<PayoutDestinationType>, status?: Set<PayoutStatus>, sourceCurrency?: "USD" | "EUR" | "BTC" | "ETH" | "MTC" | "FLW" | "MAN", destinationCurrency?: | "USD" | "EUR" | "BTC" | "ETH" | "MTC" | "FLW" | "MAN", chain?: | "ALGO" | "ARB" | "AVAX" | "BASE" | "BTC" | "CELO" | "ETH" | "FLOW" | "HBAR" | "NEAR" | "NOBLE" | "OP" | "PAH" | "POLY" | "SOL" | "TRX" | "XLM", from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<ListPayoutsResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.listPayouts( source, destination, type, status, sourceCurrency, destinationCurrency, chain, from, to, pageBefore, pageAfter, pageSize, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); } }; }; /** * PayoutsApi - factory interface * @export */ export const PayoutsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance ) { const localVarFp = PayoutsApiFp(configuration); return { /** * * @summary Create a payout * @param {BusinessPayoutCreationRequest} [businessPayoutCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createBusinessPayout( businessPayoutCreationRequest?: BusinessPayoutCreationRequest, options?: any ): AxiosPromise<CreateBusinessPayoutResponse> { return localVarFp .createBusinessPayout(businessPayoutCreationRequest, options) .then((request) => request(axios, basePath)); }, /** * Create a crypto payout. The following table includes the supported pairs of amount.currency and toAmount.currency for address book payouts: | amount.currency | toAmount.currency | | ---------------- | ------------ | | USD | USD | | USD | BTC | | USD | ETH | | USD | MTC | | EUR | EUR | | BTC | USD | | BTC | BTC | | ETH | USD | | ETH | ETH | * @summary Create a payout * @param {CryptoPayoutCreationRequest} [cryptoPayoutCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPayout( cryptoPayoutCreationRequest?: CryptoPayoutCreationRequest, options?: any ): AxiosPromise<CreatePayoutResponse> { return localVarFp .createPayout(cryptoPayoutCreationRequest, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get a payout * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBusinessPayout( id: string, options?: any ): AxiosPromise<GetBusinessPayoutResponse> { return localVarFp .getBusinessPayout(id, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get a payout * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPayout(id: string, options?: any): AxiosPromise<GetPayoutResponse> { return localVarFp .getPayout(id, options) .then((request) => request(axios, basePath)); }, /** * * @summary List all payouts * @param {string} [destination] Universally unique identifier (UUID v4) for the destination bank account. Filters the results to fetch all payouts made to a destination bank account. * @param {'wire' | 'cbit'} [type] Destination bank account type. Filters the results to fetch all payouts made to a specified destination bank account type. This query parameter can be passed multiple times to fetch results matching multiple destination bank account types. * @param {Set<PayoutStatus>} [status] Queries items with the specified status. Matches any status if unspecified. * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listBusinessPayouts( destination?: string, type?: "wire" | "cbit", status?: Set<PayoutStatus>, from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options?: any ): AxiosPromise<ListBusinessPayoutsResponse> { return localVarFp .listBusinessPayouts( destination, type, status, from, to, pageBefore, pageAfter, pageSize, options ) .then((request) => request(axios, basePath)); }, /** * * @summary List all payouts * @param {string} [source] Identifier for the source wallet. Filters the fetched payout results to only be from a specific source wallet. If not provided, payouts from all wallets will be returned. * @param {string} [destination] Universally unique identifier (UUID v4) for the destination. Filters the fetched payout results made to a specific destination. If not provided, payouts to all destinations will be returned. * @param {Set<PayoutDestinationType>} [type] Destination type. Filters the results to fetch all payouts made to a specified destination type. This query parameter can be passed multiple times to fetch results matching multiple destination types. The address_book destination type cannot be combined with other types. * @param {Set<PayoutStatus>} [status] Queries items with the specified status. Matches any status if unspecified. * @param {'USD' | 'EUR' | 'BTC' | 'ETH' | 'MTC' | 'FLW' | 'MAN'} [sourceCurrency] Queries items with the specified source currency &#x60;amount.currency&#x60;. Matches any source currency if unspecified. * @param {'USD' | 'EUR' | 'BTC' | 'ETH' | 'MTC' | 'FLW' | 'MAN'} [destinationCurrency] Queries items with the specified destination currency &#x60;toAmount.currency&#x60;. Matches any destination currency if unspecified. * @param {'ALGO' | 'ARB' | 'AVAX' | 'BASE' | 'BTC' | 'CELO' | 'ETH' | 'FLOW' | 'HBAR' | 'NEAR' | 'NOBLE' | 'OP' | 'PAH' | 'POLY' | 'SOL' | 'TRX' | 'XLM'} [chain] Queries items with the specified chain. Matches any chain if unspecified * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listPayouts( source?: string, destination?: string, type?: Set<PayoutDestinationType>, status?: Set<PayoutStatus>, sourceCurrency?: "USD" | "EUR" | "BTC" | "ETH" | "MTC" | "FLW" | "MAN", destinationCurrency?: | "USD" | "EUR" | "BTC" | "ETH" | "MTC" | "FLW" | "MAN", chain?: | "ALGO" | "ARB" | "AVAX" | "BASE" | "BTC" | "CELO" | "ETH" | "FLOW" | "HBAR" | "NEAR" | "NOBLE" | "OP" | "PAH" | "POLY" | "SOL" | "TRX" | "XLM", from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options?: any ): AxiosPromise<ListPayoutsResponse> { return localVarFp .listPayouts( source, destination, type, status, sourceCurrency, destinationCurrency, chain, from, to, pageBefore, pageAfter, pageSize, options ) .then((request) => request(axios, basePath)); } }; }; /** * PayoutsApi - object-oriented interface * @export * @class PayoutsApi * @extends {BaseAPI} */ export class PayoutsApi extends BaseAPI { /** * * @summary Create a payout * @param {BusinessPayoutCreationRequest} [businessPayoutCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PayoutsApi */ public createBusinessPayout( businessPayoutCreationRequest?: BusinessPayoutCreationRequest, options?: AxiosRequestConfig ) { return PayoutsApiFp(this.configuration) .createBusinessPayout(businessPayoutCreationRequest, options) .then((request) => request(this.axios, this.basePath)); } /** * Create a crypto payout. The following table includes the supported pairs of amount.currency and toAmount.currency for address book payouts: | amount.currency | toAmount.currency | | ---------------- | ------------ | | USD | USD | | USD | BTC | | USD | ETH | | USD | MTC | | EUR | EUR | | BTC | USD | | BTC | BTC | | ETH | USD | | ETH | ETH | * @summary Create a payout * @param {CryptoPayoutCreationRequest} [cryptoPayoutCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PayoutsApi */ public createPayout( cryptoPayoutCreationRequest?: CryptoPayoutCreationRequest, options?: AxiosRequestConfig ) { return PayoutsApiFp(this.configuration) .createPayout(cryptoPayoutCreationRequest, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get a payout * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PayoutsApi */ public getBusinessPayout(id: string, options?: AxiosRequestConfig) { return PayoutsApiFp(this.configuration) .getBusinessPayout(id, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get a payout * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PayoutsApi */ public getPayout(id: string, options?: AxiosRequestConfig) { return PayoutsApiFp(this.configuration) .getPayout(id, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary List all payouts * @param {string} [destination] Universally unique identifier (UUID v4) for the destination bank account. Filters the results to fetch all payouts made to a destination bank account. * @param {'wire' | 'cbit'} [type] Destination bank account type. Filters the results to fetch all payouts made to a specified destination bank account type. This query parameter can be passed multiple times to fetch results matching multiple destination bank account types. * @param {Set<PayoutStatus>} [status] Queries items with the specified status. Matches any status if unspecified. * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PayoutsApi */ public listBusinessPayouts( destination?: string, type?: "wire" | "cbit", status?: Set<PayoutStatus>, from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options?: AxiosRequestConfig ) { return PayoutsApiFp(this.configuration) .listBusinessPayouts( destination, type, status, from, to, pageBefore, pageAfter, pageSize, options ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary List all payouts * @param {string} [source] Identifier for the source wallet. Filters the fetched payout results to only be from a specific source wallet. If not provided, payouts from all wallets will be returned. * @param {string} [destination] Universally unique identifier (UUID v4) for the destination. Filters the fetched payout results made to a specific destination. If not provided, payouts to all destinations will be returned. * @param {Set<PayoutDestinationType>} [type] Destination type. Filters the results to fetch all payouts made to a specified destination type. This query parameter can be passed multiple times to fetch results matching multiple destination types. The address_book destination type cannot be combined with other types. * @param {Set<PayoutStatus>} [status] Queries items with the specified status. Matches any status if unspecified. * @param {'USD' | 'EUR' | 'BTC' | 'ETH' | 'MTC' | 'FLW' | 'MAN'} [sourceCurrency] Queries items with the specified source currency &#x60;amount.currency&#x60;. Matches any source currency if unspecified. * @param {'USD' | 'EUR' | 'BTC' | 'ETH' | 'MTC' | 'FLW' | 'MAN'} [destinationCurrency] Queries items with the specified destination currency &#x60;toAmount.currency&#x60;. Matches any destination currency if unspecified. * @param {'ALGO' | 'ARB' | 'AVAX' | 'BASE' | 'BTC' | 'CELO' | 'ETH' | 'FLOW' | 'HBAR' | 'NEAR' | 'NOBLE' | 'OP' | 'PAH' | 'POLY' | 'SOL' | 'TRX' | 'XLM'} [chain] Queries items with the specified chain. Matches any chain if unspecified * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#