UNPKG

lightningdevkit

Version:
46 lines 1.56 kB
import { UnauthenticatedReceiveTlvs } from '../structs/UnauthenticatedReceiveTlvs.mjs'; import { CommonBase } from './CommonBase.mjs'; import * as bindings from '../bindings.mjs'; /** * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and * may not be valid if received by another lightning implementation. * * Can only be constructed by calling [`UnauthenticatedReceiveTlvs::authenticate`]. */ export class ReceiveTlvs extends CommonBase { /* @internal */ constructor(_dummy, ptr) { super(ptr, bindings.ReceiveTlvs_free); } clone_ptr() { const ret = bindings.ReceiveTlvs_clone_ptr(this.ptr); return ret; } /** * Creates a copy of the ReceiveTlvs */ clone() { const ret = bindings.ReceiveTlvs_clone(this.ptr); const ret_hu_conv = new ReceiveTlvs(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * Returns the underlying TLVs. */ tlvs() { const ret = bindings.ReceiveTlvs_tlvs(this.ptr); const ret_hu_conv = new UnauthenticatedReceiveTlvs(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read */ write() { const ret = bindings.ReceiveTlvs_write(this.ptr); const ret_conv = bindings.decodeUint8Array(ret); return ret_conv; } } //# sourceMappingURL=ReceiveTlvs.mjs.map