From 7033e1451159cf010afe28372f5615c2c2c1f2dd Mon Sep 17 00:00:00 2001 From: Yahav Amar Date: Mon, 30 Oct 2023 14:57:11 +0200 Subject: [PATCH] fix staking getters and remove CheckTermsOfServiceRequest --- fireblocks_sdk/api_types.py | 3 --- fireblocks_sdk/sdk.py | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/fireblocks_sdk/api_types.py b/fireblocks_sdk/api_types.py index 4290c61..c225edf 100644 --- a/fireblocks_sdk/api_types.py +++ b/fireblocks_sdk/api_types.py @@ -394,9 +394,6 @@ def serialize(self) -> dict: return obj -class CheckTermsOfServiceRequestDto: - validatorProviderId: int - class PolicyTransactionType(str, Enum): ANY = "*" CONTRACT_CALL = "CONTRACT_CALL" diff --git a/fireblocks_sdk/sdk.py b/fireblocks_sdk/sdk.py index 2ffc0c1..b9bcbbd 100644 --- a/fireblocks_sdk/sdk.py +++ b/fireblocks_sdk/sdk.py @@ -33,7 +33,7 @@ GetSmartTransferFilters, NFTsWalletTypeValues, NFTOwnershipStatusUpdatedPayload, - CheckTermsOfServiceRequest + ) from .sdk_token_provider import SdkTokenProvider @@ -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