diff options
Diffstat (limited to 'packages/taler-util')
-rw-r--r-- | packages/taler-util/src/merchant-api-types.ts | 8 | ||||
-rw-r--r-- | packages/taler-util/src/taler-types.ts | 48 | ||||
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 20 |
3 files changed, 21 insertions, 55 deletions
diff --git a/packages/taler-util/src/merchant-api-types.ts b/packages/taler-util/src/merchant-api-types.ts index 9a7740088..999246597 100644 --- a/packages/taler-util/src/merchant-api-types.ts +++ b/packages/taler-util/src/merchant-api-types.ts @@ -44,8 +44,8 @@ import { TalerProtocolDuration, codecForTimestamp, TalerProtocolTimestamp, - WireAccount, - codecForWireAccount, + ExchangeWireAccount, + codecForExchangeWireAccount, codecForList, FacadeCredentials, } from "@gnu-taler/taler-util"; @@ -376,13 +376,13 @@ export interface MerchantReserveCreateConfirmation { reserve_pub: EddsaPublicKeyString; // Wire accounts of the exchange where to transfer the funds. - accounts: WireAccount[]; + accounts: ExchangeWireAccount[]; } export const codecForMerchantReserveCreateConfirmation = (): Codec<MerchantReserveCreateConfirmation> => buildCodecForObject<MerchantReserveCreateConfirmation>() - .property("accounts", codecForList(codecForWireAccount())) + .property("accounts", codecForList(codecForExchangeWireAccount())) .property("reserve_pub", codecForString()) .build("MerchantReserveCreateConfirmation"); 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())) diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 7a4ad91e8..148117673 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -58,11 +58,13 @@ import { DenomKeyType, DenominationPubKey, ExchangeAuditor, + ExchangeWireAccount, InternationalizedString, MerchantContractTerms, MerchantInfo, PeerContractTerms, UnblindedSignature, + codecForExchangeWireAccount, codecForMerchantContractTerms, codecForPeerContractTerms, } from "./taler-types.js"; @@ -1123,19 +1125,11 @@ export interface WireFee { sig: string; } -/** - * Information about one of the exchange's bank accounts. - */ -export interface ExchangeAccount { - payto_uri: string; - master_sig: string; -} - export type WireFeeMap = { [wireMethod: string]: WireFee[] }; export interface WireInfo { feesForType: WireFeeMap; - accounts: ExchangeAccount[]; + accounts: ExchangeWireAccount[]; } export interface ExchangeGlobalFees { @@ -1154,12 +1148,6 @@ export interface ExchangeGlobalFees { signature: string; } -const codecForExchangeAccount = (): Codec<ExchangeAccount> => - buildCodecForObject<ExchangeAccount>() - .property("payto_uri", codecForString()) - .property("master_sig", codecForString()) - .build("codecForExchangeAccount"); - const codecForWireFee = (): Codec<WireFee> => buildCodecForObject<WireFee>() .property("sig", codecForString()) @@ -1172,7 +1160,7 @@ const codecForWireFee = (): Codec<WireFee> => const codecForWireInfo = (): Codec<WireInfo> => buildCodecForObject<WireInfo>() .property("feesForType", codecForMap(codecForList(codecForWireFee()))) - .property("accounts", codecForList(codecForExchangeAccount())) + .property("accounts", codecForList(codecForExchangeWireAccount())) .build("codecForWireInfo"); export interface DenominationInfo { |