Prerequisites
| Requirement | How to get it |
|---|---|
| Node.js >= 20 | nodejs.org |
| Newton API key | Dashboard or email product@magicnewton.com |
This quickstart uses
simulateTask — a dry run that does not submit anything on-chain. No Sepolia ETH or wallet needed.Step 1 — Install
Step 2 — Run a simulation
Createquickstart.ts and paste:
Step 3 — Understand the response
The simulation returns aSimulateTaskResult:
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the evaluation completed without errors |
result.allow | boolean | Whether the policy approved the intent |
result.reason | string | Human-readable explanation |
error | string | Error message if evaluation failed |
Step 4 — What just happened?
Your script submitted an Intent to the Newton Gateway, where an Operator ran the OFAC sanctions Rego policy with a PolicyData oracle and returned an allow/deny result. This was a simulation — no on-chain transaction occurred. In production, the same flow produces a BLS attestation that your smart contract verifies on-chain before executing the transaction.Next steps
Integration Guide
Build and deploy a full Newton integration — policy, contract, and frontend
Core Concepts
Understand policies, intents, tasks, and attestations
SDK Reference
Full TypeScript SDK documentation
Try the demo
See a live sanctions-checked transfer app built with the Newton SDK
Alternative: AI-assisted build
Alternative: AI-assisted build
The fastest way to build a complete Newton application is to use Claude (or a similar AI coding assistant) with the Newton LLM context files. This approach scaffolds a full-stack app including data oracle, Rego policy, Solidity contract, and Next.js frontend.
Get the LLM context files
Download both Newton LLM context files and place them in your project root. See the LLM context files reference for full usage details.Provide context to your AI assistant
Start a conversation with Claude and provide the LLM context file. Then ask it to build the Newton sanctions-checked transfer app.Example prompt:Using the Newton integration context provided, help me build a complete Newton Protocol app that:
- Creates a WASM data oracle for sanctions checking
- Writes a Rego policy that checks the oracle results
- Deploys the policy via newton-cli
- Deploys a NewtonPolicyWallet on Sepolia
- Builds a Next.js frontend using the Newton SDK
Environment variables
| Variable | Description |
|---|---|
CHAIN_ID | 11155111 (Sepolia) or 84532 (Base Sepolia) |
PINATA_JWT | Your Pinata API JWT token |
PINATA_GATEWAY | Your Pinata gateway URL |
PRIVATE_KEY | Deployer wallet private key (with 0x prefix) |
RPC_URL | Sepolia RPC endpoint |
NEXT_PUBLIC_NEWTON_API_KEY | Newton Protocol API key |
NEXT_PUBLIC_SEPOLIA_ALCHEMY_URL | Alchemy HTTP RPC URL |
NEXT_PUBLIC_SEPOLIA_ALCHEMY_WS_URL | Alchemy WebSocket RPC URL |