Skip to content

Commit

Permalink
Add multi NFT ownership status update endpoint (#128)
Browse files Browse the repository at this point in the history
* feat: added multi nft token status update endpoint

* fix: class init and serialize
  • Loading branch information
lazars14-f authored Oct 24, 2023
1 parent e51bdb3 commit 58f3f93
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 12 additions & 0 deletions fireblocks_sdk/api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,18 @@ class NFTOwnershipStatusValues(str, Enum):
ARCHIVED = "ARCHIVED"


class NFTOwnershipStatusUpdatedPayload:
def __init__(self, asset_id: str, status: NFTOwnershipStatusValues):
self.asset_id = asset_id
self.status = status

def serialize(self) -> dict:
return {
'assetId': self.asset_id,
'status': self.status,
}


class GetOwnedCollectionsSortValue(str, Enum):
COLLECTION_NAME = "name"

Expand Down
13 changes: 12 additions & 1 deletion fireblocks_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
GetOwnedAssetsSortValues,
PolicyRule,
GetSmartTransferFilters,
NFTsWalletTypeValues
NFTsWalletTypeValues,
NFTOwnershipStatusUpdatedPayload,
)
from .sdk_token_provider import SdkTokenProvider

Expand Down Expand Up @@ -319,6 +320,16 @@ def update_nft_ownership_status(self, id: str, status: NFTOwnershipStatusValues)

return self._put_request(url, {"status": status.value})

def update_nft_ownerships_status(self, payload: List[NFTOwnershipStatusUpdatedPayload]):
"""Updates tokens status for a tenant, in all tenant vaults.
Args:
payload (NFTOwnershipStatusUpdatedPayload[]): List of assets with status for update
"""
url = "/v1/nfts/ownership/tokens/status"

return self._put_request(url, list(map((lambda payload_item: payload_item.serialize()), payload)))

def get_supported_assets(self):
"""Gets all assets that are currently supported by Fireblocks"""

Expand Down

0 comments on commit 58f3f93

Please sign in to comment.