def direct1

cswap-bend-cli@0.1.0.0 · switch.bend:54

import cswap-bend-cli@0.1.0.0/switch.bend as Switch
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/swbase.bend as B
import cswap-bend-cli@0.1.0.0/swlive.bend as L
import cswap-bend-cli@0.1.0.0/store/base.bend as SBase
import cswap-bend-cli@0.1.0.0/store/ops.bend as SOps
import cswap-bend-cli@0.1.0.0/store/seq.bend as SSeq

54def direct1(+ctx: SBase.Ctx, +ident: String, +force: Bool, +opts: L.Opts, +m: Maybe<&2, Json.Json>) -> Act.of(Json.Json):
55  match m:
56    case None{}:
57      Act.fail(Json.Json, B.e_config(), "No accounts are managed yet")
58    case Some{seq}:
59      do ActM<Json.Json>:
60        Act.guard(SOps.valid_ident(seq, ident), B.e_validation(), "Invalid account identifier: " ++ ident)
61        direct2(ctx, seq, ident, force, opts, SSeq.resolve(seq, ident))

Uses (18)

Used by (1)