Options
All
  • Public
  • Public/Protected
  • All
Menu

Wallet action combine all the actions related to user wallets.

Hierarchy

  • WalletAction

Index

Constructors

  • Public constructor without parameters.

    Returns WalletAction

Properties

selectedAdapter: BaseWalletAdapter

Selected adapter.

storageProvider: StorageProvider

Storage provides all methods to handle storage actions.

supportedWallets: Record<string, BaseWalletAdapter> = {}

Supported Wallets array.

Methods

  • cleanWalletCache(): void
  • The function to clean wallet cache

    Returns void

  • connectWallet(walletName: string): Promise<string>
  • Disconnect selected wallet and select a new wallet.

    Parameters

    • walletName: string

    Returns Promise<string>

  • disconnectWallet(): Promise<void>
  • Disconnect selected wallet.

    Returns Promise<void>

  • ensureWalletIsAvailable(): void
  • Ensure a wallet is available, otherwise raise error.

    Returns void

  • ensureWalletIsConnected(): Promise<void>
  • The function to ensure wallet is connected, otherwise raise error

    Returns Promise<void>

  • The function to get connected session

    Returns Promise<ConnectedWalletPayload>

  • Get wallet adapter with specific wallet name

    Parameters

    • walletName: string

    Returns BaseWalletAdapter

  • Get all wallet adapters, or with specific chain type condition.

    Parameters

    Returns BaseWalletAdapter[]

  • getWalletAddress(): Promise<string>
  • Get wallet address.

    Returns Promise<string>

  • initializeAdapters(): void
  • Initialize injected adapters in a public function to callback

    Returns void

  • isInstalled(walletName: string): boolean
  • To check whether the wallet is installed.

    Parameters

    • walletName: string

    Returns boolean

  • isWalletStateValid tells whether the current wallet state is valid or not.

    Parameters

    Returns Promise<boolean>

  • restoreConnection(forceConnect?: boolean): Promise<string>
  • Restore connection. Normally the function won't connect if user has disconnected the wallet from DApp. Enable forceConnect to bypass and try to connect regardless the wallet is connected or not.

    Parameters

    • forceConnect: boolean = false

    Returns Promise<string>

  • signMessage(message: string): Promise<{ signature: string; walletAddress: string; walletName: string }>
  • Connect and Sign a message.

    Parameters

    • message: string

    Returns Promise<{ signature: string; walletAddress: string; walletName: string }>

Generated using TypeDoc