+ AggregateTransferFee

This commit is contained in:
swrup 2025-12-04 17:54:40 +01:00
parent ac08f7cc07
commit e19db93d2c
2 changed files with 58 additions and 11 deletions

View file

@ -812,3 +812,31 @@ module ExchangePartnerListEntry = struct
|> mem "master_sig" WadPartnerSignaturePS.jsont ~enc:master_sig |> mem "master_sig" WadPartnerSignaturePS.jsont ~enc:master_sig
|> finish |> finish
end end
module AggregateTransferFee = struct
type t = {
wire_fee: Amount.t;
closing_fee: Amount.t;
start_date: Timestamp.t;
end_date: Timestamp.t;
sig_: MasterWireFeePS.t;
}
let jsont =
let make wire_fee closing_fee start_date end_date sig_ =
{ wire_fee; closing_fee; start_date; end_date; sig_ }
in
let wire_fee v = v.wire_fee in
let closing_fee v = v.closing_fee in
let start_date v = v.start_date in
let end_date v = v.end_date in
let sig_ v = v.sig_ in
let open Jsont.Object in
map ~kind:"AggregateTransferFee" make
|> mem "wire_fee" Amount.jsont ~enc:wire_fee
|> mem "closing_fee" Amount.jsont ~enc:closing_fee
|> mem "start_date" Timestamp.jsont ~enc:start_date
|> mem "end_date" Timestamp.jsont ~enc:end_date
|> mem "sig" MasterWireFeePS.jsont ~enc:sig_
|> finish
end

View file

@ -605,6 +605,36 @@ module WadPartnerSignaturePS = struct
include MK (R) include MK (R)
end end
module MasterWireFeePS = struct
module R = struct
(* purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_FEES *)
type r = {
h_wire_method: Hash_64_cstr.t;
start_date: TimeAbsoluteNBO.t;
end_date: TimeAbsoluteNBO.t;
wire_fee: AmountNBO.t;
closing_fee: AmountNBO.t;
}
let bin =
let open Bin in
Purpose.make_bin Taler_signatures.master_wire_fees @@ fun _purpose ->
record
(fun _purpose h_wire_method start_date end_date wire_fee closing_fee ->
{ h_wire_method; start_date; end_date; wire_fee; closing_fee })
|+ Purpose.field _purpose
|+ field Hash_64_cstr.bin (fun t -> t.h_wire_method)
|+ field TimeAbsoluteNBO.bin (fun t -> t.start_date)
|+ field TimeAbsoluteNBO.bin (fun t -> t.end_date)
|+ field AmountNBO.bin (fun t -> t.wire_fee)
|+ field AmountNBO.bin (fun t -> t.closing_fee)
|> sealr
end
include R
include MK (R)
end
(* ### BIN IMPL END ### *) (* ### BIN IMPL END ### *)
module WithdrawRequestPS = struct module WithdrawRequestPS = struct
@ -723,17 +753,6 @@ module ExchangeKeySetPS = struct
} }
end end
module MasterWireFeePS = struct
(* purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_FEES *)
type t = {
h_wire_method: Hash_64_cstr.t;
start_date: TimeAbsoluteNBO.t;
end_date: TimeAbsoluteNBO.t;
wire_fee: AmountNBO.t;
closing_fee: AmountNBO.t;
}
end
module DepositTrackPS = struct module DepositTrackPS = struct
(* purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION *) (* purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION *)
type t = { type t = {