diff options
Diffstat (limited to 'packages/taler-wallet-core/src/wallet-api-types.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet-api-types.ts | 133 |
1 files changed, 125 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts index 4f4b24b62..aa88331ea 100644 --- a/packages/taler-wallet-core/src/wallet-api-types.ts +++ b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -38,6 +38,10 @@ import { ApplyDevExperimentRequest, BackupRecovery, BalancesResponse, + CanonicalizeBaseUrlRequest, + CanonicalizeBaseUrlResponse, + CheckPayTemplateReponse, + CheckPayTemplateRequest, CheckPeerPullCreditRequest, CheckPeerPullCreditResponse, CheckPeerPushDebitRequest, @@ -47,6 +51,7 @@ import { ConfirmPayResult, ConfirmPeerPullDebitRequest, ConfirmPeerPushCreditRequest, + ConfirmWithdrawalRequest, ConvertAmountRequest, CreateDepositGroupRequest, CreateDepositGroupResponse, @@ -60,7 +65,7 @@ import { FailTransactionRequest, ForceRefreshRequest, ForgetKnownBankAccountsRequest, - GetActiveTasks, + GetActiveTasksResponse, GetAmountRequest, GetBalanceDetailRequest, GetContractTermsDetailsRequest, @@ -76,6 +81,7 @@ import { GetPlanForOperationResponse, GetWithdrawalDetailsForAmountRequest, GetWithdrawalDetailsForUriRequest, + HintNetworkAvailabilityRequest, ImportDbRequest, InitRequest, InitResponse, @@ -91,6 +97,8 @@ import { ListGlobalCurrencyAuditorsResponse, ListGlobalCurrencyExchangesResponse, ListKnownBankAccountsRequest, + PrepareBankIntegratedWithdrawalRequest, + PrepareBankIntegratedWithdrawalResponse, PrepareDepositRequest, PrepareDepositResponse, PreparePayRequest, @@ -154,10 +162,12 @@ import { PaymentBalanceDetails } from "./balance.js"; export enum WalletApiOperation { InitWallet = "initWallet", + SetWalletRunConfig = "setWalletRunConfig", WithdrawTestkudos = "withdrawTestkudos", WithdrawTestBalance = "withdrawTestBalance", PreparePayForUri = "preparePayForUri", SharePayment = "sharePayment", + CheckPayForTemplate = "checkPayForTemplate", PreparePayForTemplate = "preparePayForTemplate", GetContractTermsDetails = "getContractTermsDetails", RunIntegrationTest = "runIntegrationTest", @@ -194,6 +204,8 @@ export enum WalletApiOperation { SetExchangeTosForgotten = "SetExchangeTosForgotten", StartRefundQueryForUri = "startRefundQueryForUri", StartRefundQuery = "startRefundQuery", + PrepareBankIntegratedWithdrawal = "prepareBankIntegratedWithdrawal", + ConfirmWithdrawal = "confirmWithdrawal", AcceptBankIntegratedWithdrawal = "acceptBankIntegratedWithdrawal", GetExchangeTos = "getExchangeTos", GetExchangeDetailedInfo = "getExchangeDetailedInfo", @@ -234,10 +246,6 @@ export enum WalletApiOperation { Recycle = "recycle", ApplyDevExperiment = "applyDevExperiment", ValidateIban = "validateIban", - TestingWaitTransactionsFinal = "testingWaitTransactionsFinal", - TestingWaitRefreshesFinal = "testingWaitRefreshesFinal", - TestingWaitTransactionState = "testingWaitTransactionState", - TestingSetTimetravel = "testingSetTimetravel", GetCurrencySpecification = "getCurrencySpecification", ListStoredBackups = "listStoredBackups", CreateStoredBackup = "createStoredBackup", @@ -246,7 +254,6 @@ export enum WalletApiOperation { UpdateExchangeEntry = "updateExchangeEntry", ListExchangesForScopedCurrency = "listExchangesForScopedCurrency", PrepareWithdrawExchange = "prepareWithdrawExchange", - TestingInfiniteTransactionLoop = "testingInfiniteTransactionLoop", GetExchangeResources = "getExchangeResources", DeleteExchange = "deleteExchange", ListGlobalCurrencyExchanges = "listGlobalCurrencyExchanges", @@ -256,17 +263,30 @@ export enum WalletApiOperation { AddGlobalCurrencyAuditor = "addGlobalCurrencyAuditor", RemoveGlobalCurrencyAuditor = "removeGlobalCurrencyAuditor", ListAssociatedRefreshes = "listAssociatedRefreshes", + Shutdown = "shutdown", + HintNetworkAvailability = "hintNetworkAvailability", + CanonicalizeBaseUrl = "canonicalizeBaseUrl", + TestingWaitTransactionsFinal = "testingWaitTransactionsFinal", + TestingWaitRefreshesFinal = "testingWaitRefreshesFinal", + TestingWaitTransactionState = "testingWaitTransactionState", + TestingWaitTasksDone = "testingWaitTasksDone", + TestingSetTimetravel = "testingSetTimetravel", + TestingInfiniteTransactionLoop = "testingInfiniteTransactionLoop", TestingListTaskForTransaction = "testingListTasksForTransaction", TestingGetDenomStats = "testingGetDenomStats", + TestingPing = "testingPing", + TestingGetReserveHistory = "testingGetReserveHistory", + TestingResetAllRetries = "testingResetAllRetries", } // group: Initialization type EmptyObject = Record<string, never>; + /** * Initialize wallet-core. * - * Must be the request before any other operations. + * Must be the first request made to wallet-core. */ export type InitWalletOp = { op: WalletApiOperation.InitWallet; @@ -274,12 +294,35 @@ export type InitWalletOp = { response: InitResponse; }; +export type ShutdownOp = { + op: WalletApiOperation.Shutdown; + request: EmptyObject; + response: EmptyObject; +}; + +/** + * Change the configuration of wallet-core. + * + * Currently an alias for the initWallet request. + */ +export type SetWalletRunConfigOp = { + op: WalletApiOperation.SetWalletRunConfig; + request: InitRequest; + response: InitResponse; +}; + export type GetVersionOp = { op: WalletApiOperation.GetVersion; request: EmptyObject; response: WalletCoreVersion; }; +export type HintNetworkAvailabilityOp = { + op: WalletApiOperation.HintNetworkAvailability; + request: HintNetworkAvailabilityRequest; + response: EmptyObject; +}; + // group: Basic Wallet Information /** @@ -454,7 +497,27 @@ export type GetWithdrawalDetailsForUriOp = { }; /** + * Prepare a bank-integrated withdrawal operation. + */ +export type PrepareBankIntegratedWithdrawalOp = { + op: WalletApiOperation.PrepareBankIntegratedWithdrawal; + request: PrepareBankIntegratedWithdrawalRequest; + response: PrepareBankIntegratedWithdrawalResponse; +}; + +/** + * Confirm a withdrawal transaction. + */ +export type ConfirmWithdrawalOp = { + op: WalletApiOperation.ConfirmWithdrawal; + request: ConfirmWithdrawalRequest; + response: EmptyObject; +}; + +/** * Accept a bank-integrated withdrawal. + * + * @deprecated in favor of prepare/confirm withdrawal. */ export type AcceptBankIntegratedWithdrawalOp = { op: WalletApiOperation.AcceptBankIntegratedWithdrawal; @@ -488,6 +551,12 @@ export type SharePaymentOp = { response: SharePaymentResult; }; +export type CheckPayForTemplateOp = { + op: WalletApiOperation.CheckPayForTemplate; + request: CheckPayTemplateRequest; + response: CheckPayTemplateReponse; +}; + /** * Prepare to make a payment based on a taler://pay-template/ URI. */ @@ -911,6 +980,12 @@ export type ValidateIbanOp = { response: ValidateIbanResponse; }; +export type CanonicalizeBaseUrlOp = { + op: WalletApiOperation.CanonicalizeBaseUrl; + request: CanonicalizeBaseUrlRequest; + response: CanonicalizeBaseUrlResponse; +}; + // group: Database Management /** @@ -1059,7 +1134,7 @@ export type GetPendingTasksOp = { export type GetActiveTasksOp = { op: WalletApiOperation.GetActiveTasks; request: EmptyObject; - response: GetActiveTasks; + response: GetActiveTasksResponse; }; /** @@ -1099,6 +1174,15 @@ export type TestingWaitTransactionsFinalOp = { }; /** + * Wait until all transactions are in a final state. + */ +export type TestingWaitTasksDoneOp = { + op: WalletApiOperation.TestingWaitTasksDone; + request: EmptyObject; + response: EmptyObject; +}; + +/** * Wait until all refresh transactions are in a final state. */ export type TestingWaitRefreshesFinalOp = { @@ -1116,6 +1200,28 @@ export type TestingWaitTransactionStateOp = { response: EmptyObject; }; +export type TestingPingOp = { + op: WalletApiOperation.TestingPing; + request: EmptyObject; + response: EmptyObject; +}; + +export type TestingGetReserveHistoryOp = { + op: WalletApiOperation.TestingGetReserveHistory; + request: EmptyObject; + response: any; +}; + +/** + * Reset all task/transaction retries, + * resulting in immediate re-try of all operations. + */ +export type TestingResetAllRetriesOp = { + op: WalletApiOperation.TestingResetAllRetries; + request: EmptyObject; + response: EmptyObject; +}; + /** * Get stats about an exchange denomination. */ @@ -1147,9 +1253,11 @@ export type ForceRefreshOp = { export type WalletOperations = { [WalletApiOperation.InitWallet]: InitWalletOp; + [WalletApiOperation.SetWalletRunConfig]: SetWalletRunConfigOp; [WalletApiOperation.GetVersion]: GetVersionOp; [WalletApiOperation.PreparePayForUri]: PreparePayForUriOp; [WalletApiOperation.SharePayment]: SharePaymentOp; + [WalletApiOperation.CheckPayForTemplate]: CheckPayForTemplateOp; [WalletApiOperation.PreparePayForTemplate]: PreparePayForTemplateOp; [WalletApiOperation.GetContractTermsDetails]: GetContractTermsDetailsOp; [WalletApiOperation.WithdrawTestkudos]: WithdrawTestkudosOp; @@ -1232,6 +1340,7 @@ export type WalletOperations = { [WalletApiOperation.TestingWaitRefreshesFinal]: TestingWaitRefreshesFinalOp; [WalletApiOperation.TestingSetTimetravel]: TestingSetTimetravelOp; [WalletApiOperation.TestingWaitTransactionState]: TestingWaitTransactionStateOp; + [WalletApiOperation.TestingWaitTasksDone]: TestingWaitTasksDoneOp; [WalletApiOperation.GetCurrencySpecification]: GetCurrencySpecificationOp; [WalletApiOperation.CreateStoredBackup]: CreateStoredBackupsOp; [WalletApiOperation.ListStoredBackups]: ListStoredBackupsOp; @@ -1251,6 +1360,14 @@ export type WalletOperations = { [WalletApiOperation.ListAssociatedRefreshes]: ListAssociatedRefreshesOp; [WalletApiOperation.TestingListTaskForTransaction]: TestingListTasksForTransactionOp; [WalletApiOperation.TestingGetDenomStats]: TestingGetDenomStatsOp; + [WalletApiOperation.TestingPing]: TestingPingOp; + [WalletApiOperation.Shutdown]: ShutdownOp; + [WalletApiOperation.PrepareBankIntegratedWithdrawal]: PrepareBankIntegratedWithdrawalOp; + [WalletApiOperation.ConfirmWithdrawal]: ConfirmWithdrawalOp; + [WalletApiOperation.CanonicalizeBaseUrl]: CanonicalizeBaseUrlOp; + [WalletApiOperation.TestingGetReserveHistory]: TestingGetReserveHistoryOp; + [WalletApiOperation.TestingResetAllRetries]: TestingResetAllRetriesOp; + [WalletApiOperation.HintNetworkAvailability]: HintNetworkAvailabilityOp; }; export type WalletCoreRequestType< |