From 64ca3ea3f076a77077c5ceb3e20ed05f268cf951 Mon Sep 17 00:00:00 2001 From: boufni95 Date: Tue, 4 Nov 2025 18:16:57 +0000 Subject: [PATCH] addr test --- src/index.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 40f05ef0..09a9d5dd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,8 @@ import { initMainHandler, initSettings } from './services/main/init.js'; import { nip19 } from 'nostr-tools' import { LoadStorageSettingsFromEnv } from './services/storage/index.js'; import Main from './services/main/index.js'; +import * as Types from '../proto/autogenerated/ts/types.js'; +import { networks } from 'bitcoinjs-lib'; //@ts-ignore const { nprofileEncode } = nip19 @@ -66,7 +68,13 @@ const exitHandler = async (kill: () => void) => { } const TMP_swapTest_TMP = async (mainHandler: Main) => { - const i = await mainHandler.lnd.NewInvoice(25000, 'test', 3600, { useProvider: false, from: 'user' }) - const decoded = await mainHandler.lnd.DecodeInvoice(i.payRequest) - await mainHandler.paymentManager.swaps.SwapInvoice(i.payRequest, decoded.paymentHash) + await new Promise(resolve => setTimeout(resolve, 10000)) + /* const i = await mainHandler.lnd.NewInvoice(25000, 'test', 3600, { useProvider: true, from: 'user' }) + console.log('Invoice created with provider destination', i.providerDst) + const decoded = await mainHandler.lnd.DecodeInvoice(i.payRequest) + await mainHandler.paymentManager.swaps.SwapInvoice(i.payRequest, decoded.paymentHash) */ + const a = await mainHandler.lnd.NewAddress(Types.AddressType.WITNESS_PUBKEY_HASH, { useProvider: false, from: 'user' }) + console.log('Address created', a.address) + await mainHandler.paymentManager.swaps.SwapTransaction(a.address, 25000, networks.bitcoin) + } \ No newline at end of file