diff --git a/api/resolvers/wallet.js b/api/resolvers/wallet.js index 7d578cb7..a794eb4b 100644 --- a/api/resolvers/wallet.js +++ b/api/resolvers/wallet.js @@ -65,7 +65,7 @@ function injectResolvers (resolvers) { wallet, testCreateInvoice: walletDef.testCreateInvoice && validateLightning && canReceive({ def: walletDef, config: data }) - ? (data) => walletDef.testCreateInvoice(data, { logger, me, models }) + ? (data) => walletDef.testCreateInvoice(data, { logger }) : null }, { settings, diff --git a/wallets/config.js b/wallets/config.js index 7a078ab4..49e47c90 100644 --- a/wallets/config.js +++ b/wallets/config.js @@ -43,7 +43,7 @@ export function useWalletConfigurator (wallet) { clientConfig = Object.assign(clientConfig, transformedConfig) } if (wallet.def.testSendPayment && validateLightning) { - transformedConfig = await wallet.def.testSendPayment(clientConfig, { me, logger }) + transformedConfig = await wallet.def.testSendPayment(clientConfig, { logger }) if (transformedConfig) { clientConfig = Object.assign(clientConfig, transformedConfig) } diff --git a/wallets/nwc/client.js b/wallets/nwc/client.js index 0d3a9223..ea34f2c1 100644 --- a/wallets/nwc/client.js +++ b/wallets/nwc/client.js @@ -1,16 +1,16 @@ import { getNwc, supportedMethods, nwcTryRun } from '@/wallets/nwc' export * from '@/wallets/nwc' -export async function testSendPayment ({ nwcUrl }, { logger }) { +export async function testSendPayment ({ nwcUrl }) { const timeout = 15_000 - const supported = await supportedMethods(nwcUrl, { logger, timeout }) + const supported = await supportedMethods(nwcUrl, { timeout }) if (!supported.includes('pay_invoice')) { throw new Error('pay_invoice not supported') } } -export async function sendPayment (bolt11, { nwcUrl }, { logger }) { +export async function sendPayment (bolt11, { nwcUrl }) { const nwc = await getNwc(nwcUrl) const result = await nwcTryRun(() => nwc.payInvoice(bolt11)) return result.preimage diff --git a/wallets/nwc/index.js b/wallets/nwc/index.js index 6b9e40d0..7360cba5 100644 --- a/wallets/nwc/index.js +++ b/wallets/nwc/index.js @@ -63,7 +63,7 @@ export async function nwcTryRun (fun) { } } -export async function supportedMethods (nwcUrl, { logger, timeout } = {}) { +export async function supportedMethods (nwcUrl, { timeout } = {}) { const nwc = await getNwc(nwcUrl, { timeout }) const result = await nwcTryRun(() => nwc.getInfo()) return result.methods diff --git a/wallets/nwc/server.js b/wallets/nwc/server.js index e66bc1d3..bcb0201c 100644 --- a/wallets/nwc/server.js +++ b/wallets/nwc/server.js @@ -2,10 +2,10 @@ import { withTimeout } from '@/lib/time' import { getNwc, supportedMethods, nwcTryRun } from '@/wallets/nwc' export * from '@/wallets/nwc' -export async function testCreateInvoice ({ nwcUrlRecv }, { logger }) { +export async function testCreateInvoice ({ nwcUrlRecv }) { const timeout = 15_000 - const supported = await supportedMethods(nwcUrlRecv, { logger, timeout }) + const supported = await supportedMethods(nwcUrlRecv, { timeout }) const supports = (method) => supported.includes(method) @@ -20,10 +20,10 @@ export async function testCreateInvoice ({ nwcUrlRecv }, { logger }) { } } - return await withTimeout(createInvoice({ msats: 1000, expiry: 1 }, { nwcUrlRecv }, { logger }), timeout) + return await withTimeout(createInvoice({ msats: 1000, expiry: 1 }, { nwcUrlRecv }), timeout) } -export async function createInvoice ({ msats, description, expiry }, { nwcUrlRecv }, { logger }) { +export async function createInvoice ({ msats, description, expiry }, { nwcUrlRecv }) { const nwc = await getNwc(nwcUrlRecv) const result = await nwcTryRun(() => nwc.sendReq('make_invoice', { amount: msats, description, expiry })) return result.invoice