summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-11-21 17:10:07 -0300
committerSebastian <sebasjm@gmail.com>2023-11-21 17:10:31 -0300
commit32182fb1b912e1136ba933c4a4f204e6e2f33de2 (patch)
tree9de9caf82632994c233fbbd4366b086818217c7d /packages/taler-wallet-core/src/operations
parent6000a55d583832a71335310514688f1f6faed722 (diff)
downloadwallet-core-32182fb1b912e1136ba933c4a4f204e6e2f33de2.tar.gz
wallet-core-32182fb1b912e1136ba933c4a4f204e6e2f33de2.tar.bz2
wallet-core-32182fb1b912e1136ba933c4a4f204e6e2f33de2.zip
cashout creation
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts92
1 files changed, 44 insertions, 48 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts
index 9819ae6a9..275d0aaf0 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -21,53 +21,62 @@ import {
AbsoluteTime,
AcceptManualWithdrawalResult,
AcceptWithdrawalResponse,
- addPaytoQueryParams,
AgeRestriction,
AmountJson,
AmountLike,
Amounts,
BankWithdrawDetails,
CancellationToken,
- canonicalizeBaseUrl,
- codecForBankWithdrawalOperationPostResponse,
- codecForReserveStatus,
- codecForTalerConfigResponse,
- codecForWalletKycUuid,
- codecForExchangeWithdrawBatchResponse,
- codecForWithdrawOperationStatusResponse,
- codecForWithdrawResponse,
CoinStatus,
DenomKeyType,
DenomSelectionState,
Duration,
- encodeCrock,
+ ExchangeBatchWithdrawRequest,
ExchangeListItem,
- ExchangeWithdrawalDetails,
+ ExchangeWithdrawBatchResponse,
ExchangeWithdrawRequest,
+ ExchangeWithdrawResponse,
+ ExchangeWithdrawalDetails,
ForcedDenomSel,
- getRandomBytes,
HttpStatusCode,
- j2s,
LibtoolVersion,
Logger,
NotificationType,
- parseWithdrawUri,
+ TalerError,
TalerErrorCode,
TalerErrorDetail,
+ TalerPreciseTimestamp,
TalerProtocolTimestamp,
+ TransactionAction,
+ TransactionMajorState,
+ TransactionMinorState,
+ TransactionState,
TransactionType,
- UnblindedSignature,
URL,
- ExchangeWithdrawBatchResponse,
- ExchangeWithdrawResponse,
+ UnblindedSignature,
WithdrawUriInfoResponse,
- ExchangeBatchWithdrawRequest,
- TransactionState,
- TransactionMajorState,
- TransactionMinorState,
- TalerPreciseTimestamp,
- TransactionAction,
+ addPaytoQueryParams,
+ canonicalizeBaseUrl,
+ codecForBankWithdrawalOperationPostResponse,
+ codecForExchangeWithdrawBatchResponse,
+ codecForIntegrationBankConfig,
+ codecForReserveStatus,
+ codecForWalletKycUuid,
+ codecForWithdrawOperationStatusResponse,
+ encodeCrock,
+ getErrorDetailFromException,
+ getRandomBytes,
+ j2s,
+ makeErrorDetail,
+ parseWithdrawUri
} from "@gnu-taler/taler-util";
+import {
+ HttpRequestLibrary,
+ HttpResponse,
+ readSuccessResponseJsonOrErrorCode,
+ readSuccessResponseJsonOrThrow,
+ throwUnexpectedRequestError,
+} from "@gnu-taler/taler-util/http";
import { EddsaKeypair } from "../crypto/cryptoImplementation.js";
import {
CoinRecord,
@@ -84,28 +93,28 @@ import {
WithdrawalRecordType,
} from "../db.js";
import {
- getErrorDetailFromException,
- makeErrorDetail,
- TalerError,
-} from "@gnu-taler/taler-util";
+ ExchangeDetailsRecord,
+ ExchangeEntryDbRecordStatus,
+ PendingTaskType,
+ isWithdrawableDenom,
+ timestampPreciseToDb
+} from "../index.js";
import { InternalWalletState } from "../internal-wallet-state.js";
import {
+ TaskIdentifiers,
TaskRunResult,
TaskRunResultType,
- TaskIdentifiers,
constructTaskIdentifier,
makeCoinAvailable,
makeCoinsVisible,
makeExchangeListItem,
runLongpollAsync,
} from "../operations/common.js";
+import { assertUnreachable } from "../util/assertUnreachable.js";
import {
- HttpRequestLibrary,
- HttpResponse,
- readSuccessResponseJsonOrErrorCode,
- readSuccessResponseJsonOrThrow,
- throwUnexpectedRequestError,
-} from "@gnu-taler/taler-util/http";
+ selectForcedWithdrawalDenominations,
+ selectWithdrawalDenominations,
+} from "../util/coinSelection.js";
import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js";
import {
DbAccess,
@@ -122,24 +131,11 @@ import {
updateExchangeFromUrl,
} from "./exchanges.js";
import {
- selectForcedWithdrawalDenominations,
- selectWithdrawalDenominations,
-} from "../util/coinSelection.js";
-import {
- ExchangeDetailsRecord,
- ExchangeEntryDbRecordStatus,
- ExchangeEntryDbUpdateStatus,
- PendingTaskType,
- isWithdrawableDenom,
- timestampPreciseToDb,
-} from "../index.js";
-import {
TransitionInfo,
constructTransactionIdentifier,
notifyTransition,
stopLongpolling,
} from "./transactions.js";
-import { assertUnreachable } from "../util/assertUnreachable.js";
/**
* Logger for this file.
@@ -559,7 +555,7 @@ export async function getBankWithdrawalInfo(
const configResp = await http.fetch(configReqUrl.href);
const config = await readSuccessResponseJsonOrThrow(
configResp,
- codecForTalerConfigResponse(),
+ codecForIntegrationBankConfig(),
);
const versionRes = LibtoolVersion.compare(