ekzyis 2cf0f1d268
Update NDK to v2.12.2 (#2041)
* Update NDK to v2.12.2

* Fix NWC with @nostr-dev-kit/ndk-wallet

* Add test for nip-57 zap receipts
2025-04-02 17:20:47 -05:00

15 lines
506 B
JavaScript

import { supportedMethods, nwcTryRun } from '@/wallets/nwc'
export * from '@/wallets/nwc'
export async function testSendPayment ({ nwcUrl }, { signal }) {
const supported = await supportedMethods(nwcUrl, { signal })
if (!supported.includes('pay_invoice')) {
throw new Error('pay_invoice not supported')
}
}
export async function sendPayment (bolt11, { nwcUrl }, { signal }) {
const result = await nwcTryRun(nwc => nwc.lnPay({ pr: bolt11 }), { nwcUrl }, { signal })
return result.preimage
}