setSplits
Sets splits for multiple tokens.
The tokens are specified via tokenIds
as well as the nftContractId
from where the token was minted. This panics if you specify no token IDs or try to set splits for tokens that you do not own.
The nftContactId
can be supplied as an argument or through the CONTRACT_ADDRESS
environment variable. If this is a smart contract ending in mintbase1.near
(mainnet) or mintspace2.testnet
(testnet), this can only be done once and will fail in subsequent calls.
The splits are given via the splitOwners
objects, whose keys are account IDs and the corresponding value is the assigned the fraction of available payout after royalty application. For example, if a token has 20 % royalties and you pass {'a.near': 0.8, 'b.near': 0.2}
, 64 % of the next sale will be paid to a.near
, and 16 % will be paid to b.near
, while the remaining 20 % are reserved for the royalty holders that can only be specified during minting. This panics if the percentages do not add up to 100 %.
As with all new SDK api methods, this call should be wrapped in execute and passed a signing method
setSplits(args: SetSplitsArgs): NearContractCall
setSplits
takes a single argument of type SetSplitsArgs
React example
Example usage of setSplits method in a hypothetical React component:
Last updated