The following discussion applies to v5.0.4 of the SDK.
Lend/Rent NFTs In-App
import { Sylvester } from "@renft/sdk";
const renft = new Sylvester(signer);
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:
To interact with our smart contract, we'd recommend using our .
The ReNFT object takes in an ethers and an optional contract address if not using the default collateral-free contract.
We name our contracts after famous cats. You can find the name mappings . Sylvester is the code-name for the collateral free contract.
Batching
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.
Claim Rent
Stop Lend
Query Loan/Rental Status
To learn about how to learn about the status of a particular lending / rental, read .
Unpacking Data
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 's unpackPrice function: