diff --git a/ironfish/src/rpc/routes/wallet/sendTransaction.test.ts b/ironfish/src/rpc/routes/wallet/sendTransaction.test.ts index 647049cb15..eab572a5d5 100644 --- a/ironfish/src/rpc/routes/wallet/sendTransaction.test.ts +++ b/ironfish/src/rpc/routes/wallet/sendTransaction.test.ts @@ -158,7 +158,6 @@ describe('Transactions sendTransaction', () => { await expect(routeTest.client.sendTransaction(TEST_PARAMS)).rejects.toThrow( expect.objectContaining({ - message: expect.stringContaining('Your balance changed while creating a transaction.'), status: 400, code: ERROR_CODES.INSUFFICIENT_BALANCE, }), diff --git a/ironfish/src/rpc/routes/wallet/sendTransaction.ts b/ironfish/src/rpc/routes/wallet/sendTransaction.ts index 48e00c245d..fcb5be3106 100644 --- a/ironfish/src/rpc/routes/wallet/sendTransaction.ts +++ b/ironfish/src/rpc/routes/wallet/sendTransaction.ts @@ -159,7 +159,7 @@ router.register( } catch (e) { if (e instanceof NotEnoughFundsError) { throw new ValidationError( - `Your balance changed while creating a transaction.`, + `Not enough unspent notes available to fund the transaction. Please wait for any pending transactions to be confirmed.`, 400, ERROR_CODES.INSUFFICIENT_BALANCE, ) diff --git a/ironfish/src/wallet/errors.ts b/ironfish/src/wallet/errors.ts index ae8d878db7..c681c188dc 100644 --- a/ironfish/src/wallet/errors.ts +++ b/ironfish/src/wallet/errors.ts @@ -13,6 +13,8 @@ export class NotEnoughFundsError extends Error { amountNeeded, true, assetId.toString('hex'), - )} but have '${CurrencyUtils.renderIron(amount)}'` + )} but have '${CurrencyUtils.renderIron( + amount, + )} available to spend. Please fund your account and/or wait for any pending transactions to be confirmed.'` } }