Skip to main content

NEAR Protocol, the home of

Build decentralized applications and AI agents with seamless cross-chain capabilities on a layer-1 blockchain built for scale

import { Hono } from "hono";
import { agentAccountId, agent } from "@neardefi/shade-agent-js";

const app = new Hono();

app.get("/", async (c) => {
try {
// Get the agents account Id
const accountId = await agentAccountId();

// Get the balance of the agent account
const balance = await agent("getBalance");

return c.json({
accountId: accountId.accountId,
balance: balance.balance,
});
} catch (error) {
console.log("Error getting agent account:", error);
return c.json({ error: "Failed to get agent account " + error }, 500);
}
});

export default app;
NEAR Protocol

New to NEAR?

NEAR is a layer-1 blockchain built for scale and multichain compatibility. Battle-tested with 13M+ transaction peaks and 5 years of zero downtime

AI Native Infrastructure

AI Native Infrastructure

NEAR is the execution layer for AI-native apps—enabling agents to own assets, make decisions, and transact freely across networks

Multi-Chain

Multi-Chain

Tap into any blockchain with NEAR's chain abstraction layer

Web3 Applications

Web3 Applications

Create modern web applications that interact with the NEAR blockchain. Learn frontend integration and user experience best practices

Smart Contracts

Smart Contracts

Deploy and interact with smart contracts on NEAR. From basic concepts to advanced patterns and security best practices

Tokens and Primitives

Tokens and Primitives

Learn about FTs, NFTs, DAOs and everything you need to build an application on NEAR