diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-28 14:22:35 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-28 14:22:35 +0530 |
commit | 4365cd6401713b2e207d8c032c0558487e860154 (patch) | |
tree | f66b4bc5aa9dd7e92b72546e0b2fe79c18ed6573 /src/walletCoreApiHandler.ts | |
parent | 472307a607b046e32f50b05a8be44c47c4b153d4 (diff) | |
download | wallet-core-4365cd6401713b2e207d8c032c0558487e860154.tar.xz |
towards the new withdrawal API (temporarily breaks WebExtension wallet)
Diffstat (limited to 'src/walletCoreApiHandler.ts')
-rw-r--r-- | src/walletCoreApiHandler.ts | 17 |
1 files changed, 8 insertions, 9 deletions
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<ApplyRefundRequest> => .property("talerRefundUri", codecForString) .build("ApplyRefundRequest"); -interface GetWithdrawUriInfoRequest { +interface GetWithdrawalDetailsForUriRequest { talerWithdrawUri: string; } -const codecForGetWithdrawUriInfoRequest = (): Codec< - GetWithdrawUriInfoRequest +const codecForGetWithdrawalDetailsForUri = (): Codec< + GetWithdrawalDetailsForUriRequest > => - makeCodecForObject<GetWithdrawUriInfoRequest>() + makeCodecForObject<GetWithdrawalDetailsForUriRequest>() .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); |