@kryptogo/kryptogokit-sdk-react
Version:
KryptogoKit offers a comprehensive web3 wallet solution with seamless KryptoGO Auth integration and multi-wallet connection support. Designed for users. Built for developers.
42 lines (41 loc) • 1.51 kB
TypeScript
import { type ReactNode } from 'react';
import { type PaymentIntentData, type QuoteDetailData, type PaymentModalParams, type SupportedChain } from '../types/api';
export declare enum PaymentStep {
CONNECT = "CONNECT",
PAYMENT = "PAYMENT",
ON_TRANSFER = "ON_TRANSFER",
PAID = "PAID"
}
interface PaymentState {
step: PaymentStep;
paymentIntent: PaymentIntentData | null;
quoteDetail: QuoteDetailData | null;
paymentParams: PaymentModalParams | null;
selectedChain: SupportedChain | null;
selectedToken: string | null;
logs: any;
error: Error | null;
isLoading: boolean;
}
interface PaymentContextValue extends PaymentState {
setStep: (step: PaymentStep) => void;
setPaymentIntent: (data: PaymentIntentData) => void;
setQuoteDetail: (data: QuoteDetailData) => void;
setPaymentParams: (params: PaymentModalParams) => void;
setSelectedToken: (token: string) => void;
setSelectedChain: (chain: SupportedChain) => void;
setLogs: (logs: any) => void;
setError: (error: Error | null) => void;
setLoading: (isLoading: boolean) => void;
reset: () => void;
isSuccess: boolean;
isError: boolean;
txHash: string | undefined;
payment_tx_hash: string | undefined;
}
interface PaymentProviderProps {
children: ReactNode;
}
export declare function PaymentProvider({ children }: PaymentProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function usePaymentContext(): PaymentContextValue;
export {};