diff options
author | Sebastian <sebasjm@gmail.com> | 2023-06-13 16:46:16 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-06-13 16:46:16 -0300 |
commit | 8b74bda065e1f2e01b322662dce3a002aa0fb20b (patch) | |
tree | 8865b61d2ed35430a1171dd041890f36e659f2a0 /packages/taler-wallet-core/src/wallet.ts | |
parent | 671342818fb79123f231cfcbaf8251f1672effd1 (diff) | |
download | wallet-core-8b74bda065e1f2e01b322662dce3a002aa0fb20b.tar.xz |
get operation plan impl, no test
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 5277916de..a04464630 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -75,6 +75,7 @@ import { codecForGetBalanceDetailRequest, codecForGetContractTermsDetails, codecForGetExchangeTosRequest, + codecForGetPlanForOperationRequest, codecForGetWithdrawalDetailsForAmountRequest, codecForGetWithdrawalDetailsForUri, codecForImportDbRequest, @@ -218,9 +219,7 @@ import { processPeerPushDebit, } from "./operations/pay-peer-push-debit.js"; import { getPendingOperations } from "./operations/pending.js"; -import { - createRecoupGroup, processRecoupGroup, -} from "./operations/recoup.js"; +import { createRecoupGroup, processRecoupGroup } from "./operations/recoup.js"; import { autoRefresh, createRefreshGroup, @@ -283,6 +282,7 @@ import { WalletCoreApiClient, WalletCoreResponseType, } from "./wallet-api-types.js"; +import { getPlanForOperation } from "./util/coinSelection.js"; const logger = new Logger("wallet.ts"); @@ -331,9 +331,7 @@ async function callOperationHandler( /** * Process pending operations. */ -export async function runPending( - ws: InternalWalletState, -): Promise<void> { +export async function runPending(ws: InternalWalletState): Promise<void> { const pendingOpsResponse = await getPendingOperations(ws); for (const p of pendingOpsResponse.pendingOperations) { if (!AbsoluteTime.isExpired(p.timestampDue)) { @@ -1336,6 +1334,10 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( await loadBackupRecovery(ws, req); return {}; } + case WalletApiOperation.GetPlanForOperation: { + const req = codecForGetPlanForOperationRequest().decode(payload); + return await getPlanForOperation(ws, req); + } case WalletApiOperation.GetBackupInfo: { const resp = await getBackupInfo(ws); return resp; |