Payment intents & batch¶
Payment intents (authorize / capture)¶
A payment intent separates authorization (simulation + persistence of intent) from capture (actual pay()).
-
await client.create_payment_intent(wallet_id, recipient, amount, ...)
Runssimulate()first. If it would fail, raisesPaymentError. Otherwise creates aPaymentIntentwith statusrequires_confirmation. -
await client.confirm_payment_intent(intent_id)
Loads the intent, transitions to processing, callspay()with metadata from the intent, then marks succeeded or failed. -
await client.cancel_payment_intent(intent_id)— Cancels intents still inrequires_confirmation. -
await client.get_payment_intent(intent_id)— Lookup.
Use intents when a human or another service must approve before funds move, or when you want a durable two-phase flow.
Batch payments¶
await client.batch_pay(requests, concurrency=5) accepts a list of PaymentRequest (wallet_id, recipient, amount, optional purpose, idempotency_key, destination_chain, metadata).
Returns BatchPaymentResult with aggregate counts and per-item PaymentResult entries. Tune concurrency for throughput vs RPC load.