/* 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 { CreateOffersRequest } from '../models'; // @ts-ignore import { CreateOrderRequest } from '../models'; // @ts-ignore import { CreateQuote } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { GetOrdersResponse } from '../models'; // @ts-ignore import { OffersResponse } from '../models'; // @ts-ignore import { OrderDetails } from '../models'; // @ts-ignore import { OrderRequirementDetails } from '../models'; // @ts-ignore import { OrderStatus } from '../models'; // @ts-ignore import { ProvidersListResponse } from '../models'; // @ts-ignore import { QuotesResponse } from '../models'; // @ts-ignore import { RatesRequest } from '../models'; // @ts-ignore import { RatesResponse } from '../models'; // @ts-ignore import { SubmitOrderRequirementRequest } from '../models'; // @ts-ignore import { TradeClass } from '../models'; // @ts-ignore import { TradingErrorSchema } from '../models'; // @ts-ignore import { TradingPairSide } from '../models'; // @ts-ignore import { TradingPairsListPage } from '../models'; // @ts-ignore import { TradingProvider } from '../models'; // @ts-ignore import { TransferRail } from '../models'; /** * TradingApi - axios parameter creator * @export */ export const TradingApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Create an order to buy or sell an asset. If no source is given, an external source will be use. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Create an order * @param {CreateOrderRequest} createOrderRequest * @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} */ createOrder: async (createOrderRequest: CreateOrderRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createOrder', 'createOrderRequest', createOrderRequest) const localVarPath = `/trading/orders`; // 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 = 'createOrder'; 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(createOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Generate a time-limited quote for asset conversion, providing exchange rate and amount calculations. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get quotes for each side the provider supports in a single call; providers that support only one side return that side only. Every returned quote carries a concrete `BUY` or `SELL` side, never `BOTH`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Create a quote * @param {CreateQuote} createQuote * @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} */ createQuote: async (createQuote: CreateQuote, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createQuote', 'createQuote', createQuote) const localVarPath = `/trading/quotes`; // 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 = 'createQuote'; 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(createQuote, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve all available offers across the workspace for a given asset pair. Always operates in open scope — no provider or account selection required. Returns a mix of indicative rates and committed quotes as applicable per provider. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get offers for each side the provider supports in a single call; providers that support only one side return that side only. Every returned offer carries a concrete `BUY` or `SELL` side, never `BOTH`. If no slippageBps is provided, it defaults to 50 bps (0.5%). Slippage and settlement configuration do not affect the returned rate. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get all offers * @param {CreateOffersRequest} createOffersRequest * @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} */ fetchAllOffers: async (createOffersRequest: CreateOffersRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('fetchAllOffers', 'createOffersRequest', createOffersRequest) const localVarPath = `/trading/offers`; // 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 = 'fetchAllOffers'; 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(createOffersRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve indicative exchange rate from specified providers for a given asset pair. Rates are non-executable price signals intended for discovery and display purposes. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get rates for each side the provider supports in a single call; providers that support only one side return that side only. Every returned rate carries a concrete `BUY` or `SELL` side, never `BOTH`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get rates * @param {RatesRequest} ratesRequest * @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} */ fetchRates: async (ratesRequest: RatesRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('fetchRates', 'ratesRequest', ratesRequest) const localVarPath = `/trading/rates`; // 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 = 'fetchRates'; 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(ratesRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve detailed information about a specific order by its ID. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get order details * @param {string} orderId The ID of the order to fetch. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrder: async (orderId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getOrder', 'orderId', orderId) const localVarPath = `/trading/orders/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // 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 = 'getOrder'; 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, }; }, /** * Fetch order requirement details for an order that is in `AWAITING_INFORMATION` status. The response includes `requirementId` and `dueBy` metadata, a `requiredData` JSON Schema (Draft-7) describing the shape of the `data` object expected on `POST /trading/orders/{orderId}/requirement/data`, and `requiredFiles` descriptors for any files the provider requires (uploaded via `POST /trading/orders/{orderId}/requirement/file`). Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get order requirement details for an order * @param {string} orderId The ID of the order for which the order requirement is issued. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderRequirements: async (orderId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getOrderRequirements', 'orderId', orderId) const localVarPath = `/trading/orders/{orderId}/requirement` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // 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 = 'getOrderRequirements'; 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, }; }, /** * Retrieve a paginated list of orders with optional filtering by account, provider, status, and time range. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get orders * @param {number} pageSize pageSize for pagination. * @param {string} [pageCursor] * @param {GetOrdersOrderEnum} [order] ASC / DESC ordering (default DESC) * @param {Array} [accountId] Filter by accountId. * @param {Array} [providerId] Filter by providerId. * @param {Array} [statuses] Filter by order status. * @param {number} [startTime] * @param {number} [endTime] * @param {GetOrdersAssetConversionTypeEnum} [assetConversionType] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrders: async (pageSize: number, pageCursor?: string, order?: GetOrdersOrderEnum, accountId?: Array, providerId?: Array, statuses?: Array, startTime?: number, endTime?: number, assetConversionType?: GetOrdersAssetConversionTypeEnum, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('getOrders', 'pageSize', pageSize) const localVarPath = `/trading/orders`; // 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 = 'getOrders'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (order !== undefined) { localVarQueryParameter['order'] = order; } if (accountId) { localVarQueryParameter['accountId'] = accountId; } if (providerId) { localVarQueryParameter['providerId'] = providerId; } if (statuses) { localVarQueryParameter['statuses'] = statuses; } if (startTime !== undefined) { localVarQueryParameter['startTime'] = startTime; } if (endTime !== undefined) { localVarQueryParameter['endTime'] = endTime; } if (assetConversionType !== undefined) { localVarQueryParameter['assetConversionType'] = assetConversionType; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve the base/quote trading pairs supported by the tenant\'s trading providers. All filters are optional and combined with AND. A provider can return several rows for one pair, one per side and per connected account, each with its own `tradeClass`. Rows may use the wildcard `*` asset ID or the `BOTH` side and are returned unexpanded (see the `baseAsset`, `side` and `baseChain` filters for how they match). **Examples** - Which providers support ETH/USDC: `?baseAsset=ETH"eAsset=USDC`. Add `providerId` to check one provider; an empty `data` array means it does not support the pair. - All pairs of one account: `?providerId=ACME&accountId=`. Page through large results with `pageSize` and `pageCursor`. - Everything you can buy with euro: `?baseAsset=EUR&tradeClass=ON_RAMP`. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get trading pairs * @param {string} [baseAsset] Filter by base asset ID. Also matches `*` rows on the chain of this asset. * @param {string} [quoteAsset] Filter by quote asset ID. Also matches `*` rows on the chain of this asset. * @param {string} [baseChain] Filter by base asset blockchain `legacyId` (e.g. `ETH`, `BASECHAIN_ETH`, `SOL`). Matches both concrete-asset rows and `*` rows on that chain. * @param {string} [quoteChain] Filter by quote asset blockchain `legacyId` (e.g. `ETH`, `BASECHAIN_ETH`, `SOL`). Matches both concrete-asset rows and `*` rows on that chain. * @param {TransferRail} [baseRail] Filter by base asset transfer rail. * @param {TransferRail} [quoteRail] Filter by quote asset transfer rail. * @param {TradingPairSide} [side] Filter by trading side. `BUY` or `SELL` also matches rows whose side is `BOTH`; `BOTH` matches rows of any side. * @param {TradeClass} [tradeClass] Filter by trade class. * @param {Array} [providerId] Filter by provider ID. Repeat the parameter to match any of several providers, up to 50. * @param {Array} [accountId] Filter by connected account ID. Repeat the parameter to match any of several accounts, up to 50. * @param {boolean} [prefunded] Filter by whether the pair requires prefunding. * @param {string} [min] An order-size filter, not a bound on the result. Only returns pairs whose own `min` field (the smallest base-asset amount the pair accepts) is at most this value, i.e. pairs that can serve an order of this size. For example, `min=10` returns pairs with a `min` of 10 or less. * @param {string} [max] An order-size filter, not a bound on the result. Only returns pairs whose own `max` field (the largest base-asset amount the pair accepts) is at least this value. For example, `max=1000` returns pairs with a `max` of 1000 or more. * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTradingPairs: async (baseAsset?: string, quoteAsset?: string, baseChain?: string, quoteChain?: string, baseRail?: TransferRail, quoteRail?: TransferRail, side?: TradingPairSide, tradeClass?: TradeClass, providerId?: Array, accountId?: Array, prefunded?: boolean, min?: string, max?: string, pageSize?: number, pageCursor?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/trading/pairs`; // 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 = 'getTradingPairs'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (baseAsset !== undefined) { localVarQueryParameter['baseAsset'] = baseAsset; } if (quoteAsset !== undefined) { localVarQueryParameter['quoteAsset'] = quoteAsset; } if (baseChain !== undefined) { localVarQueryParameter['baseChain'] = baseChain; } if (quoteChain !== undefined) { localVarQueryParameter['quoteChain'] = quoteChain; } if (baseRail !== undefined) { localVarQueryParameter['baseRail'] = baseRail; } if (quoteRail !== undefined) { localVarQueryParameter['quoteRail'] = quoteRail; } if (side !== undefined) { localVarQueryParameter['side'] = side; } if (tradeClass !== undefined) { localVarQueryParameter['tradeClass'] = tradeClass; } if (providerId) { localVarQueryParameter['providerId'] = providerId; } if (accountId) { localVarQueryParameter['accountId'] = accountId; } if (prefunded !== undefined) { localVarQueryParameter['prefunded'] = prefunded; } if (min !== undefined) { localVarQueryParameter['min'] = min; } if (max !== undefined) { localVarQueryParameter['max'] = max; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve a single provider by ID. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get trading provider by ID * @param {string} providerId The unique identifier of the provider. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTradingProviderById: async (providerId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getTradingProviderById', 'providerId', providerId) const localVarPath = `/trading/providers/{providerId}` .replace(`{${"providerId"}}`, encodeURIComponent(String(providerId))); // 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 = 'getTradingProviderById'; 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, }; }, /** * Retrieve a list of all available external providers supporting trading activities through the platform. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get providers * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTradingProviders: async (pageSize?: number, pageCursor?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/trading/providers`; // 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 = 'getTradingProviders'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Submit the user\'s textual response to an order requirement on an order that is in `AWAITING_INFORMATION` status. The request body carries `data` — a free-form object conforming to the `requiredData` JSON Schema returned by the GET endpoint. Any required files are uploaded separately via `POST /trading/orders/{orderId}/requirement/file`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Submit a response to an order requirement * @param {SubmitOrderRequirementRequest} submitOrderRequirementRequest * @param {string} orderId The ID of the order to submit the order requirement response for. * @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} */ submitOrderRequirements: async (submitOrderRequirementRequest: SubmitOrderRequirementRequest, orderId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('submitOrderRequirements', 'submitOrderRequirementRequest', submitOrderRequirementRequest) assertParamExistsAndNotEmpty('submitOrderRequirements', 'orderId', orderId) const localVarPath = `/trading/orders/{orderId}/requirement/data` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // 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 = 'submitOrderRequirements'; 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(submitOrderRequirementRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Upload a single file (multipart/form-data) in response to an order requirement on an order that is in `AWAITING_INFORMATION` status. Call this endpoint once per required file. Send `fileKey` (matching a `fileKey` from `requiredFiles` on the GET response) and the binary `file`. Its type must be one of the supported file formats. Fireblocks encrypts each file and uploads it individually to the underlying provider. The textual response is submitted separately via `POST /trading/orders/{orderId}/requirement/data`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Upload a file for an order requirement * @param {string} fileKey Identifier of the required file this upload satisfies. Must match a `fileKey` from `requiredFiles` on the GET response. * @param {File} file The binary file content. The file\\\'s type must be one of the supported OrderRequirementAllowedFileType values; the file name and type are derived from the uploaded part. * @param {string} orderId The ID of the order to upload the order requirement file for. * @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} */ uploadOrderRequirementFile: async (fileKey: string, file: File, orderId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('uploadOrderRequirementFile', 'fileKey', fileKey) assertParamExists('uploadOrderRequirementFile', 'file', file) assertParamExistsAndNotEmpty('uploadOrderRequirementFile', 'orderId', orderId) const localVarPath = `/trading/orders/{orderId}/requirement/file` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // 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 = 'uploadOrderRequirementFile'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } if (fileKey !== undefined) { localVarFormParams.append('fileKey', fileKey as any); } if (file !== undefined) { localVarFormParams.append('file', file as any); } localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * TradingApi - functional programming interface * @export */ export const TradingApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = TradingApiAxiosParamCreator(configuration) return { /** * Create an order to buy or sell an asset. If no source is given, an external source will be use. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Create an order * @param {CreateOrderRequest} createOrderRequest * @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 createOrder(createOrderRequest: CreateOrderRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createOrder(createOrderRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.createOrder']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Generate a time-limited quote for asset conversion, providing exchange rate and amount calculations. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get quotes for each side the provider supports in a single call; providers that support only one side return that side only. Every returned quote carries a concrete `BUY` or `SELL` side, never `BOTH`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Create a quote * @param {CreateQuote} createQuote * @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 createQuote(createQuote: CreateQuote, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createQuote(createQuote, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.createQuote']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve all available offers across the workspace for a given asset pair. Always operates in open scope — no provider or account selection required. Returns a mix of indicative rates and committed quotes as applicable per provider. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get offers for each side the provider supports in a single call; providers that support only one side return that side only. Every returned offer carries a concrete `BUY` or `SELL` side, never `BOTH`. If no slippageBps is provided, it defaults to 50 bps (0.5%). Slippage and settlement configuration do not affect the returned rate. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get all offers * @param {CreateOffersRequest} createOffersRequest * @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 fetchAllOffers(createOffersRequest: CreateOffersRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.fetchAllOffers(createOffersRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.fetchAllOffers']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve indicative exchange rate from specified providers for a given asset pair. Rates are non-executable price signals intended for discovery and display purposes. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get rates for each side the provider supports in a single call; providers that support only one side return that side only. Every returned rate carries a concrete `BUY` or `SELL` side, never `BOTH`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get rates * @param {RatesRequest} ratesRequest * @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 fetchRates(ratesRequest: RatesRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.fetchRates(ratesRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.fetchRates']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve detailed information about a specific order by its ID. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get order details * @param {string} orderId The ID of the order to fetch. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOrder(orderId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrder(orderId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.getOrder']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Fetch order requirement details for an order that is in `AWAITING_INFORMATION` status. The response includes `requirementId` and `dueBy` metadata, a `requiredData` JSON Schema (Draft-7) describing the shape of the `data` object expected on `POST /trading/orders/{orderId}/requirement/data`, and `requiredFiles` descriptors for any files the provider requires (uploaded via `POST /trading/orders/{orderId}/requirement/file`). Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get order requirement details for an order * @param {string} orderId The ID of the order for which the order requirement is issued. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOrderRequirements(orderId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderRequirements(orderId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.getOrderRequirements']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve a paginated list of orders with optional filtering by account, provider, status, and time range. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get orders * @param {number} pageSize pageSize for pagination. * @param {string} [pageCursor] * @param {GetOrdersOrderEnum} [order] ASC / DESC ordering (default DESC) * @param {Array} [accountId] Filter by accountId. * @param {Array} [providerId] Filter by providerId. * @param {Array} [statuses] Filter by order status. * @param {number} [startTime] * @param {number} [endTime] * @param {GetOrdersAssetConversionTypeEnum} [assetConversionType] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOrders(pageSize: number, pageCursor?: string, order?: GetOrdersOrderEnum, accountId?: Array, providerId?: Array, statuses?: Array, startTime?: number, endTime?: number, assetConversionType?: GetOrdersAssetConversionTypeEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrders(pageSize, pageCursor, order, accountId, providerId, statuses, startTime, endTime, assetConversionType, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.getOrders']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve the base/quote trading pairs supported by the tenant\'s trading providers. All filters are optional and combined with AND. A provider can return several rows for one pair, one per side and per connected account, each with its own `tradeClass`. Rows may use the wildcard `*` asset ID or the `BOTH` side and are returned unexpanded (see the `baseAsset`, `side` and `baseChain` filters for how they match). **Examples** - Which providers support ETH/USDC: `?baseAsset=ETH"eAsset=USDC`. Add `providerId` to check one provider; an empty `data` array means it does not support the pair. - All pairs of one account: `?providerId=ACME&accountId=`. Page through large results with `pageSize` and `pageCursor`. - Everything you can buy with euro: `?baseAsset=EUR&tradeClass=ON_RAMP`. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get trading pairs * @param {string} [baseAsset] Filter by base asset ID. Also matches `*` rows on the chain of this asset. * @param {string} [quoteAsset] Filter by quote asset ID. Also matches `*` rows on the chain of this asset. * @param {string} [baseChain] Filter by base asset blockchain `legacyId` (e.g. `ETH`, `BASECHAIN_ETH`, `SOL`). Matches both concrete-asset rows and `*` rows on that chain. * @param {string} [quoteChain] Filter by quote asset blockchain `legacyId` (e.g. `ETH`, `BASECHAIN_ETH`, `SOL`). Matches both concrete-asset rows and `*` rows on that chain. * @param {TransferRail} [baseRail] Filter by base asset transfer rail. * @param {TransferRail} [quoteRail] Filter by quote asset transfer rail. * @param {TradingPairSide} [side] Filter by trading side. `BUY` or `SELL` also matches rows whose side is `BOTH`; `BOTH` matches rows of any side. * @param {TradeClass} [tradeClass] Filter by trade class. * @param {Array} [providerId] Filter by provider ID. Repeat the parameter to match any of several providers, up to 50. * @param {Array} [accountId] Filter by connected account ID. Repeat the parameter to match any of several accounts, up to 50. * @param {boolean} [prefunded] Filter by whether the pair requires prefunding. * @param {string} [min] An order-size filter, not a bound on the result. Only returns pairs whose own `min` field (the smallest base-asset amount the pair accepts) is at most this value, i.e. pairs that can serve an order of this size. For example, `min=10` returns pairs with a `min` of 10 or less. * @param {string} [max] An order-size filter, not a bound on the result. Only returns pairs whose own `max` field (the largest base-asset amount the pair accepts) is at least this value. For example, `max=1000` returns pairs with a `max` of 1000 or more. * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getTradingPairs(baseAsset?: string, quoteAsset?: string, baseChain?: string, quoteChain?: string, baseRail?: TransferRail, quoteRail?: TransferRail, side?: TradingPairSide, tradeClass?: TradeClass, providerId?: Array, accountId?: Array, prefunded?: boolean, min?: string, max?: string, pageSize?: number, pageCursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTradingPairs(baseAsset, quoteAsset, baseChain, quoteChain, baseRail, quoteRail, side, tradeClass, providerId, accountId, prefunded, min, max, pageSize, pageCursor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.getTradingPairs']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve a single provider by ID. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get trading provider by ID * @param {string} providerId The unique identifier of the provider. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getTradingProviderById(providerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTradingProviderById(providerId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.getTradingProviderById']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve a list of all available external providers supporting trading activities through the platform. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get providers * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getTradingProviders(pageSize?: number, pageCursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTradingProviders(pageSize, pageCursor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.getTradingProviders']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Submit the user\'s textual response to an order requirement on an order that is in `AWAITING_INFORMATION` status. The request body carries `data` — a free-form object conforming to the `requiredData` JSON Schema returned by the GET endpoint. Any required files are uploaded separately via `POST /trading/orders/{orderId}/requirement/file`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Submit a response to an order requirement * @param {SubmitOrderRequirementRequest} submitOrderRequirementRequest * @param {string} orderId The ID of the order to submit the order requirement response for. * @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 submitOrderRequirements(submitOrderRequirementRequest: SubmitOrderRequirementRequest, orderId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.submitOrderRequirements(submitOrderRequirementRequest, orderId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.submitOrderRequirements']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Upload a single file (multipart/form-data) in response to an order requirement on an order that is in `AWAITING_INFORMATION` status. Call this endpoint once per required file. Send `fileKey` (matching a `fileKey` from `requiredFiles` on the GET response) and the binary `file`. Its type must be one of the supported file formats. Fireblocks encrypts each file and uploads it individually to the underlying provider. The textual response is submitted separately via `POST /trading/orders/{orderId}/requirement/data`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Upload a file for an order requirement * @param {string} fileKey Identifier of the required file this upload satisfies. Must match a `fileKey` from `requiredFiles` on the GET response. * @param {File} file The binary file content. The file\\\'s type must be one of the supported OrderRequirementAllowedFileType values; the file name and type are derived from the uploaded part. * @param {string} orderId The ID of the order to upload the order requirement file for. * @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 uploadOrderRequirementFile(fileKey: string, file: File, orderId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.uploadOrderRequirementFile(fileKey, file, orderId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['TradingApi.uploadOrderRequirementFile']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * TradingApi - factory interface * @export */ export const TradingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = TradingApiFp(configuration) return { /** * Create an order to buy or sell an asset. If no source is given, an external source will be use. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Create an order * @param {TradingApiCreateOrderRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createOrder(requestParameters: TradingApiCreateOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createOrder(requestParameters.createOrderRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Generate a time-limited quote for asset conversion, providing exchange rate and amount calculations. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get quotes for each side the provider supports in a single call; providers that support only one side return that side only. Every returned quote carries a concrete `BUY` or `SELL` side, never `BOTH`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Create a quote * @param {TradingApiCreateQuoteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createQuote(requestParameters: TradingApiCreateQuoteRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createQuote(requestParameters.createQuote, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Retrieve all available offers across the workspace for a given asset pair. Always operates in open scope — no provider or account selection required. Returns a mix of indicative rates and committed quotes as applicable per provider. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get offers for each side the provider supports in a single call; providers that support only one side return that side only. Every returned offer carries a concrete `BUY` or `SELL` side, never `BOTH`. If no slippageBps is provided, it defaults to 50 bps (0.5%). Slippage and settlement configuration do not affect the returned rate. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get all offers * @param {TradingApiFetchAllOffersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchAllOffers(requestParameters: TradingApiFetchAllOffersRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fetchAllOffers(requestParameters.createOffersRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Retrieve indicative exchange rate from specified providers for a given asset pair. Rates are non-executable price signals intended for discovery and display purposes. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get rates for each side the provider supports in a single call; providers that support only one side return that side only. Every returned rate carries a concrete `BUY` or `SELL` side, never `BOTH`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get rates * @param {TradingApiFetchRatesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchRates(requestParameters: TradingApiFetchRatesRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fetchRates(requestParameters.ratesRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Retrieve detailed information about a specific order by its ID. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get order details * @param {TradingApiGetOrderRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrder(requestParameters: TradingApiGetOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrder(requestParameters.orderId, options).then((request) => request(axios, basePath)); }, /** * Fetch order requirement details for an order that is in `AWAITING_INFORMATION` status. The response includes `requirementId` and `dueBy` metadata, a `requiredData` JSON Schema (Draft-7) describing the shape of the `data` object expected on `POST /trading/orders/{orderId}/requirement/data`, and `requiredFiles` descriptors for any files the provider requires (uploaded via `POST /trading/orders/{orderId}/requirement/file`). Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get order requirement details for an order * @param {TradingApiGetOrderRequirementsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderRequirements(requestParameters: TradingApiGetOrderRequirementsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderRequirements(requestParameters.orderId, options).then((request) => request(axios, basePath)); }, /** * Retrieve a paginated list of orders with optional filtering by account, provider, status, and time range. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get orders * @param {TradingApiGetOrdersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrders(requestParameters: TradingApiGetOrdersRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrders(requestParameters.pageSize, requestParameters.pageCursor, requestParameters.order, requestParameters.accountId, requestParameters.providerId, requestParameters.statuses, requestParameters.startTime, requestParameters.endTime, requestParameters.assetConversionType, options).then((request) => request(axios, basePath)); }, /** * Retrieve the base/quote trading pairs supported by the tenant\'s trading providers. All filters are optional and combined with AND. A provider can return several rows for one pair, one per side and per connected account, each with its own `tradeClass`. Rows may use the wildcard `*` asset ID or the `BOTH` side and are returned unexpanded (see the `baseAsset`, `side` and `baseChain` filters for how they match). **Examples** - Which providers support ETH/USDC: `?baseAsset=ETH"eAsset=USDC`. Add `providerId` to check one provider; an empty `data` array means it does not support the pair. - All pairs of one account: `?providerId=ACME&accountId=`. Page through large results with `pageSize` and `pageCursor`. - Everything you can buy with euro: `?baseAsset=EUR&tradeClass=ON_RAMP`. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get trading pairs * @param {TradingApiGetTradingPairsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTradingPairs(requestParameters: TradingApiGetTradingPairsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getTradingPairs(requestParameters.baseAsset, requestParameters.quoteAsset, requestParameters.baseChain, requestParameters.quoteChain, requestParameters.baseRail, requestParameters.quoteRail, requestParameters.side, requestParameters.tradeClass, requestParameters.providerId, requestParameters.accountId, requestParameters.prefunded, requestParameters.min, requestParameters.max, requestParameters.pageSize, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, /** * Retrieve a single provider by ID. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get trading provider by ID * @param {TradingApiGetTradingProviderByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTradingProviderById(requestParameters: TradingApiGetTradingProviderByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getTradingProviderById(requestParameters.providerId, options).then((request) => request(axios, basePath)); }, /** * Retrieve a list of all available external providers supporting trading activities through the platform. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get providers * @param {TradingApiGetTradingProvidersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTradingProviders(requestParameters: TradingApiGetTradingProvidersRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getTradingProviders(requestParameters.pageSize, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, /** * Submit the user\'s textual response to an order requirement on an order that is in `AWAITING_INFORMATION` status. The request body carries `data` — a free-form object conforming to the `requiredData` JSON Schema returned by the GET endpoint. Any required files are uploaded separately via `POST /trading/orders/{orderId}/requirement/file`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Submit a response to an order requirement * @param {TradingApiSubmitOrderRequirementsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ submitOrderRequirements(requestParameters: TradingApiSubmitOrderRequirementsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.submitOrderRequirements(requestParameters.submitOrderRequirementRequest, requestParameters.orderId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Upload a single file (multipart/form-data) in response to an order requirement on an order that is in `AWAITING_INFORMATION` status. Call this endpoint once per required file. Send `fileKey` (matching a `fileKey` from `requiredFiles` on the GET response) and the binary `file`. Its type must be one of the supported file formats. Fireblocks encrypts each file and uploads it individually to the underlying provider. The textual response is submitted separately via `POST /trading/orders/{orderId}/requirement/data`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Upload a file for an order requirement * @param {TradingApiUploadOrderRequirementFileRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadOrderRequirementFile(requestParameters: TradingApiUploadOrderRequirementFileRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadOrderRequirementFile(requestParameters.fileKey, requestParameters.file, requestParameters.orderId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createOrder operation in TradingApi. * @export * @interface TradingApiCreateOrderRequest */ export interface TradingApiCreateOrderRequest { /** * * @type {CreateOrderRequest} * @memberof TradingApiCreateOrder */ readonly createOrderRequest: CreateOrderRequest /** * 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 TradingApiCreateOrder */ readonly idempotencyKey?: string } /** * Request parameters for createQuote operation in TradingApi. * @export * @interface TradingApiCreateQuoteRequest */ export interface TradingApiCreateQuoteRequest { /** * * @type {CreateQuote} * @memberof TradingApiCreateQuote */ readonly createQuote: CreateQuote /** * 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 TradingApiCreateQuote */ readonly idempotencyKey?: string } /** * Request parameters for fetchAllOffers operation in TradingApi. * @export * @interface TradingApiFetchAllOffersRequest */ export interface TradingApiFetchAllOffersRequest { /** * * @type {CreateOffersRequest} * @memberof TradingApiFetchAllOffers */ readonly createOffersRequest: CreateOffersRequest /** * 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 TradingApiFetchAllOffers */ readonly idempotencyKey?: string } /** * Request parameters for fetchRates operation in TradingApi. * @export * @interface TradingApiFetchRatesRequest */ export interface TradingApiFetchRatesRequest { /** * * @type {RatesRequest} * @memberof TradingApiFetchRates */ readonly ratesRequest: RatesRequest /** * 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 TradingApiFetchRates */ readonly idempotencyKey?: string } /** * Request parameters for getOrder operation in TradingApi. * @export * @interface TradingApiGetOrderRequest */ export interface TradingApiGetOrderRequest { /** * The ID of the order to fetch. * @type {string} * @memberof TradingApiGetOrder */ readonly orderId: string } /** * Request parameters for getOrderRequirements operation in TradingApi. * @export * @interface TradingApiGetOrderRequirementsRequest */ export interface TradingApiGetOrderRequirementsRequest { /** * The ID of the order for which the order requirement is issued. * @type {string} * @memberof TradingApiGetOrderRequirements */ readonly orderId: string } /** * Request parameters for getOrders operation in TradingApi. * @export * @interface TradingApiGetOrdersRequest */ export interface TradingApiGetOrdersRequest { /** * pageSize for pagination. * @type {number} * @memberof TradingApiGetOrders */ readonly pageSize: number /** * * @type {string} * @memberof TradingApiGetOrders */ readonly pageCursor?: string /** * ASC / DESC ordering (default DESC) * @type {'ASC' | 'DESC'} * @memberof TradingApiGetOrders */ readonly order?: GetOrdersOrderEnum /** * Filter by accountId. * @type {Array} * @memberof TradingApiGetOrders */ readonly accountId?: Array /** * Filter by providerId. * @type {Array} * @memberof TradingApiGetOrders */ readonly providerId?: Array /** * Filter by order status. * @type {Array} * @memberof TradingApiGetOrders */ readonly statuses?: Array /** * * @type {number} * @memberof TradingApiGetOrders */ readonly startTime?: number /** * * @type {number} * @memberof TradingApiGetOrders */ readonly endTime?: number /** * * @type {'DIGITAL_ONLY' | 'FIAT'} * @memberof TradingApiGetOrders */ readonly assetConversionType?: GetOrdersAssetConversionTypeEnum } /** * Request parameters for getTradingPairs operation in TradingApi. * @export * @interface TradingApiGetTradingPairsRequest */ export interface TradingApiGetTradingPairsRequest { /** * Filter by base asset ID. Also matches `*` rows on the chain of this asset. * @type {string} * @memberof TradingApiGetTradingPairs */ readonly baseAsset?: string /** * Filter by quote asset ID. Also matches `*` rows on the chain of this asset. * @type {string} * @memberof TradingApiGetTradingPairs */ readonly quoteAsset?: string /** * Filter by base asset blockchain `legacyId` (e.g. `ETH`, `BASECHAIN_ETH`, `SOL`). Matches both concrete-asset rows and `*` rows on that chain. * @type {string} * @memberof TradingApiGetTradingPairs */ readonly baseChain?: string /** * Filter by quote asset blockchain `legacyId` (e.g. `ETH`, `BASECHAIN_ETH`, `SOL`). Matches both concrete-asset rows and `*` rows on that chain. * @type {string} * @memberof TradingApiGetTradingPairs */ readonly quoteChain?: string /** * Filter by base asset transfer rail. * @type {TransferRail} * @memberof TradingApiGetTradingPairs */ readonly baseRail?: TransferRail /** * Filter by quote asset transfer rail. * @type {TransferRail} * @memberof TradingApiGetTradingPairs */ readonly quoteRail?: TransferRail /** * Filter by trading side. `BUY` or `SELL` also matches rows whose side is `BOTH`; `BOTH` matches rows of any side. * @type {TradingPairSide} * @memberof TradingApiGetTradingPairs */ readonly side?: TradingPairSide /** * Filter by trade class. * @type {TradeClass} * @memberof TradingApiGetTradingPairs */ readonly tradeClass?: TradeClass /** * Filter by provider ID. Repeat the parameter to match any of several providers, up to 50. * @type {Array} * @memberof TradingApiGetTradingPairs */ readonly providerId?: Array /** * Filter by connected account ID. Repeat the parameter to match any of several accounts, up to 50. * @type {Array} * @memberof TradingApiGetTradingPairs */ readonly accountId?: Array /** * Filter by whether the pair requires prefunding. * @type {boolean} * @memberof TradingApiGetTradingPairs */ readonly prefunded?: boolean /** * An order-size filter, not a bound on the result. Only returns pairs whose own `min` field (the smallest base-asset amount the pair accepts) is at most this value, i.e. pairs that can serve an order of this size. For example, `min=10` returns pairs with a `min` of 10 or less. * @type {string} * @memberof TradingApiGetTradingPairs */ readonly min?: string /** * An order-size filter, not a bound on the result. Only returns pairs whose own `max` field (the largest base-asset amount the pair accepts) is at least this value. For example, `max=1000` returns pairs with a `max` of 1000 or more. * @type {string} * @memberof TradingApiGetTradingPairs */ readonly max?: string /** * Page size for pagination. * @type {number} * @memberof TradingApiGetTradingPairs */ readonly pageSize?: number /** * Page cursor for pagination. * @type {string} * @memberof TradingApiGetTradingPairs */ readonly pageCursor?: string } /** * Request parameters for getTradingProviderById operation in TradingApi. * @export * @interface TradingApiGetTradingProviderByIdRequest */ export interface TradingApiGetTradingProviderByIdRequest { /** * The unique identifier of the provider. * @type {string} * @memberof TradingApiGetTradingProviderById */ readonly providerId: string } /** * Request parameters for getTradingProviders operation in TradingApi. * @export * @interface TradingApiGetTradingProvidersRequest */ export interface TradingApiGetTradingProvidersRequest { /** * Page size for pagination. * @type {number} * @memberof TradingApiGetTradingProviders */ readonly pageSize?: number /** * Page cursor for pagination. * @type {string} * @memberof TradingApiGetTradingProviders */ readonly pageCursor?: string } /** * Request parameters for submitOrderRequirements operation in TradingApi. * @export * @interface TradingApiSubmitOrderRequirementsRequest */ export interface TradingApiSubmitOrderRequirementsRequest { /** * * @type {SubmitOrderRequirementRequest} * @memberof TradingApiSubmitOrderRequirements */ readonly submitOrderRequirementRequest: SubmitOrderRequirementRequest /** * The ID of the order to submit the order requirement response for. * @type {string} * @memberof TradingApiSubmitOrderRequirements */ readonly orderId: string /** * 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 TradingApiSubmitOrderRequirements */ readonly idempotencyKey?: string } /** * Request parameters for uploadOrderRequirementFile operation in TradingApi. * @export * @interface TradingApiUploadOrderRequirementFileRequest */ export interface TradingApiUploadOrderRequirementFileRequest { /** * Identifier of the required file this upload satisfies. Must match a `fileKey` from `requiredFiles` on the GET response. * @type {string} * @memberof TradingApiUploadOrderRequirementFile */ readonly fileKey: string /** * The binary file content. The file\\\'s type must be one of the supported OrderRequirementAllowedFileType values; the file name and type are derived from the uploaded part. * @type {File} * @memberof TradingApiUploadOrderRequirementFile */ readonly file: File /** * The ID of the order to upload the order requirement file for. * @type {string} * @memberof TradingApiUploadOrderRequirementFile */ readonly orderId: string /** * 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 TradingApiUploadOrderRequirementFile */ readonly idempotencyKey?: string } /** * TradingApi - object-oriented interface * @export * @class TradingApi * @extends {BaseAPI} */ export class TradingApi extends BaseAPI { /** * Create an order to buy or sell an asset. If no source is given, an external source will be use. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Create an order * @param {TradingApiCreateOrderRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public createOrder(requestParameters: TradingApiCreateOrderRequest) { return TradingApiFp(this.configuration).createOrder(requestParameters.createOrderRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Generate a time-limited quote for asset conversion, providing exchange rate and amount calculations. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get quotes for each side the provider supports in a single call; providers that support only one side return that side only. Every returned quote carries a concrete `BUY` or `SELL` side, never `BOTH`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Create a quote * @param {TradingApiCreateQuoteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public createQuote(requestParameters: TradingApiCreateQuoteRequest) { return TradingApiFp(this.configuration).createQuote(requestParameters.createQuote, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve all available offers across the workspace for a given asset pair. Always operates in open scope — no provider or account selection required. Returns a mix of indicative rates and committed quotes as applicable per provider. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get offers for each side the provider supports in a single call; providers that support only one side return that side only. Every returned offer carries a concrete `BUY` or `SELL` side, never `BOTH`. If no slippageBps is provided, it defaults to 50 bps (0.5%). Slippage and settlement configuration do not affect the returned rate. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get all offers * @param {TradingApiFetchAllOffersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public fetchAllOffers(requestParameters: TradingApiFetchAllOffersRequest) { return TradingApiFp(this.configuration).fetchAllOffers(requestParameters.createOffersRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve indicative exchange rate from specified providers for a given asset pair. Rates are non-executable price signals intended for discovery and display purposes. If `side` is omitted it defaults to `SELL`. Use `side: BOTH` to get rates for each side the provider supports in a single call; providers that support only one side return that side only. Every returned rate carries a concrete `BUY` or `SELL` side, never `BOTH`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get rates * @param {TradingApiFetchRatesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public fetchRates(requestParameters: TradingApiFetchRatesRequest) { return TradingApiFp(this.configuration).fetchRates(requestParameters.ratesRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve detailed information about a specific order by its ID. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get order details * @param {TradingApiGetOrderRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public getOrder(requestParameters: TradingApiGetOrderRequest) { return TradingApiFp(this.configuration).getOrder(requestParameters.orderId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Fetch order requirement details for an order that is in `AWAITING_INFORMATION` status. The response includes `requirementId` and `dueBy` metadata, a `requiredData` JSON Schema (Draft-7) describing the shape of the `data` object expected on `POST /trading/orders/{orderId}/requirement/data`, and `requiredFiles` descriptors for any files the provider requires (uploaded via `POST /trading/orders/{orderId}/requirement/file`). Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get order requirement details for an order * @param {TradingApiGetOrderRequirementsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public getOrderRequirements(requestParameters: TradingApiGetOrderRequirementsRequest) { return TradingApiFp(this.configuration).getOrderRequirements(requestParameters.orderId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve a paginated list of orders with optional filtering by account, provider, status, and time range. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get orders * @param {TradingApiGetOrdersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public getOrders(requestParameters: TradingApiGetOrdersRequest) { return TradingApiFp(this.configuration).getOrders(requestParameters.pageSize, requestParameters.pageCursor, requestParameters.order, requestParameters.accountId, requestParameters.providerId, requestParameters.statuses, requestParameters.startTime, requestParameters.endTime, requestParameters.assetConversionType).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve the base/quote trading pairs supported by the tenant\'s trading providers. All filters are optional and combined with AND. A provider can return several rows for one pair, one per side and per connected account, each with its own `tradeClass`. Rows may use the wildcard `*` asset ID or the `BOTH` side and are returned unexpanded (see the `baseAsset`, `side` and `baseChain` filters for how they match). **Examples** - Which providers support ETH/USDC: `?baseAsset=ETH"eAsset=USDC`. Add `providerId` to check one provider; an empty `data` array means it does not support the pair. - All pairs of one account: `?providerId=ACME&accountId=`. Page through large results with `pageSize` and `pageCursor`. - Everything you can buy with euro: `?baseAsset=EUR&tradeClass=ON_RAMP`. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get trading pairs * @param {TradingApiGetTradingPairsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public getTradingPairs(requestParameters: TradingApiGetTradingPairsRequest = {}) { return TradingApiFp(this.configuration).getTradingPairs(requestParameters.baseAsset, requestParameters.quoteAsset, requestParameters.baseChain, requestParameters.quoteChain, requestParameters.baseRail, requestParameters.quoteRail, requestParameters.side, requestParameters.tradeClass, requestParameters.providerId, requestParameters.accountId, requestParameters.prefunded, requestParameters.min, requestParameters.max, requestParameters.pageSize, requestParameters.pageCursor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve a single provider by ID. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get trading provider by ID * @param {TradingApiGetTradingProviderByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public getTradingProviderById(requestParameters: TradingApiGetTradingProviderByIdRequest) { return TradingApiFp(this.configuration).getTradingProviderById(requestParameters.providerId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve a list of all available external providers supporting trading activities through the platform. **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Get providers * @param {TradingApiGetTradingProvidersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public getTradingProviders(requestParameters: TradingApiGetTradingProvidersRequest = {}) { return TradingApiFp(this.configuration).getTradingProviders(requestParameters.pageSize, requestParameters.pageCursor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Submit the user\'s textual response to an order requirement on an order that is in `AWAITING_INFORMATION` status. The request body carries `data` — a free-form object conforming to the `requiredData` JSON Schema returned by the GET endpoint. Any required files are uploaded separately via `POST /trading/orders/{orderId}/requirement/file`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Submit a response to an order requirement * @param {TradingApiSubmitOrderRequirementsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public submitOrderRequirements(requestParameters: TradingApiSubmitOrderRequirementsRequest) { return TradingApiFp(this.configuration).submitOrderRequirements(requestParameters.submitOrderRequirementRequest, requestParameters.orderId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Upload a single file (multipart/form-data) in response to an order requirement on an order that is in `AWAITING_INFORMATION` status. Call this endpoint once per required file. Send `fileKey` (matching a `fileKey` from `requiredFiles` on the GET response) and the binary `file`. Its type must be one of the supported file formats. Fireblocks encrypts each file and uploads it individually to the underlying provider. The textual response is submitted separately via `POST /trading/orders/{orderId}/requirement/data`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. For detailed information about error codes and troubleshooting, please refer to our [API Error Codes documentation](https://developers.fireblocks.com/reference/api-error-codes). * @summary Upload a file for an order requirement * @param {TradingApiUploadOrderRequirementFileRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TradingApi */ public uploadOrderRequirementFile(requestParameters: TradingApiUploadOrderRequirementFileRequest) { return TradingApiFp(this.configuration).uploadOrderRequirementFile(requestParameters.fileKey, requestParameters.file, requestParameters.orderId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const GetOrdersOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetOrdersOrderEnum = typeof GetOrdersOrderEnum[keyof typeof GetOrdersOrderEnum]; /** * @export */ export const GetOrdersAssetConversionTypeEnum = { DigitalOnly: 'DIGITAL_ONLY', Fiat: 'FIAT' } as const; export type GetOrdersAssetConversionTypeEnum = typeof GetOrdersAssetConversionTypeEnum[keyof typeof GetOrdersAssetConversionTypeEnum];