Validate a NEAR NFT payout map before distributing proceeds
A marketplace receives a payout map from the NFT contract. Parsing the return value is only the first step before scheduling payments to the listed accounts.
Reconcile recipients with the sale balance
Read each amount string as an unsigned integer in the same units as the balance supplied to nft_transfer_payout. This illustrative map divides a balance of 1000 into 75 and 925. Count recipients against the max_len_payout sent with the call.
{
"payout": {
"artist.testnet": "75",
"seller.testnet": "925"
}
}
Reject over-allocation before creating transfers
If the second amount changes to 1025, the total becomes 1100 and exceeds the available 1000. Stop settlement before issuing any payment. Handle a remaining difference using the marketplace’s documented rounding and fee policy, respecting the standard’s payout constraints.
Use the map from the actual successful transfer callback as the settlement input. A preview from nft_payout is useful for display, but a later sale may execute under different state. Store the sale identifier with each payment for safe retries.