Docs / SDK
Payments from TypeScript.
Use the SDK to create a mandate and submit payments. MandateRegistry remains the authority for every transfer.
Install
npm install @ackrate/core@0.4.1 @ackrate/stellar@0.3.0 @stellar/stellar-sdk@16.3.0Create a mandate
This example only builds a mandate in memory. Supply funded user and agent addresses, the merchant, and the Circle USDC asset from the verified Mainnet configuration.
import { ackrate } from "@ackrate/core";
const mandate = ackrate.createIntentMandate({
user, agent, merchant, asset,
maxAmount: "3.00",
expiry: Math.floor(Date.now() / 1000) + 3600,
});Authorize, then pay
- Register with the user signer using
ackrate.registerMandate. - Approve the contract allowance using
ackrate.approveBudget. - Bind the agent signer using
ackrate.agent. - Persist the prepared transaction before submission using
agent.payand itsonPreparedcallback. Keep a durable receipt store for paid HTTP delivery.
If submission is interrupted, reconcile the exact prepared transaction hash before retrying. A timeout does not mean payment failed.
Follow the complete Mainnet signing and settlement guide →
Run an end-to-end example
The Testnet starters include both agents, payment-bound HTTP delivery, and recovery evidence. Their scripts call the SDK directly and print concise status lines.
Published modules
- @ackrate/core 0.4.1
- Mandates, payments, receipts, and reconciliation.
- @ackrate/stellar 0.3.0
- Network configuration and transaction signing.
- @ackrate/express-middleware 0.3.0
- Verify a paid request before resource delivery.
- @ackrate/ap2 0.4.0
- Validate AP2-style intent mandates.