/* 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 { BulkSigningKeyJob } from '../models'; // @ts-ignore import { CreateBulkSigningKeys } from '../models'; // @ts-ignore import { CreateBulkSigningKeysResponse } from '../models'; // @ts-ignore import { CreateSigningKeyDto } from '../models'; // @ts-ignore import { CreateValidationKeyDto } from '../models'; // @ts-ignore import { CreateValidationKeyResponseDto } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { GetBulkSigningKeysJobsResponse } from '../models'; // @ts-ignore import { GetSigningKeyResponseDto } from '../models'; // @ts-ignore import { GetValidationKeyResponseDto } from '../models'; // @ts-ignore import { ModifySigningKeyAgentIdDto } from '../models'; // @ts-ignore import { ModifySigningKeyDto } from '../models'; // @ts-ignore import { ModifyValidationKeyDto } from '../models'; // @ts-ignore import { SigningKeyDto } from '../models'; // @ts-ignore import { ValidationKeyDto } from '../models'; /** * KeyLinkApi - axios parameter creator * @export */ export const KeyLinkApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Accepts a set of signing keys certified by a single validation key and queues them for registration in the background. Returns a job id to poll. A workspace can have one bulk registration at a time; submitting another while one is QUEUED or IN_PROGRESS is rejected with 409. Bulk registrations from different workspaces share a limited number of slots, so a job may wait QUEUED behind another workspace\'s before it starts. Keys already registered in the workspace are recognized and skipped, so resubmitting the same request after a failure is safe and only processes what is missing. Every key must carry its own proof of ownership; a bulk registration has no interactive step in which one can arrive later. * @summary Register signing keys in bulk * @param {CreateBulkSigningKeys} createBulkSigningKeys * @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} */ createBulkSigningKeys: async (createBulkSigningKeys: CreateBulkSigningKeys, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createBulkSigningKeys', 'createBulkSigningKeys', createBulkSigningKeys) const localVarPath = `/key_link/signing_keys/bulk`; // 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 = 'createBulkSigningKeys'; 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(createBulkSigningKeys, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Adds a new signing key to the workspace. The added key will be linked to the specific Fireblocks agent user ID. The same user will receive the proof of ownership message to be signed, and upon successful proof, the key will become enabled. * @summary Add a new signing key * @param {CreateSigningKeyDto} createSigningKeyDto * @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} */ createSigningKey: async (createSigningKeyDto: CreateSigningKeyDto, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createSigningKey', 'createSigningKeyDto', createSigningKeyDto) const localVarPath = `/key_link/signing_keys`; // 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 = 'createSigningKey'; 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(createSigningKeyDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Adds a new validation key used to validate signing keys. The new validation key will undergo an approval process by the workspace quorum. * @summary Add a new validation key * @param {CreateValidationKeyDto} createValidationKeyDto * @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} */ createValidationKey: async (createValidationKeyDto: CreateValidationKeyDto, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createValidationKey', 'createValidationKeyDto', createValidationKeyDto) const localVarPath = `/key_link/validation_keys`; // 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 = 'createValidationKey'; 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(createValidationKeyDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * DEPRECATED - Please use `POST /key_link/validation_keys/{keyId}/revoke` instead. Allows disabling validation key even if it has not expired yet. It is not allowed to enable the validation key back. Another key has to be used for future validations. * @summary Disables a validation key * @param {ModifyValidationKeyDto} modifyValidationKeyDto * @param {string} keyId The unique identifier for the validation key provided by Fireblocks * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ disableValidationKey: async (modifyValidationKeyDto: ModifyValidationKeyDto, keyId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('disableValidationKey', 'modifyValidationKeyDto', modifyValidationKeyDto) assertParamExistsAndNotEmpty('disableValidationKey', 'keyId', keyId) const localVarPath = `/key_link/validation_keys/{keyId}` .replace(`{${"keyId"}}`, encodeURIComponent(String(keyId))); // 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 = 'disableValidationKey'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(modifyValidationKeyDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the progress and outcome of a bulk registration job. `created + alreadyRegistered` reaching `total` means every submitted key is present. * @summary Get a bulk registration job * @param {string} jobId The id of the bulk registration job * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBulkSigningKeysJob: async (jobId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getBulkSigningKeysJob', 'jobId', jobId) const localVarPath = `/key_link/signing_keys/bulk/jobs/{jobId}` .replace(`{${"jobId"}}`, encodeURIComponent(String(jobId))); // 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 = 'getBulkSigningKeysJob'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the workspace\'s bulk registration jobs, newest first, a page at a time. * @summary Get bulk registration jobs * @param {string} [pageCursor] Cursor to the next page * @param {number} [pageSize] Amount of results to return in the next page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBulkSigningKeysJobs: async (pageCursor?: string, pageSize?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/key_link/signing_keys/bulk/jobs`; // 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 = 'getBulkSigningKeysJobs'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; 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, }; }, /** * Returns a signing key if it exists, identified by the specified `keyId`. * @summary Get a signing key by `keyId` * @param {string} keyId The unique identifier for the signing key provided by Fireblocks * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSigningKey: async (keyId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getSigningKey', 'keyId', keyId) const localVarPath = `/key_link/signing_keys/{keyId}` .replace(`{${"keyId"}}`, encodeURIComponent(String(keyId))); // 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 = 'getSigningKey'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the list of signing keys in the workspace * @summary Get list of signing keys * @param {string} [pageCursor] Cursor to the next page * @param {number} [pageSize] Amount of results to return in the next page * @param {GetSigningKeysListSortByEnum} [sortBy] Field(s) to use for sorting * @param {GetSigningKeysListOrderEnum} [order] Is the order ascending or descending * @param {number} [vaultAccountId] Return keys assigned to a specific vault * @param {string} [agentUserId] Return keys associated with a specific agent user * @param {GetSigningKeysListAlgorithmEnum} [algorithm] Return only keys with a specific algorithm * @param {boolean} [enabled] Return keys that have been proof of ownership * @param {boolean} [available] Return keys that are proof of ownership but not assigned. Available filter can be used only when vaultAccountId and enabled filters are not set * @param {boolean | null} [isAssigned] Return keys that are assigned to a vault account * @param {string} [keyPrefix] A case-insensitive prefix filter that matches records where either keyId or signingDeviceKeyID starts with the specified value. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSigningKeysList: async (pageCursor?: string, pageSize?: number, sortBy?: GetSigningKeysListSortByEnum, order?: GetSigningKeysListOrderEnum, vaultAccountId?: number, agentUserId?: string, algorithm?: GetSigningKeysListAlgorithmEnum, enabled?: boolean, available?: boolean, isAssigned?: boolean | null, keyPrefix?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/key_link/signing_keys`; // 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 = 'getSigningKeysList'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (sortBy !== undefined) { localVarQueryParameter['sortBy'] = sortBy; } if (order !== undefined) { localVarQueryParameter['order'] = order; } if (vaultAccountId !== undefined) { localVarQueryParameter['vaultAccountId'] = vaultAccountId; } if (agentUserId !== undefined) { localVarQueryParameter['agentUserId'] = agentUserId; } if (algorithm !== undefined) { localVarQueryParameter['algorithm'] = algorithm; } if (enabled !== undefined) { localVarQueryParameter['enabled'] = enabled; } if (available !== undefined) { localVarQueryParameter['available'] = available; } if (isAssigned !== undefined) { localVarQueryParameter['isAssigned'] = isAssigned; } if (keyPrefix !== undefined) { localVarQueryParameter['keyPrefix'] = keyPrefix; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a validation key if it exists, identified by the specified `keyId`. * @summary Get a validation key by `keyId` * @param {string} keyId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getValidationKey: async (keyId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getValidationKey', 'keyId', keyId) const localVarPath = `/key_link/validation_keys/{keyId}` .replace(`{${"keyId"}}`, encodeURIComponent(String(keyId))); // 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 = 'getValidationKey'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the list of validation keys in the workspace. By default, revoked keys are filtered out. Use `includeRevoked=true` to show all keys. * @summary Get list of registered validation keys * @param {string} [pageCursor] Cursor to the next page * @param {number} [pageSize] Amount of results to return in the next page * @param {GetValidationKeysListSortByEnum} [sortBy] Field(s) to use for sorting * @param {GetValidationKeysListOrderEnum} [order] Is the order ascending or descending * @param {boolean} [includeRevoked] Include revoked validation keys in the response * @param {*} [options] Override http request option. * @throws {RequiredError} */ getValidationKeysList: async (pageCursor?: string, pageSize?: number, sortBy?: GetValidationKeysListSortByEnum, order?: GetValidationKeysListOrderEnum, includeRevoked?: boolean, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/key_link/validation_keys`; // 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 = 'getValidationKeysList'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (sortBy !== undefined) { localVarQueryParameter['sortBy'] = sortBy; } if (order !== undefined) { localVarQueryParameter['order'] = order; } if (includeRevoked !== undefined) { localVarQueryParameter['includeRevoked'] = includeRevoked; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Revokes a validation key, making it permanently unusable for validation. Once revoked, a key cannot be un-revoked. Another key has to be used for future validations. * @summary Revokes a validation key * @param {string} keyId The unique identifier for the validation key provided by Fireblocks * @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} */ revokeValidationKey: async (keyId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('revokeValidationKey', 'keyId', keyId) const localVarPath = `/key_link/validation_keys/{keyId}/revoke` .replace(`{${"keyId"}}`, encodeURIComponent(String(keyId))); // 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 = 'revokeValidationKey'; 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, }; }, /** * Can modify existing signing key id if the key is not enabled. The change done in background and will be visible once applied. If key is already enabled (after proof of ownership) the user cannot be changed. * @summary Set agent user id * @param {ModifySigningKeyAgentIdDto} modifySigningKeyAgentIdDto * @param {string} keyId The unique identifier for the signing key provided by Fireblocks * @param {*} [options] Override http request option. * @throws {RequiredError} */ setAgentId: async (modifySigningKeyAgentIdDto: ModifySigningKeyAgentIdDto, keyId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('setAgentId', 'modifySigningKeyAgentIdDto', modifySigningKeyAgentIdDto) assertParamExistsAndNotEmpty('setAgentId', 'keyId', keyId) const localVarPath = `/key_link/signing_keys/{keyId}/agent_user_id` .replace(`{${"keyId"}}`, encodeURIComponent(String(keyId))); // 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 = 'setAgentId'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(modifySigningKeyAgentIdDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Allows assigning the signing key to a vault account, if it hasn\'t been assigned to any other vault accounts yet. * @summary Modify the signing keyId * @param {ModifySigningKeyDto} modifySigningKeyDto * @param {string} keyId The unique identifier for the signing key provided by Fireblocks * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSigningKey: async (modifySigningKeyDto: ModifySigningKeyDto, keyId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateSigningKey', 'modifySigningKeyDto', modifySigningKeyDto) assertParamExistsAndNotEmpty('updateSigningKey', 'keyId', keyId) const localVarPath = `/key_link/signing_keys/{keyId}` .replace(`{${"keyId"}}`, encodeURIComponent(String(keyId))); // 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 = 'updateSigningKey'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(modifySigningKeyDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * KeyLinkApi - functional programming interface * @export */ export const KeyLinkApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = KeyLinkApiAxiosParamCreator(configuration) return { /** * Accepts a set of signing keys certified by a single validation key and queues them for registration in the background. Returns a job id to poll. A workspace can have one bulk registration at a time; submitting another while one is QUEUED or IN_PROGRESS is rejected with 409. Bulk registrations from different workspaces share a limited number of slots, so a job may wait QUEUED behind another workspace\'s before it starts. Keys already registered in the workspace are recognized and skipped, so resubmitting the same request after a failure is safe and only processes what is missing. Every key must carry its own proof of ownership; a bulk registration has no interactive step in which one can arrive later. * @summary Register signing keys in bulk * @param {CreateBulkSigningKeys} createBulkSigningKeys * @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 createBulkSigningKeys(createBulkSigningKeys: CreateBulkSigningKeys, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createBulkSigningKeys(createBulkSigningKeys, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.createBulkSigningKeys']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Adds a new signing key to the workspace. The added key will be linked to the specific Fireblocks agent user ID. The same user will receive the proof of ownership message to be signed, and upon successful proof, the key will become enabled. * @summary Add a new signing key * @param {CreateSigningKeyDto} createSigningKeyDto * @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 createSigningKey(createSigningKeyDto: CreateSigningKeyDto, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createSigningKey(createSigningKeyDto, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.createSigningKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Adds a new validation key used to validate signing keys. The new validation key will undergo an approval process by the workspace quorum. * @summary Add a new validation key * @param {CreateValidationKeyDto} createValidationKeyDto * @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 createValidationKey(createValidationKeyDto: CreateValidationKeyDto, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createValidationKey(createValidationKeyDto, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.createValidationKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * DEPRECATED - Please use `POST /key_link/validation_keys/{keyId}/revoke` instead. Allows disabling validation key even if it has not expired yet. It is not allowed to enable the validation key back. Another key has to be used for future validations. * @summary Disables a validation key * @param {ModifyValidationKeyDto} modifyValidationKeyDto * @param {string} keyId The unique identifier for the validation key provided by Fireblocks * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async disableValidationKey(modifyValidationKeyDto: ModifyValidationKeyDto, keyId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.disableValidationKey(modifyValidationKeyDto, keyId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.disableValidationKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns the progress and outcome of a bulk registration job. `created + alreadyRegistered` reaching `total` means every submitted key is present. * @summary Get a bulk registration job * @param {string} jobId The id of the bulk registration job * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBulkSigningKeysJob(jobId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getBulkSigningKeysJob(jobId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.getBulkSigningKeysJob']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns the workspace\'s bulk registration jobs, newest first, a page at a time. * @summary Get bulk registration jobs * @param {string} [pageCursor] Cursor to the next page * @param {number} [pageSize] Amount of results to return in the next page * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBulkSigningKeysJobs(pageCursor?: string, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getBulkSigningKeysJobs(pageCursor, pageSize, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.getBulkSigningKeysJobs']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a signing key if it exists, identified by the specified `keyId`. * @summary Get a signing key by `keyId` * @param {string} keyId The unique identifier for the signing key provided by Fireblocks * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSigningKey(keyId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSigningKey(keyId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.getSigningKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns the list of signing keys in the workspace * @summary Get list of signing keys * @param {string} [pageCursor] Cursor to the next page * @param {number} [pageSize] Amount of results to return in the next page * @param {GetSigningKeysListSortByEnum} [sortBy] Field(s) to use for sorting * @param {GetSigningKeysListOrderEnum} [order] Is the order ascending or descending * @param {number} [vaultAccountId] Return keys assigned to a specific vault * @param {string} [agentUserId] Return keys associated with a specific agent user * @param {GetSigningKeysListAlgorithmEnum} [algorithm] Return only keys with a specific algorithm * @param {boolean} [enabled] Return keys that have been proof of ownership * @param {boolean} [available] Return keys that are proof of ownership but not assigned. Available filter can be used only when vaultAccountId and enabled filters are not set * @param {boolean | null} [isAssigned] Return keys that are assigned to a vault account * @param {string} [keyPrefix] A case-insensitive prefix filter that matches records where either keyId or signingDeviceKeyID starts with the specified value. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSigningKeysList(pageCursor?: string, pageSize?: number, sortBy?: GetSigningKeysListSortByEnum, order?: GetSigningKeysListOrderEnum, vaultAccountId?: number, agentUserId?: string, algorithm?: GetSigningKeysListAlgorithmEnum, enabled?: boolean, available?: boolean, isAssigned?: boolean | null, keyPrefix?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSigningKeysList(pageCursor, pageSize, sortBy, order, vaultAccountId, agentUserId, algorithm, enabled, available, isAssigned, keyPrefix, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.getSigningKeysList']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a validation key if it exists, identified by the specified `keyId`. * @summary Get a validation key by `keyId` * @param {string} keyId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getValidationKey(keyId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getValidationKey(keyId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.getValidationKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns the list of validation keys in the workspace. By default, revoked keys are filtered out. Use `includeRevoked=true` to show all keys. * @summary Get list of registered validation keys * @param {string} [pageCursor] Cursor to the next page * @param {number} [pageSize] Amount of results to return in the next page * @param {GetValidationKeysListSortByEnum} [sortBy] Field(s) to use for sorting * @param {GetValidationKeysListOrderEnum} [order] Is the order ascending or descending * @param {boolean} [includeRevoked] Include revoked validation keys in the response * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getValidationKeysList(pageCursor?: string, pageSize?: number, sortBy?: GetValidationKeysListSortByEnum, order?: GetValidationKeysListOrderEnum, includeRevoked?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getValidationKeysList(pageCursor, pageSize, sortBy, order, includeRevoked, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.getValidationKeysList']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Revokes a validation key, making it permanently unusable for validation. Once revoked, a key cannot be un-revoked. Another key has to be used for future validations. * @summary Revokes a validation key * @param {string} keyId The unique identifier for the validation key provided by Fireblocks * @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 revokeValidationKey(keyId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.revokeValidationKey(keyId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.revokeValidationKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Can modify existing signing key id if the key is not enabled. The change done in background and will be visible once applied. If key is already enabled (after proof of ownership) the user cannot be changed. * @summary Set agent user id * @param {ModifySigningKeyAgentIdDto} modifySigningKeyAgentIdDto * @param {string} keyId The unique identifier for the signing key provided by Fireblocks * @param {*} [options] Override http request option. * @throws {RequiredError} */ async setAgentId(modifySigningKeyAgentIdDto: ModifySigningKeyAgentIdDto, keyId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.setAgentId(modifySigningKeyAgentIdDto, keyId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.setAgentId']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Allows assigning the signing key to a vault account, if it hasn\'t been assigned to any other vault accounts yet. * @summary Modify the signing keyId * @param {ModifySigningKeyDto} modifySigningKeyDto * @param {string} keyId The unique identifier for the signing key provided by Fireblocks * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateSigningKey(modifySigningKeyDto: ModifySigningKeyDto, keyId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateSigningKey(modifySigningKeyDto, keyId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeyLinkApi.updateSigningKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * KeyLinkApi - factory interface * @export */ export const KeyLinkApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = KeyLinkApiFp(configuration) return { /** * Accepts a set of signing keys certified by a single validation key and queues them for registration in the background. Returns a job id to poll. A workspace can have one bulk registration at a time; submitting another while one is QUEUED or IN_PROGRESS is rejected with 409. Bulk registrations from different workspaces share a limited number of slots, so a job may wait QUEUED behind another workspace\'s before it starts. Keys already registered in the workspace are recognized and skipped, so resubmitting the same request after a failure is safe and only processes what is missing. Every key must carry its own proof of ownership; a bulk registration has no interactive step in which one can arrive later. * @summary Register signing keys in bulk * @param {KeyLinkApiCreateBulkSigningKeysRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createBulkSigningKeys(requestParameters: KeyLinkApiCreateBulkSigningKeysRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createBulkSigningKeys(requestParameters.createBulkSigningKeys, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Adds a new signing key to the workspace. The added key will be linked to the specific Fireblocks agent user ID. The same user will receive the proof of ownership message to be signed, and upon successful proof, the key will become enabled. * @summary Add a new signing key * @param {KeyLinkApiCreateSigningKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSigningKey(requestParameters: KeyLinkApiCreateSigningKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createSigningKey(requestParameters.createSigningKeyDto, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Adds a new validation key used to validate signing keys. The new validation key will undergo an approval process by the workspace quorum. * @summary Add a new validation key * @param {KeyLinkApiCreateValidationKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createValidationKey(requestParameters: KeyLinkApiCreateValidationKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createValidationKey(requestParameters.createValidationKeyDto, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * DEPRECATED - Please use `POST /key_link/validation_keys/{keyId}/revoke` instead. Allows disabling validation key even if it has not expired yet. It is not allowed to enable the validation key back. Another key has to be used for future validations. * @summary Disables a validation key * @param {KeyLinkApiDisableValidationKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ disableValidationKey(requestParameters: KeyLinkApiDisableValidationKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.disableValidationKey(requestParameters.modifyValidationKeyDto, requestParameters.keyId, options).then((request) => request(axios, basePath)); }, /** * Returns the progress and outcome of a bulk registration job. `created + alreadyRegistered` reaching `total` means every submitted key is present. * @summary Get a bulk registration job * @param {KeyLinkApiGetBulkSigningKeysJobRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBulkSigningKeysJob(requestParameters: KeyLinkApiGetBulkSigningKeysJobRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getBulkSigningKeysJob(requestParameters.jobId, options).then((request) => request(axios, basePath)); }, /** * Returns the workspace\'s bulk registration jobs, newest first, a page at a time. * @summary Get bulk registration jobs * @param {KeyLinkApiGetBulkSigningKeysJobsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBulkSigningKeysJobs(requestParameters: KeyLinkApiGetBulkSigningKeysJobsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getBulkSigningKeysJobs(requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(axios, basePath)); }, /** * Returns a signing key if it exists, identified by the specified `keyId`. * @summary Get a signing key by `keyId` * @param {KeyLinkApiGetSigningKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSigningKey(requestParameters: KeyLinkApiGetSigningKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSigningKey(requestParameters.keyId, options).then((request) => request(axios, basePath)); }, /** * Returns the list of signing keys in the workspace * @summary Get list of signing keys * @param {KeyLinkApiGetSigningKeysListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSigningKeysList(requestParameters: KeyLinkApiGetSigningKeysListRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSigningKeysList(requestParameters.pageCursor, requestParameters.pageSize, requestParameters.sortBy, requestParameters.order, requestParameters.vaultAccountId, requestParameters.agentUserId, requestParameters.algorithm, requestParameters.enabled, requestParameters.available, requestParameters.isAssigned, requestParameters.keyPrefix, options).then((request) => request(axios, basePath)); }, /** * Returns a validation key if it exists, identified by the specified `keyId`. * @summary Get a validation key by `keyId` * @param {KeyLinkApiGetValidationKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getValidationKey(requestParameters: KeyLinkApiGetValidationKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getValidationKey(requestParameters.keyId, options).then((request) => request(axios, basePath)); }, /** * Returns the list of validation keys in the workspace. By default, revoked keys are filtered out. Use `includeRevoked=true` to show all keys. * @summary Get list of registered validation keys * @param {KeyLinkApiGetValidationKeysListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getValidationKeysList(requestParameters: KeyLinkApiGetValidationKeysListRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getValidationKeysList(requestParameters.pageCursor, requestParameters.pageSize, requestParameters.sortBy, requestParameters.order, requestParameters.includeRevoked, options).then((request) => request(axios, basePath)); }, /** * Revokes a validation key, making it permanently unusable for validation. Once revoked, a key cannot be un-revoked. Another key has to be used for future validations. * @summary Revokes a validation key * @param {KeyLinkApiRevokeValidationKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ revokeValidationKey(requestParameters: KeyLinkApiRevokeValidationKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.revokeValidationKey(requestParameters.keyId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Can modify existing signing key id if the key is not enabled. The change done in background and will be visible once applied. If key is already enabled (after proof of ownership) the user cannot be changed. * @summary Set agent user id * @param {KeyLinkApiSetAgentIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ setAgentId(requestParameters: KeyLinkApiSetAgentIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.setAgentId(requestParameters.modifySigningKeyAgentIdDto, requestParameters.keyId, options).then((request) => request(axios, basePath)); }, /** * Allows assigning the signing key to a vault account, if it hasn\'t been assigned to any other vault accounts yet. * @summary Modify the signing keyId * @param {KeyLinkApiUpdateSigningKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSigningKey(requestParameters: KeyLinkApiUpdateSigningKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateSigningKey(requestParameters.modifySigningKeyDto, requestParameters.keyId, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createBulkSigningKeys operation in KeyLinkApi. * @export * @interface KeyLinkApiCreateBulkSigningKeysRequest */ export interface KeyLinkApiCreateBulkSigningKeysRequest { /** * * @type {CreateBulkSigningKeys} * @memberof KeyLinkApiCreateBulkSigningKeys */ readonly createBulkSigningKeys: CreateBulkSigningKeys /** * 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 KeyLinkApiCreateBulkSigningKeys */ readonly idempotencyKey?: string } /** * Request parameters for createSigningKey operation in KeyLinkApi. * @export * @interface KeyLinkApiCreateSigningKeyRequest */ export interface KeyLinkApiCreateSigningKeyRequest { /** * * @type {CreateSigningKeyDto} * @memberof KeyLinkApiCreateSigningKey */ readonly createSigningKeyDto: CreateSigningKeyDto /** * 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 KeyLinkApiCreateSigningKey */ readonly idempotencyKey?: string } /** * Request parameters for createValidationKey operation in KeyLinkApi. * @export * @interface KeyLinkApiCreateValidationKeyRequest */ export interface KeyLinkApiCreateValidationKeyRequest { /** * * @type {CreateValidationKeyDto} * @memberof KeyLinkApiCreateValidationKey */ readonly createValidationKeyDto: CreateValidationKeyDto /** * 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 KeyLinkApiCreateValidationKey */ readonly idempotencyKey?: string } /** * Request parameters for disableValidationKey operation in KeyLinkApi. * @export * @interface KeyLinkApiDisableValidationKeyRequest */ export interface KeyLinkApiDisableValidationKeyRequest { /** * * @type {ModifyValidationKeyDto} * @memberof KeyLinkApiDisableValidationKey */ readonly modifyValidationKeyDto: ModifyValidationKeyDto /** * The unique identifier for the validation key provided by Fireblocks * @type {string} * @memberof KeyLinkApiDisableValidationKey */ readonly keyId: string } /** * Request parameters for getBulkSigningKeysJob operation in KeyLinkApi. * @export * @interface KeyLinkApiGetBulkSigningKeysJobRequest */ export interface KeyLinkApiGetBulkSigningKeysJobRequest { /** * The id of the bulk registration job * @type {string} * @memberof KeyLinkApiGetBulkSigningKeysJob */ readonly jobId: string } /** * Request parameters for getBulkSigningKeysJobs operation in KeyLinkApi. * @export * @interface KeyLinkApiGetBulkSigningKeysJobsRequest */ export interface KeyLinkApiGetBulkSigningKeysJobsRequest { /** * Cursor to the next page * @type {string} * @memberof KeyLinkApiGetBulkSigningKeysJobs */ readonly pageCursor?: string /** * Amount of results to return in the next page * @type {number} * @memberof KeyLinkApiGetBulkSigningKeysJobs */ readonly pageSize?: number } /** * Request parameters for getSigningKey operation in KeyLinkApi. * @export * @interface KeyLinkApiGetSigningKeyRequest */ export interface KeyLinkApiGetSigningKeyRequest { /** * The unique identifier for the signing key provided by Fireblocks * @type {string} * @memberof KeyLinkApiGetSigningKey */ readonly keyId: string } /** * Request parameters for getSigningKeysList operation in KeyLinkApi. * @export * @interface KeyLinkApiGetSigningKeysListRequest */ export interface KeyLinkApiGetSigningKeysListRequest { /** * Cursor to the next page * @type {string} * @memberof KeyLinkApiGetSigningKeysList */ readonly pageCursor?: string /** * Amount of results to return in the next page * @type {number} * @memberof KeyLinkApiGetSigningKeysList */ readonly pageSize?: number /** * Field(s) to use for sorting * @type {'createdAt'} * @memberof KeyLinkApiGetSigningKeysList */ readonly sortBy?: GetSigningKeysListSortByEnum /** * Is the order ascending or descending * @type {'ASC' | 'DESC'} * @memberof KeyLinkApiGetSigningKeysList */ readonly order?: GetSigningKeysListOrderEnum /** * Return keys assigned to a specific vault * @type {number} * @memberof KeyLinkApiGetSigningKeysList */ readonly vaultAccountId?: number /** * Return keys associated with a specific agent user * @type {string} * @memberof KeyLinkApiGetSigningKeysList */ readonly agentUserId?: string /** * Return only keys with a specific algorithm * @type {'ECDSA_SECP256K1' | 'EDDSA_ED25519'} * @memberof KeyLinkApiGetSigningKeysList */ readonly algorithm?: GetSigningKeysListAlgorithmEnum /** * Return keys that have been proof of ownership * @type {boolean} * @memberof KeyLinkApiGetSigningKeysList */ readonly enabled?: boolean /** * Return keys that are proof of ownership but not assigned. Available filter can be used only when vaultAccountId and enabled filters are not set * @type {boolean} * @memberof KeyLinkApiGetSigningKeysList */ readonly available?: boolean /** * Return keys that are assigned to a vault account * @type {boolean} * @memberof KeyLinkApiGetSigningKeysList */ readonly isAssigned?: boolean | null /** * A case-insensitive prefix filter that matches records where either keyId or signingDeviceKeyID starts with the specified value. * @type {string} * @memberof KeyLinkApiGetSigningKeysList */ readonly keyPrefix?: string } /** * Request parameters for getValidationKey operation in KeyLinkApi. * @export * @interface KeyLinkApiGetValidationKeyRequest */ export interface KeyLinkApiGetValidationKeyRequest { /** * * @type {string} * @memberof KeyLinkApiGetValidationKey */ readonly keyId: string } /** * Request parameters for getValidationKeysList operation in KeyLinkApi. * @export * @interface KeyLinkApiGetValidationKeysListRequest */ export interface KeyLinkApiGetValidationKeysListRequest { /** * Cursor to the next page * @type {string} * @memberof KeyLinkApiGetValidationKeysList */ readonly pageCursor?: string /** * Amount of results to return in the next page * @type {number} * @memberof KeyLinkApiGetValidationKeysList */ readonly pageSize?: number /** * Field(s) to use for sorting * @type {'createdAt'} * @memberof KeyLinkApiGetValidationKeysList */ readonly sortBy?: GetValidationKeysListSortByEnum /** * Is the order ascending or descending * @type {'ASC' | 'DESC'} * @memberof KeyLinkApiGetValidationKeysList */ readonly order?: GetValidationKeysListOrderEnum /** * Include revoked validation keys in the response * @type {boolean} * @memberof KeyLinkApiGetValidationKeysList */ readonly includeRevoked?: boolean } /** * Request parameters for revokeValidationKey operation in KeyLinkApi. * @export * @interface KeyLinkApiRevokeValidationKeyRequest */ export interface KeyLinkApiRevokeValidationKeyRequest { /** * The unique identifier for the validation key provided by Fireblocks * @type {string} * @memberof KeyLinkApiRevokeValidationKey */ readonly keyId: 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 KeyLinkApiRevokeValidationKey */ readonly idempotencyKey?: string } /** * Request parameters for setAgentId operation in KeyLinkApi. * @export * @interface KeyLinkApiSetAgentIdRequest */ export interface KeyLinkApiSetAgentIdRequest { /** * * @type {ModifySigningKeyAgentIdDto} * @memberof KeyLinkApiSetAgentId */ readonly modifySigningKeyAgentIdDto: ModifySigningKeyAgentIdDto /** * The unique identifier for the signing key provided by Fireblocks * @type {string} * @memberof KeyLinkApiSetAgentId */ readonly keyId: string } /** * Request parameters for updateSigningKey operation in KeyLinkApi. * @export * @interface KeyLinkApiUpdateSigningKeyRequest */ export interface KeyLinkApiUpdateSigningKeyRequest { /** * * @type {ModifySigningKeyDto} * @memberof KeyLinkApiUpdateSigningKey */ readonly modifySigningKeyDto: ModifySigningKeyDto /** * The unique identifier for the signing key provided by Fireblocks * @type {string} * @memberof KeyLinkApiUpdateSigningKey */ readonly keyId: string } /** * KeyLinkApi - object-oriented interface * @export * @class KeyLinkApi * @extends {BaseAPI} */ export class KeyLinkApi extends BaseAPI { /** * Accepts a set of signing keys certified by a single validation key and queues them for registration in the background. Returns a job id to poll. A workspace can have one bulk registration at a time; submitting another while one is QUEUED or IN_PROGRESS is rejected with 409. Bulk registrations from different workspaces share a limited number of slots, so a job may wait QUEUED behind another workspace\'s before it starts. Keys already registered in the workspace are recognized and skipped, so resubmitting the same request after a failure is safe and only processes what is missing. Every key must carry its own proof of ownership; a bulk registration has no interactive step in which one can arrive later. * @summary Register signing keys in bulk * @param {KeyLinkApiCreateBulkSigningKeysRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public createBulkSigningKeys(requestParameters: KeyLinkApiCreateBulkSigningKeysRequest) { return KeyLinkApiFp(this.configuration).createBulkSigningKeys(requestParameters.createBulkSigningKeys, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Adds a new signing key to the workspace. The added key will be linked to the specific Fireblocks agent user ID. The same user will receive the proof of ownership message to be signed, and upon successful proof, the key will become enabled. * @summary Add a new signing key * @param {KeyLinkApiCreateSigningKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public createSigningKey(requestParameters: KeyLinkApiCreateSigningKeyRequest) { return KeyLinkApiFp(this.configuration).createSigningKey(requestParameters.createSigningKeyDto, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Adds a new validation key used to validate signing keys. The new validation key will undergo an approval process by the workspace quorum. * @summary Add a new validation key * @param {KeyLinkApiCreateValidationKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public createValidationKey(requestParameters: KeyLinkApiCreateValidationKeyRequest) { return KeyLinkApiFp(this.configuration).createValidationKey(requestParameters.createValidationKeyDto, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * DEPRECATED - Please use `POST /key_link/validation_keys/{keyId}/revoke` instead. Allows disabling validation key even if it has not expired yet. It is not allowed to enable the validation key back. Another key has to be used for future validations. * @summary Disables a validation key * @param {KeyLinkApiDisableValidationKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof KeyLinkApi */ public disableValidationKey(requestParameters: KeyLinkApiDisableValidationKeyRequest) { return KeyLinkApiFp(this.configuration).disableValidationKey(requestParameters.modifyValidationKeyDto, requestParameters.keyId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns the progress and outcome of a bulk registration job. `created + alreadyRegistered` reaching `total` means every submitted key is present. * @summary Get a bulk registration job * @param {KeyLinkApiGetBulkSigningKeysJobRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public getBulkSigningKeysJob(requestParameters: KeyLinkApiGetBulkSigningKeysJobRequest) { return KeyLinkApiFp(this.configuration).getBulkSigningKeysJob(requestParameters.jobId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns the workspace\'s bulk registration jobs, newest first, a page at a time. * @summary Get bulk registration jobs * @param {KeyLinkApiGetBulkSigningKeysJobsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public getBulkSigningKeysJobs(requestParameters: KeyLinkApiGetBulkSigningKeysJobsRequest = {}) { return KeyLinkApiFp(this.configuration).getBulkSigningKeysJobs(requestParameters.pageCursor, requestParameters.pageSize).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a signing key if it exists, identified by the specified `keyId`. * @summary Get a signing key by `keyId` * @param {KeyLinkApiGetSigningKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public getSigningKey(requestParameters: KeyLinkApiGetSigningKeyRequest) { return KeyLinkApiFp(this.configuration).getSigningKey(requestParameters.keyId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns the list of signing keys in the workspace * @summary Get list of signing keys * @param {KeyLinkApiGetSigningKeysListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public getSigningKeysList(requestParameters: KeyLinkApiGetSigningKeysListRequest = {}) { return KeyLinkApiFp(this.configuration).getSigningKeysList(requestParameters.pageCursor, requestParameters.pageSize, requestParameters.sortBy, requestParameters.order, requestParameters.vaultAccountId, requestParameters.agentUserId, requestParameters.algorithm, requestParameters.enabled, requestParameters.available, requestParameters.isAssigned, requestParameters.keyPrefix).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a validation key if it exists, identified by the specified `keyId`. * @summary Get a validation key by `keyId` * @param {KeyLinkApiGetValidationKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public getValidationKey(requestParameters: KeyLinkApiGetValidationKeyRequest) { return KeyLinkApiFp(this.configuration).getValidationKey(requestParameters.keyId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns the list of validation keys in the workspace. By default, revoked keys are filtered out. Use `includeRevoked=true` to show all keys. * @summary Get list of registered validation keys * @param {KeyLinkApiGetValidationKeysListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public getValidationKeysList(requestParameters: KeyLinkApiGetValidationKeysListRequest = {}) { return KeyLinkApiFp(this.configuration).getValidationKeysList(requestParameters.pageCursor, requestParameters.pageSize, requestParameters.sortBy, requestParameters.order, requestParameters.includeRevoked).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Revokes a validation key, making it permanently unusable for validation. Once revoked, a key cannot be un-revoked. Another key has to be used for future validations. * @summary Revokes a validation key * @param {KeyLinkApiRevokeValidationKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public revokeValidationKey(requestParameters: KeyLinkApiRevokeValidationKeyRequest) { return KeyLinkApiFp(this.configuration).revokeValidationKey(requestParameters.keyId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Can modify existing signing key id if the key is not enabled. The change done in background and will be visible once applied. If key is already enabled (after proof of ownership) the user cannot be changed. * @summary Set agent user id * @param {KeyLinkApiSetAgentIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public setAgentId(requestParameters: KeyLinkApiSetAgentIdRequest) { return KeyLinkApiFp(this.configuration).setAgentId(requestParameters.modifySigningKeyAgentIdDto, requestParameters.keyId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Allows assigning the signing key to a vault account, if it hasn\'t been assigned to any other vault accounts yet. * @summary Modify the signing keyId * @param {KeyLinkApiUpdateSigningKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeyLinkApi */ public updateSigningKey(requestParameters: KeyLinkApiUpdateSigningKeyRequest) { return KeyLinkApiFp(this.configuration).updateSigningKey(requestParameters.modifySigningKeyDto, requestParameters.keyId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const GetSigningKeysListSortByEnum = { CreatedAt: 'createdAt' } as const; export type GetSigningKeysListSortByEnum = typeof GetSigningKeysListSortByEnum[keyof typeof GetSigningKeysListSortByEnum]; /** * @export */ export const GetSigningKeysListOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetSigningKeysListOrderEnum = typeof GetSigningKeysListOrderEnum[keyof typeof GetSigningKeysListOrderEnum]; /** * @export */ export const GetSigningKeysListAlgorithmEnum = { EcdsaSecp256K1: 'ECDSA_SECP256K1', EddsaEd25519: 'EDDSA_ED25519' } as const; export type GetSigningKeysListAlgorithmEnum = typeof GetSigningKeysListAlgorithmEnum[keyof typeof GetSigningKeysListAlgorithmEnum]; /** * @export */ export const GetValidationKeysListSortByEnum = { CreatedAt: 'createdAt' } as const; export type GetValidationKeysListSortByEnum = typeof GetValidationKeysListSortByEnum[keyof typeof GetValidationKeysListSortByEnum]; /** * @export */ export const GetValidationKeysListOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetValidationKeysListOrderEnum = typeof GetValidationKeysListOrderEnum[keyof typeof GetValidationKeysListOrderEnum];