lightningdevkit
Version:
Lightning Development Kit
36 lines • 1.33 kB
JavaScript
import { MessageSendInstructions } from '../structs/MessageSendInstructions.mjs';
import { CommonBase } from './CommonBase.mjs';
import * as bindings from '../bindings.mjs';
/**
* Instructions for how and where to send the response to an onion message.
*/
export class ResponseInstruction extends CommonBase {
/* @internal */
constructor(_dummy, ptr) {
super(ptr, bindings.ResponseInstruction_free);
}
clone_ptr() {
const ret = bindings.ResponseInstruction_clone_ptr(this.ptr);
return ret;
}
/**
* Creates a copy of the ResponseInstruction
*/
clone() {
const ret = bindings.ResponseInstruction_clone(this.ptr);
const ret_hu_conv = new ResponseInstruction(null, ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
}
/**
* Converts this [`ResponseInstruction`] into a [`MessageSendInstructions`] so that it can be
* used to send the response via a normal message sending method.
*/
into_instructions() {
const ret = bindings.ResponseInstruction_into_instructions(this.ptr);
const ret_hu_conv = MessageSendInstructions.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
}
}
//# sourceMappingURL=ResponseInstruction.mjs.map