from web3 import Web3
# In this case, lets say there is a root IPA 'A' and a derivative IPA 'B'.
# Someone wants to pay 'B' for whatever reason (they bought it, they want to tip it, etc).
# Since the payer is not an IP Asset (rather an external user), the `payer_ip_id` can
# be a zero address. And the receiver is, well, the receiver's ipId which is B.
#
# It's important to note that both 'B' and its parent 'A' will be able
# to claim revenue from this based on the negotiated license terms
pay_royalty = story_client.Royalty.pay_royalty_on_behalf(
receiver_ip_id="0x0b825D9E5FA196e6B563C0a446e8D9885057f9B1", # B's ipId
payer_ip_id="0x0000000000000000000000000000000000000000", # zero address
token="0x1514000000000000000000000000000000000000", # $WIP
amount=Web3.to_wei(2, 'ether'), # 2 $WIP
tx_options={"wait_for_transaction": True}
)
print(f"Paid royalty at transaction hash {pay_royalty['tx_hash']}")
# In this case, lets say there is a root IPA 'A' and a derivative IPA 'B'.
# 'B' earns revenue off-chain, but must pay 'A' based on their negotiated license terms.
# So 'B' pays 'A' what they are due
pay_royalty = story_client.Royalty.pay_royalty_on_behalf(
receiver_ip_id="0x6B86B39F03558A8a4E9252d73F2bDeBfBedf5b68", # A's ipId
payer_ip_id="0x0b825D9E5FA196e6B563C0a446e8D9885057f9B1", # B's ipId
token="0x1514000000000000000000000000000000000000", # $WIP
amount=Web3.to_wei(2, 'ether'), # 2 $WIP
tx_options={"wait_for_transaction": True}
)
print(f"Paid royalty at transaction hash {pay_royalty['tx_hash']}")