Skip to main content
This page documents the core types and interfaces used in use-wallet.

Wallet Types

WalletId

enum WalletId {
  BIATEC = 'biatec',
  DEFLY = 'defly',
  DEFLY_WEB = 'defly-web',
  CUSTOM = 'custom',
  EXODUS = 'exodus',
  KIBISIS = 'kibisis',
  KMD = 'kmd',
  LUTE = 'lute',
  MAGIC = 'magic',
  MNEMONIC = 'mnemonic',
  PERA = 'pera',
  WALLETCONNECT = 'walletconnect',
  WEB3AUTH = 'web3auth',
  W3_WALLET = 'w3-wallet'
}
Enum of supported wallet providers.

WalletKey

type WalletKey = WalletId | `${WalletId.WALLETCONNECT}:${string}`
Composite key type that can be either a standard WalletId or a composite string for skinned WalletConnect instances (e.g., 'walletconnect:biatec').

WalletAccount

interface WalletAccount {
  name: string
  address: string
}
Represents a wallet account with a name and Algorand address.
name
string
Display name for the account
address
string
The Algorand address of the account

WalletMetadata

interface WalletMetadata {
  name: string
  icon: string
}
Metadata for displaying wallet information in the UI.
name
string
Display name for the wallet
icon
string
Wallet icon as a data URI or URL

SupportedWallet

type SupportedWallet = WalletIdConfig<WalletId> | WalletId
A wallet configuration can be either:
  • A simple WalletId string (e.g., WalletId.PERA)
  • A configuration object with id, options, and metadata

Example

// Simple wallet ID
const wallet1: SupportedWallet = WalletId.PERA

// Full configuration
const wallet2: SupportedWallet = {
  id: WalletId.WALLETCONNECT,
  options: { projectId: 'your-project-id' },
  metadata: { name: 'Custom Name', icon: 'data:image/svg...' }
}

WalletIdConfig

type WalletIdConfig<T extends keyof WalletConfigMap> = {
  [K in T]: {
    id: K
  } & WalletConfigMap[K]
}[T]
Configuration object for a wallet, including its ID, options, and metadata.
id
WalletId
required
The wallet identifier
options
WalletOptions<T>
Wallet-specific options (e.g., WalletConnect projectId)
metadata
Partial<WalletMetadata>
Custom metadata to override the wallet’s default name and icon

WalletConnectSkin

interface WalletConnectSkin {
  id: string
  name: string
  icon: string
}
Metadata for a WalletConnect skin, used to customize the appearance of WalletConnect-based wallets.
id
string
required
Unique identifier for the skin
name
string
required
Display name for the skinned wallet
icon
string
required
Wallet icon as a data URI or URL

State Types

State

interface State {
  wallets: WalletStateMap
  activeWallet: WalletKey | null
  activeNetwork: string
  algodClient: algosdk.Algodv2
  managerStatus: ManagerStatus
  networkConfig: Record<string, NetworkConfig>
  customNetworkConfigs: Record<string, Partial<NetworkConfig>>
}
The global state managed by WalletManager.
wallets
WalletStateMap
Map of wallet keys to their connection state
activeWallet
WalletKey | null
The currently active wallet key, or null if none
activeNetwork
string
The ID of the currently active network
algodClient
algosdk.Algodv2
The Algod client instance for the active network
managerStatus
ManagerStatus
Current status of the wallet manager
networkConfig
Record<string, NetworkConfig>
All network configurations
customNetworkConfigs
Record<string, Partial<NetworkConfig>>
User-customized network configurations

WalletState

interface WalletState {
  accounts: WalletAccount[]
  activeAccount: WalletAccount | null
}
The connection state for a specific wallet.
accounts
WalletAccount[]
Array of connected accounts
activeAccount
WalletAccount | null
The currently active account for this wallet

ManagerStatus

type ManagerStatus = 'initializing' | 'ready'
The initialization status of the WalletManager.

Transaction Types

WalletTransaction

interface WalletTransaction {
  txn: string
  authAddr?: string
  msig?: MultisigMetadata
  signers?: string[]
  stxn?: string
  message?: string
  groupMessage?: string
}
Wallet transaction format following ARC-0001.
txn
string
required
Base64 encoding of the canonical msgpack encoding of a Transaction
authAddr
string
Optional authorized address used to sign the transaction when the account is rekeyed
msig
MultisigMetadata
Multisig metadata used to sign the transaction
signers
string[]
Optional list of addresses that must sign the transactions
stxn
string
Optional base64 encoding of a SignedTxn when signers=[]
message
string
Optional message explaining the reason for the transaction
groupMessage
string
Optional message for the transaction group. Only allowed in the first transaction of a group

MultisigMetadata

interface MultisigMetadata {
  version: number
  threshold: number
  addrs: string[]
}
Multisig metadata following ARC-0001.
version
number
required
Multisig version
threshold
number
required
Authorization requires a subset of signatures equal to or greater than this value
addrs
string[]
required
List of Algorand addresses of possible signers. Order is important

SignerTransaction

interface SignerTransaction {
  txn: algosdk.Transaction
  authAddr?: string
  signers?: string[]
  message?: string
}
Transaction format with an algosdk.Transaction object (used by Pera Wallet).
txn
algosdk.Transaction
required
The Transaction object to sign
authAddr
string
Optional authorized address when account is rekeyed
signers
string[]
Optional list of addresses that must sign. Empty array means skip signing
message
string
Optional message explaining the transaction

Data Signing Types

SignMetadata

interface SignMetadata {
  scope: ScopeType
  encoding: string
}
Metadata for arbitrary data signing requests.
scope
ScopeType
required
The scope of the signature request
encoding
string
required
The encoding format of the data (e.g., ‘base64’)

ScopeType

enum ScopeType {
  UNKNOWN = -1,
  AUTH = 1
}
Scope types for data signing.

SignDataResponse

interface SignDataResponse extends SignData {
  signature: Uint8Array
}
Response from a data signing operation, including the signature.

Siwa

interface Siwa {
  domain: string
  account_address: string
  uri: string
  version: string
  statement?: string
  nonce?: string
  'issued-at'?: string
  'expiration-time'?: string
  'not-before'?: string
  'request-id'?: string
  chain_id: '283'
  resources?: string[]
  type: 'ed25519'
}
Sign In With Algorand (SIWA) message format.

Error Types

SignTxnsError

class SignTxnsError extends Error {
  code: number
  data?: any
  
  constructor(message: string, code: number, data?: any)
}
Error thrown when transaction signing fails.
message
string
Error message
code
number
Error code
data
any
Additional error data

SignDataError

class SignDataError extends Error {
  code: number
  data?: any
  
  constructor(message: string, code: number, data?: any)
}
Error thrown when data signing fails.
message
string
Error message
code
number
Error code
data
any
Additional error data

Utility Types

LogLevel

enum LogLevel {
  ERROR = 0,
  WARN = 1,
  INFO = 2,
  DEBUG = 3
}
Logging levels for the WalletManager and wallet implementations.

Build docs developers (and LLMs) love