Channels manager

list

Returns list of channels from database

const ChannelsManager = require('biot-core/lib/ChannelsManager');

const channelsManager = new ChannelsManager(wallets[0], timeout);
let list = await channelsManager.list();

newChannel

Create new channel

const ChannelsManager = require('biot-core/lib/ChannelsManager');
let channel = channelsManager.newChannel({
			peerDeviceAddress,
			myAmount: 100,
			peerAmount: 100,
			age: 10
		});
channel.init();

Event: New channel

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

Last updated