3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export class BroadcasterInterface extends CommonBase {
10 bindings_instance?: bindings.LDKBroadcasterInterface;
12 constructor(ptr?: number, arg?: bindings.LDKBroadcasterInterface) {
13 if (Number.isFinite(ptr)) {
15 this.bindings_instance = null;
17 // TODO: private constructor instantiation
18 super(bindings.LDKBroadcasterInterface_new(arg));
19 this.ptrs_to.push(arg);
24 protected finalize() {
26 bindings.BroadcasterInterface_free(this.ptr);
31 static new_impl(arg: BroadcasterInterfaceInterface): BroadcasterInterface {
32 const impl_holder: LDKBroadcasterInterfaceHolder = new LDKBroadcasterInterfaceHolder();
33 let structImplementation = <bindings.LDKBroadcasterInterface>{
34 // todo: in-line interface filling
35 broadcast_transaction (tx: Uint8Array): void {
36 arg.broadcast_transaction(tx);
41 impl_holder.held = new BroadcasterInterface (null, structImplementation);
45 export interface BroadcasterInterfaceInterface {
46 broadcast_transaction(tx: Uint8Array): void;
50 class LDKBroadcasterInterfaceHolder {
51 held: BroadcasterInterface;
53 public void broadcast_transaction(Uint8Array tx) {
54 bindings.BroadcasterInterface_broadcast_transaction(this.ptr, tx);