commit 6cb522bba247021cc20133da8705ddd0a597ed62
parent dbcc79e74e2d057595bd036b8f002f196f90d4f6
Author: Florian Dold <florian@dold.me>
Date: Fri, 13 Jun 2025 00:40:00 +0200
wallet-core: expose bankComplianceLanguage on exchange entries
Diffstat:
4 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/packages/taler-util/src/types-taler-exchange.ts b/packages/taler-util/src/types-taler-exchange.ts
@@ -413,6 +413,17 @@ export interface ExchangeKeysResponse {
*/
currency: string;
+ // Instructs wallets to use certain bank-specific
+ // language (for buttons) and/or other UI/UX customization
+ // for compliance with the rules of that bank.
+ // The specific customizations to apply are done on a per-wallet
+ // basis as requested by the specific bank. They only
+ // apply when it is clear that the wallet is using digital
+ // cash from that bank. This is an advisory option, not
+ // all wallets must support all compliance languages.
+ // @since protocol **v24**.
+ bank_compliance_language?: string;
+
/**
* Type of the asset. "fiat", "crypto", "regional"
* or "stock". Wallets should adjust their UI/UX
@@ -2592,6 +2603,7 @@ export const codecForExchangeKeysResponse = (): Codec<ExchangeKeysResponse> =>
.property("kyc_enabled", codecOptional(codecForBoolean()))
.property("shopping_url", codecOptional(codecForString()))
.property("tiny_amount", codecOptional(codecForAmountString()))
+ .property("bank_compliance_language", codecOptional(codecForString()))
.deprecatedProperty("rewards_allowed")
.build("TalerExchangeApi.ExchangeKeysResponse");
diff --git a/packages/taler-util/src/types-taler-wallet.ts b/packages/taler-util/src/types-taler-wallet.ts
@@ -1602,6 +1602,7 @@ export interface ExchangeListItem {
walletKycReservePub?: string;
walletKycAccessToken?: string;
walletKycUrl?: string;
+
/** Threshold that we've requested to satisfy. */
walletKycRequestedThreshold?: string;
@@ -1611,13 +1612,19 @@ export interface ExchangeListItem {
*/
peerPaymentsDisabled: boolean;
- /**
- * Set to true if this exchange doesn't charge any fees.
- */
+ /** Set to true if this exchange doesn't charge any fees. */
noFees: boolean;
+ /** Most general scope that the exchange is a part of. */
scopeInfo: ScopeInfo;
+ /**
+ * Instructs wallets to use certain bank-specific
+ * language (for buttons) and/or other UI/UX customization
+ * for compliance with the rules of that bank.
+ */
+ bankComplianceLanguage: string | undefined;
+
lastUpdateTimestamp: TalerPreciseTimestamp | undefined;
/**
@@ -1699,6 +1706,7 @@ export const codecForExchangeListItem = (): Codec<ExchangeListItem> =>
.property("lastUpdateTimestamp", codecOptional(codecForPreciseTimestamp))
.property("noFees", codecForBoolean())
.property("peerPaymentsDisabled", codecForBoolean())
+ .property("bankComplianceLanguage", codecOptional(codecForString()))
.build("ExchangeListItem");
export const codecForExchangesListResponse = (): Codec<ExchangesListResponse> =>
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts
@@ -641,6 +641,13 @@ export interface ExchangeDetailsRecord {
hardLimits?: AccountLimit[];
zeroLimits?: ZeroLimitedOperation[];
+
+ /**
+ * Instructs wallets to use certain bank-specific
+ * language (for buttons) and/or other UI/UX customization
+ * for compliance with the rules of that bank.
+ */
+ bankComplianceLanguage: string | undefined;
}
export interface ExchangeDetailsPointer {
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
@@ -512,6 +512,7 @@ async function makeExchangeListItem(
? AgeRestriction.getAgeGroupsFromMask(exchangeDetails.ageMask)
: [],
paytoUris: exchangeDetails?.wireInfo.accounts.map((x) => x.payto_uri) ?? [],
+ bankComplianceLanguage: exchangeDetails?.bankComplianceLanguage,
lastUpdateTimestamp: timestampOptionalPreciseFromDb(r.lastUpdate),
lastUpdateErrorInfo,
scopeInfo: scopeInfo ?? {
@@ -904,6 +905,7 @@ export interface ExchangeKeysDownloadResult {
walletBalanceLimits: AmountString[] | undefined;
hardLimits: AccountLimit[] | undefined;
zeroLimits: ZeroLimitedOperation[] | undefined;
+ bankComplianceLanguage: string | undefined;
}
/**
@@ -1070,6 +1072,8 @@ async function downloadExchangeKeysInfo(
exchangeKeysResponseUnchecked.wallet_balance_limit_without_kyc,
hardLimits: exchangeKeysResponseUnchecked.hard_limits,
zeroLimits: exchangeKeysResponseUnchecked.zero_limits,
+ bankComplianceLanguage:
+ exchangeKeysResponseUnchecked.bank_compliance_language,
};
return {
type: "ok",
@@ -1847,6 +1851,7 @@ export async function updateExchangeFromUrlHandler(
walletBalanceLimits: keysInfo.walletBalanceLimits,
hardLimits: keysInfo.hardLimits,
zeroLimits: keysInfo.zeroLimits,
+ bankComplianceLanguage: keysInfo.bankComplianceLanguage,
};
r.noFees = noFees;
r.peerPaymentsDisabled = peerPaymentsDisabled;