def token_run2

cswap-bend-cli@0.1.0.0 · cliops.bend:172

import cswap-bend-cli@0.1.0.0/cliops.bend as Cliops
import Base
import cswap-bend-cli@0.1.0.0/store/ops.bend as SOps
import cswap-bend-cli@0.1.0.0/store/base.bend as SBase
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/cmd.bend as Cmd

172def token_run2(empty: Bool, +ctx: SBase.Ctx, +t: String, +email: Maybe<&2, String>, +slot: Maybe<&2, U32>, +noin: Bool) -> Act.of(Cmd.Out):
173  match empty:
174    case True{}:
175      Act.fail(Cmd.Out, 2, "Token cannot be empty")
176    case False{}:
177      Act.bind(String, Cmd.Out, with_overwrite(SOps.add_token(ctx, t, email, slot, False{}), SOps.add_token(ctx, t, email, slot, True{}), noin),
178        out => after_write(SBase.root_of(ctx), out))

Uses (13)

Used by (1)