Group

Methods

  • register_group
  • register_group_and_attach_license
  • mint_and_register_ip_and_attach_license_and_add_to_group
  • register_ip_and_attach_license_and_add_to_group
  • register_group_and_attach_license_and_add_ips
  • collect_and_distribute_group_royalties

register_group

Registers a Group IPA.

Method
register_group

Parameters:

  • group_pool: The address of the group pool.
  • tx_options: [Optional] The transaction options dictionary.
result = story_client.Group.register_group(
    group_pool="0xf96f2c30b41Cb6e0290de43C8528ae83d4f33F89",  # EvenSplitGroupPool
)
print(f"Group registered with ID: {result['group_id']} at transaction hash {result['tx_hash']}")

register_group_and_attach_license

Register a group IP with a group reward pool and attach license terms to the group IP.

Method
register_group_and_attach_license

Parameters:

  • group_pool: The address of the group pool.
  • license_data: License data object with terms and config.
  • tx_options: [Optional] The transaction options dictionary.
result = story_client.Group.register_group_and_attach_license(
    group_pool="0xf96f2c30b41Cb6e0290de43C8528ae83d4f33F89",  # EvenSplitGroupPool
    license_data={
        "license_template": "0x7e9b9B31BF5F3399D36E1E0a9E589c30Cb6925D1",  # Programmable IP License
        "license_terms_id": "5"
    }
)
print(f"Group registered with ID: {result['group_id']} at transaction hash {result['tx_hash']}")

mint_and_register_ip_and_attach_license_and_add_to_group

Mint an NFT from a SPGNFT collection, register it with metadata as an IP, attach license terms to the registered IP, and add it to a group IP.

Method
mint_and_register_ip_and_attach_license_and_add_to_group

Parameters:

  • group_id: The ID of the group to add the IP to.
  • spg_nft_contract: The address of the SPG NFT contract.
  • license_data: List of license data objects with terms and config.
  • max_allowed_reward_share: Maximum allowed reward share percentage.
  • ip_metadata: [Optional] The metadata for the IP.
  • recipient: [Optional] The recipient of the NFT (defaults to caller).
  • allow_duplicates: [Optional] Whether to allow duplicate IPs.
  • deadline: [Optional] The deadline for the signature in milliseconds.
  • tx_options: [Optional] The transaction options dictionary.
result = story_client.Group.mint_and_register_ip_and_attach_license_and_add_to_group(
    group_id="0x089d75C9b7E441dA3115AF93FF9A855BDdbfe384",
    spg_nft_contract="0x1234567890123456789012345678901234567890",
    license_data=[
        {
            "license_template": "0x7e9b9B31BF5F3399D36E1E0a9E589c30Cb6925D1",  # Programmable IP License
            "license_terms_id": "5"
        }
    ],
    max_allowed_reward_share=5,  # 5%
    ip_metadata={
        "ip_metadata_uri": "ipfs://QmXxxx",
        "ip_metadata_hash": "0x1234..."
    },
)
print(f"IP registered with ID: {result['ip_id']} and token ID: {result['token_id']} at transaction hash {result['tx_hash']}")

register_ip_and_attach_license_and_add_to_group

Register an NFT as IP with metadata, attach license terms to the registered IP, and add it to a group IP.

Method
register_ip_and_attach_license_and_add_to_group

Parameters:

  • group_id: The ID of the group to add the IP to.
  • nft_contract: The address of the NFT contract.
  • token_id: The token ID of the NFT.
  • license_data: List of license data objects with terms and config.
  • max_allowed_reward_share: Maximum allowed reward share percentage.
  • ip_metadata: [Optional] The metadata for the IP.
  • deadline: [Optional] The deadline for the signature in milliseconds.
  • tx_options: [Optional] The transaction options dictionary.
result = story_client.Group.register_ip_and_attach_license_and_add_to_group(
    group_id="0x089d75C9b7E441dA3115AF93FF9A855BDdbfe384",
    nft_contract="0x1234567890123456789012345678901234567890",
    token_id=123,
    license_data=[
        {
            "license_template": "0x7e9b9B31BF5F3399D36E1E0a9E589c30Cb6925D1",  # Programmable IP License
            "license_terms_id": "5"
        }
    ],
    max_allowed_reward_share=5,  # 5%
    ip_metadata={
        "ip_metadata_uri": "ipfs://QmXxxx",
        "ip_metadata_hash": "0x1234..."
    }
)
print(f"IP registered with ID: {result['ip_id']} and token ID: {result['token_id']} at transaction hash {result['tx_hash']}")

register_group_and_attach_license_and_add_ips

Register a group IP with a group reward pool, attach license terms to the group IP, and add individual IPs to the group IP.

Method
register_group_and_attach_license_and_add_ips

Parameters:

  • group_pool: The address of the group pool.
  • ip_ids: List of IP IDs to add to the group.
  • license_data: License data object with terms and config.
  • max_allowed_reward_share: Maximum allowed reward share percentage.
  • tx_options: [Optional] The transaction options dictionary.
result = story_client.Group.register_group_and_attach_license_and_add_ips(
    group_pool="0xf96f2c30b41Cb6e0290de43C8528ae83d4f33F89",  # EvenSplitGroupPool
    ip_ids=["0x1234567890123456789012345678901234567890", "0x0987654321098765432109876543210987654321"],
    license_data={
        "license_template": "0x7e9b9B31BF5F3399D36E1E0a9E589c30Cb6925D1",  # Programmable IP License
        "license_terms_id": "5"
    },
    max_allowed_reward_share=5,  # 5%
)
print(f"Group registered with ID: {result['group_id']} at transaction hash {result['tx_hash']}")

collect_and_distribute_group_royalties

Collect royalties for the entire group and distribute the rewards to each member IP’s royalty vault.

Method
collect_and_distribute_group_royalties

Parameters:

  • group_ip_id: The ID of the group IP.
  • currency_tokens: List of currency token addresses.
  • member_ip_ids: List of member IP IDs.
  • tx_options: [Optional] The transaction options dictionary.
result = story_client.Group.collect_and_distribute_group_royalties(
    group_ip_id="0x089d75C9b7E441dA3115AF93FF9A855BDdbfe384",
    currency_tokens=["0x1514000000000000000000000000000000000000"],  # $WIP
    member_ip_ids=["0x1234567890123456789012345678901234567890", "0x0987654321098765432109876543210987654321"]
)
print(f"Collected royalties: {result['collected_royalties']}")
print(f"Royalties distributed: {result['royalties_distributed']}")