Identification Of A Trial NFT

When a user logs in to the game platform, in addition to the NFTs normally held by the user, the trial NFTs held by the user via the Rentero Protocol will be identified and displayed through Rentero SDK.

getRentNFTsByAddress: it supports getting users' trial NFTs. Examples are as follows:

import { RenteroNFT } from '@rentero/sdk-js'

const nftAddress = '0x80b4a4da97d676ee139bada2bf757b7f5afd0644'
const renterAddress = '0x431b4ca18e269fc7e1f5af49b9f4e2af683f6207'

// pass in the blockchain network and NFT contracts, instantiate the object
const renteroNFT = new RenteroNFT('goerli', [nftAddress])

// query renter‘s NFTs
const result = await renteroNFT.getRentNFTsByAddress(renterAddress)

// result example
  leases: [
      tokenId: '341',
      nftAddress: '0x80b4a4da97d676ee139bada2bf757b7f5afd0644',
      lender: '0x576687d59d191a9b20110fb3e126dbf27d8e42e0',
      expires: '1660638300'

Note: Currently, SDK only returns the basic lease information on a user's trial NFT, and the NFT metadata required for display shall be obtained by the game developer.

Last updated