/** * Payment Type Definitions * * Simplified type definitions for direct payments */ export type PaymentStatus = 'created' | 'completed' | 'cancelled' | 'failed'; export interface PaymentIntent { /** * Unique payment identifier */ id: string; /** * Buyer's address */ buyer: string; /** * Merchant's address */ merchant: string; /** * Amount in smallest unit (Planck for DOT) * 1 DOT = 10^10 Planck */ amount: bigint; /** * Currency/asset identifier (default: 'DOT') */ currency: string; /** * Current payment status */ status: PaymentStatus; /** * When payment was created */ createdAt: number; /** * When payment was last updated */ updatedAt: number; /** * Optional external reference ID */ externalId?: string; /** * Optional description */ description?: string; /** * Transaction hash when completed */ txHash?: string; /** * Block number where transaction was included */ blockNumber?: number; /** * Block hash where transaction was finalized */ blockHash?: string; } export interface CreatePaymentParams { /** * Merchant's Polkadot address */ merchant: string; /** * Payment amount in DOT (e.g., "10.5" for 10.5 DOT) */ amount: string | bigint; /** * Currency (default: 'DOT') */ currency?: string; /** * Payment description */ description?: string; /** * External reference ID (for your system) */ externalId?: string; } export interface PaymentEvent { /** * Event type */ type: 'payment.created' | 'payment.completed' | 'payment.cancelled' | 'payment.failed'; /** * Payment ID */ paymentId: string; /** * Event timestamp */ timestamp: number; /** * Transaction hash */ txHash?: string; /** * Error message (for failed payments) */ error?: string; } /** * Payment verification result from on-chain query */ export interface PaymentVerificationResult { /** * Overall verification status */ verified: boolean; /** * Transaction exists on chain */ exists: boolean; /** * Transaction is finalized */ finalized: boolean; /** * Actual transferred amount from chain */ amount: bigint; /** * Actual sender address from chain */ from: string; /** * Actual recipient address from chain */ to: string; /** * Block number of transaction */ blockNumber: number; /** * Block hash */ blockHash: string; /** * Block timestamp */ timestamp: number; /** * Transaction hash */ txHash: string; /** * Event index in block (optional) */ eventIndex?: number; /** * Error message if verification failed */ error?: string; } /** * Payment link for no-code payments */ export interface PaymentLink { /** * Unique link identifier (e.g., "pmt_abc123xyz") */ id: string; /** * Merchant's Polkadot address */ merchant: string; /** * Payment amount in Planck, or 'custom' to allow user input */ amount: bigint | 'custom'; /** * Currency/asset identifier (default: 'DOT') */ currency: string; /** * Payment description */ description?: string; /** * External reference ID (for merchant's system) */ externalId?: string; /** * URL to redirect to after successful payment */ successUrl?: string; /** * URL to redirect to if payment is cancelled */ cancelUrl?: string; /** * Custom metadata (key-value pairs) */ metadata?: Record; /** * When the link was created */ createdAt: number; /** * When the link expires (optional) */ expiresAt?: number; /** * Whether the link is active */ active: boolean; /** * Network the link is for */ network: 'paseo' | 'polkadot' | 'kusama'; } /** * Parameters for creating a payment link */ export interface CreatePaymentLinkParams { /** * Merchant's Polkadot address */ merchant: string; /** * Payment amount in DOT (e.g., "10.5"), or 'custom' to allow user input */ amount: string | bigint | 'custom'; /** * Currency (default: 'DOT') */ currency?: string; /** * Payment description */ description?: string; /** * External reference ID */ externalId?: string; /** * Success redirect URL */ successUrl?: string; /** * Cancel redirect URL */ cancelUrl?: string; /** * Custom metadata */ metadata?: Record; /** * Expiration timestamp (optional) */ expiresAt?: number; } //# sourceMappingURL=payment.types.d.ts.map