/* 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 { Asset } from '../models'; // @ts-ignore import { AssetBadRequestErrorResponse } from '../models'; // @ts-ignore import { AssetClass } from '../models'; // @ts-ignore import { AssetConflictErrorResponse } from '../models'; // @ts-ignore import { AssetForbiddenErrorResponse } from '../models'; // @ts-ignore import { AssetInternalServerErrorResponse } from '../models'; // @ts-ignore import { AssetNotFoundErrorResponse } from '../models'; // @ts-ignore import { AssetPriceForbiddenErrorResponse } from '../models'; // @ts-ignore import { AssetPriceNotFoundErrorResponse } from '../models'; // @ts-ignore import { AssetPriceResponse } from '../models'; // @ts-ignore import { AssetResponse } from '../models'; // @ts-ignore import { AssetScope } from '../models'; // @ts-ignore import { BlockchainNotFoundErrorResponse } from '../models'; // @ts-ignore import { BlockchainResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { GetSupportedAssetsResponse } from '../models'; // @ts-ignore import { ListAssetsResponse } from '../models'; // @ts-ignore import { ListBlockchainsResponse } from '../models'; // @ts-ignore import { RegisterNewAssetRequest } from '../models'; // @ts-ignore import { SetAssetPriceRequest } from '../models'; // @ts-ignore import { TokenInfoNotFoundErrorResponse } from '../models'; // @ts-ignore import { UpdateAssetUserMetadataRequest } from '../models'; /** * BlockchainsAssetsApi - axios parameter creator * @export */ export const BlockchainsAssetsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns an asset by ID or legacyID. **Note**: - We will continue displaying and supporting the legacy ID (API ID). Since not all Fireblocks services fully support the new Assets UUID, please use only the legacy ID until further notice. * @summary Get an asset * @param {string} id The ID or legacyId of the asset * @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} */ getAsset: async (id: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getAsset', 'id', id) const localVarPath = `/assets/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; // 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 = 'getAsset'; 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, }; }, /** * Returns a blockchain by ID or legacyID. * @summary Get a Blockchain by ID * @param {string} id The ID or legacyId of the blockchain * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockchain: async (id: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getBlockchain', 'id', id) const localVarPath = `/blockchains/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; // 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 = 'getBlockchain'; 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, }; }, /** * **This legacy endpoint has not been deprecated but it should not be used in your operations. Instead, use the new [List assets](https://developers.fireblocks.com/reference/listassets) endpoint for better performance and to retrieve more detailed asset information.** Retrieves all assets supported by Fireblocks in your workspace. **Endpoint Permissions:** Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary List assets (Legacy) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSupportedAssets: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/supported_assets`; // 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 = 'getSupportedAssets'; 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 a paginated list of all assets supported by Fireblocks in your workspace **Note:** We will continue to support and display the legacy ID (API ID). Since not all Fireblocks services fully support the new Assets UUID, please use only the legacy ID until further notice. * @summary List assets * @param {string} [blockchainId] Blockchain id of the assets * @param {AssetClass} [assetClass] Assets class * @param {string} [symbol] Assets onchain symbol * @param {AssetScope} [scope] Scope of the assets * @param {boolean} [deprecated] Are assets deprecated * @param {Array} [ids] A list of asset IDs (max 100) * @param {string} [pageCursor] Next page cursor to fetch * @param {number} [pageSize] Items per page * @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} */ listAssets: async (blockchainId?: string, assetClass?: AssetClass, symbol?: string, scope?: AssetScope, deprecated?: boolean, ids?: Array, pageCursor?: string, pageSize?: number, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/assets`; // 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 = 'listAssets'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (blockchainId !== undefined) { localVarQueryParameter['blockchainId'] = blockchainId; } if (assetClass !== undefined) { localVarQueryParameter['assetClass'] = assetClass; } if (symbol !== undefined) { localVarQueryParameter['symbol'] = symbol; } if (scope !== undefined) { localVarQueryParameter['scope'] = scope; } if (deprecated !== undefined) { localVarQueryParameter['deprecated'] = deprecated; } if (ids) { localVarQueryParameter['ids'] = ids; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } 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, }; }, /** * Returns all blockchains supported by Fireblocks. * @summary List blockchains * @param {string} [protocol] Blockchain protocol * @param {boolean} [deprecated] Is blockchain deprecated * @param {boolean} [test] Is test blockchain * @param {Array} [ids] A list of blockchain IDs (max 100) * @param {string} [pageCursor] Page cursor to fetch * @param {number} [pageSize] Items per page (max 500) * @param {*} [options] Override http request option. * @throws {RequiredError} */ listBlockchains: async (protocol?: string, deprecated?: boolean, test?: boolean, ids?: Array, pageCursor?: string, pageSize?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/blockchains`; // 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 = 'listBlockchains'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (protocol !== undefined) { localVarQueryParameter['protocol'] = protocol; } if (deprecated !== undefined) { localVarQueryParameter['deprecated'] = deprecated; } if (test !== undefined) { localVarQueryParameter['test'] = test; } if (ids) { localVarQueryParameter['ids'] = ids; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Register a new asset to a workspace and return the newly created asset\'s details. Currently supported chains are: - EVM based chains - Stellar - Algorand - TRON - NEAR - Solana - Sui - TON * @summary Register an asset * @param {RegisterNewAssetRequest} [registerNewAssetRequest] * @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} */ registerNewAsset: async (registerNewAssetRequest?: RegisterNewAssetRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/assets`; // 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 = 'registerNewAsset'; 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(registerNewAssetRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Set asset price for the given asset id. Returns the asset price response. * @summary Set asset price * @param {string} id The ID of the asset * @param {SetAssetPriceRequest} [setAssetPriceRequest] * @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} */ setAssetPrice: async (id: string, setAssetPriceRequest?: SetAssetPriceRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('setAssetPrice', 'id', id) const localVarPath = `/assets/prices/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: '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 = 'setAssetPrice'; 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(setAssetPriceRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Update the user’s metadata for an asset. Endpoint Permission: Owner, Admin, Non-Signing Admin, NCW Admin, Signer, Editor. * @summary Update the user’s metadata for an asset * @param {string} id The ID or legacyId of the asset * @param {UpdateAssetUserMetadataRequest} [updateAssetUserMetadataRequest] * @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} */ updateAssetUserMetadata: async (id: string, updateAssetUserMetadataRequest?: UpdateAssetUserMetadataRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('updateAssetUserMetadata', 'id', id) const localVarPath = `/assets/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PATCH', ...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 = 'updateAssetUserMetadata'; 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(updateAssetUserMetadataRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * BlockchainsAssetsApi - functional programming interface * @export */ export const BlockchainsAssetsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = BlockchainsAssetsApiAxiosParamCreator(configuration) return { /** * Returns an asset by ID or legacyID. **Note**: - We will continue displaying and supporting the legacy ID (API ID). Since not all Fireblocks services fully support the new Assets UUID, please use only the legacy ID until further notice. * @summary Get an asset * @param {string} id The ID or legacyId of the asset * @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 getAsset(id: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAsset(id, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BlockchainsAssetsApi.getAsset']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a blockchain by ID or legacyID. * @summary Get a Blockchain by ID * @param {string} id The ID or legacyId of the blockchain * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockchain(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getBlockchain(id, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BlockchainsAssetsApi.getBlockchain']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * **This legacy endpoint has not been deprecated but it should not be used in your operations. Instead, use the new [List assets](https://developers.fireblocks.com/reference/listassets) endpoint for better performance and to retrieve more detailed asset information.** Retrieves all assets supported by Fireblocks in your workspace. **Endpoint Permissions:** Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary List assets (Legacy) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSupportedAssets(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSupportedAssets(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BlockchainsAssetsApi.getSupportedAssets']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieves a paginated list of all assets supported by Fireblocks in your workspace **Note:** We will continue to support and display the legacy ID (API ID). Since not all Fireblocks services fully support the new Assets UUID, please use only the legacy ID until further notice. * @summary List assets * @param {string} [blockchainId] Blockchain id of the assets * @param {AssetClass} [assetClass] Assets class * @param {string} [symbol] Assets onchain symbol * @param {AssetScope} [scope] Scope of the assets * @param {boolean} [deprecated] Are assets deprecated * @param {Array} [ids] A list of asset IDs (max 100) * @param {string} [pageCursor] Next page cursor to fetch * @param {number} [pageSize] Items per page * @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 listAssets(blockchainId?: string, assetClass?: AssetClass, symbol?: string, scope?: AssetScope, deprecated?: boolean, ids?: Array, pageCursor?: string, pageSize?: number, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listAssets(blockchainId, assetClass, symbol, scope, deprecated, ids, pageCursor, pageSize, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BlockchainsAssetsApi.listAssets']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns all blockchains supported by Fireblocks. * @summary List blockchains * @param {string} [protocol] Blockchain protocol * @param {boolean} [deprecated] Is blockchain deprecated * @param {boolean} [test] Is test blockchain * @param {Array} [ids] A list of blockchain IDs (max 100) * @param {string} [pageCursor] Page cursor to fetch * @param {number} [pageSize] Items per page (max 500) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listBlockchains(protocol?: string, deprecated?: boolean, test?: boolean, ids?: Array, pageCursor?: string, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listBlockchains(protocol, deprecated, test, ids, pageCursor, pageSize, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BlockchainsAssetsApi.listBlockchains']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Register a new asset to a workspace and return the newly created asset\'s details. Currently supported chains are: - EVM based chains - Stellar - Algorand - TRON - NEAR - Solana - Sui - TON * @summary Register an asset * @param {RegisterNewAssetRequest} [registerNewAssetRequest] * @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 registerNewAsset(registerNewAssetRequest?: RegisterNewAssetRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.registerNewAsset(registerNewAssetRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BlockchainsAssetsApi.registerNewAsset']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Set asset price for the given asset id. Returns the asset price response. * @summary Set asset price * @param {string} id The ID of the asset * @param {SetAssetPriceRequest} [setAssetPriceRequest] * @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 setAssetPrice(id: string, setAssetPriceRequest?: SetAssetPriceRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.setAssetPrice(id, setAssetPriceRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BlockchainsAssetsApi.setAssetPrice']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Update the user’s metadata for an asset. Endpoint Permission: Owner, Admin, Non-Signing Admin, NCW Admin, Signer, Editor. * @summary Update the user’s metadata for an asset * @param {string} id The ID or legacyId of the asset * @param {UpdateAssetUserMetadataRequest} [updateAssetUserMetadataRequest] * @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 updateAssetUserMetadata(id: string, updateAssetUserMetadataRequest?: UpdateAssetUserMetadataRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateAssetUserMetadata(id, updateAssetUserMetadataRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BlockchainsAssetsApi.updateAssetUserMetadata']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * BlockchainsAssetsApi - factory interface * @export */ export const BlockchainsAssetsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = BlockchainsAssetsApiFp(configuration) return { /** * Returns an asset by ID or legacyID. **Note**: - We will continue displaying and supporting the legacy ID (API ID). Since not all Fireblocks services fully support the new Assets UUID, please use only the legacy ID until further notice. * @summary Get an asset * @param {BlockchainsAssetsApiGetAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAsset(requestParameters: BlockchainsAssetsApiGetAssetRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getAsset(requestParameters.id, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Returns a blockchain by ID or legacyID. * @summary Get a Blockchain by ID * @param {BlockchainsAssetsApiGetBlockchainRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockchain(requestParameters: BlockchainsAssetsApiGetBlockchainRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getBlockchain(requestParameters.id, options).then((request) => request(axios, basePath)); }, /** * **This legacy endpoint has not been deprecated but it should not be used in your operations. Instead, use the new [List assets](https://developers.fireblocks.com/reference/listassets) endpoint for better performance and to retrieve more detailed asset information.** Retrieves all assets supported by Fireblocks in your workspace. **Endpoint Permissions:** Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary List assets (Legacy) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSupportedAssets(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSupportedAssets(options).then((request) => request(axios, basePath)); }, /** * Retrieves a paginated list of all assets supported by Fireblocks in your workspace **Note:** We will continue to support and display the legacy ID (API ID). Since not all Fireblocks services fully support the new Assets UUID, please use only the legacy ID until further notice. * @summary List assets * @param {BlockchainsAssetsApiListAssetsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listAssets(requestParameters: BlockchainsAssetsApiListAssetsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listAssets(requestParameters.blockchainId, requestParameters.assetClass, requestParameters.symbol, requestParameters.scope, requestParameters.deprecated, requestParameters.ids, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Returns all blockchains supported by Fireblocks. * @summary List blockchains * @param {BlockchainsAssetsApiListBlockchainsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listBlockchains(requestParameters: BlockchainsAssetsApiListBlockchainsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listBlockchains(requestParameters.protocol, requestParameters.deprecated, requestParameters.test, requestParameters.ids, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(axios, basePath)); }, /** * Register a new asset to a workspace and return the newly created asset\'s details. Currently supported chains are: - EVM based chains - Stellar - Algorand - TRON - NEAR - Solana - Sui - TON * @summary Register an asset * @param {BlockchainsAssetsApiRegisterNewAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ registerNewAsset(requestParameters: BlockchainsAssetsApiRegisterNewAssetRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.registerNewAsset(requestParameters.registerNewAssetRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Set asset price for the given asset id. Returns the asset price response. * @summary Set asset price * @param {BlockchainsAssetsApiSetAssetPriceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ setAssetPrice(requestParameters: BlockchainsAssetsApiSetAssetPriceRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.setAssetPrice(requestParameters.id, requestParameters.setAssetPriceRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Update the user’s metadata for an asset. Endpoint Permission: Owner, Admin, Non-Signing Admin, NCW Admin, Signer, Editor. * @summary Update the user’s metadata for an asset * @param {BlockchainsAssetsApiUpdateAssetUserMetadataRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAssetUserMetadata(requestParameters: BlockchainsAssetsApiUpdateAssetUserMetadataRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateAssetUserMetadata(requestParameters.id, requestParameters.updateAssetUserMetadataRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getAsset operation in BlockchainsAssetsApi. * @export * @interface BlockchainsAssetsApiGetAssetRequest */ export interface BlockchainsAssetsApiGetAssetRequest { /** * The ID or legacyId of the asset * @type {string} * @memberof BlockchainsAssetsApiGetAsset */ readonly id: 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 BlockchainsAssetsApiGetAsset */ readonly idempotencyKey?: string } /** * Request parameters for getBlockchain operation in BlockchainsAssetsApi. * @export * @interface BlockchainsAssetsApiGetBlockchainRequest */ export interface BlockchainsAssetsApiGetBlockchainRequest { /** * The ID or legacyId of the blockchain * @type {string} * @memberof BlockchainsAssetsApiGetBlockchain */ readonly id: string } /** * Request parameters for listAssets operation in BlockchainsAssetsApi. * @export * @interface BlockchainsAssetsApiListAssetsRequest */ export interface BlockchainsAssetsApiListAssetsRequest { /** * Blockchain id of the assets * @type {string} * @memberof BlockchainsAssetsApiListAssets */ readonly blockchainId?: string /** * Assets class * @type {AssetClass} * @memberof BlockchainsAssetsApiListAssets */ readonly assetClass?: AssetClass /** * Assets onchain symbol * @type {string} * @memberof BlockchainsAssetsApiListAssets */ readonly symbol?: string /** * Scope of the assets * @type {AssetScope} * @memberof BlockchainsAssetsApiListAssets */ readonly scope?: AssetScope /** * Are assets deprecated * @type {boolean} * @memberof BlockchainsAssetsApiListAssets */ readonly deprecated?: boolean /** * A list of asset IDs (max 100) * @type {Array} * @memberof BlockchainsAssetsApiListAssets */ readonly ids?: Array /** * Next page cursor to fetch * @type {string} * @memberof BlockchainsAssetsApiListAssets */ readonly pageCursor?: string /** * Items per page * @type {number} * @memberof BlockchainsAssetsApiListAssets */ readonly pageSize?: number /** * 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 BlockchainsAssetsApiListAssets */ readonly idempotencyKey?: string } /** * Request parameters for listBlockchains operation in BlockchainsAssetsApi. * @export * @interface BlockchainsAssetsApiListBlockchainsRequest */ export interface BlockchainsAssetsApiListBlockchainsRequest { /** * Blockchain protocol * @type {string} * @memberof BlockchainsAssetsApiListBlockchains */ readonly protocol?: string /** * Is blockchain deprecated * @type {boolean} * @memberof BlockchainsAssetsApiListBlockchains */ readonly deprecated?: boolean /** * Is test blockchain * @type {boolean} * @memberof BlockchainsAssetsApiListBlockchains */ readonly test?: boolean /** * A list of blockchain IDs (max 100) * @type {Array} * @memberof BlockchainsAssetsApiListBlockchains */ readonly ids?: Array /** * Page cursor to fetch * @type {string} * @memberof BlockchainsAssetsApiListBlockchains */ readonly pageCursor?: string /** * Items per page (max 500) * @type {number} * @memberof BlockchainsAssetsApiListBlockchains */ readonly pageSize?: number } /** * Request parameters for registerNewAsset operation in BlockchainsAssetsApi. * @export * @interface BlockchainsAssetsApiRegisterNewAssetRequest */ export interface BlockchainsAssetsApiRegisterNewAssetRequest { /** * * @type {RegisterNewAssetRequest} * @memberof BlockchainsAssetsApiRegisterNewAsset */ readonly registerNewAssetRequest?: RegisterNewAssetRequest /** * 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 BlockchainsAssetsApiRegisterNewAsset */ readonly idempotencyKey?: string } /** * Request parameters for setAssetPrice operation in BlockchainsAssetsApi. * @export * @interface BlockchainsAssetsApiSetAssetPriceRequest */ export interface BlockchainsAssetsApiSetAssetPriceRequest { /** * The ID of the asset * @type {string} * @memberof BlockchainsAssetsApiSetAssetPrice */ readonly id: string /** * * @type {SetAssetPriceRequest} * @memberof BlockchainsAssetsApiSetAssetPrice */ readonly setAssetPriceRequest?: SetAssetPriceRequest /** * 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 BlockchainsAssetsApiSetAssetPrice */ readonly idempotencyKey?: string } /** * Request parameters for updateAssetUserMetadata operation in BlockchainsAssetsApi. * @export * @interface BlockchainsAssetsApiUpdateAssetUserMetadataRequest */ export interface BlockchainsAssetsApiUpdateAssetUserMetadataRequest { /** * The ID or legacyId of the asset * @type {string} * @memberof BlockchainsAssetsApiUpdateAssetUserMetadata */ readonly id: string /** * * @type {UpdateAssetUserMetadataRequest} * @memberof BlockchainsAssetsApiUpdateAssetUserMetadata */ readonly updateAssetUserMetadataRequest?: UpdateAssetUserMetadataRequest /** * 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 BlockchainsAssetsApiUpdateAssetUserMetadata */ readonly idempotencyKey?: string } /** * BlockchainsAssetsApi - object-oriented interface * @export * @class BlockchainsAssetsApi * @extends {BaseAPI} */ export class BlockchainsAssetsApi extends BaseAPI { /** * Returns an asset by ID or legacyID. **Note**: - We will continue displaying and supporting the legacy ID (API ID). Since not all Fireblocks services fully support the new Assets UUID, please use only the legacy ID until further notice. * @summary Get an asset * @param {BlockchainsAssetsApiGetAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockchainsAssetsApi */ public getAsset(requestParameters: BlockchainsAssetsApiGetAssetRequest) { return BlockchainsAssetsApiFp(this.configuration).getAsset(requestParameters.id, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a blockchain by ID or legacyID. * @summary Get a Blockchain by ID * @param {BlockchainsAssetsApiGetBlockchainRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockchainsAssetsApi */ public getBlockchain(requestParameters: BlockchainsAssetsApiGetBlockchainRequest) { return BlockchainsAssetsApiFp(this.configuration).getBlockchain(requestParameters.id).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * **This legacy endpoint has not been deprecated but it should not be used in your operations. Instead, use the new [List assets](https://developers.fireblocks.com/reference/listassets) endpoint for better performance and to retrieve more detailed asset information.** Retrieves all assets supported by Fireblocks in your workspace. **Endpoint Permissions:** Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary List assets (Legacy) * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockchainsAssetsApi */ public getSupportedAssets() { return BlockchainsAssetsApiFp(this.configuration).getSupportedAssets().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieves a paginated list of all assets supported by Fireblocks in your workspace **Note:** We will continue to support and display the legacy ID (API ID). Since not all Fireblocks services fully support the new Assets UUID, please use only the legacy ID until further notice. * @summary List assets * @param {BlockchainsAssetsApiListAssetsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockchainsAssetsApi */ public listAssets(requestParameters: BlockchainsAssetsApiListAssetsRequest = {}) { return BlockchainsAssetsApiFp(this.configuration).listAssets(requestParameters.blockchainId, requestParameters.assetClass, requestParameters.symbol, requestParameters.scope, requestParameters.deprecated, requestParameters.ids, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns all blockchains supported by Fireblocks. * @summary List blockchains * @param {BlockchainsAssetsApiListBlockchainsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockchainsAssetsApi */ public listBlockchains(requestParameters: BlockchainsAssetsApiListBlockchainsRequest = {}) { return BlockchainsAssetsApiFp(this.configuration).listBlockchains(requestParameters.protocol, requestParameters.deprecated, requestParameters.test, requestParameters.ids, requestParameters.pageCursor, requestParameters.pageSize).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Register a new asset to a workspace and return the newly created asset\'s details. Currently supported chains are: - EVM based chains - Stellar - Algorand - TRON - NEAR - Solana - Sui - TON * @summary Register an asset * @param {BlockchainsAssetsApiRegisterNewAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockchainsAssetsApi */ public registerNewAsset(requestParameters: BlockchainsAssetsApiRegisterNewAssetRequest = {}) { return BlockchainsAssetsApiFp(this.configuration).registerNewAsset(requestParameters.registerNewAssetRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Set asset price for the given asset id. Returns the asset price response. * @summary Set asset price * @param {BlockchainsAssetsApiSetAssetPriceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockchainsAssetsApi */ public setAssetPrice(requestParameters: BlockchainsAssetsApiSetAssetPriceRequest) { return BlockchainsAssetsApiFp(this.configuration).setAssetPrice(requestParameters.id, requestParameters.setAssetPriceRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Update the user’s metadata for an asset. Endpoint Permission: Owner, Admin, Non-Signing Admin, NCW Admin, Signer, Editor. * @summary Update the user’s metadata for an asset * @param {BlockchainsAssetsApiUpdateAssetUserMetadataRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockchainsAssetsApi */ public updateAssetUserMetadata(requestParameters: BlockchainsAssetsApiUpdateAssetUserMetadataRequest) { return BlockchainsAssetsApiFp(this.configuration).updateAssetUserMetadata(requestParameters.id, requestParameters.updateAssetUserMetadataRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }