@bit-gpt/h402
Version:
BitGPT's 402 open protocol for blockchain-native payments
31 lines • 1.7 kB
TypeScript
import { EvmClient } from "../../types/shared/client.js";
import { EvmPaymentPayload, PaymentRequirements, SettleResponse, VerifyResponse } from "../../types/index.js";
import { PublicClient } from "viem";
/**
* Verifies a payment payload against the required payment details regardless of the scheme
* this function wraps all verify functions for each specific scheme
*
* @param client - The public client used for blockchain interactions
* @param payload - The signed payment payload containing transfer parameters and signature
* @param paymentRequirements - The payment requirements that the payload must satisfy
* @returns A ValidPaymentRequest indicating if the payment is valid and any invalidation reason
*/
export declare function verify(client: PublicClient, payload: EvmPaymentPayload, paymentRequirements: PaymentRequirements): Promise<VerifyResponse>;
/**
* Settles a payment payload against the required payment details regardless of the scheme
* this function wraps all settle functions for each specific scheme
*
* @param client - The signer wallet used for blockchain interactions
* @param payload - The signed payment payload containing transfer parameters and signature
* @param paymentRequirements - The payment requirements that the payload must satisfy
* @returns A SettleResponse indicating if the payment is settled and any settlement reason
*/
export declare function settle(client: EvmClient, payload: EvmPaymentPayload, paymentRequirements: PaymentRequirements): Promise<SettleResponse>;
export type Supported = {
h402Version: number;
kind: {
scheme: string;
networkId: string;
}[];
};
//# sourceMappingURL=facilitator.d.ts.map