From fdeaab01518b85589c8599dbf4768e3cfb73299d Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 6 Nov 2024 08:50:21 +0100 Subject: [PATCH] Fix displaying negative allowance changes --- src/vendors/nexus.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vendors/nexus.ts b/src/vendors/nexus.ts index 0f4c597bc3..e2ebd82df8 100644 --- a/src/vendors/nexus.ts +++ b/src/vendors/nexus.ts @@ -275,7 +275,10 @@ function parseTransactionsList(list: (NexusTransaction | ExtendedRuntimeTransact const parsed: Transaction = { amount: (t.body as { amount?: StringifiedBigInt })?.amount || - (t.body as { amount_change?: StringifiedBigInt })?.amount_change || + ((t.body as { amount_change?: StringifiedBigInt })?.amount_change && + ((t.body as { negative?: boolean })?.negative + ? `-${(t.body as { amount_change?: StringifiedBigInt }).amount_change}` + : (t.body as { amount_change?: StringifiedBigInt }).amount_change)) || undefined, fee: t.fee, from: t.sender,