Skip to content

v0.3.16

Choose a tag to compare

@lucas2brh lucas2brh released this 30 Oct 16:50
· 16 commits to main since this release
2d7aa7a

Story Protocol Python SDK v0.3.16

Stable Release - This is the stable release of Story Protocol Python SDK v0.3.16.

PyPI: https://pypi.org/project/story-protocol-python-sdk/0.3.16/

Overview

This release introduces enhancements to the IP asset and royalty modules, adding multiple SPG methods for minting and registering IPs. It also expands support for Wrapped IP (WIP) workflows, improves event parsing accuracy, and resolves bugs.

Key Changes

IPAsset Module Enhancements

Batch IP Minting and Registration

Introduced the batch_mint_and_register_ip method to facilitate the batch minting and registration of intellectual properties (IPs), streamlining the process for handling multiple IPs simultaneously([#154](#154)).

Code Example:

  requests = [
            BatchMintAndRegisterIPInput(
                spg_nft_contract=public_nft_collection,
            ),
            BatchMintAndRegisterIPInput(
                spg_nft_contract=private_nft_collection,
            ),
            BatchMintAndRegisterIPInput(
                spg_nft_contract=private_nft_collection,
                ip_metadata=IPMetadataInput(
                    ip_metadata_hash=web3.keccak(text="private-custom-metadata2"),
                    ip_metadata_uri="https://example.com/private-metadata.json",
                ),
            ),
        ]
 response = story_client.IPAsset.batch_mint_and_register_ip(requests)

Register Derivative IP with PIL Terms and Royalty Distribution

Added the register_derivative_ip_and_attach_pil_terms_and_distribute_royalty_tokens method, enabling the registration of derivative IPs, attachment of PIL terms, and distribution of royalty tokens in a single operation([#153](#153)).

Note: The first attached license must be a commercial license for successful royalty distribution.

Code Example:

story_client.IPAsset.register_derivative_ip_and_attach_pil_terms_and_distribute_royalty_tokens(
            nft_contract=nft_collection,
            token_id=token_id,
            deriv_data=DerivativeDataInput(
                parent_ip_ids=[parent_ip_and_license_terms["parent_ip_id"]],
                license_terms_ids=[parent_ip_and_license_terms["license_terms_id"]],
            ),
            royalty_shares=[
            RoyaltyShareInput(recipient=account.address, percentage=40.0),
            RoyaltyShareInput(recipient=account_2.address, percentage=60.0),
        ]
        )

Register IP with PIL Terms and Royalty Distribution

Implemented the register_ip_and_attach_pil_terms_and_distribute_royalty_tokens method, allowing for the registration of IPs with attached PIL terms and the distribution of royalty tokens([#152](#152)).

Note: The first attached license must be a commercial license for successful royalty distribution.

Code Example:

story_client.IPAsset.register_ip_and_attach_pil_terms_and_distribute_royalty_tokens(
            nft_contract=nft_collection,
            token_id=token_id,
            license_terms_data=[
                LicenseTermsDataInput(
                    terms=LicenseTermsInput(
                       ... 
                    ),
                    licensing_config=LicensingConfig(
                      ...
                    ),
                )
            ],
            royalty_shares=[
	            RoyaltyShareInput(recipient=account.address, percentage=30),
              RoyaltyShareInput(recipient=account_2.address, percentage=70),
		        ]
,
        )

Mint and Register IP with PIL Terms and Royalty Distribution

Introduced the mint_and_register_ip_and_attach_pil_terms_and_distribute_royalty_tokens method, combining the minting and registration of IPs with the attachment of PIL terms and distribution of royalty tokens([#150](#150)).

Code Example:

story_client.IPAsset.mint_and_register_ip_and_attach_pil_terms_and_distribute_royalty_tokens(
            spg_nft_contract=nft_collection,
            license_terms_data=[
                LicenseTermsDataInput(
                    terms=LicenseTermsInput(
                      ...
                    ),
                    licensing_config=LicensingConfig(
                      ...
                    ),
                )
            ],
            royalty_shares=[
            RoyaltyShareInput(recipient=account.address, percentage=50),
		        ],
        )

Register IP with Derivative Creation and license tokens

Added the register_ip_and_make_derivative_with_license_tokens method, enabling the registration of IPs along with the creation of derivative works using license tokens([#140](#140)).

Code Example:

story_client.IPAsset.register_ip_and_make_derivative_with_license_tokens(
                nft_contract=nft_contract,
                token_id=token_id,
                license_token_ids=license_token_ids,
            )

Mint and Register IP with Derivative Creation and Royalty Distribution:

Implemented the mint_and_register_ip_and_make_derivative_and_distribute_royalty_tokens method, facilitating the minting and registration of IPs, creation of derivative works, and distribution of royalty tokens([#148](#148)).

Code Example:

story_client.IPAsset.mint_and_register_ip_and_make_derivative_and_distribute_royalty_tokens(
            spg_nft_contract=nft_collection,
            deriv_data=DerivativeDataInput(
                parent_ip_ids=[parent_ip_id],
                license_terms_ids=[license_terms_id],
            ),
            royalty_shares=[
                RoyaltyShareInput(recipient=recipient1, percentage=60),
                RoyaltyShareInput(recipient=recipient2, percentage=40),
            ],
        )

Bug Fixes

  • Resolved an issue in the claim_all_revenue method where the "unwrap IP" option was not functioning correctly, ensuring proper revenue claims. (PR [#155](#155))
  • Corrected deadline calculation, changing the unit from milliseconds to seconds([#149](#149)).

Breaking Change

Fixed an issue where the deadline signature used milliseconds instead of seconds. The signature expiration time has been shortened.

Migration

  • This fix requires no action. No code changes are needed on your side.