Auto renewable channels
This class is intended for automatic opening of new channels when the specified balance is reached and automatic payment from the current channel. Example: https://github.com/BIoTws/endless-channels-example
Constructor
walletId - String
timeout - Number - in ms
maxOpenChannels - Number
timeForMutualClosingChannel - Number
Example: init
const autoRenewableChannel = new AutoRenewableChannel(wallets[0], peerDeviceAddress, 20000, 2);
await autoRenewableChannel.openNewChannel({
walletId: wallets[0],
peerAddress: null,
myAmount: 100,
peerAmount: 100,
age: 10
});Example: channel approval
Events
Error
start
This event is triggered once at the start of the first channel. The event fires after approve channel.
init
init autoRenewableChannel
request_approve_channel
This event notifies us of the request to open the first channel. Contains technical information.
Structure objInfo:
peerDeviceAddress - String - peer device address for opening channel
myAddress - String - peer byteball address
peerAmount - Number - your amount in bytes
myAmount: - Number - peer amount in bytes
age - Number - Timeout in MCI for withdrawal bytes from channel when using one-side closure
id - String - channel id
myUnilateralAddress - Array - The address of the peer for signing transactions inside the channel
myDestinationAddress - Array - The address of the peer for withdrawal from the channel
changed_step
new_transfer
Last updated