FastNear
Built for agents

Answer NEAR RPC and API questions with one library.

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.

  • Copy a starter snippet
  • Pick the right API family
  • Go deeper in the docs
Try it in DevTools

Drive the target contract from the browser console.

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.

Read total supply

Calls a common FT view method against the active contract.

await near.ft.totalSupply({ contractId: app.contractId })
Read your account state

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() },
})
Send a function call

Template for any signed transaction — replace methodName and args.

await nearWallet.sendTransaction({
  receiverId: app.contractId,
  actions: [{
    type: "FunctionCall",
    params: {
      methodName: "your_method",
      gas: near.utils.convertUnit("100 Tgas"),
      deposit: "0",
      args: {},
    },
  }],
})
Pick the right API

Start with the FastNear family that matches the question.

Use these lower-level FastNear families when the question is about direct RPC, indexed transactions, transfers, recent blocks, or contract storage history.

Go deeper in the docs

Open the full reference only when you need it.

These links connect the JS quickstart to the full FastNear docs for RPC, indexed APIs, auth, and agent workflows.

Common tasks

Copy the smallest snippet that gets you a useful answer.

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.

Browser example

Berry Club and berry.fast show the same library working in real apps.

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).

Live example

berry.fast board preview

Open berry.fast

Loading live berry.fast crop…

Wallet-backed example

Draw or buy tokens

Example app

The same library you used in the terminal — now driving a browser app.

Total supply
Your balance
Custom contract connected

Signed in as

Custom

Target contract . Use the browser DevTools console with near.view({ contractId: app.contractId, … }) for reads and nearWallet.sendTransaction({ receiverId: app.contractId, … }) for writes.