Timer
swapchain documentation › Timer
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:
Name | Type | Description |
---|---|---|
blockSequence | number | - |
network | string | - |
BitcoinAPIConstructor | BitcoinAPIConstructor |
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:
Name | Type | Default | Description |
---|---|---|---|
blockHeightDifference | number | 10 | The number of blocks to calculate mean. |
Returns: Promise‹number›
Bitshares timelock in seconds.