Skip to main content
Version: 23.2.x

Class: Checkpoint

api/entities/Checkpoint.Checkpoint

Represents a snapshot of the Asset's holders and their respective balances at a certain point in time

Hierarchy

Properties

asset

asset: FungibleAsset

Asset whose balances are being recorded in this Checkpoint

Defined in

api/entities/Checkpoint.ts:52


id

id: BigNumber

Checkpoint identifier number

Defined in

api/entities/Checkpoint.ts:47


uuid

uuid: string

Inherited from

Entity.uuid

Defined in

api/entities/Entity.ts:46

Methods

allBalances

allBalances(paginationOpts?): Promise<ResultSet<IdentityBalance>>

Retrieve all Asset Holder balances at this Checkpoint

Parameters

NameType
paginationOpts?PaginationOptions

Returns

Promise<ResultSet<IdentityBalance>>

Note

supports pagination

Note

current Asset holders who didn't hold any tokens when the Checkpoint was created will be listed with a balance of 0. This arises from a chain storage optimization and pagination.

See

balance for a more detailed explanation of the logic

Defined in

api/entities/Checkpoint.ts:109


balance

balance(args?): Promise<BigNumber>

Retrieve the balance of a specific Asset Holder Identity at this Checkpoint

Parameters

NameTypeDescription
args?Object-
args.identitystring | Identitydefaults to the signing Identity

Returns

Promise<BigNumber>

Note

A checkpoint only records balances when they change. The implementation is to query for all balance updates for [ticker, did] pair. If no balance updates have happened since the Checkpoint has been created, then the storage will not have an entry for the user. Instead the current balance should be used. The balance is stored only when the Identity makes a transaction after a Checkpoint is created. This helps keep storage usage to a minimum

Defined in

api/entities/Checkpoint.ts:201


createdAt

createdAt(): Promise<Date>

Retrieve this Checkpoint's creation date

Returns

Promise<Date>

Defined in

api/entities/Checkpoint.ts:87


exists

exists(): Promise<boolean>

Determine whether this Checkpoint exists on chain

Returns

Promise<boolean>

Overrides

Entity.exists

Defined in

api/entities/Checkpoint.ts:245


isEqual

isEqual(entity): boolean

Determine whether this Entity is the same as another one

Parameters

NameType
entityEntity<unknown, unknown>

Returns

boolean

Inherited from

Entity.isEqual

Defined in

api/entities/Entity.ts:61


toHuman

toHuman(): HumanReadable

Return the Checkpoint's ticker and identifier

Returns

HumanReadable

Overrides

Entity.toHuman

Defined in

api/entities/Checkpoint.ts:265


totalSupply

totalSupply(): Promise<BigNumber>

Retrieve the Asset's total supply at this checkpoint

Returns

Promise<BigNumber>

Defined in

api/entities/Checkpoint.ts:69


generateUuid

Static generateUuid<Identifiers>(identifiers): string

Generate the Entity's UUID from its identifying properties

Type parameters

Name
Identifiers

Parameters

NameType
identifiersIdentifiers

Returns

string

Inherited from

Entity.generateUuid

Defined in

api/entities/Entity.ts:14


unserialize

Static unserialize<Identifiers>(serialized): Identifiers

Unserialize a UUID into its Unique Identifiers

Type parameters

Name
Identifiers

Parameters

NameTypeDescription
serializedstringUUID to unserialize

Returns

Identifiers

Inherited from

Entity.unserialize

Defined in

api/entities/Entity.ts:23