Function FlashAPI.proposePayment
Proposes a payment through this channel. This may be a direct payment, or an indirect routed payment. Both types of payments use this API.
abstract Result!(agora.flash.Types.PublicNonce) proposePayment
(
PublicKey sender_pk,
PublicKey recv_pk,
geod24 .bitblob .BitBlob!(64L) chan_id,
uint seq_id,
geod24 .bitblob .BitBlob!(64L) payment_hash,
Amount amount,
Height lock_height,
OnionPacket packet,
PublicNonce peer_nonce,
Height height
) @safe;
Parameters
Name | Description |
---|---|
sender_pk | the sender public key as managed by the counter-party. (note: will be used for signature authentication later) |
recv_pk | the receiving public key. If the receiving flash node does not manage this key it will return an error. |
chan_id | an existing channel ID previously opened with
openChannel() and agreed to by the counter-party. |
seq_id | the new sequence ID |
payment_hash | the hash of the secret that's included in the HTLC. The destination node reveals this value. |
amount | the amount that the sender wants to send to this node |
lock_height | the lock height of the HTLC |
packet | the encrypted packet and any further destinations |
peer_nonce | the nonce the calling peer will use |
height | the block height of the calling node. This is needed in order to properly resolve any pending HTLCs in the channel. For example, timed-out HTLCs should be replaced with a payout back to the funder. If the called node's local block height does not match the provided block height, an error will be returned. |
Returns
the nonce the receiving node will use, or an error code in case the HTLC is rejected