WalletRegistry
Registry of the supported browser wallet adapters; it detects which wallets are installed and resolves the right adapter.
Registry of the supported browser wallet adapters; it detects which wallets are installed and resolves the right adapter.
Constructor
WalletRegistry
constructor(adapters?: WalletAdapter[])Parameters
adapters(optional):WalletAdapter[]
Methods
register()
Register (or replace, by id) a wallet adapter. By default it's appended at the lowest priority; pass prepend to make it win auto-detection.
register(adapter: WalletAdapter, prepend?: boolean): thisParameters
adapter:WalletAdapterprepend(optional):boolean
Returns this
unregister()
Remove an adapter by id.
unregister(id: string): thisParameters
id:string
Returns this
get()
Get a registered adapter by id.
get(id: string): WalletAdapter | undefinedParameters
id:string
Returns WalletAdapter | undefined
ids()
All registered adapter ids, in priority order.
ids(): string[]Returns string[]
list()
Probe every adapter and report which are available.
list(): Promise<WalletInfo[]>Returns Promise<WalletInfo[]>
available()
The available adapters, in priority order.
available(): Promise<WalletAdapter[]>Returns Promise<WalletAdapter[]>
detect()
Pick a wallet automatically. If preferred is given and available it wins; otherwise the first available adapter (in priority order) is returned. Throws {@link WalletNotFoundError} when nothing is available.
detect(preferred?: string): Promise<WalletAdapter>Parameters
preferred(optional):string
Returns Promise<WalletAdapter>