From 5ff5a686e4f15dea839b18fda9275687557d23a7 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 8 Feb 2021 15:38:34 +0100 Subject: organize imports --- packages/taler-wallet-core/src/wallet.ts | 259 +++++++++++++++---------------- 1 file changed, 125 insertions(+), 134 deletions(-) (limited to 'packages/taler-wallet-core/src/wallet.ts') 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 { return this.ws.memoGetPending.memo(() => getPendingOperations(this.ws, { onlyDue }), ); -- cgit v1.2.3