Any of the following functions support batching as shown below for the Lend instruction where the user lends an AstroCat and a CatPlsr in the same function call:
import { NFTStandard } from"@renft/sdk";constnftStandard=NFTStandard.E1155;constnftAddress="0x0db8c099b426677f575d512874d45a767e9acc3c";consttokenID="1";constlendingID="1"; // this information is pulled from the subgraphconstrentDuration=1; // in daysconstrentAmount=1;awaitrenft.rent( [nftStandard], [nftAddress], [tokenID], [lendingID], [rentDuration], [rentAmount]);
Stop Rent
Even though no real posession of the NFT is given, the renter must signal that they have concluded "using" the NFT with this call. If the renter fails to do so, then the lender can invoke "Claim Rent" explained below, to redeem the full amount of rent. Note that "Stop Lend" will be blocked until the user calls "Claim Rent" first.
import { NFTStandard } from"@renft/sdk";constnftStandard=NFTStandard.E1155;constnftAddress="0x0db8c099b426677f575d512874d45a767e9acc3c";consttokenID="1";constlendingID="1"; // from subgraphconstrentingID="1"; // from subgraphawaitrenft.stopRent( [nftStandard], [nftAddress], [tokenID], [lendingID], [rentingID],);
Prices are returned in a custom format (rationale for this format was to fit the lending into a single storage slot). To unpack them, use our SDK's unpackPrice function: