Wallet Balance
This API endpoint allows clients to check if a specific Non-Fungible Token (NFT) is present within a wallet. This can be useful for scenarios like token gating, where access to specific resources or features is controlled based on token ownership.
Endpoint Details
Headers
Content-Type
application/json
x-api-key
API_KEY
Query Parameters
contractId
string, required
Identifier for the contract, formatted as contract_<UUID>
nftTokenId
string, required
Identifier for the NFT.
User can be identified by one of the parameter:
walletAddress
string, optional
Address
walletId
string, optional
Wallet ID (wallet_UUID)
string, optional
Wallet email
phone
string, optional
Wallet phone, format: "+!2223334444"
Response format
result: {
value: number, // 0,1,...
transactionStatus?: string // "pending" or "complete"
} | error? : IResponseErrorSuccess response
{
"result": {
"value": 3,
"transactionStatus": "finished"
}
}Error messages
More than one user ID is defined.
{ "code: 400, "message": "Validation error: \"value\" must contain at least one of [email, phone, walletId, walletAddress]" }
Contracts not found
{ "code: 400, "message": "Contracts not found" }
User wallet not found
{ "code: 400, "message": "User wallet not found" }
Examples
curl -X GET "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance?contractId=contract_63b848e9-b316-48a3-adfd-065403ab88ae&nftTokenId=1&[email protected]" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY"import requests
url = "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance"
headers = {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY"
}
data = {
"contractId": "contract_63b848e9-b316-48a3-adfd-065403ab88ae",
"nftTokenId": "2",
"walletAddress": "0x0097f04ac9b2af2fb40c2c30a65023a78eaff5d6"
}
response = requests.get(url, json=data, headers=headers)
print(response.json()["result"]["value"])const axios = require('axios');
const url = "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance";
const headers = {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY"
};
const data = {
"contractId": "contract_63b848e9-b316-48a3-adfd-065403ab88ae",
"nftTokenId": "3",
"wallet": "wallet_60afcf25-2c1f-4b90-9fea-6174fd416040"
};
axios.get(url, data, {headers})
.then(response => {
console.log(response.data.result.value);
})
.catch(error => {
console.error(error);
});Last updated
Was this helpful?