diff options
author | Florian Dold <florian@dold.me> | 2024-01-16 13:15:40 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-01-16 13:15:40 +0100 |
commit | 1c286ebb2f1c817f5362517d47466c39826c8699 (patch) | |
tree | c0cfcee641529032ee06674b943036fe5c0a7cef /packages/taler-wallet-core/src/wallet.ts | |
parent | 2e2cf4049a771c82fcc520686de3ace7603baa05 (diff) | |
download | wallet-core-1c286ebb2f1c817f5362517d47466c39826c8699.tar.xz |
wallet-core: implement remaining DD48 calls, test
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 1a876b2c8..3294e2a09 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -73,6 +73,7 @@ import { codecForConfirmPeerPushPaymentRequest, codecForConvertAmountRequest, codecForCreateDepositGroupRequest, + codecForDeleteExchangeRequest, codecForDeleteStoredBackupRequest, codecForDeleteTransactionRequest, codecForFailTransactionRequest, @@ -83,6 +84,7 @@ import { codecForGetContractTermsDetails, codecForGetCurrencyInfoRequest, codecForGetExchangeEntryByUrlRequest, + codecForGetExchangeResourcesRequest, codecForGetExchangeTosRequest, codecForGetWithdrawalDetailsForAmountRequest, codecForGetWithdrawalDetailsForUri, @@ -189,8 +191,10 @@ import { import { acceptExchangeTermsOfService, addPresetExchangeEntry, + deleteExchange, fetchFreshExchange, getExchangeDetailedInfo, + getExchangeResources, getExchangeTos, listExchanges, lookupExchangeByUri, @@ -726,9 +730,9 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> { ageCommitmentProof: c.ageCommitmentProof, spend_allocation: c.spendAllocation ? { - amount: c.spendAllocation.amount, - id: c.spendAllocation.id, - } + amount: c.spendAllocation.amount, + id: c.spendAllocation.id, + } : undefined, }); } @@ -1071,7 +1075,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( } case WalletApiOperation.SetExchangeTosAccepted: { const req = codecForAcceptExchangeTosRequest().decode(payload); - await acceptExchangeTermsOfService(ws, req.exchangeBaseUrl, req.etag); + await acceptExchangeTermsOfService(ws, req.exchangeBaseUrl); return {}; } case WalletApiOperation.AcceptBankIntegratedWithdrawal: { @@ -1400,6 +1404,15 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( ws.workAvailable.trigger(); return {}; } + case WalletApiOperation.DeleteExchange: { + const req = codecForDeleteExchangeRequest().decode(payload); + await deleteExchange(ws, req); + return {}; + } + case WalletApiOperation.GetExchangeResources: { + const req = codecForGetExchangeResourcesRequest().decode(payload); + return await getExchangeResources(ws, req.exchangeBaseUrl); + } case WalletApiOperation.TestingInfiniteTransactionLoop: { const myDelayMs = (payload as any).delayMs ?? 5; const shouldFetch = !!(payload as any).shouldFetch; @@ -1616,7 +1629,6 @@ class InternalWalletStateImpl implements InternalWalletState { createRecoupGroup, }; - refreshOps: RefreshOperations = { createRefreshGroup, }; |