aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util/src/http-client/exchange.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/http-client/exchange.ts')
-rw-r--r--packages/taler-util/src/http-client/exchange.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/taler-util/src/http-client/exchange.ts b/packages/taler-util/src/http-client/exchange.ts
index 726c28204..003410ddb 100644
--- a/packages/taler-util/src/http-client/exchange.ts
+++ b/packages/taler-util/src/http-client/exchange.ts
@@ -31,6 +31,7 @@ import {
codecForAmlDecisionDetails,
codecForAmlRecords,
codecForExchangeConfig,
+ codecForExchangeKeys,
} from "./types.js";
import { addPaginationParams } from "./utils.js";
@@ -59,7 +60,7 @@ export class TalerExchangeHttpClient {
return compare?.compatible ?? false;
}
/**
- * https://docs.taler.net/core/api-merchant.html#get--config
+ * https://docs.taler.net/core/api-exchange.html#get--config
*
*/
async getConfig() {
@@ -74,6 +75,23 @@ export class TalerExchangeHttpClient {
return opUnknownFailure(resp, await resp.text());
}
}
+ /**
+ * https://docs.taler.net/core/api-merchant.html#get--config
+ *
+ * PARTIALLY IMPLEMENTED!!
+ */
+ async getKeys() {
+ const url = new URL(`keys`, this.baseUrl);
+ const resp = await this.httpLib.fetch(url.href, {
+ method: "GET",
+ });
+ switch (resp.status) {
+ case HttpStatusCode.Ok:
+ return opSuccess(resp, codecForExchangeKeys());
+ default:
+ return opUnknownFailure(resp, await resp.text());
+ }
+ }
// TERMS