diff options
author | Florian Dold <florian@dold.me> | 2024-03-05 17:41:52 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-03-05 17:41:52 +0100 |
commit | f9c45391bed222b4ebbedc376a30e44051d2a649 (patch) | |
tree | 43868f9a2fd6fc0da989f6d1742f1a859821c9ab /packages/taler-wallet-core/src/wallet.ts | |
parent | 9fb6e73900bc80bab70ff0d7e2789913373cc360 (diff) | |
download | wallet-core-f9c45391bed222b4ebbedc376a30e44051d2a649.tar.xz |
cleanup
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 28d54fde3..b9d277cf0 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -71,7 +71,7 @@ import { codecForAbortTransaction, codecForAcceptBankIntegratedWithdrawalRequest, codecForAcceptExchangeTosRequest, - codecForAcceptManualWithdrawalRequet, + codecForAcceptManualWithdrawalRequest, codecForAcceptPeerPullPaymentRequest, codecForAddExchangeRequest, codecForAddGlobalCurrencyAuditorRequest, @@ -848,7 +848,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( }); } case WalletApiOperation.AcceptManualWithdrawal: { - const req = codecForAcceptManualWithdrawalRequet().decode(payload); + const req = codecForAcceptManualWithdrawalRequest().decode(payload); const res = await createManualWithdrawal(wex, { amount: Amounts.parseOrThrow(req.amount), exchangeBaseUrl: req.exchangeBaseUrl, @@ -869,7 +869,6 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( for (const x of wi.selectedDenoms.selectedDenoms) { numCoins += x.count; } - const amt = Amounts.parseOrThrow(req.amount); const resp: WithdrawalDetailsForAmount = { amountRaw: req.amount, amountEffective: Amounts.stringify(wi.selectedDenoms.totalCoinValue), @@ -1802,26 +1801,3 @@ export class InternalWalletState { } } } - -/** - * Take the full object as template, create a new result with all the values. - * Use the override object to change the values in the result - * return result - * @param full - * @param override - * @returns - */ -function deepMerge<T extends object>(full: T, override: object): T { - const keys = Object.keys(full); - const result = { ...full }; - for (const k of keys) { - // @ts-ignore - const newVal = override[k]; - if (newVal === undefined) continue; - // @ts-ignore - result[k] = - // @ts-ignore - typeof newVal === "object" ? deepMerge(full[k], newVal) : newVal; - } - return result; -} |