Multi Token Standard (NEP-245)
After a successful deposit, the Verifier contract manages tokens using the Multi Token Standard (NEP-245). This enables uniform handling of all supported token types.
Each token is identified by a string-based token ID, prefixed with its standard type.
| Token Type | Prefix | Example |
|---|
| Fungible (NEP-141) | nep141: | nep141:wrap.near |
| Non-fungible (NEP-171) | nep171: | nep171:coolnfts.near:rock.near |
| Multi Token (NEP-245) | nep245: | nep245:mygame.near:shield.near |
Checking your balance
After a successful deposit, query your balance using mt_balance_of, which adheres to the NEP-245 standard.
near contract call-function as-read-only intents.near mt_balance_of \
json-args '{"account_id": "your-account.near", "token_id": "nep141:wrap.near"}' \
network-config mainnet now
import { JsonRpcProvider } from "near-api-js";
const provider = new JsonRpcProvider({ url: "https://rpc.fastnear.com" });
const balance = await provider.callFunction({
contractId: "intents.near",
method: "mt_balance_of",
args: {
account_id: "your-account.near",
token_id: "nep141:wrap.near",
},
});
console.log(balance);
See contract interaction example in near-api-examples repository.
| Parameter | Description |
|---|
account_id | The NEAR account to check the balance of. |
token_id | The token ID with its standard prefix (e.g., nep141:wrap.near). See Token ID format. |
Batch balance query
To check multiple token balances at once, use mt_batch_balance_of:
near contract call-function as-read-only intents.near mt_batch_balance_of \
json-args '{"account_id": "your-account.near", "token_ids": ["nep141:wrap.near", "nep141:usdt.tether-token.near"]}' \
network-config mainnet now
const balances = await provider.callFunction({
contractId: "intents.near",
method: "mt_batch_balance_of",
args: {
account_id: "your-account.near",
token_ids: [
"nep141:wrap.near",
"nep141:usdt.tether-token.near",
],
},
});
console.log(balances);
Response:
[
"3000004000004000006",
"10"
]
Balances are returned in the smallest unit of each token (e.g., yoctoNEAR for wrapped NEAR).