Skip to content

Commit

Permalink
staking-sdk: add solana split support
Browse files Browse the repository at this point in the history
  • Loading branch information
Yahav Amar committed Nov 28, 2024
1 parent 1048e2c commit fc01f8d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fireblocks_sdk/api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,5 +714,16 @@ def __init__(self, id: str, fee: str = None, fee_level: str = None, tx_note: str
self.fee_level = fee_level
self.tx_note = tx_note

def to_dict(self):
return convert_class_to_dict(self.__dict__)

class SplitRequestDto:
def __init__(self, id: str, amount: str, fee: str = None, fee_level: str = None, tx_note: str = None):
self.id = id
self.amount = amount
self.fee = fee
self.fee_level = fee_level
self.tx_note = tx_note

def to_dict(self):
return convert_class_to_dict(self.__dict__)
6 changes: 6 additions & 0 deletions fireblocks_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
UnstakeRequestDto,
WithdrawRequestDto,
ClaimRewardsRequestDto,
SplitRequestDto,
Role,
SpamTokenOwnershipValues,
TokenOwnershipSpamUpdatePayload,
Expand Down Expand Up @@ -153,6 +154,11 @@ def execute_staking_claim_rewards(self, chain_descriptor: str, request_body: Cla
"""
return self._post_request(f"/v1/staking/chains/{chain_descriptor}/claimRewards", request_body.to_dict())

def execute_staking_split(self, chain_descriptor: str, request_body: SplitRequestDto):
"""Execute staking split on a chain.
"""
return self._post_request(f"/v1/staking/chains/{chain_descriptor}/split", request_body.to_dict())

def get_staking_positions(self, chain_descriptor: str = None):
"""Get all staking positions, optionally filtered by chain."""
return self._get_request("/v1/staking/positions",
Expand Down

0 comments on commit fc01f8d

Please sign in to comment.