Get Asset Information
Stash API offers an API endpoint for retrieving information about a specific NFT asset that is lent to Stash.
You can call getAsset
function under api
object of the core class to make the API call. This function has following declaration, parameters and response:
Declaration
async getAsset(contractAddress: string, tokenId: string)
Parameters
- contractAddress: Address of the NFT contract which the queried assets belong to
- tokenId: Token ID of the NFT
Example Usage
const asset = stash.api.getAsset("0x0493kdffE92m34kS29lI1942EdaW21", 123456);
Sample Response
{
"lender_address":"0x003",
"renter_address":"0x002",
"rental_id":1,
"token_id":123456,
"nft_address":"0x001",
"share_percent":3,
"expiry":5,
"daily_price":0.5,
"buy_price":10.0,
"ended":false,
"created_at":"2022-09-15T05:24:58+0000"
}
Updated 6 months ago