NFTs (Rented)
Using External Indexer
Query Parameters specific for rentals:
collection
: Filter for token address of the NFT collectionrentee
: Filter for assets rented by a walletstate
: Filter for all assets on Marketplace (STALE) or rented out (RENT)onlyRentData
: Output only rental data (NFT rentee, NFT owner, rental expiry, state)
The ID of the blockchain chain
296
NFT owner
Loan provided by
The token address of the collection
0x00000000000000000000000000000000003a05ad
The current rentee of the asset manager
The state of the asset manager (Valid values: LOAN | RENT | STALE | PRE_LOAN)
filter to only get rented NFT data (rentee, owner, rent_expiry, state)
Successful response
Internal server error
GET /assetManager/{chainId} HTTP/1.1
Host: api.danlabs.xyz
Accept: */*
[
{
"id": 1,
"initializer": "text",
"loan_pool_index": 1,
"loan_offer_index": 1,
"state": "text",
"loan_expiry": 1,
"provider": "text",
"rate": 1,
"validity_expiry": 1,
"is_fixed": true,
"fixed_minutes": 1,
"rent_expiry": 1,
"rentee": "text",
"private_rental": true,
"owner_share": 1,
"whitelist": [
"text"
],
"metadata_uri": "text",
"metadata_link": "text",
"name": "text",
"image": "text",
"chain_id": "text",
"contract_address": "text",
"token_address": "text",
"token_id": "text",
"rental_type": "text",
"profit": 1,
"domint": true,
"loan_amount": 1,
"index": 1,
"tx_hash": "text",
"master_index": 1
}
]
Response:
Successful responses return an array of asset managers for provided token address with detailed information, such as the current rentee and the state of each asset.
Example: How to Integrate with exiting external NFT indexer
Get all rented collection NFTs by user wallet
let nfts= indexerCall(wallet.address) // indexer call to get nfts by wallet
nfts.push.apply(nfts, await getNFTs(chainId,wallet.address,tokenAddress));
async function getNFTs(chainId, address,tokenAddress){
const nfts = await fetch(`https://api.danlabs.xyz/assetManager/${chainId}?user=${walletAddress}&collection=${collectionAddress}`)
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.catch(error => {
// Handle network errors or API response errors here
console.error('Error:', error.message);
});
return nfts;
}
Get all rented NFTs by user wallet
let nfts= indexerCall(wallet.address) // indexer call to get nfts by wallet
nfts.push.apply(nfts, await getNFTs(chainId,wallet.address));
async function getNFTs(chainId, address){
const nfts = await fetch(`https://api.danlabs.xyz/assetManager/${chainId}?user=${walletAddress}`)
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.catch(error => {
// Handle network errors or API response errors here
console.error('Error:', error.message);
});
return nfts;
Last updated