Calls a common FT view method against the active contract.
await near.ft.totalSupply({ contractId: app.contractId })
FastNear JS gives agents and developers a fast path from a NEAR data question to a working answer. Start with copyable snippets; open the docs only when you need the full reference.
Open DevTools and paste any of these. They reference app.contractId,
so they follow whatever target contract is set via the ⚙ gear in the navbar —
change it once, and these snippets retarget. NEP-standard reads have shorthand under
near.ft.* and near.nft.*; the recipe-driven equivalents
live under near.recipes.* and accept an optional { network }
override (so a testnet read from a mainnet-active page is one call, not a config flip).
Calls a common FT view method against the active contract.
await near.ft.totalSupply({ contractId: app.contractId })
Reads get_account for the signed-in account — swap the argument for any account id.
await near.view({
contractId: app.contractId,
methodName: "get_account",
args: { account_id: nearWallet.accountId() },
})
Template for any signed transaction — replace methodName and args.
await near.recipes.functionCall({
receiverId: app.contractId,
methodName: "your_method",
args: {},
gas: near.utils.convertUnit("100 Tgas"),
deposit: "0",
})
Pass { network } to retarget any helper for a single call —
no near.config() flip, mainnet stays the active network.
await near.ft.balance({
network: "testnet",
contractId: "wrap.testnet",
accountId: "mike.testnet",
})
Use these lower-level FastNear families when the question is about direct RPC, indexed transactions, transfers, recent blocks, or contract storage history.
These links connect the JS quickstart to the full FastNear docs for RPC, indexed APIs, auth, and agent workflows.
These task helpers are layered on top of the lower-level APIs and come from the same
machine-readable catalog behind recipes.json, llms.txt, and
the terminal wrapper.
The same FastNear JS runtime driving a live app — a berry.fast board crop and wallet-backed Berry Club actions (or a testnet counter on testnet).
Loading live berry.fast crop…
Connect any wallet to try draw or buy_tokens on
berryclub.ek.near — all from the browser.
The same library you used in the terminal — now driving a browser app.
—
Target contract —. Use the browser DevTools console
with near.recipes.viewContract({ … }) or near.view({ … }) for reads, and
near.recipes.functionCall({ … }) for writes — both accept an optional
{ network } override so a one-off testnet call from a mainnet-active page
doesn't need a config flip.