Skip to Content
API referenceOrbit CoreSrcVariablesrecentConnectedWalletHelpers

@tuwaio/orbit-monorepo


recentConnectedWalletHelpers

const recentConnectedWalletHelpers: object

Defined in: packages/orbit-core/src/utils/recentConnectedWalletHelpers.ts:13 

Helper utilities for managing the last connected wallet state

Type Declaration

getRecentConnectedWallet()

getRecentConnectedWallet: () => RecentConnectedWallet | undefined

Retrieves the current last connected wallet data from localStorage.

Returns

RecentConnectedWallet | undefined

The LastConnectedWallet object or undefined if not set or in SSR context

recentConnectedWallet

recentConnectedWallet: RecentConnectedWallet | undefined

The value of the last connected wallet, initialized when the module loads. Returns undefined if not set, invalid, or in an SSR context.

removeRecentConnectedWallet()

removeRecentConnectedWallet: () => void

Removes the last connected wallet data from localStorage.

Returns

void

undefined in SSR context, void in browser

setRecentConnectedWallet()

setRecentConnectedWallet: (wallets) => void

Stores the last connected wallet data in localStorage.

Parameters

wallets

RecentConnectedWallet

RecentConnectedWallet

Returns

void

undefined in SSR context, void in browser

STORAGE_KEY

STORAGE_KEY: string = 'orbit-core:recentConnectedWallet'

Remarks

All data is stored in localStorage with the ‘orbit-core:lastConnectedWallet’ key. Functions are safe to use in both browser and SSR environments.

Last updated on