@base-org/account
Version:
Base Account SDK
39 lines • 1.55 kB
TypeScript
import type { PaymentStatus, PaymentStatusOptions } from './types.js';
/**
* Check the status of a payment transaction using its transaction ID (userOp hash)
*
* @param options - Payment status check options
* @param options.id - Transaction ID (userOp hash) to check status for
* @param options.testnet - Whether to check on testnet (Base Sepolia). Defaults to false (mainnet)
* @param options.telemetry - Whether to enable telemetry logging. Defaults to true
* @param options.bundlerUrl - Optional custom bundler URL to use for status checks. Useful for avoiding rate limits on public endpoints.
* @returns Promise<PaymentStatus> - Status information about the payment
* @throws Error if unable to connect to the RPC endpoint or if the RPC request fails
*
* @example
* ```typescript
* try {
* const status = await getPaymentStatus({
* id: "0x1234...5678",
* testnet: true
* })
*
* // With custom bundler URL to avoid rate limits
* const status = await getPaymentStatus({
* id: "0x1234...5678",
* testnet: false,
* bundlerUrl: 'https://my-bundler.example.com/rpc'
* })
*
* if (status.status === 'failed') {
* console.log(`Payment failed: ${status.reason}`)
* }
* } catch (error) {
* console.error('Unable to check payment status:', error.message)
* }
* ```
*
* @note The id is the userOp hash returned from the pay function
*/
export declare function getPaymentStatus(options: PaymentStatusOptions): Promise<PaymentStatus>;
//# sourceMappingURL=getPaymentStatus.d.ts.map