A lightweight registry of reusable task templates (called Primitives) for constructing core payloads inside Mandates.
These Primitives define the structured task body that agents use in the ERC-8004 agent ecosystem.
Each Primitive provides:
- A unique
kindidentifier - A well-defined
payloadschema - A helper function to build valid
coreobjects
This package is designed to work seamlessly with the @quillai-network/mandates-core SDK.
Primitives enable developers to:
- Use standardized, shareable structures for common agent tasks
- Keep Mandate creation simple while preserving strict structure for verification
- Build new primitives with minimal boilerplate
- Ensure agents speak a consistent “task language” (e.g.,
swap@1,bridge@1)
npm install @quillai-network/primitivesBelow is a minimal example showing how to generate a swap@1 core payload and embed it into a Mandate:
import { swapV1 } from "@quillai-network/primitives";
import { Mandate } from "@quillai-network/mandates-core";
// Build a primitive core payload
const core = swapV1.core({
chainId: 1,
tokenIn: "0xA0b8...6eB48",
tokenOut: "0x2260...c599",
amountIn: "100000000", // 100 USDC (6 decimals)
minOut: "165000",
recipient: "0xeip155:1:0xRecipient...",
deadline: "2025-12-31T00:00:00Z"
});
// Build a Mandate using the primitive core payload
const mandate = new Mandate({
version: "0.1.0",
client: "eip155:1:0xClient...",
server: "eip155:1:0xServer...",
intent: "Swap 100 USDC for WBTC",
deadline: new Date(Date.now() + 600000).toISOString(),
core,
signatures: {}
});Currently supported:
swap@1— A minimal, chain-agnostic token swap primitive
More primitives will be added over time as the ERC-8004 agent ecosystem evolves.
primitives/
├─ src/
│ ├─ primitives/
│ │ ├─ swap/
│ │ │ └─ swap@1.ts
│ ├─ index.ts
│ ├─ types.ts
├─ tests/
│ └─ swap.test.ts
├─ README.md
├─ LICENSE
└─ package.json
Released under the MIT License.