diff --git a/wallets/graphql.js b/wallets/graphql.js index b39b6ebd..d46c86f4 100644 --- a/wallets/graphql.js +++ b/wallets/graphql.js @@ -1,6 +1,8 @@ import gql from 'graphql-tag' import { isServerField } from './common' -import { WALLET_FIELDS } from '@/fragments/wallet' +// for some reason, this is needed to make the import work from worker +import * as walletFragments from '@/fragments/wallet' +const { WALLET_FIELDS } = walletFragments export function fieldToGqlArg (field) { let arg = `${field.name}: String` diff --git a/wallets/server.js b/wallets/server.js index 26894041..b57c55ba 100644 --- a/wallets/server.js +++ b/wallets/server.js @@ -40,9 +40,9 @@ export async function createInvoice (userId, { msats, description, descriptionHa msats = toPositiveNumber(msats) for (const wallet of wallets) { - const w = walletDefs.find(w => w.walletType === wallet.def.walletType) + const w = walletDefs.find(w => w.walletType === wallet.type) try { - if (!canReceive({ def: w, config: wallet })) { + if (!canReceive({ def: w, config: wallet.wallet })) { continue }