From 569fe76488961a962c846ea8b4652e347224ac34 Mon Sep 17 00:00:00 2001 From: Matthew Black Date: Tue, 7 Oct 2025 23:09:14 -0500 Subject: [PATCH] compat: Value & Amount constructs public for Redux - change protected _picoSats to public _picoSats in Value class - change protected constructor to public constructor in Value class - change private constructor to public constructor in Amount class - enables Immer proxy compatibility for Redux state management - maintains all existing functionality and API surface - allows direct usage in React/Redux applications without type casting --- packages/bitcoin/lib/Amount.ts | 2 +- packages/bitcoin/lib/Value.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bitcoin/lib/Amount.ts b/packages/bitcoin/lib/Amount.ts index 5d673395..e21900f6 100644 --- a/packages/bitcoin/lib/Amount.ts +++ b/packages/bitcoin/lib/Amount.ts @@ -43,7 +43,7 @@ export class Amount extends Value { return Number(this.sats) / 1e8; } - private constructor(picoSats: bigint) { + public constructor(picoSats: bigint) { super(picoSats); } diff --git a/packages/bitcoin/lib/Value.ts b/packages/bitcoin/lib/Value.ts index b1513b30..3c9e0af9 100644 --- a/packages/bitcoin/lib/Value.ts +++ b/packages/bitcoin/lib/Value.ts @@ -62,7 +62,7 @@ export class Value implements ICloneable { return new Value(BigInt(0)); } - protected _picoSats: bigint; + public _picoSats: bigint; /** * Gets the value in picosatoshis (1/1e12 satoshis) @@ -99,7 +99,7 @@ export class Value implements ICloneable { return Math.max(0, Number(this.sats) / 1e8); } - protected constructor(picoSats: bigint) { + public constructor(picoSats: bigint) { this._picoSats = picoSats; }