Links

nft_accountRentTokenIDs

Get all renting NFTs for an account address without scanning the entire chain.
Through nft_accountRentTokenIDs, you can get all the data of NFTs that an account rents by specifying the account address, accountAddress is necessary. You can clearly know what NFTs a holder rents.
Supported on Ethereum and BNB Chain.

Parameters

Object - An object with the following fields (required):
  • accountAddress(hex string, required) - the account address you want to query.
  • contractAddress(hex string, optional) - the contract address of the collection. BlockVision currently support ERC721, ERC1155 and ERC4907.

Returns

Object - An object with the following fields:
  • id(integer number) - json-rpc id.
  • jsonrpc(string) - json-rpc version.
  • result(array of object, defined below) - response data.
  • Object schema:
    • tokenId(string) - id of the NFT.
    • contractAddress(hex string) - contract address of the NFT.
    • quantity(string) - quantity of the NFT.
    • standard(string) - ERC standard for NFT, The value is "erc4907", see the detailed description of the ERC4907 standard.
    • expires(integer number) - UNIX timestamp, The new user could use the NFT before expires.

Example

Request

curl
TypeScript
curl https://apis.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"jsonrpc": "2.0",
"method": "nft_accountRentTokenIDs",
"params": {
"contractAddress": "0x2b41eF782A3064993f8BAA368a8D14d82443fdA9",
"accountAddress": "0xfc06cc834874c6d424b6ebf4a7a48042daa2d267"
}
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
// Access the BlockVision NFT API
bv.getNFTAccountRentTokenIDs({
contractAddress: '0x2b41eF782A3064993f8BAA368a8D14d82443fdA9',
accountAddress: '0xfc06cc834874c6d424b6ebf4a7a48042daa2d267'
}).then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"contractAddress": "0x2b41eF782A3064993f8BAA368a8D14d82443fdA9",
"tokenId": "44",
"quantity": 1,
"standard": "ERC4907",
"expires": 1668068999
}
]
}