import type { Session } from "@fogo/sessions-sdk"; import type { PublicKey } from "@solana/web3.js"; import type { SolanaWallet } from "./solana-wallet.js"; export declare enum StateType { Initializing = 0, CheckingStoredSession = 1, NotEstablished = 2, SelectingWallet = 3, WalletConnecting = 4, RequestingLimits = 5, SettingLimits = 6, Established = 7, UpdatingSession = 8, RequestingExtendedExpiry = 9, RequestingIncreasedLimits = 10 } export type EstablishedOptions = Omit & { expiration: Date; solanaWallet: SolanaWallet; createLogInToken: () => Promise; isLimited: boolean; endSession: () => void; showBridgeIn: () => void; updateSession: (prevState: StateType, duration: number, limits?: Map) => void; }; export declare const SessionState: { CheckingStoredSession: () => { type: StateType.CheckingStoredSession; }; Established: (args: EstablishedOptions) => { sessionPublicKey: PublicKey; sessionKey: CryptoKeyPair; walletPublicKey: PublicKey; payer: PublicKey; getSystemProgramSessionWrapInstruction: (amount: bigint) => import("@solana/web3.js").TransactionInstruction; getSessionWrapInstructions: (amount: bigint) => import("@solana/web3.js").TransactionInstruction[]; getSessionUnwrapInstructions: () => import("@solana/web3.js").TransactionInstruction[]; sendTransaction: (instructions: import("@fogo/sessions-sdk").TransactionOrInstructions, extraConfig?: import("@fogo/sessions-sdk").SendTransactionOptions) => Promise; expiration: Date; solanaWallet: SolanaWallet; createLogInToken: () => Promise; isLimited: boolean; endSession: () => void; showBridgeIn: () => void; updateSession: (prevState: StateType, duration: number, limits?: Map) => void; type: StateType.Established; }; Initializing: () => { type: StateType.Initializing; }; NotEstablished: (establishSession: (requestedLimits?: Map) => void) => { establishSession: (requestedLimits?: Map) => void; type: StateType.NotEstablished; }; RequestingExtendedExpiry: (args: EstablishedOptions & { cancel: () => void; }) => { sessionPublicKey: PublicKey; sessionKey: CryptoKeyPair; walletPublicKey: PublicKey; payer: PublicKey; getSystemProgramSessionWrapInstruction: (amount: bigint) => import("@solana/web3.js").TransactionInstruction; getSessionWrapInstructions: (amount: bigint) => import("@solana/web3.js").TransactionInstruction[]; getSessionUnwrapInstructions: () => import("@solana/web3.js").TransactionInstruction[]; sendTransaction: (instructions: import("@fogo/sessions-sdk").TransactionOrInstructions, extraConfig?: import("@fogo/sessions-sdk").SendTransactionOptions) => Promise; expiration: Date; solanaWallet: SolanaWallet; createLogInToken: () => Promise; isLimited: boolean; endSession: () => void; showBridgeIn: () => void; updateSession: (prevState: StateType, duration: number, limits?: Map) => void; cancel: () => void; type: StateType.RequestingExtendedExpiry; }; RequestingIncreasedLimits: (args: EstablishedOptions & { cancel: () => void; }) => { sessionPublicKey: PublicKey; sessionKey: CryptoKeyPair; walletPublicKey: PublicKey; payer: PublicKey; getSystemProgramSessionWrapInstruction: (amount: bigint) => import("@solana/web3.js").TransactionInstruction; getSessionWrapInstructions: (amount: bigint) => import("@solana/web3.js").TransactionInstruction[]; getSessionUnwrapInstructions: () => import("@solana/web3.js").TransactionInstruction[]; sendTransaction: (instructions: import("@fogo/sessions-sdk").TransactionOrInstructions, extraConfig?: import("@fogo/sessions-sdk").SendTransactionOptions) => Promise; expiration: Date; solanaWallet: SolanaWallet; createLogInToken: () => Promise; isLimited: boolean; endSession: () => void; showBridgeIn: () => void; updateSession: (prevState: StateType, duration: number, limits?: Map) => void; cancel: () => void; type: StateType.RequestingIncreasedLimits; }; RequestingLimits: (args: { requestedLimits?: Map | undefined; submitLimits: (duration: number, limits?: Map) => void; cancel: () => void; walletPublicKey: PublicKey; }) => { requestedLimits?: Map | undefined; submitLimits: (duration: number, limits?: Map) => void; cancel: () => void; walletPublicKey: PublicKey; type: StateType.RequestingLimits; }; SelectingWallet: (args: { selectWallet: (wallet: SolanaWallet) => void; cancel: () => void; }) => { selectWallet: (wallet: SolanaWallet) => void; cancel: () => void; type: StateType.SelectingWallet; }; SettingLimits: (args: { cancel: () => void; walletPublicKey: PublicKey; }) => { cancel: () => void; walletPublicKey: PublicKey; type: StateType.SettingLimits; }; UpdatingSession: (args: Omit & { previousState: StateType; }) => { sessionPublicKey: PublicKey; sessionKey: CryptoKeyPair; walletPublicKey: PublicKey; payer: PublicKey; getSystemProgramSessionWrapInstruction: (amount: bigint) => import("@solana/web3.js").TransactionInstruction; getSessionWrapInstructions: (amount: bigint) => import("@solana/web3.js").TransactionInstruction[]; getSessionUnwrapInstructions: () => import("@solana/web3.js").TransactionInstruction[]; sendTransaction: (instructions: import("@fogo/sessions-sdk").TransactionOrInstructions, extraConfig?: import("@fogo/sessions-sdk").SendTransactionOptions) => Promise; expiration: Date; solanaWallet: SolanaWallet; createLogInToken: () => Promise; isLimited: boolean; endSession: () => void; showBridgeIn: () => void; previousState: StateType; type: StateType.UpdatingSession; }; WalletConnecting: (args: { cancel: () => void; }) => { cancel: () => void; type: StateType.WalletConnecting; }; }; export type SessionStates = { [key in keyof typeof SessionState]: ReturnType<(typeof SessionState)[key]>; }; export type SessionState = SessionStates[keyof SessionStates]; export type EstablishedSessionState = Extract; export type WalletConnectedSessionState = EstablishedSessionState | Extract; export declare const isEstablished: (sessionState: SessionState) => sessionState is EstablishedSessionState; export declare const isWalletLoading: (sessionState: SessionState) => boolean; export type UpdatableSessionState = Extract; export declare const isUpdatable: (sessionState: SessionState) => sessionState is UpdatableSessionState; export type CancelableSessionState = Extract void; }>; export declare const isCancelable: (sessionState: SessionState) => sessionState is CancelableSessionState;