diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-01 08:41:22 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-01 08:42:45 -0300 |
commit | 94eeab8ad011d26e447b691a2deaccb91dee1fb7 (patch) | |
tree | 7912de7228bb136fe9d3ff6eb4e20208e0896645 /packages/taler-wallet-core/src/operations/peer-to-peer.ts | |
parent | e759684fd0658b4a3ba241744424ceda11bd500b (diff) | |
download | wallet-core-94eeab8ad011d26e447b691a2deaccb91dee1fb7.tar.xz |
more information about p2p:
- added the contract terms on WgInfoBankPeerPush and WgInfoBankPeerPull, so we can show summary and expiration in the ui
- added info: PeerInfoShort on Transaction* type
- definition of completed p2p tx:
- push debit: Amounts.cmp(sentAmount, pickedUpAmount) === 0. is this transfer already picked up? (not working)
- pull debit: pi.paid, is this invoice already paid?
- pull credit: wsr.timestampFinish, has someone already paid my invoice?
- push credit: wsr.timestampFinish, have I already picked up this?
- changed the txId of peer pull debit to have the incomingId instead of pursePub (allow deletion)
Diffstat (limited to 'packages/taler-wallet-core/src/operations/peer-to-peer.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/peer-to-peer.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/peer-to-peer.ts b/packages/taler-wallet-core/src/operations/peer-to-peer.ts index 88bfecd3b..275258081 100644 --- a/packages/taler-wallet-core/src/operations/peer-to-peer.ts +++ b/packages/taler-wallet-core/src/operations/peer-to-peer.ts @@ -263,6 +263,7 @@ export async function initiatePeerToPeerPush( await tx.peerPushPaymentInitiations.add({ amount: Amounts.stringify(instructedAmount), contractPriv: econtractResp.contractPriv, + contractTerms, exchangeBaseUrl: sel.exchangeBaseUrl, mergePriv: mergePair.priv, mergePub: mergePair.pub, @@ -536,6 +537,7 @@ export async function acceptPeerPushPayment( amount, wgInfo: { withdrawalType: WithdrawalRecordType.PeerPushCredit, + contractTerms: peerInc.contractTerms, }, exchangeBaseUrl: peerInc.exchangeBaseUrl, reserveStatus: ReserveRecordStatus.QueryingStatus, @@ -552,7 +554,7 @@ export async function acceptPeerPushPayment( export async function acceptPeerPullPayment( ws: InternalWalletState, req: AcceptPeerPullPaymentRequest, -) { +): Promise<void> { const peerPullInc = await ws.db .mktx((x) => ({ peerPullPaymentIncoming: x.peerPullPaymentIncoming })) .runReadOnly(async (tx) => { @@ -808,6 +810,7 @@ export async function initiatePeerRequestForPay( amount: Amounts.parseOrThrow(req.amount), wgInfo: { withdrawalType: WithdrawalRecordType.PeerPullCredit, + contractTerms, contractPriv: econtractResp.contractPriv, }, exchangeBaseUrl: req.exchangeBaseUrl, |