summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/walletTypes.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-09-05 21:09:28 +0200
committerFlorian Dold <florian@dold.me>2022-09-05 21:09:28 +0200
commit3f5a76751b3bf410ea3df023eef2f5bfd6f730cd (patch)
tree7ed7bc46035e557ad6eeb9647980d0a60eb7621c /packages/taler-util/src/walletTypes.ts
parent0f57f48f847a7bd0b35ddc05770aa169fec1c136 (diff)
downloadwallet-core-3f5a76751b3bf410ea3df023eef2f5bfd6f730cd.tar.gz
wallet-core-3f5a76751b3bf410ea3df023eef2f5bfd6f730cd.tar.bz2
wallet-core-3f5a76751b3bf410ea3df023eef2f5bfd6f730cd.zip
wallet-core: make listExchanges return less datav0.9.0-dev.16
Since the webextension UI depends on the full response, we have a temporary listExchangesDetailled request. See https://bugs.taler.net/n/7323 for details.
Diffstat (limited to 'packages/taler-util/src/walletTypes.ts')
-rw-r--r--packages/taler-util/src/walletTypes.ts32
1 files changed, 27 insertions, 5 deletions
diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/walletTypes.ts
index 94a988c67..095266f22 100644
--- a/packages/taler-util/src/walletTypes.ts
+++ b/packages/taler-util/src/walletTypes.ts
@@ -571,6 +571,11 @@ export interface DepositInfo {
export interface ExchangesListRespose {
exchanges: ExchangeListItem[];
}
+
+export interface ExchangeDetailledListRespose {
+ exchanges: ExchangeFullDetailsListItem[];
+}
+
export interface WalletCoreVersion {
hash: string | undefined;
version: string;
@@ -578,6 +583,7 @@ export interface WalletCoreVersion {
merchant: string;
bank: string;
}
+
export interface KnownBankAccounts {
accounts: { [payto: string]: PaytoUri };
}
@@ -727,7 +733,7 @@ export interface DenominationInfo {
stampExpireDeposit: TalerProtocolTimestamp;
}
-export interface ExchangeListItem {
+export interface ExchangeFullDetailsListItem {
exchangeBaseUrl: string;
currency: string;
paytoUris: string[];
@@ -737,6 +743,13 @@ export interface ExchangeListItem {
denominations: DenominationInfo[];
}
+export interface ExchangeListItem {
+ exchangeBaseUrl: string;
+ currency: string;
+ paytoUris: string[];
+ tos: ExchangeTos;
+}
+
const codecForAuditorDenomSig = (): Codec<AuditorDenomSig> =>
buildCodecForObject<AuditorDenomSig>()
.property("denom_pub_h", codecForString())
@@ -758,20 +771,29 @@ const codecForExchangeTos = (): Codec<ExchangeTos> =>
.property("content", codecOptional(codecForString()))
.build("ExchangeTos");
+export const codecForExchangeFullDetailsListItem =
+ (): Codec<ExchangeFullDetailsListItem> =>
+ buildCodecForObject<ExchangeFullDetailsListItem>()
+ .property("currency", codecForString())
+ .property("exchangeBaseUrl", codecForString())
+ .property("paytoUris", codecForList(codecForString()))
+ .property("tos", codecForExchangeTos())
+ .property("auditors", codecForList(codecForExchangeAuditor()))
+ .property("wireInfo", codecForWireInfo())
+ .property("denominations", codecForList(codecForDenominationInfo()))
+ .build("ExchangeListItem");
+
export const codecForExchangeListItem = (): Codec<ExchangeListItem> =>
buildCodecForObject<ExchangeListItem>()
.property("currency", codecForString())
.property("exchangeBaseUrl", codecForString())
.property("paytoUris", codecForList(codecForString()))
.property("tos", codecForExchangeTos())
- .property("auditors", codecForList(codecForExchangeAuditor()))
- .property("wireInfo", codecForWireInfo())
- .property("denominations", codecForList(codecForDenominationInfo()))
.build("ExchangeListItem");
export const codecForExchangesListResponse = (): Codec<ExchangesListRespose> =>
buildCodecForObject<ExchangesListRespose>()
- .property("exchanges", codecForList(codecForExchangeListItem()))
+ .property("exchanges", codecForList(codecForExchangeFullDetailsListItem()))
.build("ExchangesListRespose");
export interface AcceptManualWithdrawalResult {