SDK
Load it
One file served by this site, no dependencies, works in browsers, Node 18+ and Deno.
import * as Elyra from "https://<this site>/sdk/elyra.js";
const q = await Elyra.quote({ sell: "USDC", buy: "HYPE", amount: "100" });
const c = await Elyra.conditions(["HYPE"]);Place an order
const order = Elyra.buildOrder({ owner, sellToken: Elyra.TOKENS.USDC, buyToken: Elyra.TOKENS.HYPE,
sellAmount: "100000000", buyAmount: "1500000000000000000", validFor: 86400,
condition: await Elyra.feedCondition("HYPE.funding", "lte", "0") });
const typed = await Elyra.typedData(order); // EIP-712, sign with any wallet
const signature = await wallet.signTypedData(typed);
const { uid } = await Elyra.submit(order, signature);