isWalletOnDevice
Checks whether wallet shares are present in the device's keychain. This method verifies if the signing shares required for wallet operations are stored in the device's local keychain.
Function Signature
Parameters
forChainId
: Optional chain identifier (e.g., "eip155:1" for Ethereum mainnet, "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" for Solana mainnet). If nil, checks for any valid shares across all chains.
Returns
A boolean value indicating whether wallet shares exist on the device:
When forChainId is provided:
Returns
true
if shares exist for the specified chainReturns
false
if no shares are found for the chain
When forChainId is nil:
Returns
true
if any valid share exists (has non-empty ID)Returns
false
if no valid shares are found
Throws
PortalClassError.invalidChainId
if the provided chain ID format is invalidPortalClassError.unsupportedChainId
if the chain's namespace is not supportedVarious keychain-related errors if share retrieval fails
Example Usage
Implementation Notes
This method checks for the physical presence of shares on the device, regardless of their status
Different from
doesWalletExist()
which checks for completed shares on the serverUseful for determining whether to trigger wallet recovery or creation flows
The check is performed against the device's keychain storage
Usage in App Flow
App Launch Check:
Device Migration:
Related Documentation
For more information about wallet storage and device management, see:
Last updated
Was this helpful?