summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-02-08 15:38:34 +0100
committerFlorian Dold <florian@dold.me>2021-02-08 15:38:34 +0100
commit5ff5a686e4f15dea839b18fda9275687557d23a7 (patch)
treeeb4579f451a70fae627b403e273e73033fa5e88c /packages/taler-wallet-core/src/wallet.ts
parent4452984a24334e3b7afb60e3db9dc12db02d65ba (diff)
downloadwallet-core-5ff5a686e4f15dea839b18fda9275687557d23a7.tar.gz
wallet-core-5ff5a686e4f15dea839b18fda9275687557d23a7.tar.bz2
wallet-core-5ff5a686e4f15dea839b18fda9275687557d23a7.zip
organize imports
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts259
1 files changed, 125 insertions, 134 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index 51987c349..5aa951d5f 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -22,169 +22,160 @@
/**
* Imports.
*/
+import { TalerErrorCode } from ".";
import { CryptoWorkerFactory } from "./crypto/workers/cryptoApi";
-import { HttpRequestLibrary } from "./util/http";
-import { Database, Store } from "./util/query";
-
-import { Amounts, AmountJson } from "./util/amounts";
-
import {
- getExchangeWithdrawalInfo,
- getWithdrawalDetailsForUri,
-} from "./operations/withdraw";
-
+ addBackupProvider,
+ AddBackupProviderRequest,
+ BackupInfo,
+ BackupRecovery,
+ codecForAddBackupProviderRequest,
+ exportBackup,
+ exportBackupEncrypted,
+ getBackupInfo,
+ getBackupRecovery,
+ importBackupEncrypted,
+ importBackupPlain,
+ loadBackupRecovery,
+ runBackupCycle,
+} from "./operations/backup";
+import { getBalances } from "./operations/balance";
+import {
+ createDepositGroup,
+ processDepositGroup,
+ trackDepositGroup,
+} from "./operations/deposits";
+import {
+ makeErrorDetails,
+ OperationFailedAndReportedError,
+ OperationFailedError,
+} from "./operations/errors";
+import {
+ acceptExchangeTermsOfService,
+ getExchangePaytoUri,
+ getExchangeTrust,
+ updateExchangeFromUrl,
+} from "./operations/exchanges";
import {
- preparePayForUri,
- refuseProposal,
confirmPay,
+ preparePayForUri,
processDownloadProposal,
processPurchasePay,
+ refuseProposal,
} from "./operations/pay";
-
+import { getPendingOperations } from "./operations/pending";
+import { processRecoupGroup } from "./operations/recoup";
+import {
+ autoRefresh,
+ createRefreshGroup,
+ processRefreshGroup,
+} from "./operations/refresh";
+import {
+ abortFailedPayWithRefund,
+ applyRefund,
+ processPurchaseQueryRefund,
+} from "./operations/refund";
+import {
+ createReserve,
+ createTalerWithdrawReserve,
+ forceQueryReserve,
+ getFundingPaytoUris,
+ processReserve,
+} from "./operations/reserves";
+import { InternalWalletState } from "./operations/state";
+import {
+ runIntegrationTest,
+ testPay,
+ withdrawTestBalance,
+} from "./operations/testing";
+import { acceptTip, prepareTip, processTip } from "./operations/tip";
+import { getTransactions } from "./operations/transactions";
+import {
+ getExchangeWithdrawalInfo,
+ getWithdrawalDetailsForUri,
+ processWithdrawGroup,
+} from "./operations/withdraw";
import {
CoinRecord,
+ CoinSourceType,
CurrencyRecord,
DenominationRecord,
ExchangeRecord,
PurchaseRecord,
+ RefundState,
ReserveRecord,
- Stores,
ReserveRecordStatus,
- CoinSourceType,
- RefundState,
- MetaStores,
- DepositGroupRecord,
+ Stores,
} from "./types/dbTypes";
-import { CoinDumpJson, WithdrawUriInfoResponse } from "./types/talerTypes";
+import { NotificationType, WalletNotification } from "./types/notifications";
+import {
+ PendingOperationInfo,
+ PendingOperationsResponse,
+ PendingOperationType,
+} from "./types/pendingTypes";
+import { CoinDumpJson } from "./types/talerTypes";
+import {
+ codecForTransactionsRequest,
+ TransactionsRequest,
+ TransactionsResponse,
+} from "./types/transactionsTypes";
import {
- BenchmarkResult,
- ConfirmPayResult,
- ReturnCoinsRequest,
- SenderWireInfos,
- PreparePayResult,
- AcceptWithdrawalResponse,
- PurchaseDetails,
- RefreshReason,
- ExchangeListItem,
- ExchangesListRespose,
- ManualWithdrawalDetails,
- GetExchangeTosResult,
AcceptManualWithdrawalResult,
+ AcceptWithdrawalResponse,
+ ApplyRefundResponse,
BalancesResponse,
- TestPayArgs,
- IntegrationTestArgs,
- codecForAddExchangeRequest,
- codecForGetWithdrawalDetailsForUri,
- codecForAcceptManualWithdrawalRequet,
- codecForGetWithdrawalDetailsForAmountRequest,
+ BenchmarkResult,
+ codecForAbortPayWithRefundRequest,
+ codecForAcceptBankIntegratedWithdrawalRequest,
codecForAcceptExchangeTosRequest,
+ codecForAcceptManualWithdrawalRequet,
+ codecForAcceptTipRequest,
+ codecForAddExchangeRequest,
codecForApplyRefundRequest,
- codecForAcceptBankIntegratedWithdrawalRequest,
- codecForGetExchangeTosRequest,
codecForConfirmPayRequest,
- CoreApiResponse,
- codecForPreparePayRequest,
- codecForIntegrationTestArgs,
- WithdrawTestBalanceRequest,
- codecForWithdrawTestBalance,
- codecForTestPayArgs,
- codecForSetCoinSuspendedRequest,
+ codecForCreateDepositGroupRequest,
codecForForceExchangeUpdateRequest,
codecForForceRefreshRequest,
- PrepareTipResult,
+ codecForGetExchangeTosRequest,
+ codecForGetWithdrawalDetailsForAmountRequest,
+ codecForGetWithdrawalDetailsForUri,
+ codecForIntegrationTestArgs,
+ codecForPreparePayRequest,
codecForPrepareTipRequest,
- codecForAcceptTipRequest,
- codecForAbortPayWithRefundRequest,
- ApplyRefundResponse,
- RecoveryLoadRequest,
- codecForCreateDepositGroupRequest,
+ codecForSetCoinSuspendedRequest,
+ codecForTestPayArgs,
+ codecForTrackDepositGroupRequest,
+ codecForWithdrawTestBalance,
+ ConfirmPayResult,
+ CoreApiResponse,
CreateDepositGroupRequest,
CreateDepositGroupResponse,
- codecForTrackDepositGroupRequest,
+ ExchangeListItem,
+ ExchangesListRespose,
+ GetExchangeTosResult,
+ IntegrationTestArgs,
+ ManualWithdrawalDetails,
+ PreparePayResult,
+ PrepareTipResult,
+ PurchaseDetails,
+ RecoveryLoadRequest,
+ RefreshReason,
+ ReturnCoinsRequest,
+ TestPayArgs,
TrackDepositGroupRequest,
TrackDepositGroupResponse,
+ WithdrawTestBalanceRequest,
+ WithdrawUriInfoResponse,
} from "./types/walletTypes";
-import { Logger } from "./util/logging";
-
+import { AmountJson, Amounts } from "./util/amounts";
import { assertUnreachable } from "./util/assertUnreachable";
-
-import {
- updateExchangeFromUrl,
- getExchangeTrust,
- getExchangePaytoUri,
- acceptExchangeTermsOfService,
-} from "./operations/exchanges";
-import {
- processReserve,
- createTalerWithdrawReserve,
- forceQueryReserve,
- getFundingPaytoUris,
-} from "./operations/reserves";
-
-import { InternalWalletState } from "./operations/state";
-import { createReserve } from "./operations/reserves";
-import {
- processRefreshGroup,
- createRefreshGroup,
- autoRefresh,
-} from "./operations/refresh";
-import { processWithdrawGroup } from "./operations/withdraw";
-import { getPendingOperations } from "./operations/pending";
-import { getBalances } from "./operations/balance";
-import { acceptTip, prepareTip, processTip } from "./operations/tip";
-import { TimerGroup } from "./util/timer";
-import { AsyncCondition } from "./util/promiseUtils";
import { AsyncOpMemoSingle } from "./util/asyncMemo";
-import {
- PendingOperationInfo,
- PendingOperationsResponse,
- PendingOperationType,
-} from "./types/pendingTypes";
-import { WalletNotification, NotificationType } from "./types/notifications";
-import {
- processPurchaseQueryRefund,
- applyRefund,
- abortFailedPayWithRefund,
-} from "./operations/refund";
-import { durationMin, Duration } from "./util/time";
-import { processRecoupGroup } from "./operations/recoup";
-import {
- OperationFailedAndReportedError,
- OperationFailedError,
- makeErrorDetails,
-} from "./operations/errors";
-import {
- TransactionsRequest,
- TransactionsResponse,
- codecForTransactionsRequest,
-} from "./types/transactionsTypes";
-import { getTransactions } from "./operations/transactions";
-import {
- withdrawTestBalance,
- runIntegrationTest,
- testPay,
-} from "./operations/testing";
-import { TalerErrorCode } from ".";
-import {
- addBackupProvider,
- codecForAddBackupProviderRequest,
- runBackupCycle,
- exportBackup,
- importBackupPlain,
- exportBackupEncrypted,
- importBackupEncrypted,
- BackupRecovery,
- getBackupRecovery,
- AddBackupProviderRequest,
- getBackupInfo,
- BackupInfo,
- loadBackupRecovery,
-} from "./operations/backup";
-import {
- createDepositGroup,
- processDepositGroup,
- trackDepositGroup,
-} from "./operations/deposits";
+import { HttpRequestLibrary } from "./util/http";
+import { Logger } from "./util/logging";
+import { AsyncCondition } from "./util/promiseUtils";
+import { Database } from "./util/query";
+import { Duration, durationMin } from "./util/time";
+import { TimerGroup } from "./util/timer";
const builtinCurrencies: CurrencyRecord[] = [
{
@@ -651,9 +642,9 @@ export class Wallet {
return await this.db.get(Stores.exchanges, exchangeBaseUrl);
}
- async getPendingOperations({ onlyDue = false } = {}): Promise<
- PendingOperationsResponse
- > {
+ async getPendingOperations({
+ onlyDue = false,
+ } = {}): Promise<PendingOperationsResponse> {
return this.ws.memoGetPending.memo(() =>
getPendingOperations(this.ws, { onlyDue }),
);