From 07cdfb2e4ec761021477271776b81f33af0e731d Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 17 Mar 2021 17:56:37 +0100 Subject: towards wallet-core / util split --- .../taler-wallet-core/src/operations/reserves.ts | 80 ++++++---------------- 1 file changed, 20 insertions(+), 60 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/reserves.ts') diff --git a/packages/taler-wallet-core/src/operations/reserves.ts b/packages/taler-wallet-core/src/operations/reserves.ts index 2be992bf2..fe6f323c8 100644 --- a/packages/taler-wallet-core/src/operations/reserves.ts +++ b/packages/taler-wallet-core/src/operations/reserves.ts @@ -19,69 +19,29 @@ import { CreateReserveResponse, TalerErrorDetails, AcceptWithdrawalResponse, -} from "../types/walletTypes"; -import { canonicalizeBaseUrl } from "../util/helpers"; -import { InternalWalletState } from "./state"; -import { - ReserveRecordStatus, - ReserveRecord, - CurrencyRecord, - Stores, - WithdrawalGroupRecord, - ReserveBankInfo, -} from "../types/dbTypes"; -import { Logger } from "../util/logging"; -import { Amounts } from "../util/amounts"; -import { - updateExchangeFromUrl, - getExchangeTrust, - getExchangePaytoUri, -} from "./exchanges"; -import { - codecForWithdrawOperationStatusResponse, + Amounts, codecForBankWithdrawalOperationPostResponse, -} from "../types/talerTypes"; -import { assertUnreachable } from "../util/assertUnreachable"; -import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto"; -import { randomBytes } from "../crypto/primitives/nacl-fast"; -import { - processWithdrawGroup, - getBankWithdrawalInfo, - denomSelectionInfoToState, - updateWithdrawalDenoms, - selectWithdrawalDenominations, - getCandidateWithdrawalDenoms, -} from "./withdraw"; -import { - guardOperationException, - OperationFailedAndReportedError, - makeErrorDetails, - OperationFailedError, -} from "./errors"; -import { NotificationType } from "../types/notifications"; -import { codecForReserveStatus } from "../types/ReserveStatus"; -import { - getTimestampNow, + codecForReserveStatus, + codecForWithdrawOperationStatusResponse, Duration, - durationMin, durationMax, -} from "../util/time"; -import { TransactionHandle } from "../util/query"; -import { addPaytoQueryParams } from "../util/payto"; -import { TalerErrorCode } from "../TalerErrorCode"; -import { - readSuccessResponseJsonOrErrorCode, - throwUnexpectedRequestError, - readSuccessResponseJsonOrThrow, -} from "../util/http"; -import { codecForAny } from "../util/codec"; -import { URL } from "../util/url"; -import { - initRetryInfo, - getRetryDuration, - updateRetryInfoTimeout, -} from "../util/retries"; -import { ReserveTransactionType } from "../types/ReserveTransaction"; + durationMin, + getTimestampNow, + NotificationType, + ReserveTransactionType, + TalerErrorCode, + addPaytoQueryParams, +} from "@gnu-taler/taler-util"; +import { randomBytes } from "../crypto/primitives/nacl-fast.js"; +import { Stores, ReserveRecordStatus, ReserveBankInfo, ReserveRecord, CurrencyRecord, WithdrawalGroupRecord } from "../db.js"; +import { Logger, encodeCrock, getRandomBytes, readSuccessResponseJsonOrThrow, URL, readSuccessResponseJsonOrErrorCode, throwUnexpectedRequestError, TransactionHandle } from "../index.js"; +import { assertUnreachable } from "../util/assertUnreachable.js"; +import { canonicalizeBaseUrl } from "../util/helpers.js"; +import { initRetryInfo, getRetryDuration, updateRetryInfoTimeout } from "../util/retries.js"; +import { guardOperationException, OperationFailedError } from "./errors.js"; +import { updateExchangeFromUrl, getExchangeTrust, getExchangePaytoUri } from "./exchanges.js"; +import { InternalWalletState } from "./state.js"; +import { updateWithdrawalDenoms, getCandidateWithdrawalDenoms, selectWithdrawalDenominations, denomSelectionInfoToState, processWithdrawGroup, getBankWithdrawalInfo } from "./withdraw.js"; const logger = new Logger("reserves.ts"); -- cgit v1.2.3