diff --git a/src/daemon/wallet/index.ts b/src/daemon/wallet/index.ts index c021122..6a64d0a 100644 --- a/src/daemon/wallet/index.ts +++ b/src/daemon/wallet/index.ts @@ -1,4 +1,5 @@ import { getDecodedToken } from "@cashu/cashu-ts"; +import { InsufficientBalanceError } from "@routstr/sdk"; import { logger } from "../../utils/logger"; import { createCocodClient, type CocodClient } from "./cocod-client"; @@ -79,6 +80,10 @@ export async function createWalletAdapter( continue; } + if (errorMessage.includes("Not enough proofs")) { + throw new InsufficientBalanceError(amount, 0); + } + logger.error("Error in walletAdapter sendToken:", error); throw error; }