addr test
This commit is contained in:
parent
0097dcc46c
commit
64ca3ea3f0
1 changed files with 11 additions and 3 deletions
12
src/index.ts
12
src/index.ts
|
|
@ -8,6 +8,8 @@ import { initMainHandler, initSettings } from './services/main/init.js';
|
||||||
import { nip19 } from 'nostr-tools'
|
import { nip19 } from 'nostr-tools'
|
||||||
import { LoadStorageSettingsFromEnv } from './services/storage/index.js';
|
import { LoadStorageSettingsFromEnv } from './services/storage/index.js';
|
||||||
import Main from './services/main/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
|
//@ts-ignore
|
||||||
const { nprofileEncode } = nip19
|
const { nprofileEncode } = nip19
|
||||||
|
|
||||||
|
|
@ -66,7 +68,13 @@ const exitHandler = async (kill: () => void) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const TMP_swapTest_TMP = async (mainHandler: Main) => {
|
const TMP_swapTest_TMP = async (mainHandler: Main) => {
|
||||||
const i = await mainHandler.lnd.NewInvoice(25000, 'test', 3600, { useProvider: false, from: 'user' })
|
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)
|
const decoded = await mainHandler.lnd.DecodeInvoice(i.payRequest)
|
||||||
await mainHandler.paymentManager.swaps.SwapInvoice(i.payRequest, decoded.paymentHash)
|
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)
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue