/** * Complete Offline Payment Flow Example * * Demonstrates the full TOSS lifecycle per Section 12 of the Technical Paper: * 1. Sender constructs and signs payment intent * 2. Intent is exchanged offline via BLE/NFC/QR * 3. Both devices store pending intent * 4. When connectivity is restored, devices reconcile * 5. Intent is submitted onchain with deterministic outcome */ import { Connection, Keypair } from '@solana/web3.js'; import { type SolanaIntent } from '../intent'; import type { TossUser } from '../types/tossUser'; import { type PeerDevice } from '../discovery'; /** * Example: Sender initiates offline payment using TOSS users * * User-centric approach: sender and recipient are TossUser objects * Intent creation validates user features and transaction limits */ export declare function exampleInitiateUserPayment(senderUser: TossUser, senderKeypair: Keypair, recipientUser: TossUser, amountLamports: number, connection: Connection): Promise; /** * Example: Sender initiates offline payment using addresses (legacy) * * This simulates a sender who wants to send lamports to a recipient * while offline. The intent is created, signed, and stored locally. */ export declare function exampleInitiateOfflinePayment(senderKeypair: Keypair, recipientAddress: string, amountLamports: number, connection: Connection): Promise; /** * Example: Intent exchange via proximity (BLE/NFC) * * One device has an intent it wants to share with a nearby peer. * This demonstrates the intent exchange protocol. */ export declare function exampleExchangeIntentWithPeer(intent: SolanaIntent, localDeviceId: string, peerDeviceId: string, peerDevice: PeerDevice): Promise; /** * Example: Multiple devices create conflicting intents * * Demonstrates TOSS's deterministic conflict resolution when * multiple offline devices create intents for the same action. */ export declare function exampleMultiDeviceConflict(connection: Connection): Promise; /** * Example: Full offline-to-settlement flow * * Shows the complete journey of an intent from creation to onchain settlement. */ export declare function exampleCompleteOfflineFlow(senderKeypair: Keypair, recipientAddress: string, amountLamports: number, connection: Connection): Promise; /** * Example: Verify intent before exchange * * Good practice: receivers should verify intent signatures * before accepting and storing them. */ export declare function exampleVerifyIntentBeforeAcceptance(intent: SolanaIntent, connection: Connection): Promise; //# sourceMappingURL=offlinePaymentFlow.d.ts.map