Royalty
RoyaltyClient allows you to manage royalty payments and claims within Story.
RoyaltyClient
Methods
- payRoyaltyOnBehalf
- claimableRevenue
- claimAllRevenue
- batchClaimAllRevenue
- getRoyaltyVaultAddress
- batchClaimAllRevenue
- transferToVault
payRoyaltyOnBehalf
Allows the function caller to pay royalties to a receiver IP asset on behalf of the payer IP Asset.
Method | Type |
---|---|
payRoyaltyOnBehalf | (request: PayRoyaltyOnBehalfRequest) => Promise<PayRoyaltyOnBehalfResponse> |
Parameters:
request.receiverIpId
: The ipId that receives the royalties.request.payerIpId
: The ID of the IP asset that pays the royalties.request.token
: The token to use to pay the royalties.request.amount
: The amount to pay.request.txOptions
: [Optional] The transaction options.request.wipOptions
: [Optional]request.wipOptions.useMulticallWhenPossible
: [Optional] Use multicall to batch the WIP calls into one transaction when possible. Default: truerequest.wipOptions.enableAutoWrapIp
: [Optional] By default IP is converted to WIP if the current WIP balance does not cover the fees. Set this tofalse
to disable this behavior. Default: truerequest.wipOptions.enableAutoApprove
: [Optional] Automatically approve WIP usage when WIP is needed but current allowance is not sufficient. Set this tofalse
to disable this behavior. Default: true
request.erc20Options
: [Optional]request.erc20Options.enableAutoApprove
: [Optional] Automatically approve ERC20 usage when ERC20 is needed but current allowance is not sufficient. Set this tofalse
to disable this behavior. Default: true
claimableRevenue
Get total amount of revenue token claimable by a royalty token holder.
Method | Type |
---|---|
claimableRevenue | (request: ClaimableRevenueRequest) => Promise<ClaimableRevenueResponse> |
Parameters:
request.royaltyVaultIpId
: The id of the royalty vault.request.claimer
: The address of the royalty token holder.request.token
: The revenue token to claim.request.txOptions
: [Optional] The transaction options.
claimAllRevenue
Claims all revenue from child IP Assets and/or from your own IP Royalty Vault.
Method | Type |
---|---|
claimAllRevenue | (request: ClaimAllRevenueRequest) => Promise<ClaimAllRevenueResponse> |
Parameters:
request.ancestorIpId
: The address of the ancestor IP from which the revenue is being claimed.request.claimer
: The address of the claimer of the currency (revenue) tokens. This is normally the ipId of the ancestor IP if the IP has all royalty tokens. Otherwise, this would be the address that is holding the ancestor IP royalty tokens.request.childIpIds[]
: The addresses of the child IPs from which royalties are derived.request.royaltyPolicies[]
: The addresses of the royalty policies, where royaltyPolicies[i] governs the royalty flow for childIpIds[i].request.currencyTokens[]
: The addresses of the currency tokens in which royalties will be claimed.request.claimOptions
: [Optional]request.claimOptions.autoTransferAllClaimedTokensFromIp
: [Optional] When enabled, all claimed tokens on the claimer are transferred to the wallet address if the wallet owns the IP. If the wallet is the claimer or if the claimer is not an IP owned by the wallet, then the tokens will not be transferred. Set to false to disable auto transferring claimed tokens from the claimer. Default: truerequest.claimOptions.autoUnwrapIpTokens
: [Optional] By default all claimed WIP tokens are converted back to IP after they are transferred. Set this to false to disable this behavior. Default: false
batchClaimAllRevenue
Automatically batch claims all revenue from the child IPs of multiple ancestor IPs. If multicall is disabled, it will call claimAllRevenue
for each ancestor IP. Then transfer all claimed tokens to the wallet if the wallet owns the IP or is the claimer. If claimed token is WIP, it will also be converted back to IP.
Method | Type |
---|---|
batchClaimAllRevenue | (request: BatchClaimAllRevenueRequest) => Promise<BatchClaimAllRevenueResponse> |
Parameters:
request.ancestorIps[]
: An array of ancestor IP information from which the revenue is being claimed.request.ancestorIps[].ipId
: The address of the ancestor IP from which the revenue is being claimed.request.ancestorIps[].claimer
: The address of the claimer of the currency (revenue) tokens. This is normally the ipId of the ancestor IP if the IP has all royalty tokens. Otherwise, this would be the address that is holding the ancestor IP royalty tokens.request.ancestorIps[].childIpIds[]
: The addresses of the child IPs from which royalties are derived.request.ancestorIps[].royaltyPolicies[]
: The addresses of the royalty policies, where royaltyPolicies[i] governs the royalty flow for childIpIds[i].request.ancestorIps[].currencyTokens[]
: The addresses of the currency tokens in which royalties will be claimed.
request.claimOptions
: [Optional]request.claimOptions.autoTransferAllClaimedTokensFromIp
: [Optional] When enabled, all claimed tokens on the claimer are transferred to the wallet address if the wallet owns the IP. If the wallet is the claimer or if the claimer is not an IP owned by the wallet, then the tokens will not be transferred. Set to false to disable auto transferring claimed tokens from the claimer. Default: truerequest.claimOptions.autoUnwrapIpTokens
: [Optional] By default all claimed WIP tokens are converted back to IP after they are transferred. Set this to false to disable this behavior. Default: false
request.options
: [Optional]request.options.useMulticallWhenPossible
: [Optional] Use multicall to batch the callsclaimAllRevenue
into one transaction when possible. If only 1 ancestorIp is provided, multicall will not be used. Default: true
getRoyaltyVaultAddress
Get the royalty vault proxy address of given royaltyVaultIpId.
Method | Type |
---|---|
getRoyaltyVaultAddress | (royaltyVaultIpId: Hex) => Promise<Address> |
Parameters:
royaltyVaultIpId
: theipId
associated with the royalty vault.
transferToVault
Transfers to vault an amount of revenue tokens claimable via a royalty policy.
Method | Type |
---|---|
transferToVault | (request: TransferToVaultRequest) => Promise<TransactionResponse> |
Parameters:
request.royaltyPolicy
: The royalty policy to use.request.ipId
: The ID of the IP asset that pays the royalties.request.ancestorIpId
: The ID of the ancestor IP asset.request.token
: The token address to transfer.request.txOptions
: [Optional] The transaction options.