aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts22
1 files changed, 18 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index 9339b2f8e..caaf6d410 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -57,6 +57,8 @@ import {
codecForListKnownBankAccounts,
codecForPrepareDepositRequest,
codecForPreparePayRequest,
+ codecForPreparePeerPullPaymentRequest,
+ codecForPreparePeerPushPaymentRequest,
codecForPrepareRefundRequest,
codecForPrepareTipRequest,
codecForRetryTransactionRequest,
@@ -186,6 +188,8 @@ import {
checkPeerPushPayment,
initiatePeerPullPayment,
initiatePeerToPeerPush,
+ preparePeerPullPayment,
+ preparePeerPushPayment,
} from "./operations/pay-peer.js";
import { getPendingOperations } from "./operations/pending.js";
import {
@@ -659,7 +663,9 @@ async function getExchanges(
const opRetryRecord = await tx.operationRetries.get(
RetryTags.forExchangeUpdate(r),
);
- exchanges.push(makeExchangeListItem(r, exchangeDetails, opRetryRecord?.lastError));
+ exchanges.push(
+ makeExchangeListItem(r, exchangeDetails, opRetryRecord?.lastError),
+ );
}
});
return { exchanges };
@@ -927,9 +933,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,
});
}
@@ -1340,6 +1346,10 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
await importDb(ws.db.idbHandle(), req.dump);
return [];
}
+ case WalletApiOperation.PreparePeerPushPayment: {
+ const req = codecForPreparePeerPushPaymentRequest().decode(payload);
+ return await preparePeerPushPayment(ws, req);
+ }
case WalletApiOperation.InitiatePeerPushPayment: {
const req = codecForInitiatePeerPushPaymentRequest().decode(payload);
return await initiatePeerToPeerPush(ws, req);
@@ -1352,6 +1362,10 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
const req = codecForAcceptPeerPushPaymentRequest().decode(payload);
return await acceptPeerPushPayment(ws, req);
}
+ case WalletApiOperation.PreparePeerPullPayment: {
+ const req = codecForPreparePeerPullPaymentRequest().decode(payload);
+ return await preparePeerPullPayment(ws, req);
+ }
case WalletApiOperation.InitiatePeerPullPayment: {
const req = codecForInitiatePeerPullPaymentRequest().decode(payload);
return await initiatePeerPullPayment(ws, req);