def put_account
import cswap-bend-cli@0.1.0.0/store/seq.bend as Seqimport Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
181# Record `rec` under slot `num` (replacing in place or appending) and list the
182# slot in `sequence`, kept sorted.
183def put_account(+seq: Json.Json, +num: String, +rec: Json.Json) -> Json.Json:
184 Json.set("sequence", nums_json(insert_sorted(str_u32(num), seq_nums(seq))),
185 Json.set("accounts", Json.set(num, rec, accounts_of(seq)), seq))