/* 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 { AddExchangeAccountRequest } from '../models'; // @ts-ignore import { AddExchangeAccountResponse } from '../models'; // @ts-ignore import { ConvertAssetsRequest } from '../models'; // @ts-ignore import { ConvertAssetsResponse } from '../models'; // @ts-ignore import { CreateInternalTransferRequest } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { ExchangeAccount } from '../models'; // @ts-ignore import { ExchangeAsset } from '../models'; // @ts-ignore import { GetExchangeAccountsCredentialsPublicKeyResponse } from '../models'; // @ts-ignore import { GetPagedExchangeAccountsResponse } from '../models'; // @ts-ignore import { InternalTransferResponse } from '../models'; /** * ExchangeAccountsApi - axios parameter creator * @export */ export const ExchangeAccountsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Add an exchange account to exchanges. Note: This endpoint currently only supports the following exchanges `INDEPENDENT_RESERVE`,`BIT`, `BITHUMB`, `BITSO`, `CRYPTOCOM`, `BYBIT_V2`, `WHITEBIT`, `HITBTC`, `GEMINI`, `HUOBI`, `GATEIO`, `COINHAKO`, `BULLISH`, `BITGET`, and `LUNO` To add an exchange account, please use the following [guide](https://developers.fireblocks.com/docs/add-an-exchange-account). * @summary Add an exchange account * @param {AddExchangeAccountRequest} addExchangeAccountRequest * @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} */ addExchangeAccount: async (addExchangeAccountRequest: AddExchangeAccountRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('addExchangeAccount', 'addExchangeAccountRequest', addExchangeAccountRequest) const localVarPath = `/exchange_accounts`; // 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 = 'addExchangeAccount'; 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(addExchangeAccountRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Convert exchange account funds from the source asset to the destination asset. Coinbase (USD to USDC, USDC to USD) and Bitso (MXN to USD) are supported conversions. Learn more about Fireblocks Exchange Connectivity in the following [guide](https://developers.fireblocks.com/docs/connect-to-exchanges-and-fiat-providers). Endpoint Permission: Admin, Non-Signing Admin. * @summary Convert exchange account funds * @param {string} exchangeAccountId The ID of the exchange account. Please make sure the exchange supports conversions. To find the ID of your exchange account, use GET/exchange_accounts. * @param {ConvertAssetsRequest} [convertAssetsRequest] * @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} */ convertAssets: async (exchangeAccountId: string, convertAssetsRequest?: ConvertAssetsRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('convertAssets', 'exchangeAccountId', exchangeAccountId) const localVarPath = `/exchange_accounts/{exchangeAccountId}/convert` .replace(`{${"exchangeAccountId"}}`, encodeURIComponent(String(exchangeAccountId))); // 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 = 'convertAssets'; 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(convertAssetsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns an exchange account by ID. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get a specific exchange account * @param {string} exchangeAccountId The ID of the exchange account to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExchangeAccount: async (exchangeAccountId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getExchangeAccount', 'exchangeAccountId', exchangeAccountId) const localVarPath = `/exchange_accounts/{exchangeAccountId}` .replace(`{${"exchangeAccountId"}}`, encodeURIComponent(String(exchangeAccountId))); // 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 = 'getExchangeAccount'; 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, }; }, /** * Returns an asset for an exchange account. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get an asset for an exchange account * @param {string} exchangeAccountId The ID of the exchange account to return * @param {string} assetId The ID of the asset to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExchangeAccountAsset: async (exchangeAccountId: string, assetId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getExchangeAccountAsset', 'exchangeAccountId', exchangeAccountId) assertParamExistsAndNotEmpty('getExchangeAccountAsset', 'assetId', assetId) const localVarPath = `/exchange_accounts/{exchangeAccountId}/{assetId}` .replace(`{${"exchangeAccountId"}}`, encodeURIComponent(String(exchangeAccountId))) .replace(`{${"assetId"}}`, encodeURIComponent(String(assetId))); // 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 = 'getExchangeAccountAsset'; 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, }; }, /** * Return public key * @summary Get public key to encrypt exchange credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExchangeAccountsCredentialsPublicKey: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/exchange_accounts/credentials_public_key`; // 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 = 'getExchangeAccountsCredentialsPublicKey'; 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, }; }, /** * Returns a list of the connected exchange accounts in your workspace. Endpoint Permission: Admin, Non-Signing Admin. * @summary List connected exchange accounts * @param {number} limit number of exchanges per page * @param {string} [before] * @param {string} [after] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPagedExchangeAccounts: async (limit: number, before?: string, after?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('getPagedExchangeAccounts', 'limit', limit) const localVarPath = `/exchange_accounts/paged`; // 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 = 'getPagedExchangeAccounts'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (before !== undefined) { localVarQueryParameter['before'] = before; } if (after !== undefined) { localVarQueryParameter['after'] = after; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Transfers funds between trading accounts under the same exchange account. Learn more about Fireblocks Exchange Connectivity in the following [guide](https://developers.fireblocks.com/docs/connect-to-exchanges-and-fiat-providers). Endpoint Permission: Admin, Non-Signing Admin. * @summary Internal transfer for exchange accounts * @param {string} exchangeAccountId The ID of the exchange account to return * @param {CreateInternalTransferRequest} [createInternalTransferRequest] * @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} */ internalTransfer: async (exchangeAccountId: string, createInternalTransferRequest?: CreateInternalTransferRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('internalTransfer', 'exchangeAccountId', exchangeAccountId) const localVarPath = `/exchange_accounts/{exchangeAccountId}/internal_transfer` .replace(`{${"exchangeAccountId"}}`, encodeURIComponent(String(exchangeAccountId))); // 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 = 'internalTransfer'; 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(createInternalTransferRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ExchangeAccountsApi - functional programming interface * @export */ export const ExchangeAccountsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ExchangeAccountsApiAxiosParamCreator(configuration) return { /** * Add an exchange account to exchanges. Note: This endpoint currently only supports the following exchanges `INDEPENDENT_RESERVE`,`BIT`, `BITHUMB`, `BITSO`, `CRYPTOCOM`, `BYBIT_V2`, `WHITEBIT`, `HITBTC`, `GEMINI`, `HUOBI`, `GATEIO`, `COINHAKO`, `BULLISH`, `BITGET`, and `LUNO` To add an exchange account, please use the following [guide](https://developers.fireblocks.com/docs/add-an-exchange-account). * @summary Add an exchange account * @param {AddExchangeAccountRequest} addExchangeAccountRequest * @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 addExchangeAccount(addExchangeAccountRequest: AddExchangeAccountRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.addExchangeAccount(addExchangeAccountRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ExchangeAccountsApi.addExchangeAccount']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Convert exchange account funds from the source asset to the destination asset. Coinbase (USD to USDC, USDC to USD) and Bitso (MXN to USD) are supported conversions. Learn more about Fireblocks Exchange Connectivity in the following [guide](https://developers.fireblocks.com/docs/connect-to-exchanges-and-fiat-providers). Endpoint Permission: Admin, Non-Signing Admin. * @summary Convert exchange account funds * @param {string} exchangeAccountId The ID of the exchange account. Please make sure the exchange supports conversions. To find the ID of your exchange account, use GET/exchange_accounts. * @param {ConvertAssetsRequest} [convertAssetsRequest] * @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 convertAssets(exchangeAccountId: string, convertAssetsRequest?: ConvertAssetsRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.convertAssets(exchangeAccountId, convertAssetsRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ExchangeAccountsApi.convertAssets']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns an exchange account by ID. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get a specific exchange account * @param {string} exchangeAccountId The ID of the exchange account to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getExchangeAccount(exchangeAccountId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeAccount(exchangeAccountId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ExchangeAccountsApi.getExchangeAccount']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns an asset for an exchange account. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get an asset for an exchange account * @param {string} exchangeAccountId The ID of the exchange account to return * @param {string} assetId The ID of the asset to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getExchangeAccountAsset(exchangeAccountId: string, assetId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeAccountAsset(exchangeAccountId, assetId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ExchangeAccountsApi.getExchangeAccountAsset']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Return public key * @summary Get public key to encrypt exchange credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getExchangeAccountsCredentialsPublicKey(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeAccountsCredentialsPublicKey(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ExchangeAccountsApi.getExchangeAccountsCredentialsPublicKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a list of the connected exchange accounts in your workspace. Endpoint Permission: Admin, Non-Signing Admin. * @summary List connected exchange accounts * @param {number} limit number of exchanges per page * @param {string} [before] * @param {string} [after] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPagedExchangeAccounts(limit: number, before?: string, after?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPagedExchangeAccounts(limit, before, after, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ExchangeAccountsApi.getPagedExchangeAccounts']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Transfers funds between trading accounts under the same exchange account. Learn more about Fireblocks Exchange Connectivity in the following [guide](https://developers.fireblocks.com/docs/connect-to-exchanges-and-fiat-providers). Endpoint Permission: Admin, Non-Signing Admin. * @summary Internal transfer for exchange accounts * @param {string} exchangeAccountId The ID of the exchange account to return * @param {CreateInternalTransferRequest} [createInternalTransferRequest] * @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 internalTransfer(exchangeAccountId: string, createInternalTransferRequest?: CreateInternalTransferRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.internalTransfer(exchangeAccountId, createInternalTransferRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ExchangeAccountsApi.internalTransfer']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * ExchangeAccountsApi - factory interface * @export */ export const ExchangeAccountsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ExchangeAccountsApiFp(configuration) return { /** * Add an exchange account to exchanges. Note: This endpoint currently only supports the following exchanges `INDEPENDENT_RESERVE`,`BIT`, `BITHUMB`, `BITSO`, `CRYPTOCOM`, `BYBIT_V2`, `WHITEBIT`, `HITBTC`, `GEMINI`, `HUOBI`, `GATEIO`, `COINHAKO`, `BULLISH`, `BITGET`, and `LUNO` To add an exchange account, please use the following [guide](https://developers.fireblocks.com/docs/add-an-exchange-account). * @summary Add an exchange account * @param {ExchangeAccountsApiAddExchangeAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ addExchangeAccount(requestParameters: ExchangeAccountsApiAddExchangeAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addExchangeAccount(requestParameters.addExchangeAccountRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Convert exchange account funds from the source asset to the destination asset. Coinbase (USD to USDC, USDC to USD) and Bitso (MXN to USD) are supported conversions. Learn more about Fireblocks Exchange Connectivity in the following [guide](https://developers.fireblocks.com/docs/connect-to-exchanges-and-fiat-providers). Endpoint Permission: Admin, Non-Signing Admin. * @summary Convert exchange account funds * @param {ExchangeAccountsApiConvertAssetsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ convertAssets(requestParameters: ExchangeAccountsApiConvertAssetsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.convertAssets(requestParameters.exchangeAccountId, requestParameters.convertAssetsRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Returns an exchange account by ID. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get a specific exchange account * @param {ExchangeAccountsApiGetExchangeAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExchangeAccount(requestParameters: ExchangeAccountsApiGetExchangeAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getExchangeAccount(requestParameters.exchangeAccountId, options).then((request) => request(axios, basePath)); }, /** * Returns an asset for an exchange account. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get an asset for an exchange account * @param {ExchangeAccountsApiGetExchangeAccountAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExchangeAccountAsset(requestParameters: ExchangeAccountsApiGetExchangeAccountAssetRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getExchangeAccountAsset(requestParameters.exchangeAccountId, requestParameters.assetId, options).then((request) => request(axios, basePath)); }, /** * Return public key * @summary Get public key to encrypt exchange credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExchangeAccountsCredentialsPublicKey(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getExchangeAccountsCredentialsPublicKey(options).then((request) => request(axios, basePath)); }, /** * Returns a list of the connected exchange accounts in your workspace. Endpoint Permission: Admin, Non-Signing Admin. * @summary List connected exchange accounts * @param {ExchangeAccountsApiGetPagedExchangeAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPagedExchangeAccounts(requestParameters: ExchangeAccountsApiGetPagedExchangeAccountsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPagedExchangeAccounts(requestParameters.limit, requestParameters.before, requestParameters.after, options).then((request) => request(axios, basePath)); }, /** * Transfers funds between trading accounts under the same exchange account. Learn more about Fireblocks Exchange Connectivity in the following [guide](https://developers.fireblocks.com/docs/connect-to-exchanges-and-fiat-providers). Endpoint Permission: Admin, Non-Signing Admin. * @summary Internal transfer for exchange accounts * @param {ExchangeAccountsApiInternalTransferRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ internalTransfer(requestParameters: ExchangeAccountsApiInternalTransferRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.internalTransfer(requestParameters.exchangeAccountId, requestParameters.createInternalTransferRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for addExchangeAccount operation in ExchangeAccountsApi. * @export * @interface ExchangeAccountsApiAddExchangeAccountRequest */ export interface ExchangeAccountsApiAddExchangeAccountRequest { /** * * @type {AddExchangeAccountRequest} * @memberof ExchangeAccountsApiAddExchangeAccount */ readonly addExchangeAccountRequest: AddExchangeAccountRequest /** * 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 ExchangeAccountsApiAddExchangeAccount */ readonly idempotencyKey?: string } /** * Request parameters for convertAssets operation in ExchangeAccountsApi. * @export * @interface ExchangeAccountsApiConvertAssetsRequest */ export interface ExchangeAccountsApiConvertAssetsRequest { /** * The ID of the exchange account. Please make sure the exchange supports conversions. To find the ID of your exchange account, use GET/exchange_accounts. * @type {string} * @memberof ExchangeAccountsApiConvertAssets */ readonly exchangeAccountId: string /** * * @type {ConvertAssetsRequest} * @memberof ExchangeAccountsApiConvertAssets */ readonly convertAssetsRequest?: ConvertAssetsRequest /** * 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 ExchangeAccountsApiConvertAssets */ readonly idempotencyKey?: string } /** * Request parameters for getExchangeAccount operation in ExchangeAccountsApi. * @export * @interface ExchangeAccountsApiGetExchangeAccountRequest */ export interface ExchangeAccountsApiGetExchangeAccountRequest { /** * The ID of the exchange account to return * @type {string} * @memberof ExchangeAccountsApiGetExchangeAccount */ readonly exchangeAccountId: string } /** * Request parameters for getExchangeAccountAsset operation in ExchangeAccountsApi. * @export * @interface ExchangeAccountsApiGetExchangeAccountAssetRequest */ export interface ExchangeAccountsApiGetExchangeAccountAssetRequest { /** * The ID of the exchange account to return * @type {string} * @memberof ExchangeAccountsApiGetExchangeAccountAsset */ readonly exchangeAccountId: string /** * The ID of the asset to return * @type {string} * @memberof ExchangeAccountsApiGetExchangeAccountAsset */ readonly assetId: string } /** * Request parameters for getPagedExchangeAccounts operation in ExchangeAccountsApi. * @export * @interface ExchangeAccountsApiGetPagedExchangeAccountsRequest */ export interface ExchangeAccountsApiGetPagedExchangeAccountsRequest { /** * number of exchanges per page * @type {number} * @memberof ExchangeAccountsApiGetPagedExchangeAccounts */ readonly limit: number /** * * @type {string} * @memberof ExchangeAccountsApiGetPagedExchangeAccounts */ readonly before?: string /** * * @type {string} * @memberof ExchangeAccountsApiGetPagedExchangeAccounts */ readonly after?: string } /** * Request parameters for internalTransfer operation in ExchangeAccountsApi. * @export * @interface ExchangeAccountsApiInternalTransferRequest */ export interface ExchangeAccountsApiInternalTransferRequest { /** * The ID of the exchange account to return * @type {string} * @memberof ExchangeAccountsApiInternalTransfer */ readonly exchangeAccountId: string /** * * @type {CreateInternalTransferRequest} * @memberof ExchangeAccountsApiInternalTransfer */ readonly createInternalTransferRequest?: CreateInternalTransferRequest /** * 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 ExchangeAccountsApiInternalTransfer */ readonly idempotencyKey?: string } /** * ExchangeAccountsApi - object-oriented interface * @export * @class ExchangeAccountsApi * @extends {BaseAPI} */ export class ExchangeAccountsApi extends BaseAPI { /** * Add an exchange account to exchanges. Note: This endpoint currently only supports the following exchanges `INDEPENDENT_RESERVE`,`BIT`, `BITHUMB`, `BITSO`, `CRYPTOCOM`, `BYBIT_V2`, `WHITEBIT`, `HITBTC`, `GEMINI`, `HUOBI`, `GATEIO`, `COINHAKO`, `BULLISH`, `BITGET`, and `LUNO` To add an exchange account, please use the following [guide](https://developers.fireblocks.com/docs/add-an-exchange-account). * @summary Add an exchange account * @param {ExchangeAccountsApiAddExchangeAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExchangeAccountsApi */ public addExchangeAccount(requestParameters: ExchangeAccountsApiAddExchangeAccountRequest) { return ExchangeAccountsApiFp(this.configuration).addExchangeAccount(requestParameters.addExchangeAccountRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Convert exchange account funds from the source asset to the destination asset. Coinbase (USD to USDC, USDC to USD) and Bitso (MXN to USD) are supported conversions. Learn more about Fireblocks Exchange Connectivity in the following [guide](https://developers.fireblocks.com/docs/connect-to-exchanges-and-fiat-providers). Endpoint Permission: Admin, Non-Signing Admin. * @summary Convert exchange account funds * @param {ExchangeAccountsApiConvertAssetsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExchangeAccountsApi */ public convertAssets(requestParameters: ExchangeAccountsApiConvertAssetsRequest) { return ExchangeAccountsApiFp(this.configuration).convertAssets(requestParameters.exchangeAccountId, requestParameters.convertAssetsRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns an exchange account by ID. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get a specific exchange account * @param {ExchangeAccountsApiGetExchangeAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExchangeAccountsApi */ public getExchangeAccount(requestParameters: ExchangeAccountsApiGetExchangeAccountRequest) { return ExchangeAccountsApiFp(this.configuration).getExchangeAccount(requestParameters.exchangeAccountId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns an asset for an exchange account. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get an asset for an exchange account * @param {ExchangeAccountsApiGetExchangeAccountAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExchangeAccountsApi */ public getExchangeAccountAsset(requestParameters: ExchangeAccountsApiGetExchangeAccountAssetRequest) { return ExchangeAccountsApiFp(this.configuration).getExchangeAccountAsset(requestParameters.exchangeAccountId, requestParameters.assetId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Return public key * @summary Get public key to encrypt exchange credentials * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExchangeAccountsApi */ public getExchangeAccountsCredentialsPublicKey() { return ExchangeAccountsApiFp(this.configuration).getExchangeAccountsCredentialsPublicKey().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a list of the connected exchange accounts in your workspace. Endpoint Permission: Admin, Non-Signing Admin. * @summary List connected exchange accounts * @param {ExchangeAccountsApiGetPagedExchangeAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExchangeAccountsApi */ public getPagedExchangeAccounts(requestParameters: ExchangeAccountsApiGetPagedExchangeAccountsRequest) { return ExchangeAccountsApiFp(this.configuration).getPagedExchangeAccounts(requestParameters.limit, requestParameters.before, requestParameters.after).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Transfers funds between trading accounts under the same exchange account. Learn more about Fireblocks Exchange Connectivity in the following [guide](https://developers.fireblocks.com/docs/connect-to-exchanges-and-fiat-providers). Endpoint Permission: Admin, Non-Signing Admin. * @summary Internal transfer for exchange accounts * @param {ExchangeAccountsApiInternalTransferRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExchangeAccountsApi */ public internalTransfer(requestParameters: ExchangeAccountsApiInternalTransferRequest) { return ExchangeAccountsApiFp(this.configuration).internalTransfer(requestParameters.exchangeAccountId, requestParameters.createInternalTransferRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }