@pshkv/bridge-economy
v0.1.0
Published
SINT Protocol Economy Bridge — Port/adapter integration with external economy services (balance, budget, trust, pricing)
Downloads
136
Readme
@sint/bridge-economy
Economic enforcement layer for SINT Protocol. Metered billing, trust-tier pricing, and balance management for agent actions.
Install
npm install @sint/bridge-economyUsage
import { EconomyPlugin } from "@pshkv/bridge-economy";
const economy = new EconomyPlugin({
balanceAdapter: myBalanceAdapter,
pricingAdapter: myPricingAdapter,
trustAdapter: myTrustAdapter,
});
// Price a tool call based on tier and trust level
const price = await economy.calculatePrice({
action: "execute_code",
tier: 3,
trustScore: 0.85,
});
// Check balance before execution
const canProceed = await economy.checkBalance(agentId, price);
// Debit after successful execution
await economy.debit(agentId, price, { txId: "tx-001" });Features
- Trust-tier pricing — higher-risk actions cost more
- Balance management — pre-flight balance checks
- Pluggable adapters — in-memory or HTTP-backed balance/pricing/trust stores
- Ledger integration — economic events emitted to evidence ledger
