Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
phanigovindaraju committed Aug 5, 2024
1 parent 4532912 commit 99a3b6d
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions fireblocks_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2900,19 +2900,26 @@ def get_linked_token(self, id: str):
def get_linked_tokens_count(self):
return self._get_request(f"/v1/tokenization/tokens/count")

def link_token(self, type: TokenLinkType, ref_id: Optional[str] = None,
display_name: Optional[str] = None, base_asset_id: Optional[str] = None, contract_address: Optional[str] = None):
def link_token(self, type: TokenLinkType, ref_id: str = None,
display_name: Optional[str] = None):
body = {
"type": type,
"refId": ref_id
}

if ref_id:
body["refId"] = ref_id

if base_asset_id and contract_address:
body["baseAssetId"] = base_asset_id
body["contractAddress"] = contract_address
if display_name:
body["displayName"] = display_name

return self._post_request(f"/v1/tokenization/tokens/link", body)

def link_contract_by_address(self, type: TokenLinkType, base_asset_id: str = None,
contract_address: str = None, display_name: Optional[str] = None):
body = {
"type": type,
"baseAssetId": base_asset_id,
"contractAddress": contract_address
}

if display_name:
body["displayName"] = display_name

Expand Down

0 comments on commit 99a3b6d

Please sign in to comment.