Explorer

definy.account-name-of-event

description
The account name of a stored create_account event (empty for other events or bytes that cannot be decoded)
type
Fn(event: @definy.stored-event) -> String
expression
fn(event$0) =>
  match @std.base64-to-bytes(text: $0.signed_event_bytes) {
    #some(bytes$1) =>
      match @definy.decode-signed-event(bytes: $1) {
        #decoded(decoded$2) =>
          match $2.content {
            #create_account(account$3) =>
              $3.account_name,
            _ =>
              ""
          },
        #invalid(_) =>
          ""
      },
    #none(_) =>
      ""
  }
visibility
public
definy.account-name-of-event (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: i4oISniBop8kXEnGjMSwu4w9e3BZe0PM3pA1lhBDiJE
content hash: b-MS-8Tq9FCNVORjlWqXWtpr_PGDzr3uelYV6P2xQMg