getNftReward

This function returns attention rewards earned from an NFT in KOII.

Parameters

id <string> - The transaction ID to process for which you have to see the earned attention rewards.

Example Code

const knode = require("@_koi/sdk/node");
const ktools = new knode.Node();
async function testGetNftReward() {
    const targetNft = "gZIRmwBIL5nnkAxaFQbGICcUdrOOmBLzqd1LFhd3vSA";
    const nftReward = await ktools.getNftReward(targetNft);
    console.log("Attention rewards for the NFT", targetNft);
    console.log(nftReward);
}
testGetNftReward();

Example Code Output

Initialized Koii Tools for true ownership and direct communication using version QA7AIFVx1KBBmzC7WUNhJbDsHlSJArUT0jWrhZMZPS8
Attention rewards for the NFT gZIRmwBIL5nnkAxaFQbGICcUdrOOmBLzqd1LFhd3vSA
0.03898202652777241

Returns

Promise<null | number> - Koii rewards earned from a given NFT

Last updated