diff --git a/src/fireblocks-sdk.ts b/src/fireblocks-sdk.ts index 22109fbe..05f3c765 100644 --- a/src/fireblocks-sdk.ts +++ b/src/fireblocks-sdk.ts @@ -161,7 +161,7 @@ import { ChainInfo, CheckTermsOfServiceResponseDto, DelegationSummaryDto, - DelegationSummaryDtoByVault, + DelegationSummaryDtoByVault, SplitRequestDto, SplitResponse, StakeRequestDto, StakeResponse, StakingChain, @@ -314,6 +314,12 @@ export class FireblocksSDK { public async executeStakingClaimRewards(chainDescriptor: StakingChain, body: WithdrawRequestDto): Promise { return await this.stakingApiClient.withdraw(chainDescriptor, body); } + /** + * Execute staking split on a chain + */ + public async executeStakingSplit(chainDescriptor: StakingChain, body: SplitRequestDto): Promise { + return await this.stakingApiClient.split(chainDescriptor, body); + } /** * Get all staking positions, optionally filtered by chain */ diff --git a/src/staking/staking-api-client.ts b/src/staking/staking-api-client.ts index 14975188..bc64628e 100644 --- a/src/staking/staking-api-client.ts +++ b/src/staking/staking-api-client.ts @@ -2,7 +2,7 @@ import { ChainInfo, CheckTermsOfServiceResponseDto, ClaimRewardsRequestDto, ClaimRewardsResponse, DelegationSummaryDto, - DelegationSummaryDtoByVault, + DelegationSummaryDtoByVault, SplitRequestDto, SplitResponse, StakeRequestDto, StakeResponse, StakingChain, StakingPosition, StakingProvider, @@ -63,6 +63,12 @@ export class StakingApiClient implements StakingSDK { body, ); } + public async split(chainDescriptor: StakingChain, body: SplitRequestDto): Promise { + return await this.apiClient.issuePostRequest( + `${STAKING_BASE_PATH}/chains/${chainDescriptor}/split`, + body, + ); + } public async getPositions(chainDescriptor?: StakingChain): Promise { const url = `${STAKING_BASE_PATH}/positions${chainDescriptor ? `?chainDescriptor=${chainDescriptor}` : ""}`; return await this.apiClient.issueGetRequest(url); diff --git a/src/staking/staking-sdk.ts b/src/staking/staking-sdk.ts index 6eab283c..44b9db65 100644 --- a/src/staking/staking-sdk.ts +++ b/src/staking/staking-sdk.ts @@ -2,7 +2,7 @@ import { ChainInfo, CheckTermsOfServiceResponseDto, ClaimRewardsRequestDto, ClaimRewardsResponse, DelegationSummaryDto, - DelegationSummaryDtoByVault, + DelegationSummaryDtoByVault, SplitRequestDto, SplitResponse, StakeRequestDto, StakeResponse, StakingChain, @@ -55,6 +55,11 @@ export interface StakingSDK { */ claimRewards(chainDescriptor: StakingChain, body: ClaimRewardsRequestDto): Promise; + /** + * Execute staking split on a chain + */ + split(chainDescriptor: StakingChain, body: SplitRequestDto): Promise; + /** * Get all staking positions, optionally filtered by chain */ diff --git a/src/staking/types.ts b/src/staking/types.ts index 8354569e..4bbe45c8 100644 --- a/src/staking/types.ts +++ b/src/staking/types.ts @@ -230,6 +230,10 @@ export type WithdrawResponse = {}; export type ClaimRewardsResponse = {}; +export type SplitResponse = { + id: string; +}; + export interface StakeRequestDto { /** * The source vault account to stake from @@ -322,6 +326,33 @@ export interface ClaimRewardsRequestDto { */ feeLevel?: string; + /** + * The note to associate with the transactions + */ + txNote?: string; +} + +export interface SplitRequestDto { + /** + * id of position to split + */ + id: string; + + /** + * Amount of tokens to split + */ + amount: string; + + /** + * Represents the fee for a transaction, which can be specified as a percentage value. Only one of fee/feeLevel is required + */ + fee?: string; + + /** + * Represents the fee level for a transaction, which can be set as slow, medium, or fast. Only one of fee/feeLevel is required + */ + feeLevel?: string; + /** * The note to associate with the transactions */