@exodus/models
This library contains a variety of classes/models used for various data structures.
Installation/Usage
yarn add @exodus/models
This library exports each model as a named export:
import { Address, AddressSet } from '@exodus/models'
Models
All models have a static method .isInstance(obj)
which returns true
if obj
is an instance of the model. This check returns true
even if the instance is of a duplicate, different version of the model; for this reason it should be used instead of the instanceof
operator.
A base class from which all asset account state clases extend. Cannot be initialized directly.
A model for blockchain addresses.
An immutable set of Address
es with sorting functionality.
A model for fiat orders.
An immutable set of FiatOrder
s, with alternate get methods like getAt
, getByTxId
, & getAllByTxId
, and an .update(orders)
method for updating details of existing orders.
A model for crypto swap orders.
An immutable set of Order
s, with alternate get methods like getAt
, getByTxId
, & getAllByTxId
, and an .update(orders)
method for updating details of existing orders.
A model for personal notes.
An immutable set of PersonalNote
s. Unlike other *Set
models, the .add()
& .update()
methods return the same PersonalNoteSet
instance if there were no changes to the data.
A model for blockchain transactions.
An immutable set of Tx
s. Cannot be constructed directly, either start with TxSet.EMPTY
or use the static method TxSet.fromArray()
. txSet.equals(otherSet)
only compares transaction ids; use txSet.deepEquals(otherSet)
for full transaction comparison.
An immutable colletion of UTXOs, with various methods for filtering, updating, and selecting from them.
An immutable model for representing wallet accounts of all sources.
A minimal, immutable set of WalletAccount
s.