@frontiercompute/zap1-core
v0.1.0
Published
v0 shared ZAP1 primitives for receipt submission and wallet-hash derivation.
Readme
@frontiercompute/zap1-core
v0 - implementation in progress.
Shared helpers for ZAP1 receipt submission, payload hashing, and wallet-hash derivation without venue-specific bindings.
install
npm install @frontiercompute/zap1-coreuse
import {
createClient,
deriveEphemeralWalletHash,
submitTradeReceipt,
} from "@frontiercompute/zap1-core";
const client = await createClient();
const walletHash = await deriveEphemeralWalletHash({
venue: "hyperliquid",
symbol: "BTC",
side: "long",
qty: 0.001,
});
const receipt = await submitTradeReceipt(
{
venue: "hyperliquid",
symbol: "BTC",
side: "long",
qty: 0.001,
entry_price: 100000,
exit_price: 100100,
pnl_bps: 10,
wallet_hash: walletHash,
metadata: { agent_id: "agent_a", strategy_id: "my_strategy" },
},
{ apiKey: process.env.ZAP1_API_KEY },
);
console.log(client, receipt.leaf_hash, receipt.verify_url);what you get
- trial-key bootstrap when
ZAP1_API_KEYis absent - deterministic contract-hash generation for trade and x402 receipt payloads
- ephemeral wallet-hash derivation keyed to the intent payload, not a persistent account identifier
- shared primitives over
@frontiercompute/zap1-attestfor venue adapters
runbook
- point
ZAP1_BASE_URLat your zap1 gateway only when you are not using the defaulthttps://api.frontiercompute.cash - provide
ZAP1_API_KEYfor persistent workloads; omit it only for short-lived evaluation flows - derive
wallet_hashper intent by default; do not reuse one customer identifier across unrelated flows - submit the receipt with
submitTradeReceipt()orsubmitX402Receipt() - verify the returned
leaf_hashatGET /verify/{leaf_hash}/check
verifier endpoint
GET https://api.frontiercompute.cash/verify/{leaf_hash}/checkspec
docs: https://api.frontiercompute.cash/docs/
openapi: https://api.frontiercompute.cash/openapi/zap1.yaml
license
MIT
