함수 호출자가 지불자 IP Asset을 대신하여 수신자 IP 자산에 로열티를 지불할 수 있게 합니다.
메서드
pay_royalty_on_behalf
Parameters:
receiver_ip_id: 로열티를 받는 ipId입니다.
payer_ip_id: 로열티를 지불하는 IP 자산의 ID입니다.
token: 로열티 지불에 사용할 토큰입니다.
amount: 지불할 금액입니다.
tx_options: [선택사항] 트랜잭션 옵션 딕셔너리입니다.
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 termspay_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 duepay_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']}")
claimer: 통화(수익) 토큰의 청구자 주소입니다. 일반적으로 IP가 모든 로열티 토큰을 가지고 있다면 조상 IP의 ipId입니다. 그렇지 않다면, 이는 조상 IP 로열티 토큰을 보유하고 있는 주소가 됩니다.
child_ip_ids: 로열티가 파생되는 자식 IP들의 주소입니다.
royalty_policies: 로열티 정책의 주소로, royalty_policies[i]는 child_ip_ids[i]의 로열티 흐름을 관리합니다.
currency_tokens: 로열티가 청구될 통화 토큰의 주소입니다.
claim_options: [선택사항]
claim_options['auto_transfer_all_claimed_tokens_from_ip']: [선택사항] 활성화되면, 지갑이 IP를 소유하고 있을 때 청구자에게 청구된 모든 토큰이 지갑 주소로 전송됩니다. 지갑이 청구자이거나 청구자가 지갑이 소유한 IP가 아닌 경우, 토큰은 전송되지 않습니다. False로 설정하면 청구자로부터 청구된 토큰의 자동 전송이 비활성화됩니다.Default: True
claim_revenue = story_client.Royalty.claim_all_revenue(# IP Asset 1's (parent) ipId ancestor_ip_id="0x089d75C9b7E441dA3115AF93FF9A855BDdbfe384",# whoever owns the royalty tokens associated with IP Royalty Vault 1# (most likely the associated ipId, which is IP Asset 1's ipId) claimer="0x089d75C9b7E441dA3115AF93FF9A855BDdbfe384", currency_tokens=["0x1514000000000000000000000000000000000000"],# $WIP# IP Asset 2's (child) ipId child_ip_ids=["0xDa03c4B278AD44f5a669e9b73580F91AeDE0E3B2"],# testnet address of RoyaltyPolicyLAP royalty_policies=["0xBe54FB168b3c982b7AaE60dB6CF75Bd8447b390E"], claim_options={'auto_transfer_all_claimed_tokens_from_ip':True})print(f"Claimed revenue: {claim_revenue['claimed_tokens']}")