aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util/src/taler-types.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-11-21 15:00:14 +0100
committerFlorian Dold <florian@dold.me>2023-11-21 15:00:24 +0100
commit6000a55d583832a71335310514688f1f6faed722 (patch)
treec9b5ae2ca9f2511c75e3ed375ae5bbeade44ac66 /packages/taler-util/src/taler-types.ts
parent77eb29cb7caf50e870ada861a4ef83712a31a1cb (diff)
downloadwallet-core-6000a55d583832a71335310514688f1f6faed722.tar.xz
towards a currency conversion integration test
Diffstat (limited to 'packages/taler-util/src/taler-types.ts')
-rw-r--r--packages/taler-util/src/taler-types.ts48
1 files changed, 13 insertions, 35 deletions
diff --git a/packages/taler-util/src/taler-types.ts b/packages/taler-util/src/taler-types.ts
index c0c8cc17d..5774f09f7 100644
--- a/packages/taler-util/src/taler-types.ts
+++ b/packages/taler-util/src/taler-types.ts
@@ -761,7 +761,7 @@ export class ExchangeKeysJson {
global_fees: GlobalFees[];
- accounts: AccountInfo[];
+ accounts: ExchangeWireAccount[];
wire_fees: { [methodName: string]: WireFeesJson[] };
@@ -939,20 +939,6 @@ export class WireFeesJson {
end_date: TalerProtocolTimestamp;
}
-export interface AccountInfo {
- payto_uri: string;
- master_sig: string;
- // Will become mandatory in later protocol versions
- conversion_url?: string;
- credit_restrictions?: any;
- debit_restrictions?: any;
-}
-
-/**
- * @deprecated
- */
-export interface ExchangeWireJson { }
-
/**
* Proposal returned from the contract URL.
*/
@@ -1516,7 +1502,7 @@ export const codecForExchangeKeysJson = (): Codec<ExchangeKeysJson> =>
.property("version", codecForString())
.property("reserve_closing_delay", codecForDuration)
.property("global_fees", codecForList(codecForGlobalFees()))
- .property("accounts", codecForList(codecForAccountInfo()))
+ .property("accounts", codecForList(codecForExchangeWireAccount()))
.property("wire_fees", codecForMap(codecForList(codecForWireFeesJson())))
.property("denominations", codecForList(codecForNgDenominations))
.build("ExchangeKeysJson");
@@ -1530,15 +1516,6 @@ export const codecForWireFeesJson = (): Codec<WireFeesJson> =>
.property("end_date", codecForTimestamp)
.build("WireFeesJson");
-export const codecForAccountInfo = (): Codec<AccountInfo> =>
- buildCodecForObject<AccountInfo>()
- .property("payto_uri", codecForString())
- .property("master_sig", codecForString())
- .property("conversion_url", codecOptional(codecForString()))
- .property("credit_restrictions", codecForAny())
- .property("debit_restrictions", codecForAny())
- .build("AccountInfo");
-
export const codecForProposal = (): Codec<Proposal> =>
buildCodecForObject<Proposal>()
.property("contract_terms", codecForAny())
@@ -1568,13 +1545,14 @@ export const codecForWithdrawOperationStatusResponse =
.property("wire_types", codecForList(codecForString()))
.build("WithdrawOperationStatusResponse");
-export const codecForRewardPickupGetResponse = (): Codec<RewardPickupGetResponse> =>
- buildCodecForObject<RewardPickupGetResponse>()
- .property("reward_amount", codecForString())
- .property("exchange_url", codecForString())
- .property("next_url", codecOptional(codecForString()))
- .property("expiration", codecForTimestamp)
- .build("TipPickupGetResponse");
+export const codecForRewardPickupGetResponse =
+ (): Codec<RewardPickupGetResponse> =>
+ buildCodecForObject<RewardPickupGetResponse>()
+ .property("reward_amount", codecForString())
+ .property("exchange_url", codecForString())
+ .property("next_url", codecOptional(codecForString()))
+ .property("expiration", codecForTimestamp)
+ .build("TipPickupGetResponse");
export const codecForRecoupConfirmation = (): Codec<RecoupConfirmation> =>
buildCodecForObject<RecoupConfirmation>()
@@ -2376,7 +2354,7 @@ export interface RegexAccountRestriction {
human_hint_i18n?: InternationalizedString;
}
-export interface WireAccount {
+export interface ExchangeWireAccount {
// payto:// URI identifying the account and wire method
payto_uri: string;
@@ -2401,8 +2379,8 @@ export interface WireAccount {
master_sig: EddsaSignatureString;
}
-export const codecForWireAccount = (): Codec<WireAccount> =>
- buildCodecForObject<WireAccount>()
+export const codecForExchangeWireAccount = (): Codec<ExchangeWireAccount> =>
+ buildCodecForObject<ExchangeWireAccount>()
.property("conversion_url", codecOptional(codecForString()))
.property("credit_restrictions", codecForList(codecForAny()))
.property("debit_restrictions", codecForList(codecForAny()))