aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/dbless.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/dbless.ts')
-rw-r--r--packages/taler-wallet-core/src/dbless.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/dbless.ts b/packages/taler-wallet-core/src/dbless.ts
index d70eab888..4fc890788 100644
--- a/packages/taler-wallet-core/src/dbless.ts
+++ b/packages/taler-wallet-core/src/dbless.ts
@@ -31,7 +31,7 @@ import {
AmountJson,
Amounts,
AmountString,
- BankAccessApiClient,
+ TalerCorebankApiClient,
codecForAny,
codecForBankWithdrawalOperationPostResponse,
codecForBatchDepositSuccess,
@@ -109,7 +109,7 @@ export async function checkReserve(
export interface TopupReserveWithDemobankArgs {
http: HttpRequestLibrary;
reservePub: string;
- bankAccessApiBaseUrl: string;
+ corebankApiBaseUrl: string;
exchangeInfo: ExchangeInfo;
amount: AmountString;
}
@@ -117,8 +117,8 @@ export interface TopupReserveWithDemobankArgs {
export async function topupReserveWithDemobank(
args: TopupReserveWithDemobankArgs,
) {
- const { http, bankAccessApiBaseUrl, amount, exchangeInfo, reservePub } = args;
- const bankClient = new BankAccessApiClient(bankAccessApiBaseUrl);
+ const { http, corebankApiBaseUrl, amount, exchangeInfo, reservePub } = args;
+ const bankClient = new TalerCorebankApiClient(corebankApiBaseUrl);
const bankUser = await bankClient.createRandomBankUser();
const wopi = await bankClient.createWithdrawalOperation(
bankUser.username,
@@ -142,7 +142,9 @@ export async function topupReserveWithDemobank(
httpResp,
codecForBankWithdrawalOperationPostResponse(),
);
- await bankClient.confirmWithdrawalOperation(bankUser.username, wopi);
+ await bankClient.confirmWithdrawalOperation(bankUser.username, {
+ withdrawalOperationId: wopi.withdrawal_id,
+ });
}
export async function withdrawCoin(args: {
@@ -276,7 +278,10 @@ export async function depositCoin(args: {
merchant_pub: merchantPub,
};
const url = new URL(`batch-deposit`, dp.exchange_url);
- const httpResp = await http.fetch(url.href, { body: requestBody });
+ const httpResp = await http.fetch(url.href, {
+ method: "POST",
+ body: requestBody,
+ });
await readSuccessResponseJsonOrThrow(httpResp, codecForBatchDepositSuccess());
}