From 4365cd6401713b2e207d8c032c0558487e860154 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 28 Jul 2020 14:22:35 +0530 Subject: towards the new withdrawal API (temporarily breaks WebExtension wallet) --- src/walletCoreApiHandler.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/walletCoreApiHandler.ts') diff --git a/src/walletCoreApiHandler.ts b/src/walletCoreApiHandler.ts index 6c32fd888..64039c0c1 100644 --- a/src/walletCoreApiHandler.ts +++ b/src/walletCoreApiHandler.ts @@ -108,16 +108,16 @@ const codecForApplyRefundRequest = (): Codec => .property("talerRefundUri", codecForString) .build("ApplyRefundRequest"); -interface GetWithdrawUriInfoRequest { +interface GetWithdrawalDetailsForUriRequest { talerWithdrawUri: string; } -const codecForGetWithdrawUriInfoRequest = (): Codec< - GetWithdrawUriInfoRequest +const codecForGetWithdrawalDetailsForUri = (): Codec< + GetWithdrawalDetailsForUriRequest > => - makeCodecForObject() + makeCodecForObject() .property("talerWithdrawUri", codecForString) - .build("GetWithdrawUriInfoRequest"); + .build("GetWithdrawalDetailsForUriRequest"); interface AbortProposalRequest { proposalId: string; @@ -172,10 +172,9 @@ async function dispatchRequestInternal( case "listExchanges": { return await wallet.getExchanges(); } - case "getWithdrawUriInfo": { - const req = codecForGetWithdrawUriInfoRequest().decode(payload); - // FIXME: implement "natively" - throw Error("not implemented"); + case "getWithdrawalDetailsForUri": { + const req = codecForGetWithdrawalDetailsForUri().decode(payload); + return await wallet.getWithdrawalDetailsForUri(req.talerWithdrawUri); } case "acceptManualWithdrawal": { const req = codecForAcceptManualWithdrawalRequet().decode(payload); -- cgit v1.2.3