Skip to content

Commit

Permalink
fix staking getters and remove CheckTermsOfServiceRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Yahav Amar committed Oct 30, 2023
1 parent 7938fa8 commit 7033e14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
3 changes: 0 additions & 3 deletions fireblocks_sdk/api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,6 @@ def serialize(self) -> dict:

return obj

class CheckTermsOfServiceRequestDto:
validatorProviderId: int

class PolicyTransactionType(str, Enum):
ANY = "*"
CONTRACT_CALL = "CONTRACT_CALL"
Expand Down
28 changes: 14 additions & 14 deletions fireblocks_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
GetSmartTransferFilters,
NFTsWalletTypeValues,
NFTOwnershipStatusUpdatedPayload,
CheckTermsOfServiceRequest

)
from .sdk_token_provider import SdkTokenProvider

Expand Down Expand Up @@ -116,29 +116,29 @@ def unlink_token(self, asset_id: str):
def get_staking_chains(self):
return self._get_request(f"/v1/staking/chains")

def get_staking_chain_info(self, chainDescriptor: str):
return self._get_request(f"/v1/staking/{chainDescriptor}/chainInfo")
def get_staking_chain_info(self, chain_descriptor: str):
return self._get_request(f"/v1/staking/{chain_descriptor}/chainInfo")

def get_staking_positions_summary(self):
return self._get_request(f"/v1/staking/positions/summary")

def execute_staking_action(self, chainDescriptor: str, actionId: str, requestBody):
return self._post_request(f"/v1/staking/chains/{chainDescriptor}/{actionId}", requestBody)
def execute_staking_action(self, chain_descriptor: str, action_id: str, request_body):
return self._post_request(f"/v1/staking/chains/{chain_descriptor}/{action_id}", request_body)

def get_staking_positions(self, chainDescriptor: str):
def get_staking_positions(self, chain_descriptor: str):
url = "/v1/staking/positions"
if chainDescriptor:
url += f"?chainDescriptor={chainDescriptor}"
if chain_descriptor:
url += f"?chainDescriptor={chain_descriptor}"
return self._get_request(url)

def get_staking_position(self, positionId: str):
return self._get_request(f"/v1/staking/position/{positionId}")
def get_staking_position(self, position_id: str):
return self._get_request(f"/v1/staking/position/{position_id}")

def get_staking_validators(self, chainDescriptor: str):
return self._get_request(f"/v1/staking/validators/{chainDescriptor}")
def get_staking_validators(self, chain_descriptor: str):
return self._get_request(f"/v1/staking/validators/{chain_descriptor}")

def approve_staking_provider(self, validatorProviderId: str):
return self._get_request(f"/v1/staking/validators/{chainDescriptor}", { validatorProviderId })
def approve_staking_provider(self, validatorProviderId: int):
return self._post_request(f"/v1/staking/providers/approveTermsOfService", {validatorProviderId})

def get_nft(self, id: str):
url = "/v1/nfts/tokens/" + id
Expand Down

0 comments on commit 7033e14

Please sign in to comment.