npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dreamline-sdk

v0.1.0

Published

On-chain spend governance for AI agents — Dreamline Protocol on BNB Chain

Readme

dreamline-sdk

On-chain spend governance for AI agents — Dreamline Protocol on BNB Chain.

Install

npm install dreamline-sdk

Quick Start

const { DreamlineSDK } = require('dreamline-sdk');

const dreamline = new DreamlineSDK({ privateKey: process.env.AGENT_WALLET_KEY });

// Request approval before any payment const result = await dreamline.requestApproval('api.coingecko.com', 100); // $1.00

if (result.approved) { console.log('Approved:', result.approvalId); // proceed with payment } else if (result.circuitBreaker) { console.error('Agent auto-paused — too many violations'); } else if (result.pending) { console.log('Awaiting human approval:', result.approvalId); } else { console.error('Blocked:', result.reason); }

What is Dreamline?

Dreamline Protocol is an on-chain spend governance layer for AI agents on BNB Chain. It enforces spending policies — budgets, limits, destination whitelists — trustlessly via smart contracts. No server. No API key. Just blockchain.

Key features:

  • On-chain policy enforcement — daily budgets, per-tx limits, destination whitelists
  • Circuit Breaker — auto-pauses agents after 3 violations in 10 minutes (first on-chain circuit breaker for AI agents)
  • Human approval — transactions above threshold require explicit operator approval
  • Protocol fee — disabled by default (Uniswap-style switch)
  • ERC-8004 compatible — works with agent identity standard

Smart Contracts (BNB Chain Testnet)

DreamlineVerifier: 0x1eA365E30e91C74fc50d62Ec5C60c9c029Ee8B58 DreamlineRegistry: 0x71dA6F5b106E3Fb0B908C7e0720aa4452338B8BE DreamlineGovernance: 0x5a57Efb32BD68437e1A200C656E580C006b2E6A6

API Reference

new DreamlineSDK(config)

const dreamline = new DreamlineSDK({ privateKey: '0x...', rpc: 'https://...', verifierAddress: '0x...', registryAddress: '0x...' });

requestApproval(destination, amountUsd)

const result = await dreamline.requestApproval('uniswap.org', 5000); // $50.00

result.approved — payment approved, use result.approvalId result.pending — awaiting human approval result.denied — blocked by policy result.circuitBreaker — agent paused after too many violations result.reason — reason for denial result.txHash — BNB Chain transaction hash

executePayment(approvalId)

const exec = await dreamline.executePayment(result.approvalId); exec.success — true if executed exec.txHash — BNB Chain transaction hash

getPolicy(agentAddress?)

const policy = await dreamline.getPolicy(); policy.dailyBudgetUsd — daily spending limit policy.singleTxLimitUsd — per-transaction limit policy.approvalThresholdUsd — manual approval threshold policy.active — agent is registered and active

getCircuitBreakerStatus(agentAddress?)

const cb = await dreamline.getCircuitBreakerStatus(); cb.paused — agent is paused cb.denialCount — current denials in window cb.minutesUntilUnpause — minutes until auto-unpause cb.totalTriggeredCount — total times circuit breaker triggered

isDestinationAllowed(destination)

const allowed = await dreamline.isDestinationAllowed('free-crypto.xyz'); // false

getDailySpend(agentAddress?)

const spent = await dreamline.getDailySpend(); // e.g. 42.50

Integration Example — ERC-8004 Agent

const { DreamlineSDK } = require('dreamline-sdk');

class MyAgent { constructor() { this.dreamline = new DreamlineSDK({ privateKey: process.env.AGENT_WALLET_KEY }); }

async pay(destination, amountUsd, execute) { const cb = await this.dreamline.getCircuitBreakerStatus(); if (cb?.paused) { throw new Error('Agent paused — ' + cb.minutesUntilUnpause + ' minutes remaining'); }

const approval = await this.dreamline.requestApproval(destination, amountUsd);
if (!approval.approved) {
  throw new Error('Payment blocked: ' + approval.reason);
}

await execute();
await this.dreamline.executePayment(approval.approvalId);

return { txHash: approval.txHash };

} }

Circuit Breaker

The circuit breaker is the first on-chain automatic safety mechanism for AI agents. If an agent triggers 3 denied payments within 10 minutes it is automatically paused on-chain for 1 hour. No server. No human needed. Enforced by smart contract math.

3 denials in 10 minutes → auto-paused for 1 hour Operator can reset manually via resetCircuitBreaker() Auto-unpause after cooldown

License

BUSL-1.1 — Business Source License. Free for non-commercial use. Commercial use requires a license from Dreamline Labs.

Links

  • Dreamline Protocol: https://dreamline.ai
  • BNB Chain Testnet Explorer: https://testnet.bscscan.com/address/0x1eA365E30e91C74fc50d62Ec5C60c9c029Ee8B58
  • The Graph Subgraph: https://thegraph.com/studio/subgraph/dreamline-protocol