$ kontext — payment lifecycle management for modern fintech

8-stage payment lifecycle. Policy engine with OFAC sanctions screening. 6 provider adapters. From intent to reconciliation in one SDK. TypeScript-first. Zero dependencies.

$WHAT IS KONTEXT

Payment Control Plane SDK for modern fintech. 8-stage lifecycle tracks every payment from intent to reconciliation. Policy engine with OFAC screening. 6 provider adapters. Zero dependencies.

$INTEGRATE IN 3 STEPS
  1. 1. npm install kontext-sdk
  2. 2. Kontext.init({ projectId: '...', environment: '...' })
  3. 3. await ctx.start({ ... }) + await ctx.authorize(attemptId, { ... })
$DEFAULT FLOW: TREASURY PAYMENT
treasury-flow.ts
// 1. Start a payment attempt
const attempt = await ctx.start({
  workspaceRef: 'acme-treasury',
  appRef: 'treasury-agent',
  archetype: 'treasury',
  intentCurrency: 'USD',
  settlementAsset: 'USDC',
  chain: 'base',
  senderRefs: { wallet: '0xTreasury...abc' },
  recipientRefs: { wallet: '0xVendor...def' },
  executionSurface: 'sdk',
});

// 2. Authorize — policy engine runs
const { receipt } = await ctx.authorize(attempt.attemptId, {
  chain: 'base', token: 'USDC', amount: '5000',
  from: '0xTreasury...abc', to: '0xVendor...def',
  actorId: 'treasury-agent',
});

// 3. Broadcast + confirm
if (receipt.allowed) {
  await ctx.broadcast(attempt.attemptId, txHash, 'base');
  await ctx.confirm(attempt.attemptId, { txHash, blockNumber });
}
$PAYMENT PRESETS (WORKSPACE PROFILES)
micropayments ($100)treasury ($25K)invoicing ($20K)payroll ($15K)cross_border ($10K)
$SUPPORTED CHAINS (Base free)
baseethereumsolana
$6 PROVIDER ADAPTERS

EVMAdapter

SolanaAdapter

CircleAdapter

X402Adapter

BridgeAdapter

ModernTreasuryAdapter

$START INPUT SCHEMA
types.ts
interface StartAttemptInput {
  workspaceRef: string;
  appRef: string;
  archetype: 'micropayments' | 'treasury' | 'invoicing' | 'payroll' | 'cross_border';
  intentCurrency: string;
  settlementAsset: string;
  chain: 'base' | 'ethereum' | 'solana';
  senderRefs: { wallet: string };
  recipientRefs: { wallet: string };
  executionSurface: 'sdk' | 'api' | 'cli';
  metadata?: Record<string, unknown>;
}
$AUTHORIZE OUTPUT SCHEMA
types.ts
interface PaymentReceipt {
  decision: 'allow' | 'block' | 'review';
  allowed: boolean;
  checksRun: Array<{ name: string; passed: boolean; severity?: string }>;
  violations: Array<{ code: string; severity: string }>;
  requiredActions: Array<{ code: string; message: string }>;
  digestProof: { valid: boolean; chainLength: number };
}
$MACHINE-READABLE ENDPOINTS

LLM guide ···· https://getkontext.com/llms.txt

npm ·········· https://npmjs.com/package/kontext-sdk

GitHub ······· https://github.com/Legaci-Labs/kontext

$ What authorize() returns

Three outcomes. One policy engine call each.

$500 USDC — Allowed
{
  decision: 'allow',
  allowed: true,
  checksRun: [
    { name: 'Sanctions screening', passed: true },
    { name: 'Max transaction amount', passed: true },
    { name: 'Daily aggregate limit', passed: true },
  ],
  violations: [],
  digestProof: { valid: true, chainLength: 12 },
}
$15K USDC — Review Required
{
  decision: 'review',
  allowed: false,
  checksRun: [
    { name: 'Sanctions screening', passed: true },
    { name: 'Human approval threshold', passed: false },
  ],
  violations: [
    { code: 'REQUIRES_HUMAN_APPROVAL', severity: 'medium' }
  ],
  requiredActions: [
    { code: 'REQUEST_APPROVAL', message: 'Collect human approval' }
  ],
}
Sanctioned — Blocked
{
  decision: 'block',
  allowed: false,
  checksRun: [
    { name: 'Sanctions screening (recipient)', passed: false },
  ],
  violations: [
    { code: 'SANCTIONED_RECIPIENT', severity: 'critical' }
  ],
  requiredActions: [
    { code: 'CHANGE_RECIPIENT', message: 'Do not send to this recipient' }
  ],
}

$ 8-stage payment lifecycle

Every payment follows the same path. Every stage is logged.

1

intent

start()

2

authorize

authorize()

3

prepare

record()

4

transmit

broadcast()

5

confirm

confirm()

6

recipient_credit

credit()

7

reconcile

record()

8

retry_or_refund

refund()

$ Policy engine — compliance at every authorize()

The policy engine runs at the authorize stage. Every payment is checked against configurable rules before transmission.

GENIUS Act (S. 1582) regulations due July 2026. Kontext policy engine covers BSA requirements out of the box.

+ OFAC sanctions screening (sender + recipient)

+ Amount limits (max transaction, daily aggregate)

+ Blocklist / allowlist enforcement

+ Required metadata by payment type

+ Human approval thresholds

+ Tamper-evident digest chain on every receipt

$ Pricing

FREE

$0 forever

  • 20K payment stage events/month
  • Core lifecycle (8 stages)
  • Policy engine (OFAC, limits, blocklists)
  • Digest chain
  • 5 workspace profiles
  • JSON export
  • Base chain

PAY AS YOU GO

$0.002 / payment stage event above 20K

  • First 20K events free every month
  • All chains (Base, Ethereum, Solana)
  • CSV export
  • Ops dashboard (5 views)
  • Slack + email notifications
  • Advanced policy configurations
  • 6 provider adapters
MIT Licensed·Patented Digest Chain·8-Stage Lifecycle·Policy Engine·6 Provider Adapters·5 Workspace Profiles·Ops Dashboard·Open Source·Zero Dependencies

Ship payment infrastructure in minutes.

npm install. Kontext.init(). start(). authorize(). 8 stages, fully logged. Open source, TypeScript-first, free tier included.