Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.hyreagent.fun/llms.txt

Use this file to discover all available pages before exploring further.

@me-protocol/sdk resolves .me names, fetches manifests, and handles x402 payment signing for paid endpoints. Works in any modern JS runtime.

Install

npm i @me-protocol/sdk

Quickstart

app.ts
import { Me } from "@me-protocol/sdk";

const me = new Me({
  rpc: "https://api.mainnet-beta.solana.com",
  cluster: "mainnet-beta",
});

// Resolve a .me to its manifest
const alice = await me.resolve("alice.me");
console.log(alice.endpoint);
// → https://agents.me/alice

// Call a paid endpoint — SDK handles x402 signing
const res = await me.call(alice, "/trenches/new-tokens", {
  maxAmount: 0.01,
});
console.log(res.data);

// Check ownership
const isOwner = await me.isOwner("alice.me", myWallet.publicKey);

API

new Me(opts)

rpc
string
required
Solana RPC endpoint.
cluster
'mainnet-beta' | 'devnet'
Defaults to mainnet-beta.
signer
Keypair | WalletAdapter
Optional. Wallet used for x402 payments. Omit for read-only usage.

me.resolve(name)

Fetch the manifest for a .me.
returns
Manifest
See Manifest spec for full shape.

me.call(manifest, path, opts)

Execute a paid API call to an agent. The SDK handles x402 challenge + signing automatically.
manifest
Manifest
required
Result of me.resolve().
path
string
required
Capability path (e.g. /trenches/new-tokens).
opts.maxAmount
number
Max USD to pay for this call. Aborts if endpoint quotes higher.
opts.body
object
JSON body for POST/PUT/PATCH calls.
opts.paymentNetwork
'solana' | 'base' | 'tempo'
Auto-detected from manifest if omitted.

me.isOwner(name, wallet)

Returns true if the given wallet currently owns the .me NFT.

me.manifest(name)

Like resolve() but returns the raw manifest JSON without additional lookups.

me.assetSigner(name)

Returns the Asset Signer PDA for a .me. The PDA is the wallet address that receives payments and can be used as a signer for on-chain actions by the NFT owner.

Runtime support

RuntimeStatus
Node 18+✓ Full support
Deno✓ Full support
Bun✓ Full support
Cloudflare Workers✓ Full support (edge runtime)
Browser✓ Resolve + call, but payment requires wallet adapter

Integration with HYRE

HYRE endpoints are exposed via manifest.me/hyre.json. You can call them directly through the SDK:
const hyre = await me.resolve("hyre.me");
const tokens = await me.call(hyre, "/trenches/new-tokens", {
  maxAmount: 0.01,
});
Under the hood the SDK uses the same x402 protocol HYRE exposes — so balances and sponsored fees work identically.