Build
sluice-pay SDK
@sluice/paywraps Circle's GatewayClient and the Sluice registry, with budget + reasoning guards and deposit-aware balance checks.
Install
bash
pnpm add @sluice/payPay
ts
const sluice = new SluicePay({ privateKey });
const { data, amount } = await sluice.pay(resourceId, { maxAmount: 0.01 });Budget & reasoning
ts
const sluice = new SluicePay({ privateKey, budget: 0.50 }); // cumulative cap
await sluice.pay(id, {
maxAmount: 0.01,
onDecision: ({ formattedPrice }) => confirm(`pay ${formattedPrice}?`), // abort by returning false
});Deposit-aware
pay() checks your Gateway balance first and fails with an actionable error instead of a revert. Use autoDeposit: true or deposit explicitly with sluice.deposit("1.00").