diff options
Diffstat (limited to 'packages/taler-util/src/http-client/types.ts')
-rw-r--r-- | packages/taler-util/src/http-client/types.ts | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index 8037b5a16..dd2161deb 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -524,17 +524,24 @@ export const codecForAccountAddResponse = export const codecForAccountsSummaryResponse = (): Codec<TalerMerchantApi.AccountsSummaryResponse> => buildCodecForObject<TalerMerchantApi.AccountsSummaryResponse>() - .property("accounts", codecForList(codecForBankAccountEntry())) + .property("accounts", codecForList(codecForBankAccountSummaryEntry())) .build("TalerMerchantApi.AccountsSummaryResponse"); +export const codecForBankAccountSummaryEntry = + (): Codec<TalerMerchantApi.BankAccountSummaryEntry> => + buildCodecForObject<TalerMerchantApi.BankAccountSummaryEntry>() + .property("payto_uri", codecForPaytoString()) + .property("h_wire", codecForString()) + .build("TalerMerchantApi.BankAccountSummaryEntry"); + export const codecForBankAccountEntry = (): Codec<TalerMerchantApi.BankAccountEntry> => buildCodecForObject<TalerMerchantApi.BankAccountEntry>() .property("payto_uri", codecForPaytoString()) .property("h_wire", codecForString()) .property("salt", codecForString()) - .property("credit_facade_url", codecForURL()) - .property("active", codecForBoolean()) + .property("credit_facade_url", codecOptional(codecForURL())) + .property("active", codecOptional(codecForBoolean())) .build("TalerMerchantApi.BankAccountEntry"); export const codecForInventorySummaryResponse = @@ -3772,7 +3779,14 @@ export namespace TalerMerchantApi { export interface AccountsSummaryResponse { // List of accounts that are known for the instance. - accounts: BankAccountEntry[]; + accounts: BankAccountSummaryEntry[]; + } + export interface BankAccountSummaryEntry { + // payto:// URI of the account. + payto_uri: PaytoString; + + // Hash over the wire details (including over the salt). + h_wire: HashCode; } export interface BankAccountEntry { // payto:// URI of the account. @@ -3790,7 +3804,7 @@ export namespace TalerMerchantApi { // true if this account is active, // false if it is historic. - active: boolean; + active?: boolean; } export interface ProductAddDetail { |