diff options
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 24c7f7b9e..f1ed592bd 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -45,6 +45,7 @@ import { codecForDeleteTransactionRequest, codecForForceRefreshRequest, codecForForgetKnownBankAccounts, + codecForGetBalanceDetailRequest, codecForGetContractTermsDetails, codecForGetExchangeTosRequest, codecForGetFeeForDeposit, @@ -87,6 +88,7 @@ import { ExchangesListResponse, ExchangeTosStatusDetails, FeeDescription, + GetBalanceDetailRequest, GetExchangeTosResult, InitResponse, j2s, @@ -154,7 +156,11 @@ import { runBackupCycle, } from "./operations/backup/index.js"; import { setWalletDeviceId } from "./operations/backup/state.js"; -import { getBalances } from "./operations/balance.js"; +import { + getBalanceDetail, + getBalances, + getMerchantPaymentBalanceDetails, +} from "./operations/balance.js"; import { getExchangeTosStatus, makeExchangeListItem, @@ -948,9 +954,9 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> { ageCommitmentProof: c.ageCommitmentProof, spend_allocation: c.spendAllocation ? { - amount: c.spendAllocation.amount, - id: c.spendAllocation.id, - } + amount: c.spendAllocation.amount, + id: c.spendAllocation.id, + } : undefined, }); } @@ -1111,6 +1117,10 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( case WalletApiOperation.GetBalances: { return await getBalances(ws); } + case WalletApiOperation.GetBalanceDetail: { + const req = codecForGetBalanceDetailRequest().decode(payload); + return await getBalanceDetail(ws, req); + } case WalletApiOperation.GetUserAttentionRequests: { const req = codecForUserAttentionsRequest().decode(payload); return await getUserAttentions(ws, req); @@ -1350,7 +1360,8 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( { amount: Amounts.stringify(amount), reserve_pub: wres.reservePub, - debit_account: "payto://x-taler-bank/localhost/testdebtor?receiver-name=Foo", + debit_account: + "payto://x-taler-bank/localhost/testdebtor?receiver-name=Foo", }, ); const fbResp = await readSuccessResponseJsonOrThrow(fbReq, codecForAny()); |