@ozentti/creon
v0.1.0
Published
Merchant-ready SDK for Creon (Chainlink CRE commerce entitlements: pay once, re-unlock later).
Readme
@ozentti/creon
Merchant‑ready SDK for Creon workflows.
Install
npm install @ozentti/creonUsage
import { createWorkflowClient, verifyReceiptHash } from "@ozentti/creon";
const runner = async (payload: object, opts?: { broadcast?: boolean }) => {
// Your bridge to CRE CLI or a workflow runner.
return fetch("/api/workflow", {
method: "POST",
body: JSON.stringify({ payload, opts }),
}).then((res) => res.json());
};
const client = createWorkflowClient(runner);
const purchase = await client.purchase(intent, paymentProof, { broadcast: true });
const reunlock = await client.reunlock(accessIntent);Receipt verification
const ok = verifyReceiptHash(receipt, receipt_hash);Exports
createWorkflowClientverifyReceiptHashreceiptHash- Types:
PurchaseIntent,AccessIntent,Receipt,PurchaseResponse,ReunlockResponse
