wip /keys
This commit is contained in:
parent
13393fbe31
commit
638cccc185
2 changed files with 58 additions and 1 deletions
17
src/keys.ml
Normal file
17
src/keys.ml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
[@@@ocaml.warning "-27"]
|
||||||
|
|
||||||
|
open Api
|
||||||
|
|
||||||
|
let mk_keys ~sm_signkey ~sm_denom = assert false
|
||||||
|
let jsont = ExchangeKeysResponse.jsont
|
||||||
|
|
||||||
|
let f req server _env =
|
||||||
|
Logs.info (fun m -> m "GET /keys/");
|
||||||
|
let sm_signkey = Vif.Server.device Devices.secmod_signkey server in
|
||||||
|
let sm_denom = Vif.Server.device Devices.secmod_denom server in
|
||||||
|
let res =
|
||||||
|
let v = mk_keys ~sm_signkey ~sm_denom in
|
||||||
|
let s = Api.encode_exn jsont v in
|
||||||
|
Ok s
|
||||||
|
in
|
||||||
|
Respond_util.respond_with_res res req
|
||||||
42
src/pg.ml
42
src/pg.ml
|
|
@ -1,5 +1,7 @@
|
||||||
(* TODO
|
(* TODO
|
||||||
|
|
||||||
|
check there is no issues with signed/unsigned integers
|
||||||
|
|
||||||
how to fix postgres/caqti tuple type?
|
how to fix postgres/caqti tuple type?
|
||||||
try something with OID?
|
try something with OID?
|
||||||
need to add boilerplate in each query for amounts
|
need to add boilerplate in each query for amounts
|
||||||
|
|
@ -342,7 +344,8 @@ let insert_wire =
|
||||||
}
|
}
|
||||||
->
|
->
|
||||||
(* TODO wire
|
(* TODO wire
|
||||||
what about master_sig_add ? *)
|
some field are allowed to be NULL
|
||||||
|
-> use option? *)
|
||||||
let conversion_url = "" in
|
let conversion_url = "" in
|
||||||
let credit_restrictions = "" in
|
let credit_restrictions = "" in
|
||||||
let debit_restrictions = "" in
|
let debit_restrictions = "" in
|
||||||
|
|
@ -481,3 +484,40 @@ let insert_partner =
|
||||||
wad_fee,
|
wad_fee,
|
||||||
master_sig,
|
master_sig,
|
||||||
partner_base_url )
|
partner_base_url )
|
||||||
|
|
||||||
|
(* TODO wire
|
||||||
|
option for nullable fields?
|
||||||
|
collect in a record type *)
|
||||||
|
let get_wire_accouts =
|
||||||
|
let get_wire_accounts =
|
||||||
|
let master_sig = Bin_sig.MasterWireDetails.caqti in
|
||||||
|
Caqti_type.(
|
||||||
|
unit
|
||||||
|
->* t7 string (option string) (option string) int (option json_str)
|
||||||
|
(option json_str) master_sig)
|
||||||
|
"SELECT payto_uri, conversion_url, debit_restrictions::TEXT, \
|
||||||
|
credit_restrictions::TEXT, master_sig, bank_label, priority FROM \
|
||||||
|
wire_accounts WHERE is_active"
|
||||||
|
in
|
||||||
|
fun (module Conn : CONN) -> Conn.collect_list get_wire_accounts ()
|
||||||
|
|
||||||
|
let get_global_fees =
|
||||||
|
let get_global_fees =
|
||||||
|
let master_sig = Bin_sig.GlobalFees.caqti in
|
||||||
|
Caqti_type.(
|
||||||
|
time
|
||||||
|
->* t9 time time amount amount amount time_span time_span int master_sig)
|
||||||
|
"SELECT start_date, end_date, (history_fee).*, (account_fee).*, \
|
||||||
|
(purse_fee).*, purse_timeout, history_expiration, purse_account_limit, \
|
||||||
|
master_sig FROM global_fee WHERE start_date >= $1"
|
||||||
|
in
|
||||||
|
fun (module Conn : CONN) ~start_date ->
|
||||||
|
Conn.collect_list get_global_fees start_date
|
||||||
|
|
||||||
|
(* TODO record types for some results *)
|
||||||
|
(* TODO
|
||||||
|
iterate_denominations
|
||||||
|
iterate_active_signkeys
|
||||||
|
iterate_auditor_denominations
|
||||||
|
iterate_active_auditors
|
||||||
|
*)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue