/* 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 { ChainDescriptor } from '../models'; // @ts-ignore import { ChainInfoResponse } from '../models'; // @ts-ignore import { ClaimRewardsRequest } from '../models'; // @ts-ignore import { Delegation } from '../models'; // @ts-ignore import { DelegationSummary } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { MergeStakeAccountsRequest } from '../models'; // @ts-ignore import { MergeStakeAccountsResponse } from '../models'; // @ts-ignore import { SplitRequest } from '../models'; // @ts-ignore import { SplitResponse } from '../models'; // @ts-ignore import { StakeRequest } from '../models'; // @ts-ignore import { StakeResponse } from '../models'; // @ts-ignore import { StakingErrorSchema } from '../models'; // @ts-ignore import { StakingGetAllDelegationsResponse } from '../models'; // @ts-ignore import { StakingGetChainsResponse } from '../models'; // @ts-ignore import { StakingGetProvidersResponse } from '../models'; // @ts-ignore import { StakingGetSummaryByVaultResponse } from '../models'; // @ts-ignore import { StakingPositionRelatedTransactionsPaginatedResponse } from '../models'; // @ts-ignore import { StakingPositionsPaginatedResponse } from '../models'; // @ts-ignore import { StakingProvider } from '../models'; // @ts-ignore import { UnstakeRequest } from '../models'; // @ts-ignore import { WithdrawRequest } from '../models'; /** * StakingApi - axios parameter creator * @export */ export const StakingApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Approves the provider\'s terms of service. Must be called once before performing any staking operation with this provider. * @summary Approve provider terms of service * @param {StakingProvider} providerId Unique identifier of the staking provider. * @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} */ approveTermsOfServiceByProviderId: async (providerId: StakingProvider, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('approveTermsOfServiceByProviderId', 'providerId', providerId) const localVarPath = `/staking/providers/{providerId}/approveTermsOfService` .replace(`{${"providerId"}}`, encodeURIComponent(String(providerId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: '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 = 'approveTermsOfServiceByProviderId'; 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, }; }, /** * Claims available staking rewards for the specified chain and vault. Supported chains: Solana and Polygon (POL/Matic). Behavior depends on protocol reward distribution. * @summary Claim accrued rewards * @param {ClaimRewardsRequest} claimRewardsRequest * @param {ClaimRewardsChainDescriptorEnum} chainDescriptor Protocol identifier for the claim rewards staking operation (e.g., POL/MATIC/SOL). * @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} */ claimRewards: async (claimRewardsRequest: ClaimRewardsRequest, chainDescriptor: ClaimRewardsChainDescriptorEnum, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('claimRewards', 'claimRewardsRequest', claimRewardsRequest) assertParamExistsAndNotEmpty('claimRewards', 'chainDescriptor', chainDescriptor) const localVarPath = `/staking/chains/{chainDescriptor}/claim_rewards` .replace(`{${"chainDescriptor"}}`, encodeURIComponent(String(chainDescriptor))); // 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 = 'claimRewards'; 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(claimRewardsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Consolidates the source staking position into the destination, merging the balance into the destination and closing the source position once complete. Both positions must be from the same vault account (i.e. same withdrawal credentials). On chain, this translates into a consolidation transaction, where the source validator is consolidated into the destination validator. Supported chains: Ethereum (ETH) only. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor. **Note:** This endpoint is currently in beta and might be subject to changes. * @summary Consolidate staking positions (ETH validator consolidation) * @param {MergeStakeAccountsRequest} mergeStakeAccountsRequest * @param {ConsolidateChainDescriptorEnum} chainDescriptor Protocol identifier for the staking operation (e.g., ETH). * @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} */ consolidate: async (mergeStakeAccountsRequest: MergeStakeAccountsRequest, chainDescriptor: ConsolidateChainDescriptorEnum, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('consolidate', 'mergeStakeAccountsRequest', mergeStakeAccountsRequest) assertParamExistsAndNotEmpty('consolidate', 'chainDescriptor', chainDescriptor) const localVarPath = `/staking/chains/{chainDescriptor}/consolidate` .replace(`{${"chainDescriptor"}}`, encodeURIComponent(String(chainDescriptor))); // 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 = 'consolidate'; 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(mergeStakeAccountsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns all staking positions with core details: amounts, rewards, status, chain, and vault. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking positions * @param {ChainDescriptor} [chainDescriptor] Protocol identifier to filter positions (e.g., ATOM_COS/AXL/CELESTIA). If omitted, positions across all supported chains are returned. * @param {string} [vaultAccountId] Filter positions by vault account ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllDelegations: async (chainDescriptor?: ChainDescriptor, vaultAccountId?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/staking/positions`; // 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 = 'getAllDelegations'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (chainDescriptor !== undefined) { localVarQueryParameter['chainDescriptor'] = chainDescriptor; } if (vaultAccountId !== undefined) { localVarQueryParameter['vaultAccountId'] = vaultAccountId; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns chain-specific staking information such as epoch/slot cadence, lockup or unbonding periods, fee/reward mechanics, and other operational constraints. * @summary Get chain-level staking parameters * @param {ChainDescriptor} chainDescriptor Protocol identifier for the chain info staking operation (e.g., ETH/MATIC/SOL). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getChainInfo: async (chainDescriptor: ChainDescriptor, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('getChainInfo', 'chainDescriptor', chainDescriptor) const localVarPath = `/staking/chains/{chainDescriptor}/chainInfo` .replace(`{${"chainDescriptor"}}`, encodeURIComponent(String(chainDescriptor))); // 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 = 'getChainInfo'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns an alphabetical list of blockchains supported for staking by the current workspace context. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary List supported staking chains * @param {*} [options] Override http request option. * @throws {RequiredError} */ getChains: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/staking/chains`; // 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 = 'getChains'; 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 full details for a single staking position: amounts, rewards, status, chain, and vault. * @summary Get position details * @param {string} id Unique identifier of the staking position. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDelegationById: async (id: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getDelegationById', 'id', id) const localVarPath = `/staking/positions/{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 = 'getDelegationById'; 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 enriched transaction history for a staking position with cursor-based pagination. Includes in-flight transactions with status pending. The in-flight transaction is always returned first; completed and failed history is ordered by the order parameter. * @summary List related transactions for a position * @param {string} id Unique identifier of the staking position. * @param {number} pageSize Number of results per page (minimum: 1, maximum: 100). * @param {string} [pageCursor] Cursor for the next page of results. Use the value from the \'next\' field in the previous response. * @param {GetPositionRelatedTransactionsOrderEnum} [order] ASC / DESC ordering for completed/failed history (default DESC). The in-flight transaction is always returned first. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPositionRelatedTransactions: async (id: string, pageSize: number, pageCursor?: string, order?: GetPositionRelatedTransactionsOrderEnum, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getPositionRelatedTransactions', 'id', id) assertParamExists('getPositionRelatedTransactions', 'pageSize', pageSize) const localVarPath = `/staking/positions/{id}/related_transactions` .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 = 'getPositionRelatedTransactions'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (order !== undefined) { localVarQueryParameter['order'] = order; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns staking positions with core details: amounts, rewards, status, chain, and vault. It supports cursor-based pagination for efficient data retrieval. This endpoint always returns a paginated response with {data, next} structure. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking positions (Paginated) * @param {number} pageSize Number of results per page. When provided, the response returns a paginated object with {data, next}. If omitted, all results are returned as an array. * @param {ChainDescriptor} [chainDescriptor] Protocol identifier to filter positions (e.g., ATOM_COS/AXL/CELESTIA). If omitted, positions across all supported chains are returned. * @param {string} [vaultAccountId] Filter positions by Fireblocks vault account ID. If omitted, positions across all vault accounts are returned. * @param {string} [pageCursor] Cursor for the next page of results. Use the value from the \'next\' field in the previous response. * @param {GetPositionsOrderEnum} [order] ASC / DESC ordering (default DESC) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPositions: async (pageSize: number, chainDescriptor?: ChainDescriptor, vaultAccountId?: string, pageCursor?: string, order?: GetPositionsOrderEnum, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('getPositions', 'pageSize', pageSize) const localVarPath = `/staking/positions_paginated`; // 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 = 'getPositions'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (chainDescriptor !== undefined) { localVarQueryParameter['chainDescriptor'] = chainDescriptor; } if (vaultAccountId !== undefined) { localVarQueryParameter['vaultAccountId'] = vaultAccountId; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (order !== undefined) { localVarQueryParameter['order'] = order; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns all available staking providers with metadata such as name, ID, and supported chains. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking providers * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProviders: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/staking/providers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getProviders'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns an aggregated cross-vault summary: active/inactive counts, total staked, and total rewards per chain. * @summary Get positions summary * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSummary: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/staking/positions/summary`; // 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 = 'getSummary'; 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 per-vault aggregates: status breakdown, total staked, and total rewards per chain. * @summary Get positions summary by vault * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSummaryByVault: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/staking/positions/summary/vaults`; // 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 = 'getSummaryByVault'; 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, }; }, /** * Merges the source stake account into the destination, consolidating the balance into the destination and closing the source account once complete. Both accounts must be from the same validator provider and of same vault account.. Supported chains: Solana (SOL). Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Merge staking positions * @param {MergeStakeAccountsRequest} mergeStakeAccountsRequest * @param {MergeStakeAccountsChainDescriptorEnum} chainDescriptor Protocol identifier for the merge staking operation (e.g., SOL). * @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} */ mergeStakeAccounts: async (mergeStakeAccountsRequest: MergeStakeAccountsRequest, chainDescriptor: MergeStakeAccountsChainDescriptorEnum, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('mergeStakeAccounts', 'mergeStakeAccountsRequest', mergeStakeAccountsRequest) assertParamExistsAndNotEmpty('mergeStakeAccounts', 'chainDescriptor', chainDescriptor) const localVarPath = `/staking/chains/{chainDescriptor}/merge` .replace(`{${"chainDescriptor"}}`, encodeURIComponent(String(chainDescriptor))); // 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 = 'mergeStakeAccounts'; 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(mergeStakeAccountsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Splits a staking position by creating a new stake account with the requested amount, while keeping the original account with the remaining balance. Supported chains: Solana (SOL). * @summary Split a staking position * @param {SplitRequest} splitRequest * @param {SplitChainDescriptorEnum} chainDescriptor Protocol identifier for the staking operation (e.g., SOL). * @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} */ split: async (splitRequest: SplitRequest, chainDescriptor: SplitChainDescriptorEnum, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('split', 'splitRequest', splitRequest) assertParamExistsAndNotEmpty('split', 'chainDescriptor', chainDescriptor) const localVarPath = `/staking/chains/{chainDescriptor}/split` .replace(`{${"chainDescriptor"}}`, encodeURIComponent(String(chainDescriptor))); // 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 = 'split'; 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(splitRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Creates a new staking position and returns its unique ID. For Ethereum compounding validator (EIP-7251): when the \'id\' of an existing compounding validator position is provided, adds to that position; otherwise creates a new position. For Ethereum legacy validator: creates a new position regardless of existing delegations. For Cosmos chains and Ethereum liquid staking (Lido): automatically add to existing positions for the same validator provider and same vault account if one exists, otherwise create a new position. For Solana and Polygon (MATIC/POL): always create new positions regardless of existing delegations. * @summary Initiate or add to existing stake * @param {StakeRequest} stakeRequest * @param {ChainDescriptor} chainDescriptor Protocol identifier for the stake staking operation (e.g., ATOM_COS/AXL/CELESTIA). * @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} */ stake: async (stakeRequest: StakeRequest, chainDescriptor: ChainDescriptor, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('stake', 'stakeRequest', stakeRequest) assertParamExists('stake', 'chainDescriptor', chainDescriptor) const localVarPath = `/staking/chains/{chainDescriptor}/stake` .replace(`{${"chainDescriptor"}}`, encodeURIComponent(String(chainDescriptor))); // 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 = 'stake'; 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(stakeRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Submits a chain-specific unstake request. * @summary Initiate unstake * @param {UnstakeRequest} unstakeRequest * @param {ChainDescriptor} chainDescriptor Protocol identifier for the unstake staking operation (e.g., SOL/SOL_TEST/MATIC). * @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} */ unstake: async (unstakeRequest: UnstakeRequest, chainDescriptor: ChainDescriptor, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('unstake', 'unstakeRequest', unstakeRequest) assertParamExists('unstake', 'chainDescriptor', chainDescriptor) const localVarPath = `/staking/chains/{chainDescriptor}/unstake` .replace(`{${"chainDescriptor"}}`, encodeURIComponent(String(chainDescriptor))); // 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 = 'unstake'; 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(unstakeRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Withdraws funds that have completed the unbonding period. Typically requires the position to be deactivated first (unstake → unbond → withdraw). Amount and timing vary by chain protocol. Partial withdrawal is supported for ETH compounding validators (EIP-7251/Pectra) and Cosmos chains via the optional \'amount\' field. For ETH compounding validators, the remaining balance must be at least 32 ETH after the withdrawal. For all other chains, omitting \'amount\' withdraws the entire available balance. * @summary Withdraw staked funds * @param {WithdrawRequest} withdrawRequest * @param {ChainDescriptor} chainDescriptor Protocol identifier for the withdraw staking operation (e.g., ATOM_COS/ETH/STETH_ETH). * @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} */ withdraw: async (withdrawRequest: WithdrawRequest, chainDescriptor: ChainDescriptor, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('withdraw', 'withdrawRequest', withdrawRequest) assertParamExists('withdraw', 'chainDescriptor', chainDescriptor) const localVarPath = `/staking/chains/{chainDescriptor}/withdraw` .replace(`{${"chainDescriptor"}}`, encodeURIComponent(String(chainDescriptor))); // 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 = 'withdraw'; 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(withdrawRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * StakingApi - functional programming interface * @export */ export const StakingApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = StakingApiAxiosParamCreator(configuration) return { /** * Approves the provider\'s terms of service. Must be called once before performing any staking operation with this provider. * @summary Approve provider terms of service * @param {StakingProvider} providerId Unique identifier of the staking provider. * @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 approveTermsOfServiceByProviderId(providerId: StakingProvider, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.approveTermsOfServiceByProviderId(providerId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.approveTermsOfServiceByProviderId']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Claims available staking rewards for the specified chain and vault. Supported chains: Solana and Polygon (POL/Matic). Behavior depends on protocol reward distribution. * @summary Claim accrued rewards * @param {ClaimRewardsRequest} claimRewardsRequest * @param {ClaimRewardsChainDescriptorEnum} chainDescriptor Protocol identifier for the claim rewards staking operation (e.g., POL/MATIC/SOL). * @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 claimRewards(claimRewardsRequest: ClaimRewardsRequest, chainDescriptor: ClaimRewardsChainDescriptorEnum, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.claimRewards(claimRewardsRequest, chainDescriptor, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.claimRewards']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Consolidates the source staking position into the destination, merging the balance into the destination and closing the source position once complete. Both positions must be from the same vault account (i.e. same withdrawal credentials). On chain, this translates into a consolidation transaction, where the source validator is consolidated into the destination validator. Supported chains: Ethereum (ETH) only. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor. **Note:** This endpoint is currently in beta and might be subject to changes. * @summary Consolidate staking positions (ETH validator consolidation) * @param {MergeStakeAccountsRequest} mergeStakeAccountsRequest * @param {ConsolidateChainDescriptorEnum} chainDescriptor Protocol identifier for the staking operation (e.g., ETH). * @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 consolidate(mergeStakeAccountsRequest: MergeStakeAccountsRequest, chainDescriptor: ConsolidateChainDescriptorEnum, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.consolidate(mergeStakeAccountsRequest, chainDescriptor, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.consolidate']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns all staking positions with core details: amounts, rewards, status, chain, and vault. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking positions * @param {ChainDescriptor} [chainDescriptor] Protocol identifier to filter positions (e.g., ATOM_COS/AXL/CELESTIA). If omitted, positions across all supported chains are returned. * @param {string} [vaultAccountId] Filter positions by vault account ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllDelegations(chainDescriptor?: ChainDescriptor, vaultAccountId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAllDelegations(chainDescriptor, vaultAccountId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getAllDelegations']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns chain-specific staking information such as epoch/slot cadence, lockup or unbonding periods, fee/reward mechanics, and other operational constraints. * @summary Get chain-level staking parameters * @param {ChainDescriptor} chainDescriptor Protocol identifier for the chain info staking operation (e.g., ETH/MATIC/SOL). * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getChainInfo(chainDescriptor: ChainDescriptor, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getChainInfo(chainDescriptor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getChainInfo']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns an alphabetical list of blockchains supported for staking by the current workspace context. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary List supported staking chains * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getChains(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getChains(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getChains']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns full details for a single staking position: amounts, rewards, status, chain, and vault. * @summary Get position details * @param {string} id Unique identifier of the staking position. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getDelegationById(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getDelegationById(id, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getDelegationById']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns enriched transaction history for a staking position with cursor-based pagination. Includes in-flight transactions with status pending. The in-flight transaction is always returned first; completed and failed history is ordered by the order parameter. * @summary List related transactions for a position * @param {string} id Unique identifier of the staking position. * @param {number} pageSize Number of results per page (minimum: 1, maximum: 100). * @param {string} [pageCursor] Cursor for the next page of results. Use the value from the \'next\' field in the previous response. * @param {GetPositionRelatedTransactionsOrderEnum} [order] ASC / DESC ordering for completed/failed history (default DESC). The in-flight transaction is always returned first. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPositionRelatedTransactions(id: string, pageSize: number, pageCursor?: string, order?: GetPositionRelatedTransactionsOrderEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPositionRelatedTransactions(id, pageSize, pageCursor, order, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getPositionRelatedTransactions']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns staking positions with core details: amounts, rewards, status, chain, and vault. It supports cursor-based pagination for efficient data retrieval. This endpoint always returns a paginated response with {data, next} structure. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking positions (Paginated) * @param {number} pageSize Number of results per page. When provided, the response returns a paginated object with {data, next}. If omitted, all results are returned as an array. * @param {ChainDescriptor} [chainDescriptor] Protocol identifier to filter positions (e.g., ATOM_COS/AXL/CELESTIA). If omitted, positions across all supported chains are returned. * @param {string} [vaultAccountId] Filter positions by Fireblocks vault account ID. If omitted, positions across all vault accounts are returned. * @param {string} [pageCursor] Cursor for the next page of results. Use the value from the \'next\' field in the previous response. * @param {GetPositionsOrderEnum} [order] ASC / DESC ordering (default DESC) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPositions(pageSize: number, chainDescriptor?: ChainDescriptor, vaultAccountId?: string, pageCursor?: string, order?: GetPositionsOrderEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPositions(pageSize, chainDescriptor, vaultAccountId, pageCursor, order, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getPositions']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns all available staking providers with metadata such as name, ID, and supported chains. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking providers * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getProviders(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getProviders(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getProviders']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns an aggregated cross-vault summary: active/inactive counts, total staked, and total rewards per chain. * @summary Get positions summary * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSummary(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSummary(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getSummary']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns per-vault aggregates: status breakdown, total staked, and total rewards per chain. * @summary Get positions summary by vault * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSummaryByVault(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSummaryByVault(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.getSummaryByVault']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Merges the source stake account into the destination, consolidating the balance into the destination and closing the source account once complete. Both accounts must be from the same validator provider and of same vault account.. Supported chains: Solana (SOL). Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Merge staking positions * @param {MergeStakeAccountsRequest} mergeStakeAccountsRequest * @param {MergeStakeAccountsChainDescriptorEnum} chainDescriptor Protocol identifier for the merge staking operation (e.g., SOL). * @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 mergeStakeAccounts(mergeStakeAccountsRequest: MergeStakeAccountsRequest, chainDescriptor: MergeStakeAccountsChainDescriptorEnum, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.mergeStakeAccounts(mergeStakeAccountsRequest, chainDescriptor, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.mergeStakeAccounts']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Splits a staking position by creating a new stake account with the requested amount, while keeping the original account with the remaining balance. Supported chains: Solana (SOL). * @summary Split a staking position * @param {SplitRequest} splitRequest * @param {SplitChainDescriptorEnum} chainDescriptor Protocol identifier for the staking operation (e.g., SOL). * @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 split(splitRequest: SplitRequest, chainDescriptor: SplitChainDescriptorEnum, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.split(splitRequest, chainDescriptor, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.split']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Creates a new staking position and returns its unique ID. For Ethereum compounding validator (EIP-7251): when the \'id\' of an existing compounding validator position is provided, adds to that position; otherwise creates a new position. For Ethereum legacy validator: creates a new position regardless of existing delegations. For Cosmos chains and Ethereum liquid staking (Lido): automatically add to existing positions for the same validator provider and same vault account if one exists, otherwise create a new position. For Solana and Polygon (MATIC/POL): always create new positions regardless of existing delegations. * @summary Initiate or add to existing stake * @param {StakeRequest} stakeRequest * @param {ChainDescriptor} chainDescriptor Protocol identifier for the stake staking operation (e.g., ATOM_COS/AXL/CELESTIA). * @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 stake(stakeRequest: StakeRequest, chainDescriptor: ChainDescriptor, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.stake(stakeRequest, chainDescriptor, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.stake']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Submits a chain-specific unstake request. * @summary Initiate unstake * @param {UnstakeRequest} unstakeRequest * @param {ChainDescriptor} chainDescriptor Protocol identifier for the unstake staking operation (e.g., SOL/SOL_TEST/MATIC). * @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 unstake(unstakeRequest: UnstakeRequest, chainDescriptor: ChainDescriptor, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.unstake(unstakeRequest, chainDescriptor, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.unstake']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Withdraws funds that have completed the unbonding period. Typically requires the position to be deactivated first (unstake → unbond → withdraw). Amount and timing vary by chain protocol. Partial withdrawal is supported for ETH compounding validators (EIP-7251/Pectra) and Cosmos chains via the optional \'amount\' field. For ETH compounding validators, the remaining balance must be at least 32 ETH after the withdrawal. For all other chains, omitting \'amount\' withdraws the entire available balance. * @summary Withdraw staked funds * @param {WithdrawRequest} withdrawRequest * @param {ChainDescriptor} chainDescriptor Protocol identifier for the withdraw staking operation (e.g., ATOM_COS/ETH/STETH_ETH). * @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 withdraw(withdrawRequest: WithdrawRequest, chainDescriptor: ChainDescriptor, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.withdraw(withdrawRequest, chainDescriptor, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['StakingApi.withdraw']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * StakingApi - factory interface * @export */ export const StakingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = StakingApiFp(configuration) return { /** * Approves the provider\'s terms of service. Must be called once before performing any staking operation with this provider. * @summary Approve provider terms of service * @param {StakingApiApproveTermsOfServiceByProviderIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ approveTermsOfServiceByProviderId(requestParameters: StakingApiApproveTermsOfServiceByProviderIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.approveTermsOfServiceByProviderId(requestParameters.providerId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Claims available staking rewards for the specified chain and vault. Supported chains: Solana and Polygon (POL/Matic). Behavior depends on protocol reward distribution. * @summary Claim accrued rewards * @param {StakingApiClaimRewardsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ claimRewards(requestParameters: StakingApiClaimRewardsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.claimRewards(requestParameters.claimRewardsRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Consolidates the source staking position into the destination, merging the balance into the destination and closing the source position once complete. Both positions must be from the same vault account (i.e. same withdrawal credentials). On chain, this translates into a consolidation transaction, where the source validator is consolidated into the destination validator. Supported chains: Ethereum (ETH) only. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor. **Note:** This endpoint is currently in beta and might be subject to changes. * @summary Consolidate staking positions (ETH validator consolidation) * @param {StakingApiConsolidateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ consolidate(requestParameters: StakingApiConsolidateRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.consolidate(requestParameters.mergeStakeAccountsRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Returns all staking positions with core details: amounts, rewards, status, chain, and vault. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking positions * @param {StakingApiGetAllDelegationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllDelegations(requestParameters: StakingApiGetAllDelegationsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getAllDelegations(requestParameters.chainDescriptor, requestParameters.vaultAccountId, options).then((request) => request(axios, basePath)); }, /** * Returns chain-specific staking information such as epoch/slot cadence, lockup or unbonding periods, fee/reward mechanics, and other operational constraints. * @summary Get chain-level staking parameters * @param {StakingApiGetChainInfoRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getChainInfo(requestParameters: StakingApiGetChainInfoRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getChainInfo(requestParameters.chainDescriptor, options).then((request) => request(axios, basePath)); }, /** * Returns an alphabetical list of blockchains supported for staking by the current workspace context. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary List supported staking chains * @param {*} [options] Override http request option. * @throws {RequiredError} */ getChains(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getChains(options).then((request) => request(axios, basePath)); }, /** * Returns full details for a single staking position: amounts, rewards, status, chain, and vault. * @summary Get position details * @param {StakingApiGetDelegationByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDelegationById(requestParameters: StakingApiGetDelegationByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getDelegationById(requestParameters.id, options).then((request) => request(axios, basePath)); }, /** * Returns enriched transaction history for a staking position with cursor-based pagination. Includes in-flight transactions with status pending. The in-flight transaction is always returned first; completed and failed history is ordered by the order parameter. * @summary List related transactions for a position * @param {StakingApiGetPositionRelatedTransactionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPositionRelatedTransactions(requestParameters: StakingApiGetPositionRelatedTransactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPositionRelatedTransactions(requestParameters.id, requestParameters.pageSize, requestParameters.pageCursor, requestParameters.order, options).then((request) => request(axios, basePath)); }, /** * Returns staking positions with core details: amounts, rewards, status, chain, and vault. It supports cursor-based pagination for efficient data retrieval. This endpoint always returns a paginated response with {data, next} structure. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking positions (Paginated) * @param {StakingApiGetPositionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPositions(requestParameters: StakingApiGetPositionsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPositions(requestParameters.pageSize, requestParameters.chainDescriptor, requestParameters.vaultAccountId, requestParameters.pageCursor, requestParameters.order, options).then((request) => request(axios, basePath)); }, /** * Returns all available staking providers with metadata such as name, ID, and supported chains. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking providers * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProviders(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getProviders(options).then((request) => request(axios, basePath)); }, /** * Returns an aggregated cross-vault summary: active/inactive counts, total staked, and total rewards per chain. * @summary Get positions summary * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSummary(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSummary(options).then((request) => request(axios, basePath)); }, /** * Returns per-vault aggregates: status breakdown, total staked, and total rewards per chain. * @summary Get positions summary by vault * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSummaryByVault(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSummaryByVault(options).then((request) => request(axios, basePath)); }, /** * Merges the source stake account into the destination, consolidating the balance into the destination and closing the source account once complete. Both accounts must be from the same validator provider and of same vault account.. Supported chains: Solana (SOL). Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Merge staking positions * @param {StakingApiMergeStakeAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ mergeStakeAccounts(requestParameters: StakingApiMergeStakeAccountsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.mergeStakeAccounts(requestParameters.mergeStakeAccountsRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Splits a staking position by creating a new stake account with the requested amount, while keeping the original account with the remaining balance. Supported chains: Solana (SOL). * @summary Split a staking position * @param {StakingApiSplitRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ split(requestParameters: StakingApiSplitRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.split(requestParameters.splitRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Creates a new staking position and returns its unique ID. For Ethereum compounding validator (EIP-7251): when the \'id\' of an existing compounding validator position is provided, adds to that position; otherwise creates a new position. For Ethereum legacy validator: creates a new position regardless of existing delegations. For Cosmos chains and Ethereum liquid staking (Lido): automatically add to existing positions for the same validator provider and same vault account if one exists, otherwise create a new position. For Solana and Polygon (MATIC/POL): always create new positions regardless of existing delegations. * @summary Initiate or add to existing stake * @param {StakingApiStakeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ stake(requestParameters: StakingApiStakeRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.stake(requestParameters.stakeRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Submits a chain-specific unstake request. * @summary Initiate unstake * @param {StakingApiUnstakeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ unstake(requestParameters: StakingApiUnstakeRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.unstake(requestParameters.unstakeRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Withdraws funds that have completed the unbonding period. Typically requires the position to be deactivated first (unstake → unbond → withdraw). Amount and timing vary by chain protocol. Partial withdrawal is supported for ETH compounding validators (EIP-7251/Pectra) and Cosmos chains via the optional \'amount\' field. For ETH compounding validators, the remaining balance must be at least 32 ETH after the withdrawal. For all other chains, omitting \'amount\' withdraws the entire available balance. * @summary Withdraw staked funds * @param {StakingApiWithdrawRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ withdraw(requestParameters: StakingApiWithdrawRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.withdraw(requestParameters.withdrawRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for approveTermsOfServiceByProviderId operation in StakingApi. * @export * @interface StakingApiApproveTermsOfServiceByProviderIdRequest */ export interface StakingApiApproveTermsOfServiceByProviderIdRequest { /** * Unique identifier of the staking provider. * @type {StakingProvider} * @memberof StakingApiApproveTermsOfServiceByProviderId */ readonly providerId: StakingProvider /** * 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 StakingApiApproveTermsOfServiceByProviderId */ readonly idempotencyKey?: string } /** * Request parameters for claimRewards operation in StakingApi. * @export * @interface StakingApiClaimRewardsRequest */ export interface StakingApiClaimRewardsRequest { /** * * @type {ClaimRewardsRequest} * @memberof StakingApiClaimRewards */ readonly claimRewardsRequest: ClaimRewardsRequest /** * Protocol identifier for the claim rewards staking operation (e.g., POL/MATIC/SOL). * @type {'SOL' | 'SOL_TEST' | 'MATIC' | 'POL' | 'POL_TEST'} * @memberof StakingApiClaimRewards */ readonly chainDescriptor: ClaimRewardsChainDescriptorEnum /** * 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 StakingApiClaimRewards */ readonly idempotencyKey?: string } /** * Request parameters for consolidate operation in StakingApi. * @export * @interface StakingApiConsolidateRequest */ export interface StakingApiConsolidateRequest { /** * * @type {MergeStakeAccountsRequest} * @memberof StakingApiConsolidate */ readonly mergeStakeAccountsRequest: MergeStakeAccountsRequest /** * Protocol identifier for the staking operation (e.g., ETH). * @type {'ETH' | 'ETH_TEST6' | 'ETH_TEST_HOODI'} * @memberof StakingApiConsolidate */ readonly chainDescriptor: ConsolidateChainDescriptorEnum /** * 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 StakingApiConsolidate */ readonly idempotencyKey?: string } /** * Request parameters for getAllDelegations operation in StakingApi. * @export * @interface StakingApiGetAllDelegationsRequest */ export interface StakingApiGetAllDelegationsRequest { /** * Protocol identifier to filter positions (e.g., ATOM_COS/AXL/CELESTIA). If omitted, positions across all supported chains are returned. * @type {ChainDescriptor} * @memberof StakingApiGetAllDelegations */ readonly chainDescriptor?: ChainDescriptor /** * Filter positions by vault account ID. * @type {string} * @memberof StakingApiGetAllDelegations */ readonly vaultAccountId?: string } /** * Request parameters for getChainInfo operation in StakingApi. * @export * @interface StakingApiGetChainInfoRequest */ export interface StakingApiGetChainInfoRequest { /** * Protocol identifier for the chain info staking operation (e.g., ETH/MATIC/SOL). * @type {ChainDescriptor} * @memberof StakingApiGetChainInfo */ readonly chainDescriptor: ChainDescriptor } /** * Request parameters for getDelegationById operation in StakingApi. * @export * @interface StakingApiGetDelegationByIdRequest */ export interface StakingApiGetDelegationByIdRequest { /** * Unique identifier of the staking position. * @type {string} * @memberof StakingApiGetDelegationById */ readonly id: string } /** * Request parameters for getPositionRelatedTransactions operation in StakingApi. * @export * @interface StakingApiGetPositionRelatedTransactionsRequest */ export interface StakingApiGetPositionRelatedTransactionsRequest { /** * Unique identifier of the staking position. * @type {string} * @memberof StakingApiGetPositionRelatedTransactions */ readonly id: string /** * Number of results per page (minimum: 1, maximum: 100). * @type {number} * @memberof StakingApiGetPositionRelatedTransactions */ readonly pageSize: number /** * Cursor for the next page of results. Use the value from the \'next\' field in the previous response. * @type {string} * @memberof StakingApiGetPositionRelatedTransactions */ readonly pageCursor?: string /** * ASC / DESC ordering for completed/failed history (default DESC). The in-flight transaction is always returned first. * @type {'ASC' | 'DESC'} * @memberof StakingApiGetPositionRelatedTransactions */ readonly order?: GetPositionRelatedTransactionsOrderEnum } /** * Request parameters for getPositions operation in StakingApi. * @export * @interface StakingApiGetPositionsRequest */ export interface StakingApiGetPositionsRequest { /** * Number of results per page. When provided, the response returns a paginated object with {data, next}. If omitted, all results are returned as an array. * @type {number} * @memberof StakingApiGetPositions */ readonly pageSize: number /** * Protocol identifier to filter positions (e.g., ATOM_COS/AXL/CELESTIA). If omitted, positions across all supported chains are returned. * @type {ChainDescriptor} * @memberof StakingApiGetPositions */ readonly chainDescriptor?: ChainDescriptor /** * Filter positions by Fireblocks vault account ID. If omitted, positions across all vault accounts are returned. * @type {string} * @memberof StakingApiGetPositions */ readonly vaultAccountId?: string /** * Cursor for the next page of results. Use the value from the \'next\' field in the previous response. * @type {string} * @memberof StakingApiGetPositions */ readonly pageCursor?: string /** * ASC / DESC ordering (default DESC) * @type {'ASC' | 'DESC'} * @memberof StakingApiGetPositions */ readonly order?: GetPositionsOrderEnum } /** * Request parameters for mergeStakeAccounts operation in StakingApi. * @export * @interface StakingApiMergeStakeAccountsRequest */ export interface StakingApiMergeStakeAccountsRequest { /** * * @type {MergeStakeAccountsRequest} * @memberof StakingApiMergeStakeAccounts */ readonly mergeStakeAccountsRequest: MergeStakeAccountsRequest /** * Protocol identifier for the merge staking operation (e.g., SOL). * @type {'SOL' | 'SOL_TEST'} * @memberof StakingApiMergeStakeAccounts */ readonly chainDescriptor: MergeStakeAccountsChainDescriptorEnum /** * 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 StakingApiMergeStakeAccounts */ readonly idempotencyKey?: string } /** * Request parameters for split operation in StakingApi. * @export * @interface StakingApiSplitRequest */ export interface StakingApiSplitRequest { /** * * @type {SplitRequest} * @memberof StakingApiSplit */ readonly splitRequest: SplitRequest /** * Protocol identifier for the staking operation (e.g., SOL). * @type {'SOL' | 'SOL_TEST'} * @memberof StakingApiSplit */ readonly chainDescriptor: SplitChainDescriptorEnum /** * 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 StakingApiSplit */ readonly idempotencyKey?: string } /** * Request parameters for stake operation in StakingApi. * @export * @interface StakingApiStakeRequest */ export interface StakingApiStakeRequest { /** * * @type {StakeRequest} * @memberof StakingApiStake */ readonly stakeRequest: StakeRequest /** * Protocol identifier for the stake staking operation (e.g., ATOM_COS/AXL/CELESTIA). * @type {ChainDescriptor} * @memberof StakingApiStake */ readonly chainDescriptor: ChainDescriptor /** * 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 StakingApiStake */ readonly idempotencyKey?: string } /** * Request parameters for unstake operation in StakingApi. * @export * @interface StakingApiUnstakeRequest */ export interface StakingApiUnstakeRequest { /** * * @type {UnstakeRequest} * @memberof StakingApiUnstake */ readonly unstakeRequest: UnstakeRequest /** * Protocol identifier for the unstake staking operation (e.g., SOL/SOL_TEST/MATIC). * @type {ChainDescriptor} * @memberof StakingApiUnstake */ readonly chainDescriptor: ChainDescriptor /** * 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 StakingApiUnstake */ readonly idempotencyKey?: string } /** * Request parameters for withdraw operation in StakingApi. * @export * @interface StakingApiWithdrawRequest */ export interface StakingApiWithdrawRequest { /** * * @type {WithdrawRequest} * @memberof StakingApiWithdraw */ readonly withdrawRequest: WithdrawRequest /** * Protocol identifier for the withdraw staking operation (e.g., ATOM_COS/ETH/STETH_ETH). * @type {ChainDescriptor} * @memberof StakingApiWithdraw */ readonly chainDescriptor: ChainDescriptor /** * 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 StakingApiWithdraw */ readonly idempotencyKey?: string } /** * StakingApi - object-oriented interface * @export * @class StakingApi * @extends {BaseAPI} */ export class StakingApi extends BaseAPI { /** * Approves the provider\'s terms of service. Must be called once before performing any staking operation with this provider. * @summary Approve provider terms of service * @param {StakingApiApproveTermsOfServiceByProviderIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public approveTermsOfServiceByProviderId(requestParameters: StakingApiApproveTermsOfServiceByProviderIdRequest) { return StakingApiFp(this.configuration).approveTermsOfServiceByProviderId(requestParameters.providerId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Claims available staking rewards for the specified chain and vault. Supported chains: Solana and Polygon (POL/Matic). Behavior depends on protocol reward distribution. * @summary Claim accrued rewards * @param {StakingApiClaimRewardsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public claimRewards(requestParameters: StakingApiClaimRewardsRequest) { return StakingApiFp(this.configuration).claimRewards(requestParameters.claimRewardsRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Consolidates the source staking position into the destination, merging the balance into the destination and closing the source position once complete. Both positions must be from the same vault account (i.e. same withdrawal credentials). On chain, this translates into a consolidation transaction, where the source validator is consolidated into the destination validator. Supported chains: Ethereum (ETH) only. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor. **Note:** This endpoint is currently in beta and might be subject to changes. * @summary Consolidate staking positions (ETH validator consolidation) * @param {StakingApiConsolidateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public consolidate(requestParameters: StakingApiConsolidateRequest) { return StakingApiFp(this.configuration).consolidate(requestParameters.mergeStakeAccountsRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns all staking positions with core details: amounts, rewards, status, chain, and vault. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking positions * @param {StakingApiGetAllDelegationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getAllDelegations(requestParameters: StakingApiGetAllDelegationsRequest = {}) { return StakingApiFp(this.configuration).getAllDelegations(requestParameters.chainDescriptor, requestParameters.vaultAccountId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns chain-specific staking information such as epoch/slot cadence, lockup or unbonding periods, fee/reward mechanics, and other operational constraints. * @summary Get chain-level staking parameters * @param {StakingApiGetChainInfoRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getChainInfo(requestParameters: StakingApiGetChainInfoRequest) { return StakingApiFp(this.configuration).getChainInfo(requestParameters.chainDescriptor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns an alphabetical list of blockchains supported for staking by the current workspace context. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary List supported staking chains * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getChains() { return StakingApiFp(this.configuration).getChains().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns full details for a single staking position: amounts, rewards, status, chain, and vault. * @summary Get position details * @param {StakingApiGetDelegationByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getDelegationById(requestParameters: StakingApiGetDelegationByIdRequest) { return StakingApiFp(this.configuration).getDelegationById(requestParameters.id).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns enriched transaction history for a staking position with cursor-based pagination. Includes in-flight transactions with status pending. The in-flight transaction is always returned first; completed and failed history is ordered by the order parameter. * @summary List related transactions for a position * @param {StakingApiGetPositionRelatedTransactionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getPositionRelatedTransactions(requestParameters: StakingApiGetPositionRelatedTransactionsRequest) { return StakingApiFp(this.configuration).getPositionRelatedTransactions(requestParameters.id, requestParameters.pageSize, requestParameters.pageCursor, requestParameters.order).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns staking positions with core details: amounts, rewards, status, chain, and vault. It supports cursor-based pagination for efficient data retrieval. This endpoint always returns a paginated response with {data, next} structure. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking positions (Paginated) * @param {StakingApiGetPositionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getPositions(requestParameters: StakingApiGetPositionsRequest) { return StakingApiFp(this.configuration).getPositions(requestParameters.pageSize, requestParameters.chainDescriptor, requestParameters.vaultAccountId, requestParameters.pageCursor, requestParameters.order).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns all available staking providers with metadata such as name, ID, and supported chains. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List staking providers * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getProviders() { return StakingApiFp(this.configuration).getProviders().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns an aggregated cross-vault summary: active/inactive counts, total staked, and total rewards per chain. * @summary Get positions summary * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getSummary() { return StakingApiFp(this.configuration).getSummary().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns per-vault aggregates: status breakdown, total staked, and total rewards per chain. * @summary Get positions summary by vault * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public getSummaryByVault() { return StakingApiFp(this.configuration).getSummaryByVault().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Merges the source stake account into the destination, consolidating the balance into the destination and closing the source account once complete. Both accounts must be from the same validator provider and of same vault account.. Supported chains: Solana (SOL). Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Merge staking positions * @param {StakingApiMergeStakeAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public mergeStakeAccounts(requestParameters: StakingApiMergeStakeAccountsRequest) { return StakingApiFp(this.configuration).mergeStakeAccounts(requestParameters.mergeStakeAccountsRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Splits a staking position by creating a new stake account with the requested amount, while keeping the original account with the remaining balance. Supported chains: Solana (SOL). * @summary Split a staking position * @param {StakingApiSplitRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public split(requestParameters: StakingApiSplitRequest) { return StakingApiFp(this.configuration).split(requestParameters.splitRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Creates a new staking position and returns its unique ID. For Ethereum compounding validator (EIP-7251): when the \'id\' of an existing compounding validator position is provided, adds to that position; otherwise creates a new position. For Ethereum legacy validator: creates a new position regardless of existing delegations. For Cosmos chains and Ethereum liquid staking (Lido): automatically add to existing positions for the same validator provider and same vault account if one exists, otherwise create a new position. For Solana and Polygon (MATIC/POL): always create new positions regardless of existing delegations. * @summary Initiate or add to existing stake * @param {StakingApiStakeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public stake(requestParameters: StakingApiStakeRequest) { return StakingApiFp(this.configuration).stake(requestParameters.stakeRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Submits a chain-specific unstake request. * @summary Initiate unstake * @param {StakingApiUnstakeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public unstake(requestParameters: StakingApiUnstakeRequest) { return StakingApiFp(this.configuration).unstake(requestParameters.unstakeRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Withdraws funds that have completed the unbonding period. Typically requires the position to be deactivated first (unstake → unbond → withdraw). Amount and timing vary by chain protocol. Partial withdrawal is supported for ETH compounding validators (EIP-7251/Pectra) and Cosmos chains via the optional \'amount\' field. For ETH compounding validators, the remaining balance must be at least 32 ETH after the withdrawal. For all other chains, omitting \'amount\' withdraws the entire available balance. * @summary Withdraw staked funds * @param {StakingApiWithdrawRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StakingApi */ public withdraw(requestParameters: StakingApiWithdrawRequest) { return StakingApiFp(this.configuration).withdraw(requestParameters.withdrawRequest, requestParameters.chainDescriptor, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const ClaimRewardsChainDescriptorEnum = { Sol: 'SOL', SolTest: 'SOL_TEST', Matic: 'MATIC', Pol: 'POL', PolTest: 'POL_TEST' } as const; export type ClaimRewardsChainDescriptorEnum = typeof ClaimRewardsChainDescriptorEnum[keyof typeof ClaimRewardsChainDescriptorEnum]; /** * @export */ export const ConsolidateChainDescriptorEnum = { Eth: 'ETH', EthTest6: 'ETH_TEST6', EthTestHoodi: 'ETH_TEST_HOODI' } as const; export type ConsolidateChainDescriptorEnum = typeof ConsolidateChainDescriptorEnum[keyof typeof ConsolidateChainDescriptorEnum]; /** * @export */ export const GetPositionRelatedTransactionsOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetPositionRelatedTransactionsOrderEnum = typeof GetPositionRelatedTransactionsOrderEnum[keyof typeof GetPositionRelatedTransactionsOrderEnum]; /** * @export */ export const GetPositionsOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetPositionsOrderEnum = typeof GetPositionsOrderEnum[keyof typeof GetPositionsOrderEnum]; /** * @export */ export const MergeStakeAccountsChainDescriptorEnum = { Sol: 'SOL', SolTest: 'SOL_TEST' } as const; export type MergeStakeAccountsChainDescriptorEnum = typeof MergeStakeAccountsChainDescriptorEnum[keyof typeof MergeStakeAccountsChainDescriptorEnum]; /** * @export */ export const SplitChainDescriptorEnum = { Sol: 'SOL', SolTest: 'SOL_TEST' } as const; export type SplitChainDescriptorEnum = typeof SplitChainDescriptorEnum[keyof typeof SplitChainDescriptorEnum];