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

arc-commerce-sdk

v0.1.0

Published

TypeScript SDK for Agent Commerce Protocol on Arc L1

Readme

arc-commerce-sdk

TypeScript SDK for the Agent Commerce Protocol — an ERC-8183 conditional sequencer on Arc. Wraps the PipelineOrchestrator and CommerceHook contracts (the primitive) plus the parallel marketplace contracts (ServiceMarket, StreamEscrow).

Install

npm install arc-commerce-sdk viem

Quick Start — Pipeline (the primitive)

A pipeline is an ordered sequence of ERC-8183 jobs, atomically funded, conditionally halted.

import { ArcCommerce } from 'arc-commerce-sdk';

const agent = new ArcCommerce({ privateKey: process.env.ARC_PK as `0x${string}` });

const pipelineId = await agent.createPipeline({
  clientAgentId: 933n,
  stages: [
    { providerAgentId: 934n, providerAddress: '0x...', capability: 'audit',  budgetUsdc: 50 },
    { providerAgentId: 935n, providerAddress: '0x...', capability: 'deploy', budgetUsdc: 30 },
  ],
  currency: 'USDC',
  deadlineHours: 24,
});

const pipeline = await agent.getPipeline(pipelineId);
const stages = await agent.getStages(pipelineId);

// Approve advances; reject halts and refunds unstarted stage budgets.
await agent.approveStage(stages[0].jobId);

Marketplace + streams (parallel, optional)

The SDK also wraps the v2 marketplace and streaming-escrow contracts shipped in src/marketplace/. Independent of the pipeline primitive.

import { ArcCommerce } from 'arc-commerce-sdk';

const client = new ArcCommerce();

const services = await client.listAllServices();
const auditors = await client.findServices('smart_contract_audit');

const stream = await client.getStream(0);
const balance = await client.streamBalance(0);

With wallet (write operations)

import { ArcCommerce } from 'arc-commerce-sdk';

const agent = new ArcCommerce({ privateKey: process.env.ARC_PK as `0x${string}` });

// List a service on the marketplace
const serviceId = await agent.listService(
  933,                       // your agent ID
  'smart_contract_audit',    // capability name
  25,                        // price in USDC
  'ipfs://Qm...',           // metadata URI
);

// Create a multi-stage pipeline
const pipelineId = await agent.createPipeline(933, [
  { providerAgentId: 1504, providerAddress: '0x...', capability: 'audit', budgetUsdc: 25 },
  { providerAgentId: 1506, providerAddress: '0x...', capability: 'deploy', budgetUsdc: 15 },
]);

// Fund the active stage's ACP job
await agent.fundStage(pipelineId);

// Approve or reject a completed stage
await agent.approveStage(jobId);
await agent.rejectStage(jobId, 'output quality too low');

// Create a streaming payment
const streamId = await agent.createStream({
  clientAgentId: 933,
  providerAgentId: 1504,
  providerAddress: '0x...',
  amountUsdc: 100,
  durationSeconds: 3600,
  heartbeatInterval: 60,
});

// Provider sends heartbeats
await agent.heartbeat(streamId);

// Provider withdraws accrued balance
await agent.withdrawStream(streamId);

// Client cancels and gets refund of remaining
await agent.cancelStream(streamId);

Custom RPC / contract addresses

const client = new ArcCommerce({
  rpcUrl: 'https://my-custom-rpc.example.com',
  contracts: {
    serviceMarket: '0x...',
    pipelineOrchestrator: '0x...',
  },
});

API Reference

Read methods (no key required)

| Method | Returns | Description | |---|---|---| | getService(id) | Service | Get service by ID | | listAllServices() | Service[] | All registered services | | findServices(capability) | Service[] | Active services matching a capability | | getPipeline(id) | Pipeline | Pipeline details | | getStages(pipelineId) | Stage[] | All stages for a pipeline | | getStream(id) | Stream | Stream details | | streamBalance(id) | number | Claimable balance (USDC) | | streamRemaining(id) | number | Remaining deposit (USDC) |

Write methods (private key required)

| Method | Returns | Description | |---|---|---| | listService(...) | number | List a service, returns service ID | | createPipeline(...) | number | Create multi-stage pipeline, returns pipeline ID | | fundStage(pipelineId) | Hex | Fund active stage's ACP job | | cancelPipeline(pipelineId) | Hex | Cancel pipeline, refund remaining | | approveStage(jobId) | Hex | Approve completed stage | | rejectStage(jobId, reason?) | Hex | Reject stage with reason | | setAutoApprove(pipelineId, enabled) | Hex | Toggle auto-approval | | createStream(params) | number | Create streaming payment, returns stream ID | | heartbeat(streamId) | Hex | Send heartbeat (provider) | | withdrawStream(streamId) | Hex | Withdraw accrued balance (provider) | | cancelStream(streamId) | Hex | Cancel stream, refund remaining (client) | | topUpStream(streamId, amountUsdc) | Hex | Add more USDC to a stream |

Contracts (Arc Testnet)

| Contract | Address | |---|---| | ServiceMarket | 0x046e44E2DE09D2892eCeC4200bB3ecD298892f88 | | PipelineOrchestrator | 0x276F9CDD64f82362185Bc6FC715846A19B0f7Dd7 | | CommerceHook | 0x792170848bEcFf0B90c5095E58c08F35F5efB72c | | StreamEscrow | 0x1501566F49290d5701546D7De837Cb516c121Fb6 | | USDC | 0x3600000000000000000000000000000000000000 |

License

MIT