Skip to main content

Class: ReadonlyWalletAccount

Base implementation of a "@wallet-standard/base".WalletAccount to be used or extended by a "@wallet-standard/base".Wallet.

WalletAccount properties must be read-only. This class enforces this by making all properties truly private and read-only, using getters for access, returning copies instead of references, and calling Object.freeze on the instance.

Implements

Constructors

Constructor

new ReadonlyWalletAccount(account): ReadonlyWalletAccount

Create and freeze a read-only account.

Parameters

account

WalletAccount

Account to copy properties from.

Returns

ReadonlyWalletAccount

Accessors

address

Get Signature

get address(): string

Implementation of "@wallet-standard/base".WalletAccount.address | WalletAccount::address

Returns

string

Address of the account, corresponding with a public key.

Implementation of

WalletAccount.address


publicKey

Get Signature

get publicKey(): Uint8Array

Implementation of "@wallet-standard/base".WalletAccount.publicKey | WalletAccount::publicKey

Returns

Uint8Array

Public key of the account, corresponding with a secret key to use.

Implementation of

WalletAccount.publicKey


chains

Get Signature

get chains(): `${string}:${string}`[]

Implementation of "@wallet-standard/base".WalletAccount.chains | WalletAccount::chains

Returns

`${string}:${string}`[]

Chains supported by the account.

This must be a subset of the chains of the Wallet.

Implementation of

WalletAccount.chains


features

Get Signature

get features(): `${string}:${string}`[]

Implementation of "@wallet-standard/base".WalletAccount.features | WalletAccount::features

Returns

`${string}:${string}`[]

Feature names supported by the account.

This must be a subset of the names of features of the Wallet.

Implementation of

WalletAccount.features


label

Get Signature

get label(): string | undefined

Implementation of "@wallet-standard/base".WalletAccount.label | WalletAccount::label

Returns

string | undefined

Optional user-friendly descriptive label or name for the account. This may be displayed by the app.

Implementation of

WalletAccount.label


icon

Get Signature

get icon(): `data:image/svg+xml;base64,${string}` | `data:image/webp;base64,${string}` | `data:image/png;base64,${string}` | `data:image/gif;base64,${string}` | undefined

Implementation of "@wallet-standard/base".WalletAccount.icon | WalletAccount::icon

Returns

`data:image/svg+xml;base64,${string}` | `data:image/webp;base64,${string}` | `data:image/png;base64,${string}` | `data:image/gif;base64,${string}` | undefined

Optional user-friendly icon for the account. This may be displayed by the app.

Implementation of

WalletAccount.icon