import { Options, WidgetEvents } from '@wert-io/widget-initializer/types'; import { Network } from '@dcl/schemas/dist/dapps/network'; import { NetworkGatewayType } from 'decentraland-ui/dist/components/BuyManaWithFiatModal/Network'; import { TradeType } from './transak/types'; export declare enum FiatGateway { WERT = "wert" } export declare enum WertTarget { DEFAULT = "default", PUBLICATION_FEES = "publicationFees" } export type WertOptions = Options & { target?: WertTarget; }; export type FiatGatewayOptions = WertOptions; export type FiatGatewayOnPendingListener = (event: WidgetEvents) => void; export type FiatGatewayOnSuccessListener = (event: WidgetEvents) => void; export type FiatGatewayOnLoadedListener = () => void; export type FiatGatewayOnCloseListener = () => void; export type FiatGatewayListeners = { onLoaded?: FiatGatewayOnLoadedListener; onPending?: FiatGatewayOnPendingListener; onSuccess?: FiatGatewayOnSuccessListener; onClose?: FiatGatewayOnCloseListener; }; export type WertMessage = { address: string; commodity: string; commodity_amount: number; network: string; sc_address: string; sc_input_data: string; }; type Commodity = { commodity: string; network: string; }; type Wallet = { name: string; network: string; address: string; }; type Extra = { wallets: Wallet[]; }; export type WertSession = { flow_type: 'simple' | 'simple_full_restrict'; phone?: string; userID?: string; commodity?: string; network?: string; wallet_address?: string; commodity_amount?: number; currency?: 'USD' | 'EUR'; currency_amount?: number; commodities?: Commodity[]; extra?: Extra; }; export type WertPayload = { message: WertMessage; session: WertSession; target?: WertTarget; }; export type WertConfig = { url: string; marketplaceServerURL: string; }; export type MoonPayConfig = { apiBaseUrl: string; apiKey: string; pollingDelay?: number; widgetBaseUrl: string; }; export type TransakConfig = { apiBaseUrl: string; pollingDelay?: number; pusher: { appKey: string; appCluster: string; }; }; export type ManaFiatGatewaySagasConfig = { [NetworkGatewayType.MOON_PAY]?: MoonPayConfig; [NetworkGatewayType.TRANSAK]?: TransakConfig; }; export type FiatGatewaySagasConfig = { [FiatGateway.WERT]?: WertConfig; }; export type GatewaySagasConfig = FiatGatewaySagasConfig & ManaFiatGatewaySagasConfig; export declare enum PurchaseStatus { PENDING = "pending", FAILED = "failed", CANCELLED = "cancelled", REFUNDED = "refunded", COMPLETE = "complete" } type BasePurchase = { id: string; network: Network; gateway: NetworkGatewayType; timestamp: number; status: PurchaseStatus; paymentMethod: string; address: string; txHash: string | null; failureReason?: string | null; }; export type ManaPurchase = BasePurchase & { amount: number; }; export type NFTPurchase = BasePurchase & { nft: { contractAddress: string; tokenId?: string; itemId?: string; tradeType: TradeType; cryptoAmount: number; }; }; export type Purchase = ManaPurchase | NFTPurchase; export {};