From d73f9bca20ea31b58b253e2bb6203db41fa9f50b Mon Sep 17 00:00:00 2001 From: Bonnie Date: Tue, 14 Oct 2025 16:41:55 +0800 Subject: [PATCH 1/2] fix: update deadline parameter documentation in Sign class to reflect seconds instead of milliseconds --- src/story_protocol_python_sdk/utils/sign.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/story_protocol_python_sdk/utils/sign.py b/src/story_protocol_python_sdk/utils/sign.py index e5be6963..060c9c64 100644 --- a/src/story_protocol_python_sdk/utils/sign.py +++ b/src/story_protocol_python_sdk/utils/sign.py @@ -1,5 +1,3 @@ -# src/story_protcol_python_sdk/utils/sign.py - from datetime import datetime from eth_abi.abi import encode @@ -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: @@ -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: From 6d2735f9c42dff1e73f84926179898180ba7c7e2 Mon Sep 17 00:00:00 2001 From: Bonnie Date: Tue, 14 Oct 2025 16:43:17 +0800 Subject: [PATCH 2/2] fix: update deadline parameter documentation across Group, IPAsset, and Permission classes to reflect seconds instead of milliseconds --- src/story_protocol_python_sdk/resources/Group.py | 4 ++-- src/story_protocol_python_sdk/resources/IPAsset.py | 10 +++++----- src/story_protocol_python_sdk/resources/Permission.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/story_protocol_python_sdk/resources/Group.py b/src/story_protocol_python_sdk/resources/Group.py index 7836e8c2..3166f059 100644 --- a/src/story_protocol_python_sdk/resources/Group.py +++ b/src/story_protocol_python_sdk/resources/Group.py @@ -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. """ @@ -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. """ diff --git a/src/story_protocol_python_sdk/resources/IPAsset.py b/src/story_protocol_python_sdk/resources/IPAsset.py index 394ccf8d..627294b3 100644 --- a/src/story_protocol_python_sdk/resources/IPAsset.py +++ b/src/story_protocol_python_sdk/resources/IPAsset.py @@ -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. """ @@ -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. """ @@ -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. """ @@ -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. @@ -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. """ diff --git a/src/story_protocol_python_sdk/resources/Permission.py b/src/story_protocol_python_sdk/resources/Permission.py index 10a0d262..1c15f83a 100644 --- a/src/story_protocol_python_sdk/resources/Permission.py +++ b/src/story_protocol_python_sdk/resources/Permission.py @@ -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. """