/* tslint:disable */ /* eslint-disable */ /** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; import { convertToFireblocksResponse } from "../response/fireblocksResponse"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; import { assertParamExistsAndNotEmpty } from '../utils/validation_utils'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { AddCollateralRequestBody } from '../models'; // @ts-ignore import { CreateTransactionResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { ExchangeAccount } from '../models'; // @ts-ignore import { ExchangeSettlementTransactionsResponse } from '../models'; // @ts-ignore import { RemoveCollateralRequestBody } from '../models'; // @ts-ignore import { SettlementRequestBody } from '../models'; // @ts-ignore import { SettlementResponse } from '../models'; /** * OffExchangesApi - axios parameter creator * @export */ export const OffExchangesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Add collateral and create deposit request. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Add Collateral * @param {AddCollateralRequestBody} [addCollateralRequestBody] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ addOffExchange: async (addCollateralRequestBody?: AddCollateralRequestBody, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/off_exchange/add`; // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'addOffExchange'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(addCollateralRequestBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a collateral account by mainExchangeAccountId. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Find a specific collateral exchange account * @param {string} mainExchangeAccountId The id of the main exchange account for which the requested collateral account is associated with * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOffExchangeCollateralAccounts: async (mainExchangeAccountId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getOffExchangeCollateralAccounts', 'mainExchangeAccountId', mainExchangeAccountId) const localVarPath = `/off_exchange/collateral_accounts/{mainExchangeAccountId}` .replace(`{${"mainExchangeAccountId"}}`, encodeURIComponent(String(mainExchangeAccountId))); // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getOffExchangeCollateralAccounts'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get settlements transactions from exchange. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Get Settlements Transactions * @param {string} mainExchangeAccountId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOffExchangeSettlementTransactions: async (mainExchangeAccountId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getOffExchangeSettlementTransactions', 'mainExchangeAccountId', mainExchangeAccountId) const localVarPath = `/off_exchange/settlements/transactions`; // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getOffExchangeSettlementTransactions'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (mainExchangeAccountId !== undefined) { localVarQueryParameter['mainExchangeAccountId'] = mainExchangeAccountId; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Remove collateral, create withdraw request. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Remove Collateral * @param {RemoveCollateralRequestBody} [removeCollateralRequestBody] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ removeOffExchange: async (removeCollateralRequestBody?: RemoveCollateralRequestBody, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/off_exchange/remove`; // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'removeOffExchange'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(removeCollateralRequestBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Create settlement for a trader. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Create Settlement for a Trader * @param {SettlementRequestBody} [settlementRequestBody] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ settleOffExchangeTrades: async (settlementRequestBody?: SettlementRequestBody, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/off_exchange/settlements/trader`; // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'settleOffExchangeTrades'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(settlementRequestBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * OffExchangesApi - functional programming interface * @export */ export const OffExchangesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = OffExchangesApiAxiosParamCreator(configuration) return { /** * Add collateral and create deposit request. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Add Collateral * @param {AddCollateralRequestBody} [addCollateralRequestBody] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async addOffExchange(addCollateralRequestBody?: AddCollateralRequestBody, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.addOffExchange(addCollateralRequestBody, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['OffExchangesApi.addOffExchange']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a collateral account by mainExchangeAccountId. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Find a specific collateral exchange account * @param {string} mainExchangeAccountId The id of the main exchange account for which the requested collateral account is associated with * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOffExchangeCollateralAccounts(mainExchangeAccountId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOffExchangeCollateralAccounts(mainExchangeAccountId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['OffExchangesApi.getOffExchangeCollateralAccounts']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get settlements transactions from exchange. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Get Settlements Transactions * @param {string} mainExchangeAccountId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOffExchangeSettlementTransactions(mainExchangeAccountId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOffExchangeSettlementTransactions(mainExchangeAccountId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['OffExchangesApi.getOffExchangeSettlementTransactions']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Remove collateral, create withdraw request. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Remove Collateral * @param {RemoveCollateralRequestBody} [removeCollateralRequestBody] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async removeOffExchange(removeCollateralRequestBody?: RemoveCollateralRequestBody, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.removeOffExchange(removeCollateralRequestBody, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['OffExchangesApi.removeOffExchange']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Create settlement for a trader. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Create Settlement for a Trader * @param {SettlementRequestBody} [settlementRequestBody] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async settleOffExchangeTrades(settlementRequestBody?: SettlementRequestBody, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.settleOffExchangeTrades(settlementRequestBody, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['OffExchangesApi.settleOffExchangeTrades']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * OffExchangesApi - factory interface * @export */ export const OffExchangesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = OffExchangesApiFp(configuration) return { /** * Add collateral and create deposit request. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Add Collateral * @param {OffExchangesApiAddOffExchangeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ addOffExchange(requestParameters: OffExchangesApiAddOffExchangeRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addOffExchange(requestParameters.addCollateralRequestBody, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Returns a collateral account by mainExchangeAccountId. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Find a specific collateral exchange account * @param {OffExchangesApiGetOffExchangeCollateralAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOffExchangeCollateralAccounts(requestParameters: OffExchangesApiGetOffExchangeCollateralAccountsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOffExchangeCollateralAccounts(requestParameters.mainExchangeAccountId, options).then((request) => request(axios, basePath)); }, /** * Get settlements transactions from exchange. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Get Settlements Transactions * @param {OffExchangesApiGetOffExchangeSettlementTransactionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOffExchangeSettlementTransactions(requestParameters: OffExchangesApiGetOffExchangeSettlementTransactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOffExchangeSettlementTransactions(requestParameters.mainExchangeAccountId, options).then((request) => request(axios, basePath)); }, /** * Remove collateral, create withdraw request. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Remove Collateral * @param {OffExchangesApiRemoveOffExchangeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ removeOffExchange(requestParameters: OffExchangesApiRemoveOffExchangeRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.removeOffExchange(requestParameters.removeCollateralRequestBody, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Create settlement for a trader. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Create Settlement for a Trader * @param {OffExchangesApiSettleOffExchangeTradesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ settleOffExchangeTrades(requestParameters: OffExchangesApiSettleOffExchangeTradesRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.settleOffExchangeTrades(requestParameters.settlementRequestBody, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for addOffExchange operation in OffExchangesApi. * @export * @interface OffExchangesApiAddOffExchangeRequest */ export interface OffExchangesApiAddOffExchangeRequest { /** * * @type {AddCollateralRequestBody} * @memberof OffExchangesApiAddOffExchange */ readonly addCollateralRequestBody?: AddCollateralRequestBody /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof OffExchangesApiAddOffExchange */ readonly idempotencyKey?: string } /** * Request parameters for getOffExchangeCollateralAccounts operation in OffExchangesApi. * @export * @interface OffExchangesApiGetOffExchangeCollateralAccountsRequest */ export interface OffExchangesApiGetOffExchangeCollateralAccountsRequest { /** * The id of the main exchange account for which the requested collateral account is associated with * @type {string} * @memberof OffExchangesApiGetOffExchangeCollateralAccounts */ readonly mainExchangeAccountId: string } /** * Request parameters for getOffExchangeSettlementTransactions operation in OffExchangesApi. * @export * @interface OffExchangesApiGetOffExchangeSettlementTransactionsRequest */ export interface OffExchangesApiGetOffExchangeSettlementTransactionsRequest { /** * * @type {string} * @memberof OffExchangesApiGetOffExchangeSettlementTransactions */ readonly mainExchangeAccountId: string } /** * Request parameters for removeOffExchange operation in OffExchangesApi. * @export * @interface OffExchangesApiRemoveOffExchangeRequest */ export interface OffExchangesApiRemoveOffExchangeRequest { /** * * @type {RemoveCollateralRequestBody} * @memberof OffExchangesApiRemoveOffExchange */ readonly removeCollateralRequestBody?: RemoveCollateralRequestBody /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof OffExchangesApiRemoveOffExchange */ readonly idempotencyKey?: string } /** * Request parameters for settleOffExchangeTrades operation in OffExchangesApi. * @export * @interface OffExchangesApiSettleOffExchangeTradesRequest */ export interface OffExchangesApiSettleOffExchangeTradesRequest { /** * * @type {SettlementRequestBody} * @memberof OffExchangesApiSettleOffExchangeTrades */ readonly settlementRequestBody?: SettlementRequestBody /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof OffExchangesApiSettleOffExchangeTrades */ readonly idempotencyKey?: string } /** * OffExchangesApi - object-oriented interface * @export * @class OffExchangesApi * @extends {BaseAPI} */ export class OffExchangesApi extends BaseAPI { /** * Add collateral and create deposit request. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Add Collateral * @param {OffExchangesApiAddOffExchangeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffExchangesApi */ public addOffExchange(requestParameters: OffExchangesApiAddOffExchangeRequest = {}) { return OffExchangesApiFp(this.configuration).addOffExchange(requestParameters.addCollateralRequestBody, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a collateral account by mainExchangeAccountId. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Find a specific collateral exchange account * @param {OffExchangesApiGetOffExchangeCollateralAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffExchangesApi */ public getOffExchangeCollateralAccounts(requestParameters: OffExchangesApiGetOffExchangeCollateralAccountsRequest) { return OffExchangesApiFp(this.configuration).getOffExchangeCollateralAccounts(requestParameters.mainExchangeAccountId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get settlements transactions from exchange. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Get Settlements Transactions * @param {OffExchangesApiGetOffExchangeSettlementTransactionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffExchangesApi */ public getOffExchangeSettlementTransactions(requestParameters: OffExchangesApiGetOffExchangeSettlementTransactionsRequest) { return OffExchangesApiFp(this.configuration).getOffExchangeSettlementTransactions(requestParameters.mainExchangeAccountId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Remove collateral, create withdraw request. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Remove Collateral * @param {OffExchangesApiRemoveOffExchangeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffExchangesApi */ public removeOffExchange(requestParameters: OffExchangesApiRemoveOffExchangeRequest = {}) { return OffExchangesApiFp(this.configuration).removeOffExchange(requestParameters.removeCollateralRequestBody, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Create settlement for a trader. Learn more about Fireblocks Off Exchange in the following [guide](https://developers.fireblocks.com/docs/off-exchange). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Create Settlement for a Trader * @param {OffExchangesApiSettleOffExchangeTradesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffExchangesApi */ public settleOffExchangeTrades(requestParameters: OffExchangesApiSettleOffExchangeTradesRequest = {}) { return OffExchangesApiFp(this.configuration).settleOffExchangeTrades(requestParameters.settlementRequestBody, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }