[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: fix tests and added addExchan
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: fix tests and added addExchange |
Date: |
Wed, 13 Oct 2021 13:29:48 +0200 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new e227fa4e fix tests and added addExchange
e227fa4e is described below
commit e227fa4e47a86c368011b063d3ac5ec005dc7652
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Oct 13 06:40:16 2021 -0300
fix tests and added addExchange
---
packages/taler-wallet-webextension/src/NavigationBar.tsx | 2 +-
.../src/wallet/ManualWithdrawPage.tsx | 8 +++++++-
packages/taler-wallet-webextension/src/wxApi.ts | 13 +++++++++++++
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx
b/packages/taler-wallet-webextension/src/NavigationBar.tsx
index 5345e3ba..7039808d 100644
--- a/packages/taler-wallet-webextension/src/NavigationBar.tsx
+++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx
@@ -48,7 +48,7 @@ export enum Pages {
pay = '/pay',
refund = '/refund',
- tips = '/tips',
+ tips = '/tip',
withdraw = '/withdraw',
}
diff --git
a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
index 35cea2b9..dcc0002e 100644
--- a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
@@ -38,7 +38,13 @@ export function ManualWithdrawPage({ }: Props): VNode {
try {
const r = await fetch(`${exchange}/keys`)
const j = await r.json()
- setCurrency(j.currency)
+ if (j.currency) {
+ await wxApi.addExchange({
+ exchangeBaseUrl: `${exchange}/`,
+ forceUpdate: true
+ })
+ setCurrency(j.currency)
+ }
} catch (e) {
setError('The exchange url seems invalid')
setCurrency(undefined)
diff --git a/packages/taler-wallet-webextension/src/wxApi.ts
b/packages/taler-wallet-webextension/src/wxApi.ts
index 664cc564..b40b06ad 100644
--- a/packages/taler-wallet-webextension/src/wxApi.ts
+++ b/packages/taler-wallet-webextension/src/wxApi.ts
@@ -44,6 +44,7 @@ import {
AcceptManualWithdrawalRequest,
AmountJson,
ExchangesListRespose,
+ AddExchangeRequest,
} from "@gnu-taler/taler-util";
import { AddBackupProviderRequest, BackupProviderState, OperationFailedError,
RemoveBackupProviderRequest } from "@gnu-taler/taler-wallet-core";
import { BackupInfo } from "@gnu-taler/taler-wallet-core";
@@ -326,6 +327,18 @@ export function getExchangeWithdrawalInfo(
): Promise<ExchangeWithdrawDetails> {
return callBackend("getExchangeWithdrawalInfo", req);
}
+// export const codecForAddExchangeRequest = (): Codec<AddExchangeRequest> =>
+// buildCodecForObject<AddExchangeRequest>()
+// .property("exchangeBaseUrl", codecForString())
+// .property("forceUpdate", codecOptional(codecForBoolean()))
+// .build("AddExchangeRequest");
+
+export function addExchange(
+ req: AddExchangeRequest,
+): Promise<void> {
+ return callBackend("addExchange", req);
+}
+
export function prepareTip(req: PrepareTipRequest): Promise<PrepareTipResult> {
return callBackend("prepareTip", req);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: fix tests and added addExchange,
gnunet <=