Build with Fenestella
Four things you can use today: the request call, the MCP server for AI agents, the account API, and the contracts. Everything here runs against qorechain-diana; reading accounts works on mainnet too.
Ask for a window
@fenestella/connect has no dependencies and is on npm (source in packages/connect):
npm install @fenestella/connect
import { requestWindow, FenestellaError } from "@fenestella/connect";
try {
const granted = await requestWindow({
reason: "Pay this month's invoices from the Bills contract.",
allowedTargets: ["0xa8006f2378e8307ffdb0d46fc89668bc69d00eb0"],
maxTxs: 10,
maxValueUqor: "2000000", // 2 QOR: value plus the maximum fee of each transaction
blocks: 1200,
network: "testnet",
});
// granted.txHash, granted.account, granted.evmAddress
// granted.window: what the chain now stores for the account
} catch (err) {
if (err instanceof FenestellaError) {
// err.code: "rejected" | "invalid" | "failed" | "blocked" | "closed" | "timeout"
}
}| Field | Meaning | Chain limit |
|---|---|---|
blocks | How long the window stays open | 1 to 17,280 |
maxTxs | How many EVM transactions it admits | 1 to 1,000 |
maxValueUqor | Total value plus maximum fees, in uqor (1 QOR = 1,000,000) | above 0 |
allowedTargets | The only recipients allowed; contract creation is refused | at most 16 |
nativeOnly | Plain QOR transfers only; cannot be combined with targets | |
reason | Shown to the user as your words | 280 characters |
What the user sees, and what you cannot change:
- Your origin, as the browser reports it. It is never read from your message.
- The bounds restated in plain words by Fenestella, with warnings where they apply.
- The result is the window as the chain stores it after the transaction, not what you asked for.
Call requestWindow() from a click handler, or the browser blocks the popup. Try the flow.
Skip the request when a window already fits
import { windowCovers } from "@fenestella/connect";
const res = await fetch(
"https://fenestella.vercel.app/api/account?network=testnet&address=" + account,
);
const { truth } = await res.json();
if (!windowCovers(truth.window, need)) {
await requestWindow({ ...need, reason: "..." });
}For AI agents: the MCP server
@fenestella/mcp gives Claude, Cursor or any MCP client a QoreChain agent on a leash the chain enforces. Its key, kept on your machine, may call only AgentVault.payBill; the vault pays only payees you approved with your post-quantum key, within your limits. Without a key it reads: what a stolen classical key could do to an account, the Q-Day radar, your vault and bills, and the pqcVerify / pqcKeyStatus precompiles.
npx @fenestella/mcp keygen # prints a new agent key
// claude_desktop_config.json or .mcp.json
{
"mcpServers": {
"fenestella": {
"command": "npx",
"args": ["-y", "@fenestella/mcp"],
"env": { "FENESTELLA_AGENT_KEY": "0x…" }
}
}
}Tools: check_account, qday_radar, vault_status, list_bills, request_window (a link you approve in your own wallet), verify_pq_signature, link_agent and pay_bill. The relayer forwards only a payBill call to the vault and refuses to spend a fee on a bill the vault would refuse. Full guide.
Account API
Read-only, no key needed. Each section of the answer is read on its own; one that fails is named in unknown and is never reported as safe.
GET /api/account?network=testnet&address=qor1... (or 0x...)
{
"truth": {
"address": { "cosmos": "qor1...", "evm": "0x..." },
"keyType": "eth_secp256k1",
"pqc": { "registered": true, "possessionProven": true },
"kem": { "found": false },
"window": { "live": true, "remainingTxs": "2", "remainingValue": "200000",
"remainingBlocks": "118", "nativeOnly": false,
"allowedTargets": ["0x..."] },
"abstractAccount": { "moduleEnabled": true, "account": null,
"rules": [], "authenticators": [] },
"unknown": []
},
"exposure": { "level": "scoped", "headline": "...", "can": [], "cannot": [],
"warnings": [], "advice": [], "linkedKeys": [] }
}Exposure levels: takeover, open, scoped, sealed, unknown.
Contracts on testnet
| Contract | Address | What it does |
|---|---|---|
| FenestellaReceipts | 0xc520f7084758a3faafd2d8ffb7432c87787a1acc | Records a digest only with an ML-DSA-87 signature by the account's registered key |
| AgentVault | 0x51fb13cc0513f02cd16e98f9b4a9f233027c2551 | Holds each owner's agent budget and bills. Pays only an approved payee within the owner's limits; payees, limits, pause and withdrawal change only with the owner's ML-DSA-87 signature, checked by pqcVerify |
| AgentReports | 0x2b8d4cdcdc7a2efbcfca7691b58605dc1bc91462 | A mailbox that only emits: the agent posts reports signed with its post-quantum key and sealed to the owner |
| Bills | 0xa8006f2378e8307ffdb0d46fc89668bc69d00eb0 | The first bill contract, kept for older leashes: paying forwards the exact amount and holds nothing |
QorePQC.sol wraps the chain's pqcKeyStatus and pqcVerify precompiles and reverts when a precompile is inactive, so an empty answer is never read as “verified”. Reuse it in your own contracts.
Run it yourself
git clone https://github.com/angelraph/fenestella cd fenestella && npm install npm run dev # the console npm test # unit tests npm run spike # window lifecycle on testnet with a throwaway key npm run attack # everything the classical key alone can try