summaryrefslogtreecommitdiff
path: root/src/wallet.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet.ts')
-rw-r--r--src/wallet.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wallet.ts b/src/wallet.ts
index 2b804ded7..e04c849d5 100644
--- a/src/wallet.ts
+++ b/src/wallet.ts
@@ -72,6 +72,7 @@ import {
ExchangeListItem,
ExchangesListRespose,
ManualWithdrawalDetails,
+ GetExchangeTosResult,
} from "./types/walletTypes";
import { Logger } from "./util/logging";
@@ -500,6 +501,20 @@ export class Wallet {
}
}
+ async getExchangeTos(exchangeBaseUrl: string): Promise<GetExchangeTosResult> {
+ const exchange = await this.updateExchangeFromUrl(exchangeBaseUrl);
+ const tos = exchange.termsOfServiceText;
+ const currentEtag = exchange.termsOfServiceLastEtag;
+ if (!tos || !currentEtag) {
+ throw Error("exchange is in invalid state");
+ }
+ return {
+ acceptedEtag: exchange.termsOfServiceAcceptedEtag,
+ currentEtag,
+ tos,
+ }
+ }
+
/**
* Get detailed balance information, sliced by exchange and by currency.
*/