로열티

메서드

  • pay_royalty_on_behalf
  • claimable_revenue
  • claim_all_revenue
  • get_royalty_vault_address
  • transfer_to_vault

pay_royalty_on_behalf

함수 호출자가 지불자 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 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']}")

claimable_revenue

로열티 토큰 보유자가 청구할 수 있는 총 수익 토큰 양을 가져옵니다.

메서드
claimable_revenue

Parameters:

  • royalty_vault_ip_id: 로열티 볼트의 id입니다.
  • claimer: 로열티 토큰 보유자의 주소입니다.
  • token: 청구할 수익 토큰입니다.
claimable = story_client.Royalty.claimable_revenue(
    royalty_vault_ip_id="0x089d75C9b7E441dA3115AF93FF9A855BDdbfe384",
    claimer="0x089d75C9b7E441dA3115AF93FF9A855BDdbfe384",
    token="0x1514000000000000000000000000000000000000"  # $WIP
)
print(f"Claimable revenue: {claimable}")

claim_all_revenue

자식 IP 자산 및/또는 자신의 IP 로열티 볼트에서 모든 수익을 청구합니다.

메서드
claim_all_revenue

Parameters:

  • ancestor_ip_id: 수익이 청구되는 조상 IP의 주소입니다.
  • 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']}")

get_royalty_vault_address

주어진 ipId의 로열티 볼트 프록시 주소를 가져옵니다ip_id.

메서드
get_royalty_vault_address

Parameters:

  • ip_id: 로열티 볼트와 연관된 ipIdipId입니다.
vault_address = story_client.Royalty.get_royalty_vault_address("0x089d75C9b7E441dA3115AF93FF9A855BDdbfe384")
print(f"Royalty vault address: {vault_address}")

transfer_to_vault

볼트로 로열티 정책을 통해 청구 가능한 수익 토큰의 금액을 이전합니다.

메서드
transfer_to_vault

Parameters:

  • ip_id: 로열티를 지불하는 IP 자산의 ID입니다.
  • ancestor_ip_id: 조상 IP 자산의 ID입니다.
  • token: 이전할 토큰 주소입니다.
  • royalty_policy: [선택사항] 사용할 로열티 정책 (“LAP” 또는 “LRP”)입니다.Default: “LAP”
  • tx_options: [선택사항] 트랜잭션 옵션 딕셔너리입니다.
transfer_result = story_client.Royalty.transfer_to_vault(
    ip_id="0x0b825D9E5FA196e6B563C0a446e8D9885057f9B1",
    ancestor_ip_id="0x6B86B39F03558A8a4E9252d73F2bDeBfBedf5b68",
    royalty_policy="LAP",
    token="0x1514000000000000000000000000000000000000",  # $WIP
)
print(f"Transferred to vault at transaction hash {transfer_result['tx_hash']}")