Zelus Labs API
  • Welcome!
  • Features
  • Quick Start
  • Reference
    • OpenAPI
    • Account API
      • Account Status
      • Account Contracts
    • Wallet API
      • Wallet Create
      • Wallet Balance
      • Wallet NFTs
    • NFT API
      • Minting an NFT
      • Get NFT metadata
Powered by GitBook
On this page
  • Endpoint Details
  • Examples

Was this helpful?

  1. Reference
  2. Wallet API

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

Description
Data

API Name

HTTP Method

GET

URL

/v1/wallet/nft/balance

Headers

Key
Value

Content-Type

application/json

x-api-key

API_KEY

Query Parameters

Parameter
Type
Description

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:

Parameter
Type
Description

walletAddress

string, optional

Address

walletId

string, optional

Wallet ID (wallet_UUID)

email

string, optional

Wallet email

phone

string, optional

Wallet phone, format: "+!2223334444"

Response format

result: {
    value: number, // 0,1,...
    transactionStatus?: string // "pending" or "complete"
} | error? : IResponseError

Success 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=email@example.com" \
     -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);
    });
PreviousWallet CreateNextWallet NFTs

Last updated 1 year ago

Was this helpful?

getWalletNftBalance