use new segwit impl

This commit is contained in:
Sebastian 2022-03-03 17:49:59 -03:00
parent 7d8acca7f9
commit 245f584fb1
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1
2 changed files with 30 additions and 2 deletions

View File

@ -63,3 +63,28 @@ export const Bitcoin = createExample(TestedComponent, {
},
exchangeBaseUrl: "https://exchange.demo.taler.net",
});
export const BitcoinRegTest = createExample(TestedComponent, {
reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
payto:
"payto://bitcoin/bcrt1q6ps8qs6v8tkqrnru4xqqqa6rfwcx5ufpdfqht4?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
amount: {
currency: "BTC",
value: 0,
fraction: 14000000,
},
exchangeBaseUrl: "https://exchange.demo.taler.net",
});
export const BitcoinTest = createExample(TestedComponent, {
reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
payto:
"payto://bitcoin/tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
amount: {
currency: "BTC",
value: 0,
fraction: 14000000,
},
exchangeBaseUrl: "https://exchange.demo.taler.net",
});
// tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx OK
// tb10v8ahvcqqleage3q5rqn3agnr7pd25msd5wd4hcj

View File

@ -2,9 +2,9 @@ import {
AmountJson,
parsePaytoUri,
i18n,
generateSegwitAddress,
Amounts,
segwitMinAmount,
generateFakeSegwitAddress,
} from "@gnu-taler/taler-util";
import { Fragment, h, VNode } from "preact";
import { BankDetailsByPaytoType } from "../components/BankDetailsByPaytoType";
@ -40,7 +40,10 @@ export function ReserveCreated({
function TransferDetails(): VNode {
if (!paytoURI) return <Fragment />;
if (paytoURI.targetType === "bitcoin") {
const { segwitAddr1, segwitAddr2 } = generateSegwitAddress(reservePub);
const { segwitAddr1, segwitAddr2 } = generateFakeSegwitAddress(
reservePub,
paytoURI.targetPath,
);
const min = segwitMinAmount();
return (
<section>