Skip to content

v0.3.15-rc.1

Pre-release
Pre-release

Choose a tag to compare

@lucas2brh lucas2brh released this 14 Aug 20:00
· 39 commits to main since this release
0dd182a

Story Protocol Python SDK v0.3.15-rc.1

Release Candidate - This is a release candidate for the upcoming v0.3.15 major version of the Story Protocol Python SDK.

Overview

This release candidate introduces significant improvements to code quality, developer experience, and adds new functionality to the Story Protocol Python SDK. The focus has been on enhancing the development workflow and introducing new features for IP asset management.

New Features

New IPAsset method: mint

The mint method for minting an NFT from the nft_contract (#74). The process is only callable when is_public_minting is true Or when the caller is the owner When creating nft_contract by calling nftClient.create_nft_collection .

  • allow_duplicates : The default value is false.

Usage Example

  response = story_client.IPAsset.mint(
            nft_contract=nft_collection,
            to_address=account.address,
            metadata_uri=metadata_uri,
            metadata_hash=metadata_hash
        )

New IPAsset method: register_ip_and_attach_pil_terms

The register_ip_and_attach_pil_terms method for registering a given NFT as an IP and attaching Programmable IP License Terms(#72).

Usage Example

result = story_client.IPAsset.register_ip_and_attach_pil_terms(
            nft_contract=nft_collection,
            token_id=token_id,
            deadline=1000,
            license_terms_data=[
                {
                    "terms": license_terms,
                    "licensing_config":licensing_config,
                },
            ],
        )

Custom nonce support enables transaction replacement

The optional transaction of tx_options accept nonce to use a custom nonce value(#108) to avoid nonce conflict. If not provided, nonce will be automatically fetched from web3.eth.get_transaction_count() .
All methods that accept tx_options support custom nonce.

Usage Example

 response = story_client.IPAsset.register(
            nft_contract=MockERC721, token_id=token_id, tx_options={"nonce": 1}
        )

Other changes

  • Code formatting: Updated tools included black, ruff ,isort , pre-commit to check and format code style( #100, #101, #102)
  • Security: Git-leaks integration for secret detection(#107)
  • Static type checker: Add mypy to check type(#103)
  • Enhance tests:
    1. Fix permission unit tests (#78)
    2. Generate unit test coverage(#80)
    3. Add common integration fixtures to conftest.py which centralizes common test setup, maintainable, and efficient pytest test suites(#102).
  • Documentation: Comprehensive DEVELOPMENT.md to guide the developer on how to set up the environment and develop(#101).
  • CODEOWNERS: Added team members to CODEOWNERS file (#79)

Migration Guide

No migration steps required for existing users. The SDK maintains backward compatibility while adding new features and improvements.

Getting Started

For new users, refer to the updated DEVELOPMENT.md for comprehensive setup instructions, including UV package manager installation, pre-commit hooks setup, testing and development workflow, and code formatting standards.