Skip to main content

Wallet

Defined in: domain/Wallet.ts:19

Represents a Wallet entity. Extends Id to provide a unique identifier.

Remarks

Each wallet has an address, email address, name, and balance. Use Wallet.getInventory to retrieve the associated inventory for this wallet.

Example

const wallet = new Wallet(1, "0x123...", "user@example.com", "Alice");
const inventory = await wallet.getInventory();
console.log(wallet.address, wallet.emailAddress, wallet.name, wallet.balance);

Extends

  • Id<number>

Constructors

Constructor

new Wallet(
id,
address,
emailAddress,
name): Wallet;

Defined in: domain/Wallet.ts:42

Creates a new Wallet instance.

Parameters

id

number

The unique identifier for the wallet.

address

string

The wallet address.

emailAddress

string

The email address associated with the wallet.

name

string

The name of the wallet owner.

Returns

Wallet

Overrides

Id.constructor

Properties

address

address: string;

Defined in: domain/Wallet.ts:21

The wallet address.


balance?

optional balance: string;

Defined in: domain/Wallet.ts:27

The balance of the wallet.


emailAddress

emailAddress: string;

Defined in: domain/Wallet.ts:23

The email address associated with the wallet.


id?

optional id: number;

Defined in: types/Id.ts:15

The unique identifier for the entity.

Inherited from

Id.id


name?

optional name: string;

Defined in: domain/Wallet.ts:25

The name of the wallet owner.

Methods

getInventory()

getInventory(): Promise<Inventory>;

Defined in: domain/Wallet.ts:53

Retrieves the inventory associated with this wallet.

Returns

Promise<Inventory>

A promise that resolves to an Inventory instance.