Skip to main content

OnchainWatermarkProvider

@totemsdk/wots-lease


@totemsdk/wots-lease / OnchainWatermarkProvider

Class: OnchainWatermarkProvider

Implements​

Constructors​

Constructor​

new OnchainWatermarkProvider(config): OnchainWatermarkProvider

Parameters​

config​

OnchainWatermarkProviderConfig

Returns​

OnchainWatermarkProvider

Methods​

burnReservation()​

burnReservation(reservationId, reason): Promise<void>

Parameters​

reservationId​

string

reason​

string

Returns​

Promise<void>

Implementation of​

WotsLeaseProvider.burnReservation


commitKeyUse()​

commitKeyUse(reservationId, txId): Promise<void>

Parameters​

reservationId​

string

txId​

string

Returns​

Promise<void>

Implementation of​

WotsLeaseProvider.commitKeyUse


getLocalWatermark()​

getLocalWatermark(treeId): Promise<LocalWatermark>

Parameters​

treeId​

string

Returns​

Promise<LocalWatermark>

Implementation of​

WotsLeaseProvider.getLocalWatermark


initialize()​

initialize(): Promise<void>

Returns​

Promise<void>


publishWatermark()​

publishWatermark(treeId): Promise<void>

Publish the local watermark cursor on-chain by spending the watermark coin back to itself with STATE(statePort) = flat cursor.

Rate-limited by minBlocksBetweenPublishes using the chain tip.

Parameters​

treeId​

string

Returns​

Promise<void>

Implementation of​

WotsLeaseProvider.publishWatermark


reserveKeyUse()​

reserveKeyUse(params): Promise<LeaseReservation>

Parameters​

params​

ReserveParams

Returns​

Promise<LeaseReservation>

Implementation of​

WotsLeaseProvider.reserveKeyUse


syncLeaseJournal()​

syncLeaseJournal(): Promise<SyncResult>

Returns​

Promise<SyncResult>

Implementation of​

WotsLeaseProvider.syncLeaseJournal


verifyLeaseCertificate()​

verifyLeaseCertificate(cert?): Promise<boolean>

Parameters​

cert?​

LeaseCertificate

Returns​

Promise<boolean>

Implementation of​

WotsLeaseProvider.verifyLeaseCertificate