diff options
author | Sebastian <sebasjm@gmail.com> | 2022-03-24 16:02:38 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-03-24 16:02:38 -0300 |
commit | f45ef767016a425d04cce7755b27aceff292603c (patch) | |
tree | 8e6e2aa47bf282d3db08f54264f2c9db2179ba90 /packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx | |
parent | 2c6b83ffea8d7b898d7ccb52b2b026c2e4ba6f24 (diff) | |
download | wallet-core-f45ef767016a425d04cce7755b27aceff292603c.tar.xz |
esbuild configuration
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx index 05c518508..bea8f0029 100644 --- a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx @@ -19,6 +19,8 @@ import { AmountJson, Amounts, NotificationType, + parsePaytoUri, + PaytoUri, } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; @@ -41,6 +43,8 @@ export function ManualWithdrawPage({ currency, onCancel }: Props): VNode { response: AcceptManualWithdrawalResult; exchangeBaseUrl: string; amount: AmountJson; + paytoURI: PaytoUri | undefined; + payto: string; } | undefined >(undefined); @@ -60,7 +64,12 @@ export function ManualWithdrawPage({ currency, onCancel }: Props): VNode { exchangeBaseUrl, Amounts.stringify(amount), ); - setSuccess({ exchangeBaseUrl, response, amount }); + const payto = response.exchangePaytoUris[0]; + const paytoURI = parsePaytoUri(payto); + if (paytoURI && paytoURI.isKnown && paytoURI.targetType === "bitcoin") { + paytoURI.generateSegwitAddress(response.reservePub); + } + setSuccess({ exchangeBaseUrl, response, amount, paytoURI, payto }); } catch (e) { if (e instanceof Error) { setError(e.message); @@ -75,7 +84,8 @@ export function ManualWithdrawPage({ currency, onCancel }: Props): VNode { return ( <ReserveCreated reservePub={success.response.reservePub} - payto={success.response.exchangePaytoUris[0]} + paytoURI={success.paytoURI} + payto={success.payto} exchangeBaseUrl={success.exchangeBaseUrl} amount={success.amount} onCancel={onCancel} |