Timer

swapchain documentationTimer

Handler to transform timelocks between blockchains.

Hierarchy

  • Timer

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Timer(blockSequence: number, network: string, BitcoinAPIConstructor: BitcoinAPIConstructor): Timer

Defined in pkg/accs/timer.ts:9

Creates an instance of Timer

Parameters:

NameTypeDescription
blockSequencenumber-
networkstring-
BitcoinAPIConstructorBitcoinAPIConstructor

Returns: Timer

Properties

Private bitcoinAPI

bitcoinAPI: BitcoinAPI

Defined in pkg/accs/timer.ts:8


Private blockSequence

blockSequence: number

Defined in pkg/accs/timer.ts:9

Methods

toBTC

toBTC(): number

Defined in pkg/accs/timer.ts:34

Get Bitcoin timelock.

Returns: number

Bitcoin timelock in number of blocks.


toBTS

toBTS(blockHeightDifference: number): Promise‹number›

Defined in pkg/accs/timer.ts:44

Calculate Bitshares timelock based on bitcoin blockchain mining speed.

Parameters:

NameTypeDefaultDescription
blockHeightDifferencenumber10The number of blocks to calculate mean.

Returns: Promise‹number›

Bitshares timelock in seconds.