aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-11-08 13:00:34 -0300
committerSebastian <sebasjm@gmail.com>2022-11-08 13:00:34 -0300
commit5c742afbdf9aaa767c3e4617c48a98439e400fa2 (patch)
tree336aa5fc9bc02879e989aef4fe2a82a7b167ef8d /packages/taler-wallet-core/src/wallet.ts
parent43c7cff75055f72c7d59a7180ae8da2554456d8d (diff)
downloadwallet-core-5c742afbdf9aaa767c3e4617c48a98439e400fa2.tar.xz
feature: 7440 add expiration to p2p
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);