From f2e98cd81a08dc05a23d9a20641ab11d91f91259 Mon Sep 17 00:00:00 2001 From: Jakob Notland Date: Wed, 29 Apr 2026 13:17:21 +0200 Subject: [PATCH 1/2] TxSummary --- packages/core/src/protocols/hdwalletv1.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/core/src/protocols/hdwalletv1.ts b/packages/core/src/protocols/hdwalletv1.ts index b12b173..e0e6f36 100644 --- a/packages/core/src/protocols/hdwalletv1.ts +++ b/packages/core/src/protocols/hdwalletv1.ts @@ -134,11 +134,27 @@ export interface ErrorMessage extends ProtocolMessage { error: string; } +export interface TxSummaryTokenChange { + categoryId: string; // hex token category ID + fungibleAmount: string; // signed bigint as string (negative = spending, positive = receiving) + nftCount?: number; + symbol?: string; + decimals?: number; +} + +export interface TxSummary { + netBchSats: string; // signed bigint as string (negative = spending, positive = receiving) + tokenChanges: TxSummaryTokenChange[]; +} + export interface SignTransactionRequest extends ProtocolMessage { action: RelayMsgAction.SignTransactionRequest; transaction: WcSignTransactionRequest; sequence: number; inputPaths: [number, PathName, number][]; // [inputIndex, pathName, addressIndex] + /// Dapp-provided transaction summary. Wallets should use this for display + /// when present rather than parsing the raw transaction themselves. + txSummary?: TxSummary; } export interface SignTransactionResponse extends ProtocolMessage { From 2267bdb62cd7bfd5a9c7acd0a390a27f39794f35 Mon Sep 17 00:00:00 2001 From: Jakob Notland Date: Wed, 29 Apr 2026 13:21:06 +0200 Subject: [PATCH 2/2] Lint --- packages/core/src/protocols/hdwalletv1.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/protocols/hdwalletv1.ts b/packages/core/src/protocols/hdwalletv1.ts index e0e6f36..dadf335 100644 --- a/packages/core/src/protocols/hdwalletv1.ts +++ b/packages/core/src/protocols/hdwalletv1.ts @@ -135,8 +135,8 @@ export interface ErrorMessage extends ProtocolMessage { } export interface TxSummaryTokenChange { - categoryId: string; // hex token category ID - fungibleAmount: string; // signed bigint as string (negative = spending, positive = receiving) + categoryId: string; // hex token category ID + fungibleAmount: string; // signed bigint as string (negative = spending, positive = receiving) nftCount?: number; symbol?: string; decimals?: number;