fn(request$1017) =>
let signed_event_bytes$1019 = @definy.string-trim(
value: match @definy.json-get-string(value: $1017, key: "signedEventBytes") {
#some(text$1018) =>
$1018,
#none(_) =>
""
}
);
match @core.equal(left: $1019, right: "") {
true =>
@definy.rpc-error(code: "invalid_argument", message: "signedEventBytes is required"),
false =>
@definy.verify-signed-event(
signed_event_bytes: $1019,
then: fn(result$1020) =>
match $1020 {
#invalid(message$1021) =>
@definy.rpc-error(code: "invalid_argument", message: $1021),
#valid(meta$1022) =>
@definy.read-account-created(
account_id: $1022.account_id,
offset: 0,
then: fn(created$1023) =>
match $1022.content {
#create_account(_) =>
@definy.submit-verified-event(
signed_event_bytes: $1019,
event: $1022,
facts: {account_id: $1022.account_id, account_created: $1023, commits: []}
),
_ =>
@definy.read-snapshot-summaries(
then: fn(commits$1024) =>
@definy.submit-verified-event(
signed_event_bytes: $1019,
event: $1022,
facts: {account_id: $1022.account_id, account_created: $1023, commits: $1024}
)
)
}
)
}
)
}