ValuePacket is a monorepo with Solidity contracts, TypeScript packages, and framework adapters.
ValuePacket/
├── contracts/ # Solidity smart contracts (Foundry)
│ ├── src/ # ServiceRegistry, PaymentChannel, SpendingPolicy
│ └── script/ # Deploy scripts (local + Base Sepolia)
├── sdk/ # @valuepacket/sdk — TypeScript SDK (tsup + vitest)
├── cli/ # @valuepacket/cli — CLI tool
├── adapters/
│ ├── eliza/ # @valuepacket/adapter-eliza — ElizaOS plugin
│ └── game/ # @valuepacket/adapter-game — G.A.M.E worker
├── indexer/ # Ponder indexer for on-chain events
└── scripts/ # Demo and utility scripts
git clone https://github.com/KryptosAI/ValuePacket.git
cd ValuePacket
npm install
make demo-local# Solidity contracts
cd contracts && forge test
# CLI
cd cli && npm test
# SDK
cd sdk && npm test
# Everything (build + test all workspaces)
npm test- Create
adapters/<name>/with apackage.jsonandsrc/index.ts - The package name should follow
@valuepacket/adapter-<name> - Add the workspace to the root
package.jsonworkspaces array - Implement your adapter using
@valuepacket/sdktypes and client - Add a build script:
tsup src/index.ts --format esm,cjs --dts --clean - Include
"files": ["dist", "src"]in package.json - If the framework has a peer dependency, add it to
peerDependencies
Minimal adapter template:
// src/index.ts
import { AgentPay, type ServiceConfig } from "@valuepacket/sdk";
export class MyAdapter {
private client: AgentPay;
constructor(rpc: string, signer: `0x${string}`) {
this.client = new AgentPay({ rpc, signer });
}
async registerService(config: ServiceConfig) {
return this.client.registerService(config);
}
async sendPayment(channelId: bigint, amount: bigint) {
return this.client.sendPayment(channelId, amount);
}
}- Register a service on-chain using the CLI or SDK
- Deploy a server that accepts ValuePacket payment proofs
- Use
ChannelServerfrom@valuepacket/sdkto verify incoming payments
Example using the CLI:
# Register a service
valuepacket register --name "my-price-feed" --price 100 --type "price-feed" \
--endpoint "https://my-service.com/api"
# Serve it
valuepacket serve --port 8080Packages are published to npm under the @valuepacket scope:
# Build all packages
npm run build
# Dry run to verify
npm publish --dry-run -w sdk
npm publish --dry-run -w cli
npm publish --dry-run -w adapters/eliza
npm publish --dry-run -w adapters/game
# Actually publish (requires npm login + @valuepacket org)
npm publish -w sdk
npm publish -w cli
npm publish -w adapters/eliza
npm publish -w adapters/gameMIT — see LICENSE.