RoyaltyClient allows you to manage royalty payments and claims within Story.
Method | Type |
---|---|
payRoyaltyOnBehalf | (request: PayRoyaltyOnBehalfRequest) => Promise<PayRoyaltyOnBehalfResponse> |
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.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 to false
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 to false
to disable this behavior. Default: truerequest.erc20Options
: [Optional]
request.erc20Options.enableAutoApprove
: [Optional] Automatically approve ERC20 usage when ERC20 is needed but current allowance is not sufficient. Set this to false
to disable this behavior. Default: trueMethod | Type |
---|---|
claimableRevenue | (request: ClaimableRevenueRequest) => Promise<ClaimableRevenueResponse> |
request.ipId
: The id of the royalty vault.request.claimer
: The address of the royalty token holder. This is most commonly the IP Account, since by default the IP Account is the owner of the royalty tokens.request.token
: The revenue token to claim.Method | Type |
---|---|
claimAllRevenue | (request: ClaimAllRevenueRequest) => Promise<ClaimAllRevenueResponse> |
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: falseclaimAllRevenue
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> |
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: falserequest.options
: [Optional]
request.options.useMulticallWhenPossible
: [Optional] Use multicall to batch the calls claimAllRevenue
into one transaction when possible. If only 1 ancestorIp is provided, multicall will not be used. Default: trueMethod | Type |
---|---|
getRoyaltyVaultAddress | (ipId: Hex) => Promise<Address> |
ipId
: the ipId
associated with the royalty vault.Method | Type |
---|---|
transferToVault | (request: TransferToVaultRequest) => Promise<TransactionResponse> |
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.