+ EchangeWireAccount
This commit is contained in:
parent
8f5980e650
commit
df30a73e23
1 changed files with 49 additions and 2 deletions
51
src/api.ml
51
src/api.ml
|
|
@ -1,6 +1,6 @@
|
||||||
(* TODO
|
(* TODO
|
||||||
option:
|
payto_uri
|
||||||
- correct use opt_mem or Jsont.option
|
option: correct use opt_mem or Jsont.option
|
||||||
number
|
number
|
||||||
- number is "float", but we probably want int everywhere instead
|
- number is "float", but we probably want int everywhere instead
|
||||||
- numeric values capped at 2^53 -1 inclusive because json
|
- numeric values capped at 2^53 -1 inclusive because json
|
||||||
|
|
@ -1131,3 +1131,50 @@ module AccountRestriction = struct
|
||||||
|> case_mem "type" Jsont.string ~enc:Fun.id ~enc_case cases
|
|> case_mem "type" Jsont.string ~enc:Fun.id ~enc_case cases
|
||||||
|> finish
|
|> finish
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module ExchangeWireAccount = struct
|
||||||
|
type t = {
|
||||||
|
payto_uri: string;
|
||||||
|
conversion_url: string option;
|
||||||
|
credit_restrictions: AccountRestriction.t list;
|
||||||
|
debit_restrictions: AccountRestriction.t list;
|
||||||
|
master_sig: MasterWireDetailsPS.t;
|
||||||
|
bank_label: string option;
|
||||||
|
priority: int option;
|
||||||
|
}
|
||||||
|
|
||||||
|
let jsont =
|
||||||
|
let make payto_uri conversion_url credit_restrictions debit_restrictions
|
||||||
|
master_sig bank_label priority =
|
||||||
|
{
|
||||||
|
payto_uri;
|
||||||
|
conversion_url;
|
||||||
|
credit_restrictions;
|
||||||
|
debit_restrictions;
|
||||||
|
master_sig;
|
||||||
|
bank_label;
|
||||||
|
priority;
|
||||||
|
}
|
||||||
|
in
|
||||||
|
let payto_uri v = v.payto_uri in
|
||||||
|
let conversion_url v = v.conversion_url in
|
||||||
|
let credit_restrictions v = v.credit_restrictions in
|
||||||
|
let debit_restrictions v = v.debit_restrictions in
|
||||||
|
let master_sig v = v.master_sig in
|
||||||
|
let bank_label v = v.bank_label in
|
||||||
|
let priority v = v.priority in
|
||||||
|
let open Jsont.Object in
|
||||||
|
map ~kind:"ExchangeWireAccount" make
|
||||||
|
|> mem "payto_uri" Jsont.string ~enc:payto_uri
|
||||||
|
|> opt_mem "conversion_url" Jsont.string ~enc:conversion_url
|
||||||
|
|> mem "credit_restrictions"
|
||||||
|
(Jsont.list AccountRestriction.jsont)
|
||||||
|
~enc:credit_restrictions
|
||||||
|
|> mem "debit_restrictions"
|
||||||
|
(Jsont.list AccountRestriction.jsont)
|
||||||
|
~enc:debit_restrictions
|
||||||
|
|> mem "master_sig" MasterWireDetailsPS.jsont ~enc:master_sig
|
||||||
|
|> opt_mem "bank_label" Jsont.string ~enc:bank_label
|
||||||
|
|> opt_mem "priority" Jsont.int ~enc:priority
|
||||||
|
|> finish
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue