Skip to content
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
4 changes: 2 additions & 2 deletions src/story_protocol_python_sdk/resources/Group.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def mint_and_register_ip_and_attach_license_and_add_to_group(
:param ip_metadata dict: [Optional] The metadata for the IP.
:param recipient str: [Optional] The recipient of the NFT (defaults to caller).
:param allow_duplicates bool: [Optional] Whether to allow duplicate IPs.
:param deadline int: [Optional] The deadline for the signature in milliseconds.
:param deadline int: [Optional] The deadline for the signature in seconds. (default: 1000 seconds)
:param tx_options dict: [Optional] The transaction options.
:return dict: A dictionary with the transaction hash, IP ID, and token ID.
"""
Expand Down Expand Up @@ -257,7 +257,7 @@ def register_ip_and_attach_license_and_add_to_group(
:param license_data list: List of license data objects with terms and config.
:param max_allowed_reward_share int: Maximum allowed reward share percentage. Must be between 0 and 100 (where 100% represents 100,000,000).
:param ip_metadata dict: [Optional] The metadata for the IP.
:param deadline int: [Optional] The deadline for the signature in milliseconds.
:param deadline int: [Optional] The deadline for the signature in seconds. (default: 1000 seconds)
:param tx_options dict: [Optional] The transaction options.
:return dict: A dictionary with the transaction hash, IP ID, and token ID.
"""
Expand Down
10 changes: 5 additions & 5 deletions src/story_protocol_python_sdk/resources/IPAsset.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def register(
:param ip_metadata_hash str: [Optional] Metadata hash for the IP.
:param nft_metadata_uri str: [Optional] Metadata URI for the NFT.
:param nft_metadata_hash str: [Optional] Metadata hash for the NFT.
:param deadline int: [Optional] Signature deadline in milliseconds.
:param deadline int: [Optional] Signature deadline in seconds. (default: 1000 seconds)
:param tx_options dict: [Optional] Transaction options.
:return dict: Dictionary with the transaction hash and IP ID.
"""
Expand Down Expand Up @@ -595,7 +595,7 @@ def register_ip_and_attach_pil_terms(
:param ip_metadata_hash str: [Optional] The hash of the metadata for the IP.
:param nft_metadata_uri str: [Optional] The URI of the metadata for the NFT.
:param nft_metadata_hash str: [Optional] The hash of the metadata for the IP NFT.
:param deadline int: [Optional] The deadline for the signature in milliseconds.
:param deadline int: [Optional] The deadline for the signature in seconds. (default: 1000 seconds)
:param tx_options dict: [Optional] The transaction options.
:return dict: A dictionary with the transaction hash, license terms ID, and IP ID.
"""
Expand Down Expand Up @@ -721,7 +721,7 @@ def register_derivative_ip(
:param token_id int: The ID of the NFT.
:param deriv_data `DerivativeDataInput`: The derivative data for registerDerivative.
:param metadata `IPMetadataInput`: [Optional] Desired IP metadata.
:param deadline int: [Optional] Signature deadline in milliseconds.
:param deadline int: [Optional] Signature deadline in seconds. (default: 1000 seconds)
:param tx_options dict: [Optional] Transaction options.
:return dict: Dictionary with the tx hash and IP ID.
"""
Expand Down Expand Up @@ -904,7 +904,7 @@ def register_ip_and_make_derivative_with_license_tokens(
:param token_id int: The ID of the NFT.
:param license_token_ids list[int]: The IDs of the license tokens to be burned for linking the IP to parent IPs.
:param max_rts int: [Optional] The maximum number of royalty tokens that can be distributed to the external royalty policies (max: 100,000,000). (default: 100,000,000)
:param deadline int: [Optional] Signature deadline in milliseconds. (default: 1000)
:param deadline int: [Optional] Signature deadline in seconds. (default: 1000 seconds)
:param ip_metadata IPMetadataInput: [Optional] The desired metadata for the newly registered IP.
:param tx_options dict: [Optional] Transaction options.
:return RegistrationResponse: Dictionary with the tx hash, IP ID and token ID.
Expand Down Expand Up @@ -1000,7 +1000,7 @@ def register_pil_terms_and_attach(

:param ip_id Address: The IP ID.
:param license_terms_data list: The data of the license and its configuration to be attached to the IP.
:param deadline int: [Optional] Signature deadline in milliseconds. If not provided, the current time + 1000ms will be used.
:param deadline int: [Optional] Signature deadline in seconds. (default: 1000 seconds)
:param tx_options dict: [Optional] Transaction options.
:return RegisterPILTermsAndAttachResponse: Dictionary with the tx hash and license terms IDs.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/story_protocol_python_sdk/resources/Permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def create_set_permission_signature(
:param to str: The address that can be called by the `signer`.
:param permission `AccessPermission`: The new permission level.
:param func str: [Optional] The function selector string.
:param deadline int: [Optional] The deadline for the signature validity.
:param deadline int: [Optional] The deadline for the signature in seconds. (default: 1000 seconds)
:param tx_options dict: [Optional] The transaction options.
:return dict: A dictionary with the transaction hash and success status if waiting for transaction.
"""
Expand Down
10 changes: 4 additions & 6 deletions src/story_protocol_python_sdk/utils/sign.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# src/story_protcol_python_sdk/utils/sign.py

from datetime import datetime

from eth_abi.abi import encode
Expand Down Expand Up @@ -39,7 +37,7 @@ def get_signature(
:param to str: The recipient address.
:param encode_data bytes: The encoded data.
:param verifying_contract str: The verifying contract address.
:param deadline int: The deadline for the signature in milliseconds.
:param deadline int: The deadline for the signature in seconds. (default: 1000 seconds)
:return dict: A dictionary containing the signature and nonce.
"""
try:
Expand Down Expand Up @@ -101,10 +99,10 @@ def get_deadline(self, deadline: int | None = None) -> int:
"""
Calculate the deadline for a transaction.

:param deadline int: [Optional] The deadline value in milliseconds.
:return int: The calculated deadline in milliseconds.
:param deadline int: [Optional] The deadline value in seconds.
:return int: The calculated deadline in seconds.
"""
current_timestamp = int(datetime.now().timestamp() * 1000)
current_timestamp = int(datetime.now().timestamp())

if deadline is not None:
if not isinstance(deadline, int) or deadline < 0:
Expand Down
Loading