Skip to content

Commit

Permalink
Update doc attach-license-terms-to-an-ip-asset-python
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Tucker committed Jan 21, 2025
1 parent ce1fec1 commit d494f56
Showing 1 changed file with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Attach Terms to an IP Asset in Python
excerpt: ''
title: Attach Terms to an IPA
excerpt: Learn how to Attach License Terms to an IP Asset in Python.
deprecated: false
hidden: true
metadata:
Expand All @@ -19,40 +19,37 @@ This section demonstrates how to add License Terms to an IPA. By attaching terms
There are a few different ways you can do this, depending on what works best for you:

1. Attach Existing License Terms to Existing IP Asset
2. Register New IP Asset and Attach License Terms (COMING SOON)
3. Register New Terms and Attach to an Existing IP Asset (COMING SOON)
2. *Register New IP Asset and Attach License Terms (COMING SOON)*
3. *Register New Terms and Attach to an Existing IP Asset (COMING SOON)*
4. Mint NFT, Register as IP Asset, and Attach Terms

## Prerequisites

* [Setup](doc:python-sdk-setup) the client object.

# Attach License Terms
# Attach Existing License Terms to Existing IP Asset

Below is a code example to add License Terms to our IP Asset:

```python Python
try:
response = story_client.License.attachLicenseTerms(
ip_id="0x4c1f8c1035a8cE379dd4ed666758Fb29696CF721",
license_template="0x58E2c909D557Cd23EF90D14f8fd21667A5Ae7a93",
license_terms_id=1
print(f"Attached License Terms to IPA at transaction hash {response['txHash']}.")
)
except Exception as e:
print("License Terms already attached to this IPA")
response = story_client.License.attachLicenseTerms(
ip_id="0x4c1f8c1035a8cE379dd4ed666758Fb29696CF721",
license_template="0x58E2c909D557Cd23EF90D14f8fd21667A5Ae7a93",
license_terms_id=1
)
print(f"Attached License Terms to IPA at transaction hash {response['txHash']}.")
```
```python Request Type
AttachLicenseTermsRequest = {
'ip_id': str,
'license_template': str,
'license_terms_id': int,
'tx_options': dict
'ip_id': str,
'license_template': str,
'license_terms_id': int,
'tx_options': dict
}
```
```python Response Type
AttachLicenseTermsResponse = {
'txHash': str
'txHash': str
}
```

Expand Down

0 comments on commit d494f56

Please sign in to comment.