Interface FlashControlAPI

interface FlashControlAPI
  : FlashAPI
  , agora.api.Handlers.BlockExternalizedHandler ;

Methods

NameDescription
beginCollaborativeClose (reg_pk, chan_id) Begin a collaborative closure of a channel with the counter-party for the given channel ID.
beginUnilateralClose (reg_pk, chan_id) If the counter-party rejects a collaborative closure, the wallet may initiate a unilateral closure of the channel.
createNewInvoice (reg_pk, amount, expiry, description) Create an invoice that can be paid by another party. A preimage is shared through a secure channel to the party which will pay the invoice. The hash of the preimage is used in the contract, which is then shared across zero or more channel hops. The invoice payer must reveal their preimage to prove.
getChannelInfo (chan_ids) Get the list of managed channels.
getManagedChannels (keys) Get the list of managed channels.
openNewChannel (funding_utxo, funding_utxo_hash, capacity, settle_time, peer_pk, is_private, peer_address) Schedule opening a new channel with another flash node. If this funding_utxo is already used, an error is returned. Otherwise, the Listener will receive a notification through the onChannelNotify() API at a later point whenever the channel is accepted / rejected by the counter-party.
payInvoice (reg_pk, invoice) Attempt to find a payment path for the invoice and pay for the invoice.
registerKey (secret) Register the given secret key as being managed by the Flash node.
start () Start the Flash node. This starts internal timers such as the periodic name registry timer.
closeChannel (sender_pk, recv_pk, chan_id, seq_id, peer_nonce, fee) Requests collaboratively closing an existing channel with this peer.
confirmChannelUpdate (sender_pk, recv_pk, chan_id, seq_id) Called by the peer when it has finished collecting the settlement & update transactions. It signals to the called node that the peer is ready for any new payments / updates.
gossipChannelsOpen (opens) Gossips open channels to this node.
gossipChannelUpdates (chan_updates) Gossips channels attribute updates to this node.
openChannel (chan_conf, peer_nonce, funder_address) Requests opening a channel with the provided peer, if it's managed by this Flash node.
proposePayment (sender_pk, recv_pk, chan_id, seq_id, payment_hash, amount, lock_height, packet, peer_nonce, height) Proposes a payment through this channel. This may be a direct payment, or an indirect routed payment. Both types of payments use this API.
proposeUpdate (sender_pk, recv_pk, chan_id, seq_id, secrets, rev_htlcs, peer_nonce, height) Proposes updating the channel by resolving all pending HTLCs with the secrets the counter-party offers.
reportPaymentError (recv_pk, chan_id, err) Report a failed payment
requestCloseSig (sender_pk, recv_pk, chan_id, seq_id) Requests a closing signature for an established channel and a previously agreed-upon closeChannel request with the given sequence ID.
requestSettleSig (sender_pk, recv_pk, chan_id, seq_id) Requests a settlement signature for an established channel and a previously agreed-upon balance update's sequence ID as set through the proposePayment / proposeUpdate call.
requestUpdateSig (sender_pk, recv_pk, chan_id, seq_id) Requests an update signature for an established channel and a previously agreed-upon balance update's sequence ID as set through the proposePayment / proposeUpdate call.