picker

In this section

Type Aliases

ArrangedWallets

type ArrangedWallets = {
  all: Wallet[];
  inline: Wallet[];
  more: Wallet[];
  primary?: Wallet;
  remembered?: Wallet;
};

Defined in: src/picker/index.ts:29

Properties

all
all: Wallet[];

Defined in: src/picker/index.ts:37

Every shown wallet, in display order.

inline
inline: Wallet[];

Defined in: src/picker/index.ts:33

Wallets listed under the main action.

more
more: Wallet[];

Defined in: src/picker/index.ts:35

Wallets behind "more", for long registries. Empty when everything fits.

primary?
optional primary?: Wallet;

Defined in: src/picker/index.ts:31

The one to present as the main action; undefined when nothing is available.

remembered?
optional remembered?: Wallet;

Defined in: src/picker/index.ts:39

The remembered wallet when preferred matched an available one.


ArrangeOptions

type ArrangeOptions = {
  includeUnavailable?: boolean;
  inlineMax?: number;
  inlineShown?: number;
  preferred?: string;
};

Defined in: src/picker/index.ts:18

Properties

includeUnavailable?
optional includeUnavailable?: boolean;

Defined in: src/picker/index.ts:24

Keep unavailable wallets instead of hiding them (for debugging).

inlineMax?
optional inlineMax?: number;

Defined in: src/picker/index.ts:20

Show every web wallet inline up to this many (default 5).

inlineShown?
optional inlineShown?: number;

Defined in: src/picker/index.ts:22

Past inlineMax, show this many inline and the rest under "more" (default 4).

preferred?
optional preferred?: string;

Defined in: src/picker/index.ts:26

A wallet id to lead with, e.g. from recallChoice.

Functions

arrangeWallets()

function arrangeWallets(list, options?): ArrangedWallets;

Defined in: src/picker/index.ts:47

Group and order wallets for display. The main action is the remembered choice if there is one, else the platform wallet when available, else the only option when there is exactly one. The rest keep their order.

Parameters

Parameter Type
list readonly Wallet[]
options ArrangeOptions

Returns

ArrangedWallets


forgetChoice()

function forgetChoice(key?): void;

Defined in: src/picker/index.ts:87

Forget the remembered wallet.

Parameters

Parameter Type Default value
key string STORAGE_KEY

Returns

void


monogram()

function monogram(name): {
  color: string;
  letter: string;
};

Defined in: src/picker/index.ts:96

A letter and a stable color for a wallet with no icon.

Parameters

Parameter Type
name string

Returns

{
  color: string;
  letter: string;
}
color
color: string;
letter
letter: string;

recallChoice()

function recallChoice(key?): string | undefined;

Defined in: src/picker/index.ts:78

The wallet id remembered for this site, if any.

Parameters

Parameter Type Default value
key string STORAGE_KEY

Returns

string | undefined


rememberChoice()

function rememberChoice(walletId, key?): void;

Defined in: src/picker/index.ts:69

Remember the wallet the patient used, in this browser, for this site.

Parameters

Parameter Type Default value
walletId string undefined
key string STORAGE_KEY

Returns

void