We're now supporting Polygon zkEVM!
Learn more here.
The API credit value for this method is 4 . To learn more about API credits and each method's value, visit the API Credits page.
Please note that this RPC method requires the Token and NFT API v2 bundle add-on enabled on your QuickNode endpoint.
Parameters:
object - A custom object with the following fields:
wallet - string - The wallet address to check for NFTs
contracts -
string - An array of ERC-721 and/or ERC-1155 NFT contract addresses, suffixed with
:tokenId
to specify a specific ID. For example, providing the value
0x2106c...7aeaa:1234
will verify ownership of Loopy Donuts' NFT token with ID
1234
. You may include up to 20 contract addresses per request
Returns:
owner - The wallet address we checked for NFTs
assets - An array of owned NFTs for the the provided wallet, in the same format as the inputted array. If an inputted array isn't returned, then it does not belong to the wallet
Code Examples:
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \ --header 'Content-Type: application/json' \ --data '{ "id":67, "jsonrpc":"2.0", "method":"qn_verifyNFTsOwner", "params": [{ "wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", "contracts": [ "0x2106c00ac7da0a3430ae667879139e832307aeaa:3643", "0xd07dc4262bcdbf85190c01c996b4c06a461d2430:133803" ] }] }'
const ethers = require("ethers"); (async () => { const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/"); const heads = await provider.send("qn_verifyNFTsOwner", [ { wallet: "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", contracts: [ "0x2106c00ac7da0a3430ae667879139e832307aeaa:3643", "0xd07dc4262bcdbf85190c01c996b4c06a461d2430:133803", ], }, ]); console.log(heads); })();
import requests import json url = "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/" payload = json.dumps([ { "id": 67, "method": "qn_verifyNFTsOwner", "params": [{ wallet: "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", contracts: [ "0x2106c00ac7da0a3430ae667879139e832307aeaa:3643", "0xd07dc4262bcdbf85190c01c996b4c06a461d2430:133803" ] }] } ]) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/')) resp = w3.provider.make_request('qn_verifyNFTsOwner', [{ wallet: "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", contracts: [ "0x2106c00ac7da0a3430ae667879139e832307aeaa:3643", "0xd07dc4262bcdbf85190c01c996b4c06a461d2430:133803" ] }]) print(resp)
require 'ethereum.rb' client = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/') response = client.send_command( 'qn_verifyNFTsOwner', [{ wallet: '0x91b51c173a4bdaa1a60e234fc3f705a16d228740', contracts: [ '0x2106c00ac7da0a3430ae667879139e832307aeaa:3643', '0xd07dc4262bcdbf85190c01c996b4c06a461d2430:133803' ] }] ) puts response['result']
require "uri" require "json" require "net/http" url = URI("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump([ { "id": 67, "method": "qn_verifyNFTsOwner", "params": [{ wallet: "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", contracts: [ "0x2106c00ac7da0a3430ae667879139e832307aeaa:3643", "0xd07dc4262bcdbf85190c01c996b4c06a461d2430:133803" ] }] } ]) response = https.request(request) puts response.read_body
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify([ { "id": 67, "method": "qn_verifyNFTsOwner", "params": [{ wallet: "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", contracts: [ "0x2106c00ac7da0a3430ae667879139e832307aeaa:3643", "0xd07dc4262bcdbf85190c01c996b4c06a461d2430:133803" ] }] } ]); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));