api.entities.Checkpoint - PolymeshAssociation/polymesh-sdk GitHub Wiki

@polymeshassociation/polymesh-sdk / api/entities/Checkpoint

api/entities/Checkpoint

Classes

Checkpoint

Defined in: api/entities/Checkpoint.ts:36

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

Extends

Properties

asset

asset: FungibleAsset

Defined in: api/entities/Checkpoint.ts:55

Asset whose balances are being recorded in this Checkpoint

id

id: BigNumber

Defined in: api/entities/Checkpoint.ts:50

Checkpoint identifier number

uuid

uuid: string

Defined in: api/entities/Entity.ts:46

Inherited from

Entity.uuid

Methods

allBalances()

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

Defined in: api/entities/Checkpoint.ts:107

Retrieve all Asset Holder balances at this Checkpoint

Parameters
Parameter Type
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

balance()

balance(args?): Promise<BigNumber>

Defined in: api/entities/Checkpoint.ts:209

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

Parameters
Parameter Type Description
args? { identity: string | Identity; } -
args.identity? string | Identity defaults 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

createdAt()

createdAt(): Promise<Date>

Defined in: api/entities/Checkpoint.ts:87

Retrieve this Checkpoint's creation date

Returns

Promise<Date>

exists()

exists(): Promise<boolean>

Defined in: api/entities/Checkpoint.ts:254

Determine whether this Checkpoint exists on chain

Returns

Promise<boolean>

Overrides

Entity.exists

isEqual()

isEqual(entity): boolean

Defined in: api/entities/Entity.ts:61

Determine whether this Entity is the same as another one

Parameters
Parameter Type
entity Entity<unknown, unknown>
Returns

boolean

Inherited from

Entity.isEqual

toHuman()

toHuman(): HumanReadable

Defined in: api/entities/Checkpoint.ts:276

Return the Checkpoint's ticker and identifier

Returns

HumanReadable

Overrides

Entity.toHuman

totalSupply()

totalSupply(): Promise<BigNumber>

Defined in: api/entities/Checkpoint.ts:72

Retrieve the Asset's total supply at this checkpoint

Returns

Promise<BigNumber>

generateUuid()

static generateUuid<Identifiers>(identifiers): string

Defined in: api/entities/Entity.ts:14

Generate the Entity's UUID from its identifying properties

Type Parameters
Type Parameter
Identifiers
Parameters
Parameter Type Description
identifiers Identifiers -
Returns

string

Inherited from

Entity.generateUuid

unserialize()

static unserialize<Identifiers>(serialized): Identifiers

Defined in: api/entities/Entity.ts:23

Unserialize a UUID into its Unique Identifiers

Type Parameters
Type Parameter
Identifiers
Parameters
Parameter Type Description
serialized string UUID to unserialize
Returns

Identifiers

Inherited from

Entity.unserialize

Interfaces

HumanReadable

Defined in: api/entities/Checkpoint.ts:27

Properties

assetId

assetId: string

Defined in: api/entities/Checkpoint.ts:29

id

id: string

Defined in: api/entities/Checkpoint.ts:28


UniqueIdentifiers

Defined in: api/entities/Checkpoint.ts:22

Properties

assetId

assetId: string

Defined in: api/entities/Checkpoint.ts:24

id

id: BigNumber

Defined in: api/entities/Checkpoint.ts:23

⚠️ **GitHub.com Fallback** ⚠️