@coin-voyage/paykit
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
33 lines (32 loc) • 1.26 kB
TypeScript
import { Currency } from "@coin-voyage/shared/types";
import type React from "react";
import { Dispatch, SetStateAction } from "react";
import { ChainId, ChainType } from "../server";
import type { ROUTES } from "./routes";
import { CurrencyAndQuoteID } from "./state";
export interface RouteConfig {
component: React.ReactNode;
heading: string | ((ctx: HeadingContext) => string | undefined);
depth?: number;
showBackButton?: boolean;
showInfoButton?: boolean;
onBack?: ROUTES | ((actions: BackNavigationActions) => void);
}
export interface HeadingContext {
locales: Record<string, any>;
walletName: string | undefined;
shouldUseQrcode: boolean;
isWalletConnectConnector: boolean;
selectedCurrencyOption: {
ticker: string;
chain_id: number;
} | undefined;
}
export interface BackNavigationActions {
setRoute: Dispatch<SetStateAction<ROUTES>>;
setConnectorChainType: Dispatch<SetStateAction<ChainType | undefined>>;
setPayToAddressChain: Dispatch<SetStateAction<ChainId | undefined>>;
setPayToAddressCurrency: Dispatch<SetStateAction<Currency | undefined>>;
setSelectedCurrencyOption: (option: CurrencyAndQuoteID | undefined) => void;
clearUserSelection: () => void;
}