BitsharesHTLC
swapchain documentation › BitsharesHTLC
Handler to create HTLCs on the bitshares blockchain using a specified node.
Hierarchy
- BitsharesHTLC
Index
Constructors
Properties
Methods
Constructors
constructor
+ new BitsharesHTLC(node
: string, senderID
: string, receiverID
: string): BitsharesHTLC
Defined in pkg/bitshares/htlc/btsHTLC.ts:56
Creates an instance of BitsharesHTLC.
memberof
BitsharesHTLC
Parameters:
Name | Type | Description |
---|---|---|
node | string | The Bitshares node you want to connect to. |
senderID | string | The account that is creating the transaction. |
receiverID | string | The receiving account. |
Returns: BitsharesHTLC
Properties
Private
node
• node: string
Defined in pkg/bitshares/htlc/btsHTLC.ts:54
Private
receiverID
• receiverID: string
Defined in pkg/bitshares/htlc/btsHTLC.ts:56
Private
senderID
• senderID: string
Defined in pkg/bitshares/htlc/btsHTLC.ts:55
Methods
Private
create
▸ create(config
: HTLCConfig): Promise‹boolean›
Defined in pkg/bitshares/htlc/btsHTLC.ts:79
Create and send the actual HTLC.
memberof
BitsharesHTLC
Parameters:
Name | Type | Description |
---|---|---|
config | HTLCConfig | Configuration object for the HTLC. |
Returns: Promise‹boolean›
Success status. Can be used for user feedback.
Private
redeem
▸ redeem(amount
: number, privateKey
: string, secret
: Secret): Promise‹boolean›
Defined in pkg/bitshares/htlc/btsHTLC.ts:117
Redeem the actual HTLC.
Never call this function directly but use redeem()
instead.
That's because the websocket must be open before redeeming an HTLC.
memberof
BitsharesHTLC
Parameters:
Name | Type | Description |
---|---|---|
amount | number | The amount of assets of the HTLC. |
privateKey | string | Private key of the redeemer in WIF format. |
secret | Secret | A secret object with the correct preimage. |
Returns: Promise‹boolean›
Success status. Can be used for user feedback.