/* 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 { AddConnectedAccountRequest } from '../models'; // @ts-ignore import { AddConnectedAccountResponse } from '../models'; // @ts-ignore import { AllowlistEntryResponse } from '../models'; // @ts-ignore import { AllowlistEntryStatus } from '../models'; // @ts-ignore import { AllowlistResponse } from '../models'; // @ts-ignore import { ConnectedAccountBalancesResponse } from '../models'; // @ts-ignore import { ConnectedAccountErrorResponse } from '../models'; // @ts-ignore import { ConnectedAccountRateResponse } from '../models'; // @ts-ignore import { ConnectedAccountTradingPairsResponse } from '../models'; // @ts-ignore import { ConnectedAccountsResponse } from '../models'; // @ts-ignore import { ConnectedSingleAccountResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { GetConnectedAccountsCredentialsPublicKeyResponse } from '../models'; // @ts-ignore import { RenameConnectedAccountRequest } from '../models'; // @ts-ignore import { RenameConnectedAccountResponse } from '../models'; // @ts-ignore import { UpdateConnectedAccountCredentialsRequest } from '../models'; // @ts-ignore import { UpdateConnectedAccountCredentialsResponse } from '../models'; /** * ConnectedAccountsApi - axios parameter creator * @export */ export const ConnectedAccountsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Creates a new connected account for the authenticated tenant. The `creds` field must be a Base64-encoded RSA-encrypted credential blob. Use `GET /connected_accounts/credentials/public_key` to retrieve the public key for encryption. The `providerType` is derived server-side from the `providerId` — callers do not supply it. Endpoint Permission: Editor, Admin, Non-Signing Admin. * @summary Add a connected account * @param {AddConnectedAccountRequest} addConnectedAccountRequest * @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} */ addConnectedAccount: async (addConnectedAccountRequest: AddConnectedAccountRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('addConnectedAccount', 'addConnectedAccountRequest', addConnectedAccountRequest) const localVarPath = `/connected_accounts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'addConnectedAccount'; 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(addConnectedAccountRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Disconnect a connected account by ID. * @summary Disconnect connected account * @param {string} accountId The ID of the account to disconnect. * @param {*} [options] Override http request option. * @throws {RequiredError} */ disconnectConnectedAccount: async (accountId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('disconnectConnectedAccount', 'accountId', accountId) const localVarPath = `/connected_accounts/{accountId}` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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: 'DELETE', ...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 = 'disconnectConnectedAccount'; 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 detailed information about a specific connected account by ID. * @summary Get connected account * @param {string} accountId The ID of the account to fetch. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccount: async (accountId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getConnectedAccount', 'accountId', accountId) const localVarPath = `/connected_accounts/{accountId}` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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 = 'getConnectedAccount'; 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, }; }, /** * Retrieves the address allowlist for a specified connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Get allowlist for connected account * @param {string} accountId The connected account identifier * @param {AllowlistEntryStatus} [status] Filter by allowlist entry status * @param {string} [assetId] Filter by Fireblocks asset ID. See [List assets](https://developers.fireblocks.com/reference/listassets) for the canonical list of Fireblocks asset IDs. * @param {string} [networkId] Filter by Fireblocks network ID. See [List blockchains](https://developers.fireblocks.com/reference/listblockchains) for the canonical list of Fireblocks blockchain identifiers. * @param {string} [address] Filter by specific address * @param {string} [pageCursor] Pagination cursor for next page * @param {number} [pageSize] Maximum number of entries to return * @param {GetConnectedAccountAllowlistOrderEnum} [order] Sort order (ASC or DESC). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountAllowlist: async (accountId: string, status?: AllowlistEntryStatus, assetId?: string, networkId?: string, address?: string, pageCursor?: string, pageSize?: number, order?: GetConnectedAccountAllowlistOrderEnum, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getConnectedAccountAllowlist', 'accountId', accountId) const localVarPath = `/connected_accounts/{accountId}/allowlist` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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 = 'getConnectedAccountAllowlist'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (status !== undefined) { localVarQueryParameter['status'] = status; } if (assetId !== undefined) { localVarQueryParameter['assetId'] = assetId; } if (networkId !== undefined) { localVarQueryParameter['networkId'] = networkId; } if (address !== undefined) { localVarQueryParameter['address'] = address; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (order !== undefined) { localVarQueryParameter['order'] = order; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieves a single allowlist entry by its Fireblocks identifier for a specified connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Get a single allowlist entry for a connected account * @param {string} accountId The connected account identifier * @param {string} allowlistId The Fireblocks allowlist entry identifier * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountAllowlistEntry: async (accountId: string, allowlistId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getConnectedAccountAllowlistEntry', 'accountId', accountId) assertParamExistsAndNotEmpty('getConnectedAccountAllowlistEntry', 'allowlistId', allowlistId) const localVarPath = `/connected_accounts/{accountId}/allowlist/{allowlistId}` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))) .replace(`{${"allowlistId"}}`, encodeURIComponent(String(allowlistId))); // 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 = 'getConnectedAccountAllowlistEntry'; 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 current asset balances for a specific connected account as a flat list (one row per `assetId`, `balanceType`). * @summary Get balances for an account * @param {string} accountId The ID of the account to fetch balances for. * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountBalances: async (accountId: string, pageSize?: number, pageCursor?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getConnectedAccountBalances', 'accountId', accountId) const localVarPath = `/connected_accounts/{accountId}/balances` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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 = 'getConnectedAccountBalances'; 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, }; }, /** * Retrieve current exchange rates for converting between specific assets in a connected account. * @summary Get exchange rates for an account * @param {string} accountId The ID of the account to fetch rates for. * @param {string} baseAssetId The ID of the asset to fetch rates for. * @param {string} quoteAssetId The ID of the asset to get the rates nominally. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountRates: async (accountId: string, baseAssetId: string, quoteAssetId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getConnectedAccountRates', 'accountId', accountId) assertParamExistsAndNotEmpty('getConnectedAccountRates', 'baseAssetId', baseAssetId) assertParamExistsAndNotEmpty('getConnectedAccountRates', 'quoteAssetId', quoteAssetId) const localVarPath = `/connected_accounts/{accountId}/rates` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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 = 'getConnectedAccountRates'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (baseAssetId !== undefined) { localVarQueryParameter['baseAssetId'] = baseAssetId; } if (quoteAssetId !== undefined) { localVarQueryParameter['quoteAssetId'] = quoteAssetId; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve all asset trading pairs supported by a specific connected account, including the pair type (`quote`, `market`, `onOffRamp`). * @summary Get supported trading pairs for an account * @param {string} accountId The ID of the account to fetch supported pairs for. * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountTradingPairs: async (accountId: string, pageSize?: number, pageCursor?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getConnectedAccountTradingPairs', 'accountId', accountId) const localVarPath = `/connected_accounts/{accountId}/manifest/capabilities/trading/pairs` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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 = 'getConnectedAccountTradingPairs'; 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, }; }, /** * Returns all connected accounts. * @summary Get connected accounts * @param {boolean} [mainAccounts] Whether to include only main accounts in the response. * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccounts: async (mainAccounts?: boolean, pageSize?: number, pageCursor?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/connected_accounts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: '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 = 'getConnectedAccounts'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (mainAccounts !== undefined) { localVarQueryParameter['mainAccounts'] = mainAccounts; } 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, }; }, /** * Returns the RSA public key used to encrypt the `creds` field before calling `POST /connected_accounts`. The key is a singleton resource scoped to the connected-accounts credentials domain — there is one per tenant context. * @summary Get public key to encrypt connected account credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountsCredentialsPublicKey: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/connected_accounts/credentials/public_key`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getConnectedAccountsCredentialsPublicKey'; 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, }; }, /** * Rename a connected account by account ID. * @summary Rename Connected Account * @param {RenameConnectedAccountRequest} renameConnectedAccountRequest * @param {string} accountId The unique identifier of the connected account * @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} */ renameConnectedAccount: async (renameConnectedAccountRequest: RenameConnectedAccountRequest, accountId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('renameConnectedAccount', 'renameConnectedAccountRequest', renameConnectedAccountRequest) assertParamExistsAndNotEmpty('renameConnectedAccount', 'accountId', accountId) const localVarPath = `/connected_accounts/{accountId}/rename` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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 = 'renameConnectedAccount'; 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(renameConnectedAccountRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Triggers an on-demand sync from the exchange, bypassing the cache and fetching live data immediately. **Rate limit:** 1 request per minute per connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Sync allowlist for connected account * @param {string} accountId The connected account identifier * @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} */ syncConnectedAccountAllowlist: async (accountId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('syncConnectedAccountAllowlist', 'accountId', accountId) const localVarPath = `/connected_accounts/{accountId}/allowlist/sync` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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 = 'syncConnectedAccountAllowlist'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Replace the API credentials (secret + API key) of a connected account. Credentials belong to an API key, which can back a single account or an entire hierarchy. Updating them affects all accounts sharing that key, so the endpoint returns an array of modified accounts. The `creds` field must be a Base64-encoded RSA-encrypted credential blob; use `GET /connected_accounts/credentials/public_key` to retrieve the public key for encryption. Both `creds` and `apiKey` are mandatory. Validation against the exchange is synchronous, but the update itself is **pending mobile approval** — the existing credentials stay live until the change is approved, so none of the affected accounts are disconnected in the meantime. Endpoint Permission: Admin, Non-Signing Admin. * @summary Update connected account credentials * @param {UpdateConnectedAccountCredentialsRequest} updateConnectedAccountCredentialsRequest * @param {string} accountId The unique identifier of the connected account whose API key credentials are being replaced. * @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} */ updateConnectedAccountCredentials: async (updateConnectedAccountCredentialsRequest: UpdateConnectedAccountCredentialsRequest, accountId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateConnectedAccountCredentials', 'updateConnectedAccountCredentialsRequest', updateConnectedAccountCredentialsRequest) assertParamExistsAndNotEmpty('updateConnectedAccountCredentials', 'accountId', accountId) const localVarPath = `/connected_accounts/{accountId}/credentials` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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 = 'updateConnectedAccountCredentials'; 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(updateConnectedAccountCredentialsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ConnectedAccountsApi - functional programming interface * @export */ export const ConnectedAccountsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ConnectedAccountsApiAxiosParamCreator(configuration) return { /** * Creates a new connected account for the authenticated tenant. The `creds` field must be a Base64-encoded RSA-encrypted credential blob. Use `GET /connected_accounts/credentials/public_key` to retrieve the public key for encryption. The `providerType` is derived server-side from the `providerId` — callers do not supply it. Endpoint Permission: Editor, Admin, Non-Signing Admin. * @summary Add a connected account * @param {AddConnectedAccountRequest} addConnectedAccountRequest * @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 addConnectedAccount(addConnectedAccountRequest: AddConnectedAccountRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.addConnectedAccount(addConnectedAccountRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.addConnectedAccount']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Disconnect a connected account by ID. * @summary Disconnect connected account * @param {string} accountId The ID of the account to disconnect. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async disconnectConnectedAccount(accountId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.disconnectConnectedAccount(accountId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.disconnectConnectedAccount']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve detailed information about a specific connected account by ID. * @summary Get connected account * @param {string} accountId The ID of the account to fetch. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getConnectedAccount(accountId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectedAccount(accountId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.getConnectedAccount']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieves the address allowlist for a specified connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Get allowlist for connected account * @param {string} accountId The connected account identifier * @param {AllowlistEntryStatus} [status] Filter by allowlist entry status * @param {string} [assetId] Filter by Fireblocks asset ID. See [List assets](https://developers.fireblocks.com/reference/listassets) for the canonical list of Fireblocks asset IDs. * @param {string} [networkId] Filter by Fireblocks network ID. See [List blockchains](https://developers.fireblocks.com/reference/listblockchains) for the canonical list of Fireblocks blockchain identifiers. * @param {string} [address] Filter by specific address * @param {string} [pageCursor] Pagination cursor for next page * @param {number} [pageSize] Maximum number of entries to return * @param {GetConnectedAccountAllowlistOrderEnum} [order] Sort order (ASC or DESC). * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getConnectedAccountAllowlist(accountId: string, status?: AllowlistEntryStatus, assetId?: string, networkId?: string, address?: string, pageCursor?: string, pageSize?: number, order?: GetConnectedAccountAllowlistOrderEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectedAccountAllowlist(accountId, status, assetId, networkId, address, pageCursor, pageSize, order, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.getConnectedAccountAllowlist']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieves a single allowlist entry by its Fireblocks identifier for a specified connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Get a single allowlist entry for a connected account * @param {string} accountId The connected account identifier * @param {string} allowlistId The Fireblocks allowlist entry identifier * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getConnectedAccountAllowlistEntry(accountId: string, allowlistId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectedAccountAllowlistEntry(accountId, allowlistId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.getConnectedAccountAllowlistEntry']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve current asset balances for a specific connected account as a flat list (one row per `assetId`, `balanceType`). * @summary Get balances for an account * @param {string} accountId The ID of the account to fetch balances for. * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getConnectedAccountBalances(accountId: string, pageSize?: number, pageCursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectedAccountBalances(accountId, pageSize, pageCursor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.getConnectedAccountBalances']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve current exchange rates for converting between specific assets in a connected account. * @summary Get exchange rates for an account * @param {string} accountId The ID of the account to fetch rates for. * @param {string} baseAssetId The ID of the asset to fetch rates for. * @param {string} quoteAssetId The ID of the asset to get the rates nominally. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getConnectedAccountRates(accountId: string, baseAssetId: string, quoteAssetId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectedAccountRates(accountId, baseAssetId, quoteAssetId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.getConnectedAccountRates']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve all asset trading pairs supported by a specific connected account, including the pair type (`quote`, `market`, `onOffRamp`). * @summary Get supported trading pairs for an account * @param {string} accountId The ID of the account to fetch supported pairs for. * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getConnectedAccountTradingPairs(accountId: string, pageSize?: number, pageCursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectedAccountTradingPairs(accountId, pageSize, pageCursor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.getConnectedAccountTradingPairs']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns all connected accounts. * @summary Get connected accounts * @param {boolean} [mainAccounts] Whether to include only main accounts in the response. * @param {number} [pageSize] Page size for pagination. * @param {string} [pageCursor] Page cursor for pagination. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getConnectedAccounts(mainAccounts?: boolean, pageSize?: number, pageCursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectedAccounts(mainAccounts, pageSize, pageCursor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.getConnectedAccounts']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns the RSA public key used to encrypt the `creds` field before calling `POST /connected_accounts`. The key is a singleton resource scoped to the connected-accounts credentials domain — there is one per tenant context. * @summary Get public key to encrypt connected account credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getConnectedAccountsCredentialsPublicKey(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectedAccountsCredentialsPublicKey(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.getConnectedAccountsCredentialsPublicKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Rename a connected account by account ID. * @summary Rename Connected Account * @param {RenameConnectedAccountRequest} renameConnectedAccountRequest * @param {string} accountId The unique identifier of the connected account * @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 renameConnectedAccount(renameConnectedAccountRequest: RenameConnectedAccountRequest, accountId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.renameConnectedAccount(renameConnectedAccountRequest, accountId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.renameConnectedAccount']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Triggers an on-demand sync from the exchange, bypassing the cache and fetching live data immediately. **Rate limit:** 1 request per minute per connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Sync allowlist for connected account * @param {string} accountId The connected account identifier * @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 syncConnectedAccountAllowlist(accountId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.syncConnectedAccountAllowlist(accountId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.syncConnectedAccountAllowlist']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Replace the API credentials (secret + API key) of a connected account. Credentials belong to an API key, which can back a single account or an entire hierarchy. Updating them affects all accounts sharing that key, so the endpoint returns an array of modified accounts. The `creds` field must be a Base64-encoded RSA-encrypted credential blob; use `GET /connected_accounts/credentials/public_key` to retrieve the public key for encryption. Both `creds` and `apiKey` are mandatory. Validation against the exchange is synchronous, but the update itself is **pending mobile approval** — the existing credentials stay live until the change is approved, so none of the affected accounts are disconnected in the meantime. Endpoint Permission: Admin, Non-Signing Admin. * @summary Update connected account credentials * @param {UpdateConnectedAccountCredentialsRequest} updateConnectedAccountCredentialsRequest * @param {string} accountId The unique identifier of the connected account whose API key credentials are being replaced. * @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 updateConnectedAccountCredentials(updateConnectedAccountCredentialsRequest: UpdateConnectedAccountCredentialsRequest, accountId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateConnectedAccountCredentials(updateConnectedAccountCredentialsRequest, accountId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ConnectedAccountsApi.updateConnectedAccountCredentials']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * ConnectedAccountsApi - factory interface * @export */ export const ConnectedAccountsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ConnectedAccountsApiFp(configuration) return { /** * Creates a new connected account for the authenticated tenant. The `creds` field must be a Base64-encoded RSA-encrypted credential blob. Use `GET /connected_accounts/credentials/public_key` to retrieve the public key for encryption. The `providerType` is derived server-side from the `providerId` — callers do not supply it. Endpoint Permission: Editor, Admin, Non-Signing Admin. * @summary Add a connected account * @param {ConnectedAccountsApiAddConnectedAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ addConnectedAccount(requestParameters: ConnectedAccountsApiAddConnectedAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addConnectedAccount(requestParameters.addConnectedAccountRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Disconnect a connected account by ID. * @summary Disconnect connected account * @param {ConnectedAccountsApiDisconnectConnectedAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ disconnectConnectedAccount(requestParameters: ConnectedAccountsApiDisconnectConnectedAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.disconnectConnectedAccount(requestParameters.accountId, options).then((request) => request(axios, basePath)); }, /** * Retrieve detailed information about a specific connected account by ID. * @summary Get connected account * @param {ConnectedAccountsApiGetConnectedAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccount(requestParameters: ConnectedAccountsApiGetConnectedAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getConnectedAccount(requestParameters.accountId, options).then((request) => request(axios, basePath)); }, /** * Retrieves the address allowlist for a specified connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Get allowlist for connected account * @param {ConnectedAccountsApiGetConnectedAccountAllowlistRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountAllowlist(requestParameters: ConnectedAccountsApiGetConnectedAccountAllowlistRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getConnectedAccountAllowlist(requestParameters.accountId, requestParameters.status, requestParameters.assetId, requestParameters.networkId, requestParameters.address, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.order, options).then((request) => request(axios, basePath)); }, /** * Retrieves a single allowlist entry by its Fireblocks identifier for a specified connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Get a single allowlist entry for a connected account * @param {ConnectedAccountsApiGetConnectedAccountAllowlistEntryRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountAllowlistEntry(requestParameters: ConnectedAccountsApiGetConnectedAccountAllowlistEntryRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getConnectedAccountAllowlistEntry(requestParameters.accountId, requestParameters.allowlistId, options).then((request) => request(axios, basePath)); }, /** * Retrieve current asset balances for a specific connected account as a flat list (one row per `assetId`, `balanceType`). * @summary Get balances for an account * @param {ConnectedAccountsApiGetConnectedAccountBalancesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountBalances(requestParameters: ConnectedAccountsApiGetConnectedAccountBalancesRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getConnectedAccountBalances(requestParameters.accountId, requestParameters.pageSize, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, /** * Retrieve current exchange rates for converting between specific assets in a connected account. * @summary Get exchange rates for an account * @param {ConnectedAccountsApiGetConnectedAccountRatesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountRates(requestParameters: ConnectedAccountsApiGetConnectedAccountRatesRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getConnectedAccountRates(requestParameters.accountId, requestParameters.baseAssetId, requestParameters.quoteAssetId, options).then((request) => request(axios, basePath)); }, /** * Retrieve all asset trading pairs supported by a specific connected account, including the pair type (`quote`, `market`, `onOffRamp`). * @summary Get supported trading pairs for an account * @param {ConnectedAccountsApiGetConnectedAccountTradingPairsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountTradingPairs(requestParameters: ConnectedAccountsApiGetConnectedAccountTradingPairsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getConnectedAccountTradingPairs(requestParameters.accountId, requestParameters.pageSize, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, /** * Returns all connected accounts. * @summary Get connected accounts * @param {ConnectedAccountsApiGetConnectedAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccounts(requestParameters: ConnectedAccountsApiGetConnectedAccountsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getConnectedAccounts(requestParameters.mainAccounts, requestParameters.pageSize, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, /** * Returns the RSA public key used to encrypt the `creds` field before calling `POST /connected_accounts`. The key is a singleton resource scoped to the connected-accounts credentials domain — there is one per tenant context. * @summary Get public key to encrypt connected account credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ getConnectedAccountsCredentialsPublicKey(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getConnectedAccountsCredentialsPublicKey(options).then((request) => request(axios, basePath)); }, /** * Rename a connected account by account ID. * @summary Rename Connected Account * @param {ConnectedAccountsApiRenameConnectedAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ renameConnectedAccount(requestParameters: ConnectedAccountsApiRenameConnectedAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.renameConnectedAccount(requestParameters.renameConnectedAccountRequest, requestParameters.accountId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Triggers an on-demand sync from the exchange, bypassing the cache and fetching live data immediately. **Rate limit:** 1 request per minute per connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Sync allowlist for connected account * @param {ConnectedAccountsApiSyncConnectedAccountAllowlistRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ syncConnectedAccountAllowlist(requestParameters: ConnectedAccountsApiSyncConnectedAccountAllowlistRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.syncConnectedAccountAllowlist(requestParameters.accountId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Replace the API credentials (secret + API key) of a connected account. Credentials belong to an API key, which can back a single account or an entire hierarchy. Updating them affects all accounts sharing that key, so the endpoint returns an array of modified accounts. The `creds` field must be a Base64-encoded RSA-encrypted credential blob; use `GET /connected_accounts/credentials/public_key` to retrieve the public key for encryption. Both `creds` and `apiKey` are mandatory. Validation against the exchange is synchronous, but the update itself is **pending mobile approval** — the existing credentials stay live until the change is approved, so none of the affected accounts are disconnected in the meantime. Endpoint Permission: Admin, Non-Signing Admin. * @summary Update connected account credentials * @param {ConnectedAccountsApiUpdateConnectedAccountCredentialsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateConnectedAccountCredentials(requestParameters: ConnectedAccountsApiUpdateConnectedAccountCredentialsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateConnectedAccountCredentials(requestParameters.updateConnectedAccountCredentialsRequest, requestParameters.accountId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for addConnectedAccount operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiAddConnectedAccountRequest */ export interface ConnectedAccountsApiAddConnectedAccountRequest { /** * * @type {AddConnectedAccountRequest} * @memberof ConnectedAccountsApiAddConnectedAccount */ readonly addConnectedAccountRequest: AddConnectedAccountRequest /** * 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 ConnectedAccountsApiAddConnectedAccount */ readonly idempotencyKey?: string } /** * Request parameters for disconnectConnectedAccount operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiDisconnectConnectedAccountRequest */ export interface ConnectedAccountsApiDisconnectConnectedAccountRequest { /** * The ID of the account to disconnect. * @type {string} * @memberof ConnectedAccountsApiDisconnectConnectedAccount */ readonly accountId: string } /** * Request parameters for getConnectedAccount operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiGetConnectedAccountRequest */ export interface ConnectedAccountsApiGetConnectedAccountRequest { /** * The ID of the account to fetch. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccount */ readonly accountId: string } /** * Request parameters for getConnectedAccountAllowlist operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiGetConnectedAccountAllowlistRequest */ export interface ConnectedAccountsApiGetConnectedAccountAllowlistRequest { /** * The connected account identifier * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlist */ readonly accountId: string /** * Filter by allowlist entry status * @type {AllowlistEntryStatus} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlist */ readonly status?: AllowlistEntryStatus /** * Filter by Fireblocks asset ID. See [List assets](https://developers.fireblocks.com/reference/listassets) for the canonical list of Fireblocks asset IDs. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlist */ readonly assetId?: string /** * Filter by Fireblocks network ID. See [List blockchains](https://developers.fireblocks.com/reference/listblockchains) for the canonical list of Fireblocks blockchain identifiers. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlist */ readonly networkId?: string /** * Filter by specific address * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlist */ readonly address?: string /** * Pagination cursor for next page * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlist */ readonly pageCursor?: string /** * Maximum number of entries to return * @type {number} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlist */ readonly pageSize?: number /** * Sort order (ASC or DESC). * @type {'ASC' | 'DESC'} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlist */ readonly order?: GetConnectedAccountAllowlistOrderEnum } /** * Request parameters for getConnectedAccountAllowlistEntry operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiGetConnectedAccountAllowlistEntryRequest */ export interface ConnectedAccountsApiGetConnectedAccountAllowlistEntryRequest { /** * The connected account identifier * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlistEntry */ readonly accountId: string /** * The Fireblocks allowlist entry identifier * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountAllowlistEntry */ readonly allowlistId: string } /** * Request parameters for getConnectedAccountBalances operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiGetConnectedAccountBalancesRequest */ export interface ConnectedAccountsApiGetConnectedAccountBalancesRequest { /** * The ID of the account to fetch balances for. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountBalances */ readonly accountId: string /** * Page size for pagination. * @type {number} * @memberof ConnectedAccountsApiGetConnectedAccountBalances */ readonly pageSize?: number /** * Page cursor for pagination. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountBalances */ readonly pageCursor?: string } /** * Request parameters for getConnectedAccountRates operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiGetConnectedAccountRatesRequest */ export interface ConnectedAccountsApiGetConnectedAccountRatesRequest { /** * The ID of the account to fetch rates for. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountRates */ readonly accountId: string /** * The ID of the asset to fetch rates for. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountRates */ readonly baseAssetId: string /** * The ID of the asset to get the rates nominally. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountRates */ readonly quoteAssetId: string } /** * Request parameters for getConnectedAccountTradingPairs operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiGetConnectedAccountTradingPairsRequest */ export interface ConnectedAccountsApiGetConnectedAccountTradingPairsRequest { /** * The ID of the account to fetch supported pairs for. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountTradingPairs */ readonly accountId: string /** * Page size for pagination. * @type {number} * @memberof ConnectedAccountsApiGetConnectedAccountTradingPairs */ readonly pageSize?: number /** * Page cursor for pagination. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccountTradingPairs */ readonly pageCursor?: string } /** * Request parameters for getConnectedAccounts operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiGetConnectedAccountsRequest */ export interface ConnectedAccountsApiGetConnectedAccountsRequest { /** * Whether to include only main accounts in the response. * @type {boolean} * @memberof ConnectedAccountsApiGetConnectedAccounts */ readonly mainAccounts?: boolean /** * Page size for pagination. * @type {number} * @memberof ConnectedAccountsApiGetConnectedAccounts */ readonly pageSize?: number /** * Page cursor for pagination. * @type {string} * @memberof ConnectedAccountsApiGetConnectedAccounts */ readonly pageCursor?: string } /** * Request parameters for renameConnectedAccount operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiRenameConnectedAccountRequest */ export interface ConnectedAccountsApiRenameConnectedAccountRequest { /** * * @type {RenameConnectedAccountRequest} * @memberof ConnectedAccountsApiRenameConnectedAccount */ readonly renameConnectedAccountRequest: RenameConnectedAccountRequest /** * The unique identifier of the connected account * @type {string} * @memberof ConnectedAccountsApiRenameConnectedAccount */ readonly accountId: 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 ConnectedAccountsApiRenameConnectedAccount */ readonly idempotencyKey?: string } /** * Request parameters for syncConnectedAccountAllowlist operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiSyncConnectedAccountAllowlistRequest */ export interface ConnectedAccountsApiSyncConnectedAccountAllowlistRequest { /** * The connected account identifier * @type {string} * @memberof ConnectedAccountsApiSyncConnectedAccountAllowlist */ readonly accountId: 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 ConnectedAccountsApiSyncConnectedAccountAllowlist */ readonly idempotencyKey?: string } /** * Request parameters for updateConnectedAccountCredentials operation in ConnectedAccountsApi. * @export * @interface ConnectedAccountsApiUpdateConnectedAccountCredentialsRequest */ export interface ConnectedAccountsApiUpdateConnectedAccountCredentialsRequest { /** * * @type {UpdateConnectedAccountCredentialsRequest} * @memberof ConnectedAccountsApiUpdateConnectedAccountCredentials */ readonly updateConnectedAccountCredentialsRequest: UpdateConnectedAccountCredentialsRequest /** * The unique identifier of the connected account whose API key credentials are being replaced. * @type {string} * @memberof ConnectedAccountsApiUpdateConnectedAccountCredentials */ readonly accountId: 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 ConnectedAccountsApiUpdateConnectedAccountCredentials */ readonly idempotencyKey?: string } /** * ConnectedAccountsApi - object-oriented interface * @export * @class ConnectedAccountsApi * @extends {BaseAPI} */ export class ConnectedAccountsApi extends BaseAPI { /** * Creates a new connected account for the authenticated tenant. The `creds` field must be a Base64-encoded RSA-encrypted credential blob. Use `GET /connected_accounts/credentials/public_key` to retrieve the public key for encryption. The `providerType` is derived server-side from the `providerId` — callers do not supply it. Endpoint Permission: Editor, Admin, Non-Signing Admin. * @summary Add a connected account * @param {ConnectedAccountsApiAddConnectedAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public addConnectedAccount(requestParameters: ConnectedAccountsApiAddConnectedAccountRequest) { return ConnectedAccountsApiFp(this.configuration).addConnectedAccount(requestParameters.addConnectedAccountRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Disconnect a connected account by ID. * @summary Disconnect connected account * @param {ConnectedAccountsApiDisconnectConnectedAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public disconnectConnectedAccount(requestParameters: ConnectedAccountsApiDisconnectConnectedAccountRequest) { return ConnectedAccountsApiFp(this.configuration).disconnectConnectedAccount(requestParameters.accountId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve detailed information about a specific connected account by ID. * @summary Get connected account * @param {ConnectedAccountsApiGetConnectedAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public getConnectedAccount(requestParameters: ConnectedAccountsApiGetConnectedAccountRequest) { return ConnectedAccountsApiFp(this.configuration).getConnectedAccount(requestParameters.accountId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieves the address allowlist for a specified connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Get allowlist for connected account * @param {ConnectedAccountsApiGetConnectedAccountAllowlistRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public getConnectedAccountAllowlist(requestParameters: ConnectedAccountsApiGetConnectedAccountAllowlistRequest) { return ConnectedAccountsApiFp(this.configuration).getConnectedAccountAllowlist(requestParameters.accountId, requestParameters.status, requestParameters.assetId, requestParameters.networkId, requestParameters.address, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.order).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieves a single allowlist entry by its Fireblocks identifier for a specified connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Get a single allowlist entry for a connected account * @param {ConnectedAccountsApiGetConnectedAccountAllowlistEntryRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public getConnectedAccountAllowlistEntry(requestParameters: ConnectedAccountsApiGetConnectedAccountAllowlistEntryRequest) { return ConnectedAccountsApiFp(this.configuration).getConnectedAccountAllowlistEntry(requestParameters.accountId, requestParameters.allowlistId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve current asset balances for a specific connected account as a flat list (one row per `assetId`, `balanceType`). * @summary Get balances for an account * @param {ConnectedAccountsApiGetConnectedAccountBalancesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public getConnectedAccountBalances(requestParameters: ConnectedAccountsApiGetConnectedAccountBalancesRequest) { return ConnectedAccountsApiFp(this.configuration).getConnectedAccountBalances(requestParameters.accountId, requestParameters.pageSize, requestParameters.pageCursor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve current exchange rates for converting between specific assets in a connected account. * @summary Get exchange rates for an account * @param {ConnectedAccountsApiGetConnectedAccountRatesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public getConnectedAccountRates(requestParameters: ConnectedAccountsApiGetConnectedAccountRatesRequest) { return ConnectedAccountsApiFp(this.configuration).getConnectedAccountRates(requestParameters.accountId, requestParameters.baseAssetId, requestParameters.quoteAssetId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve all asset trading pairs supported by a specific connected account, including the pair type (`quote`, `market`, `onOffRamp`). * @summary Get supported trading pairs for an account * @param {ConnectedAccountsApiGetConnectedAccountTradingPairsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public getConnectedAccountTradingPairs(requestParameters: ConnectedAccountsApiGetConnectedAccountTradingPairsRequest) { return ConnectedAccountsApiFp(this.configuration).getConnectedAccountTradingPairs(requestParameters.accountId, requestParameters.pageSize, requestParameters.pageCursor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns all connected accounts. * @summary Get connected accounts * @param {ConnectedAccountsApiGetConnectedAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public getConnectedAccounts(requestParameters: ConnectedAccountsApiGetConnectedAccountsRequest = {}) { return ConnectedAccountsApiFp(this.configuration).getConnectedAccounts(requestParameters.mainAccounts, requestParameters.pageSize, requestParameters.pageCursor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns the RSA public key used to encrypt the `creds` field before calling `POST /connected_accounts`. The key is a singleton resource scoped to the connected-accounts credentials domain — there is one per tenant context. * @summary Get public key to encrypt connected account credentials * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public getConnectedAccountsCredentialsPublicKey() { return ConnectedAccountsApiFp(this.configuration).getConnectedAccountsCredentialsPublicKey().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Rename a connected account by account ID. * @summary Rename Connected Account * @param {ConnectedAccountsApiRenameConnectedAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public renameConnectedAccount(requestParameters: ConnectedAccountsApiRenameConnectedAccountRequest) { return ConnectedAccountsApiFp(this.configuration).renameConnectedAccount(requestParameters.renameConnectedAccountRequest, requestParameters.accountId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Triggers an on-demand sync from the exchange, bypassing the cache and fetching live data immediately. **Rate limit:** 1 request per minute per connected account. **Note:** Currently supports CoinbaseExchange/Binance accounts only. * @summary Sync allowlist for connected account * @param {ConnectedAccountsApiSyncConnectedAccountAllowlistRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public syncConnectedAccountAllowlist(requestParameters: ConnectedAccountsApiSyncConnectedAccountAllowlistRequest) { return ConnectedAccountsApiFp(this.configuration).syncConnectedAccountAllowlist(requestParameters.accountId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Replace the API credentials (secret + API key) of a connected account. Credentials belong to an API key, which can back a single account or an entire hierarchy. Updating them affects all accounts sharing that key, so the endpoint returns an array of modified accounts. The `creds` field must be a Base64-encoded RSA-encrypted credential blob; use `GET /connected_accounts/credentials/public_key` to retrieve the public key for encryption. Both `creds` and `apiKey` are mandatory. Validation against the exchange is synchronous, but the update itself is **pending mobile approval** — the existing credentials stay live until the change is approved, so none of the affected accounts are disconnected in the meantime. Endpoint Permission: Admin, Non-Signing Admin. * @summary Update connected account credentials * @param {ConnectedAccountsApiUpdateConnectedAccountCredentialsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConnectedAccountsApi */ public updateConnectedAccountCredentials(requestParameters: ConnectedAccountsApiUpdateConnectedAccountCredentialsRequest) { return ConnectedAccountsApiFp(this.configuration).updateConnectedAccountCredentials(requestParameters.updateConnectedAccountCredentialsRequest, requestParameters.accountId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const GetConnectedAccountAllowlistOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetConnectedAccountAllowlistOrderEnum = typeof GetConnectedAccountAllowlistOrderEnum[keyof typeof GetConnectedAccountAllowlistOrderEnum];