aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet-api-types.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-02-20 01:16:31 +0100
committerFlorian Dold <florian@dold.me>2023-02-20 01:16:31 +0100
commit1747d3ac1853f0ec5791ded5ce4711ed3e5a343f (patch)
tree671667b377eeb9c9a82a397939072a6d1850c734 /packages/taler-wallet-core/src/wallet-api-types.ts
parent30b3949d2bd9da6bceddb40f3d1921b95fa80316 (diff)
downloadwallet-core-1747d3ac1853f0ec5791ded5ce4711ed3e5a343f.tar.xz
wallet-core: rename p2p requests to something more sensible
Diffstat (limited to 'packages/taler-wallet-core/src/wallet-api-types.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet-api-types.ts126
1 files changed, 61 insertions, 65 deletions
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts
index 093a1b15c..f1d1441d6 100644
--- a/packages/taler-wallet-core/src/wallet-api-types.ts
+++ b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -29,8 +29,8 @@ import {
AcceptExchangeTosRequest,
AcceptManualWithdrawalRequest,
AcceptManualWithdrawalResult,
- AcceptPeerPullPaymentRequest,
- AcceptPeerPushPaymentRequest,
+ AcceptPeerPullPaymentRequest as ConfirmPeerPullDebitRequest,
+ AcceptPeerPushPaymentRequest as ConfirmPeerPushCreditRequest,
AcceptTipRequest,
AcceptTipResponse,
AcceptWithdrawalResponse,
@@ -42,8 +42,8 @@ import {
ApplyRefundResponse,
BackupRecovery,
BalancesResponse,
- CheckPeerPullPaymentRequest,
- CheckPeerPullPaymentResponse,
+ CheckPeerPullPaymentRequest as PreparePeerPullDebitRequest,
+ CheckPeerPullPaymentResponse as PreparePeerPullDebitResponse,
CheckPeerPushPaymentRequest,
CheckPeerPushPaymentResponse,
CoinDumpJson,
@@ -64,8 +64,8 @@ import {
GetFeeForDepositRequest,
GetWithdrawalDetailsForAmountRequest,
GetWithdrawalDetailsForUriRequest,
- InitiatePeerPullPaymentRequest,
- InitiatePeerPullPaymentResponse,
+ InitiatePeerPullPaymentRequest as InitiatePeerPullCreditRequest,
+ InitiatePeerPullPaymentResponse as InitiatePeerPullCreditResponse,
InitiatePeerPushPaymentRequest,
InitiatePeerPushPaymentResponse,
InitRequest,
@@ -79,10 +79,10 @@ import {
PreparePayRequest,
PreparePayResult,
PreparePayTemplateRequest,
- PreparePeerPullPaymentRequest,
- PreparePeerPullPaymentResponse,
- PreparePeerPushPaymentRequest,
- PreparePeerPushPaymentResponse,
+ PreparePeerPullPaymentRequest as CheckPeerPullCreditRequest,
+ PreparePeerPullPaymentResponse as CheckPeerPullCreditResponse,
+ PreparePeerPushPaymentRequest as CheckPeerPushDebitRequest,
+ PreparePeerPushPaymentResponse as CheckPeerPushDebitResponse,
PrepareRefundRequest,
PrepareRefundResult,
PrepareTipRequest,
@@ -183,14 +183,22 @@ export enum WalletApiOperation {
WithdrawFakebank = "withdrawFakebank",
ImportDb = "importDb",
ExportDb = "exportDb",
- PreparePeerPushPayment = "preparePeerPushPayment",
- InitiatePeerPushPayment = "initiatePeerPushPayment",
- CheckPeerPushPayment = "checkPeerPushPayment",
- AcceptPeerPushPayment = "acceptPeerPushPayment",
- PreparePeerPullPayment = "preparePeerPullPayment",
- InitiatePeerPullPayment = "initiatePeerPullPayment",
- CheckPeerPullPayment = "checkPeerPullPayment",
- AcceptPeerPullPayment = "acceptPeerPullPayment",
+ // FIXME: Also rename enum value
+ CheckPeerPushDebit = "preparePeerPushPayment",
+ // FIXME: Also rename enum value
+ InitiatePeerPushDebit = "initiatePeerPushPayment",
+ // FIXME: Also rename enum value
+ PreparePeerPushCredit = "checkPeerPushPayment",
+ // FIXME: Also rename enum value
+ ConfirmPeerPushCredit = "acceptPeerPushPayment",
+ // FIXME: Also rename enum value
+ CheckPeerPullCredit = "preparePeerPullPayment",
+ // FIXME: Also rename enum value
+ InitiatePeerPullCredit = "initiatePeerPullPayment",
+ // FIXME: Also rename enum value
+ PreparePeerPullDebit = "checkPeerPullPayment",
+ // FIXME: Also rename enum value
+ ConfirmPeerPullDebit = "acceptPeerPullPayment",
ClearDb = "clearDb",
Recycle = "recycle",
SetDevMode = "setDevMode",
@@ -593,85 +601,73 @@ export type ExportBackupPlainOp = {
/**
* Check if initiating a peer push payment is possible
* based on the funds in the wallet.
- *
- * FIXME: Rename to CheckPeerPushPaymentInitiation
*/
-export type PreparePeerPushPaymentOp = {
- op: WalletApiOperation.PreparePeerPushPayment;
- request: PreparePeerPushPaymentRequest;
- response: PreparePeerPushPaymentResponse;
+export type CheckPeerPushDebitOp = {
+ op: WalletApiOperation.CheckPeerPushDebit;
+ request: CheckPeerPushDebitRequest;
+ response: CheckPeerPushDebitResponse;
};
/**
* Initiate an outgoing peer push payment.
*/
-export type InitiatePeerPushPaymentOp = {
- op: WalletApiOperation.InitiatePeerPushPayment;
+export type InitiatePeerPushDebitOp = {
+ op: WalletApiOperation.InitiatePeerPushDebit;
request: InitiatePeerPushPaymentRequest;
response: InitiatePeerPushPaymentResponse;
};
/**
* Check an incoming peer push payment.
- *
- * FIXME: Rename to "PrepareIncomingPeerPushPayment"
*/
-export type CheckPeerPushPaymentOp = {
- op: WalletApiOperation.CheckPeerPushPayment;
+export type PreparePeerPushCreditOp = {
+ op: WalletApiOperation.PreparePeerPushCredit;
request: CheckPeerPushPaymentRequest;
response: CheckPeerPushPaymentResponse;
};
/**
* Accept an incoming peer push payment.
- *
- * FIXME: Rename to ConfirmIncomingPeerPushPayment
*/
-export type AcceptPeerPushPaymentOp = {
- op: WalletApiOperation.AcceptPeerPushPayment;
- request: AcceptPeerPushPaymentRequest;
+export type ConfirmPeerPushCreditOp = {
+ op: WalletApiOperation.ConfirmPeerPushCredit;
+ request: ConfirmPeerPushCreditRequest;
response: EmptyObject;
};
/**
- * Initiate an outgoing peer pull payment.
- *
- * FIXME: This does not check anything, so rename to CheckPeerPullPaymentInitiation
+ * Check fees for an outgoing peer pull payment.
*/
-export type PreparePeerPullPaymentOp = {
- op: WalletApiOperation.PreparePeerPullPayment;
- request: PreparePeerPullPaymentRequest;
- response: PreparePeerPullPaymentResponse;
+export type CheckPeerPullCreditOp = {
+ op: WalletApiOperation.CheckPeerPullCredit;
+ request: CheckPeerPullCreditRequest;
+ response: CheckPeerPullCreditResponse;
};
/**
* Initiate an outgoing peer pull payment.
*/
-export type InitiatePeerPullPaymentOp = {
- op: WalletApiOperation.InitiatePeerPullPayment;
- request: InitiatePeerPullPaymentRequest;
- response: InitiatePeerPullPaymentResponse;
+export type InitiatePeerPullCreditOp = {
+ op: WalletApiOperation.InitiatePeerPullCredit;
+ request: InitiatePeerPullCreditRequest;
+ response: InitiatePeerPullCreditResponse;
};
/**
* Prepare for an incoming peer pull payment.
- *
- * FIXME: Rename to "PrepareIncomingPeerPullPayment"
*/
-export type CheckPeerPullPaymentOp = {
- op: WalletApiOperation.CheckPeerPullPayment;
- request: CheckPeerPullPaymentRequest;
- response: CheckPeerPullPaymentResponse;
+export type PreparePeerPullDebitOp = {
+ op: WalletApiOperation.PreparePeerPullDebit;
+ request: PreparePeerPullDebitRequest;
+ response: PreparePeerPullDebitResponse;
};
/**
* Accept an incoming peer pull payment (i.e. pay the other party).
- *
- * FIXME: Rename to ConfirmIncomingPeerPullPayment
*/
-export type AcceptPeerPullPaymentOp = {
- op: WalletApiOperation.AcceptPeerPullPayment;
- request: AcceptPeerPullPaymentRequest;
+export type ConfirmPeerPullDebitOp = {
+ op: WalletApiOperation.ConfirmPeerPullDebit;
+ request: ConfirmPeerPullDebitRequest;
response: EmptyObject;
};
@@ -915,14 +911,14 @@ export type WalletOperations = {
[WalletApiOperation.TestPay]: TestPayOp;
[WalletApiOperation.ExportDb]: ExportDbOp;
[WalletApiOperation.ImportDb]: ImportDbOp;
- [WalletApiOperation.PreparePeerPushPayment]: PreparePeerPushPaymentOp;
- [WalletApiOperation.InitiatePeerPushPayment]: InitiatePeerPushPaymentOp;
- [WalletApiOperation.CheckPeerPushPayment]: CheckPeerPushPaymentOp;
- [WalletApiOperation.AcceptPeerPushPayment]: AcceptPeerPushPaymentOp;
- [WalletApiOperation.PreparePeerPullPayment]: PreparePeerPullPaymentOp;
- [WalletApiOperation.InitiatePeerPullPayment]: InitiatePeerPullPaymentOp;
- [WalletApiOperation.CheckPeerPullPayment]: CheckPeerPullPaymentOp;
- [WalletApiOperation.AcceptPeerPullPayment]: AcceptPeerPullPaymentOp;
+ [WalletApiOperation.CheckPeerPushDebit]: CheckPeerPushDebitOp;
+ [WalletApiOperation.InitiatePeerPushDebit]: InitiatePeerPushDebitOp;
+ [WalletApiOperation.PreparePeerPushCredit]: PreparePeerPushCreditOp;
+ [WalletApiOperation.ConfirmPeerPushCredit]: ConfirmPeerPushCreditOp;
+ [WalletApiOperation.CheckPeerPullCredit]: CheckPeerPullCreditOp;
+ [WalletApiOperation.InitiatePeerPullCredit]: InitiatePeerPullCreditOp;
+ [WalletApiOperation.PreparePeerPullDebit]: PreparePeerPullDebitOp;
+ [WalletApiOperation.ConfirmPeerPullDebit]: ConfirmPeerPullDebitOp;
[WalletApiOperation.ClearDb]: ClearDbOp;
[WalletApiOperation.Recycle]: RecycleOp;
[WalletApiOperation.ApplyDevExperiment]: ApplyDevExperimentOp;