PersonalLeaseNodeProvider
@totemsdk/wots-lease / PersonalLeaseNodeProvider
Class: PersonalLeaseNodeProvider
Layer 3 — personal lookup-node lease coordinator.
Calls the HTTP REST API exposed by a running @totemsdk/lookup-node that has lease coordination enabled. All write operations are forwarded to the node's LeaseCoordinator so the node acts as the source-of-truth watermark journal for high-value transactions.
Wrap with HybridLeaseProvider so local reservations always succeed even when the personal node is temporarily unreachable:
const provider = new HybridLeaseProvider({
local: new LocalLeaseProvider(storage),
node: new PersonalLeaseNodeProvider({ nodeUrl, nodePubkey }),
threshold: 10, // escalate to node for txns >= 10 MIN
});
Implements
Constructors
Constructor
new PersonalLeaseNodeProvider(
config):PersonalLeaseNodeProvider
Parameters
config
Returns
PersonalLeaseNodeProvider
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
publishWatermark()
publishWatermark(
treeId):Promise<void>
Parameters
treeId
string
Returns
Promise<void>
Implementation of
WotsLeaseProvider.publishWatermark
reserveKeyUse()
reserveKeyUse(
params):Promise<LeaseReservation>
Parameters
params
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?
Returns
Promise<boolean>