diff options
author | Florian Dold <florian@dold.me> | 2023-09-06 12:32:31 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-06 12:32:31 +0200 |
commit | 7450bede5b5809f6a496b7e68852a454386850e5 (patch) | |
tree | ce4aedaad43ad095e643d96f5897883b70616c03 /packages/taler-wallet-core/src/dbless.ts | |
parent | 07d71eb29704a148f7e7bb0c064cbbad056d5a50 (diff) | |
download | wallet-core-7450bede5b5809f6a496b7e68852a454386850e5.tar.xz |
get rid of deprecated bank API client, change allowHttp to requireTls
Diffstat (limited to 'packages/taler-wallet-core/src/dbless.ts')
-rw-r--r-- | packages/taler-wallet-core/src/dbless.ts | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/packages/taler-wallet-core/src/dbless.ts b/packages/taler-wallet-core/src/dbless.ts index 5532345ae..357b7d289 100644 --- a/packages/taler-wallet-core/src/dbless.ts +++ b/packages/taler-wallet-core/src/dbless.ts @@ -48,24 +48,20 @@ import { parsePaytoUri, UnblindedSignature, } from "@gnu-taler/taler-util"; -import { TalerCryptoInterface } from "./crypto/cryptoImplementation.js"; -import { DenominationRecord } from "./db.js"; -import { - BankAccessApi, - BankApi, - BankServiceHandle, -} from "./bank-api-client.js"; import { HttpRequestLibrary, readSuccessResponseJsonOrThrow, } from "@gnu-taler/taler-util/http"; +import { BankAccessApiClient, BankServiceHandle } from "./bank-api-client.js"; +import { TalerCryptoInterface } from "./crypto/cryptoImplementation.js"; +import { DenominationRecord } from "./db.js"; +import { isWithdrawableDenom } from "./index.js"; +import { ExchangeInfo } from "./operations/exchanges.js"; +import { assembleRefreshRevealRequest } from "./operations/refresh.js"; import { getBankStatusUrl, getBankWithdrawalInfo, } from "./operations/withdraw.js"; -import { ExchangeInfo } from "./operations/exchanges.js"; -import { assembleRefreshRevealRequest } from "./operations/refresh.js"; -import { isWithdrawableDenom, WalletConfig } from "./index.js"; const logger = new Logger("dbless.ts"); @@ -125,10 +121,10 @@ export async function topupReserveWithDemobank( bankAccessApiBaseUrl: bankAccessApiBaseUrl, http, }; - const bankUser = await BankApi.createRandomBankUser(bankHandle); - const wopi = await BankAccessApi.createWithdrawalOperation( - bankHandle, - bankUser, + const bankClient = new BankAccessApiClient(bankAccessApiBaseUrl); + const bankUser = await bankClient.createRandomBankUser(); + const wopi = await bankClient.createWithdrawalOperation( + bankUser.username, amount, ); const bankInfo = await getBankWithdrawalInfo(http, wopi.taler_withdraw_uri); @@ -149,7 +145,7 @@ export async function topupReserveWithDemobank( httpResp, codecForBankWithdrawalOperationPostResponse(), ); - await BankApi.confirmWithdrawalOperation(bankHandle, bankUser, wopi); + await bankClient.confirmWithdrawalOperation(bankUser.username, wopi); } export async function withdrawCoin(args: { |