From 89f1a281fea66b986fc0a003dc10446f6ed6e4a2 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 2 Dec 2020 14:55:04 +0100 Subject: backup WIP --- packages/taler-wallet-android/src/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'packages/taler-wallet-android/src') diff --git a/packages/taler-wallet-android/src/index.ts b/packages/taler-wallet-android/src/index.ts index 07d15d584..bfda8ab71 100644 --- a/packages/taler-wallet-android/src/index.ts +++ b/packages/taler-wallet-android/src/index.ts @@ -38,6 +38,8 @@ import { WalletNotification, WALLET_EXCHANGE_PROTOCOL_VERSION, WALLET_MERCHANT_PROTOCOL_VERSION, + bytesToString, + stringToBytes, } from "taler-wallet-core"; import fs from "fs"; @@ -57,6 +59,10 @@ export class AndroidHttpLib implements HttpRequestLibrary { constructor(private sendMessage: (m: string) => void) {} + fetch(url: string, opt?: HttpRequestOptions): Promise { + return this.nodeHttpLib.fetch(url, opt); + } + get(url: string, opt?: HttpRequestOptions): Promise { if (this.useNfcTunnel) { const myId = this.requestId++; @@ -120,6 +126,7 @@ export class AndroidHttpLib implements HttpRequestLibrary { requestMethod: "FIXME", json: async () => JSON.parse(msg.responseText), text: async () => msg.responseText, + bytes: async () => { throw Error("bytes() not supported for tunnel response") }, }; p.resolve(resp); } else { -- cgit v1.2.3