Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi NFT ownership status update endpoint #128

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions fireblocks_sdk/api_types.py
lazars14-f marked this conversation as resolved.
Show resolved Hide resolved
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