httpay
Version:
HTTPay SDK for interacting with HTTPay smart contracts on Neutron
44 lines • 1.36 kB
TypeScript
import type { HTTPayConfig, ToolConfig, PaymentValidationResult, PaymentProcessResult, PaymentRequest } from './types';
/**
* High-level HTTPay provider class that simplifies contract interactions
*/
export declare class HTTPayProvider {
private config;
private tool;
private cosmWasmClient?;
private signingClient?;
private providerAddress?;
constructor(config: HTTPayConfig, tool: ToolConfig);
/**
* Initialize the provider with blockchain connections
*/
initialize(): Promise<void>;
/**
* Validate payment credentials (escrow ID and auth token)
*/
validatePayment(payment: PaymentRequest): Promise<PaymentValidationResult>;
/**
* Get tool pricing from registry
*/
getToolPrice(): Promise<{
price?: string;
error?: string;
}>;
/**
* Process payment by releasing escrow funds
*/
processPayment(escrowId: number, usageFee: string): Promise<PaymentProcessResult>;
/**
* Complete payment flow: validate + process
*/
handlePayment(payment: PaymentRequest): Promise<{
validation: PaymentValidationResult;
processing?: PaymentProcessResult;
price?: string;
}>;
/**
* Private helper to create signing client
*/
private createSigningClient;
}
//# sourceMappingURL=HTTPayProvider.d.ts.map