taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 4ed9bd5d575c00585986977b7966840eaa0ef210
parent faa8988913166c60a106ada3f81270e0ec2423cb
Author: Florian Dold <florian@dold.me>
Date:   Wed, 22 Jul 2026 00:08:01 +0200

fix bitcoin payto error rendering

Diffstat:
Mpackages/taler-exchange-aml-webui/src/pages/Search.tsx | 9++++++++-
Mpackages/taler-util/src/bech32.ts | 12++++++------
2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/packages/taler-exchange-aml-webui/src/pages/Search.tsx b/packages/taler-exchange-aml-webui/src/pages/Search.tsx @@ -51,6 +51,7 @@ import { } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; +import { BitcoinSewgit } from "../../../taler-util/src/segwit_addr.js"; import { HandleSessionNotReady } from "../components/HandleAccountNotReady.js"; import { useAccountDecisions } from "../hooks/decisions.js"; import { useOfficer } from "../hooks/officer.js"; @@ -556,7 +557,9 @@ function translateReservePubError( } function translateBitcoinError( - result: BitcoinBech32.BitcoinParseError, + result: + | BitcoinBech32.BitcoinParseError + | BitcoinSewgit.BitcoinSewgitParseError, i18n: InternationalizationAPI, ): TranslatedString { switch (result) { @@ -572,6 +575,10 @@ function translateBitcoinError( return i18n.str`Address should have less than 90 characters.`; case BitcoinBech32.BitcoinParseError.TOO_SHORT: return i18n.str`Address should have more than 6 characters.`; + case BitcoinSewgit.BitcoinSewgitParseError.DECODING_PROBLEM: + return i18n.str`Decoding issue.`; + case BitcoinSewgit.BitcoinSewgitParseError.INVALID_DATA: + return i18n.str`Invalid data`; } } diff --git a/packages/taler-util/src/bech32.ts b/packages/taler-util/src/bech32.ts @@ -109,24 +109,24 @@ export namespace BitcoinBech32 { /** * Charset can only be from BECH32 */ - WRONG_CHARSET, + WRONG_CHARSET = "wrong-charset", /** * All uppercased or all lowercased */ - MIXING_UPPER_AND_LOWER, + MIXING_UPPER_AND_LOWER = "mixing-upper-and-lower", /** * Separator is a '1' between addr and addrtype */ - MISSING_HRP, + MISSING_HRP = "missing-hrp", /** * Should be less or equal to 90 chars */ - TOO_LONG, + TOO_LONG = "too-long", /** * Addr should be greater or equal to 6 chars */ - TOO_SHORT, - WRONG_CHECKSUM, + TOO_SHORT = "too-short", + WRONG_CHECKSUM = "wrong-checksum", } /**