fn(request$0, accept_accounts$1, accept_any_account$9, otherwise$2) =>
match @std.string-starts-with(value: @http.path(request: $0), prefix: "/definy.v1.EventService/") {
false =>
$2(),
true =>
let method$3 = @core.string-slice(
value: @http.path(request: $0),
start: 24,
end: @core.string-length(value: @http.path(request: $0))
);
@definy.ensure-seeded(
then: fn(seeded$4) =>
@definy.rpc-respond(
cbor: @definy.request-wants-cbor(request: $0),
io: match @definy.rpc-request-json(request: $0) {
#invalid(message$6) =>
@definy.rpc-error(code: "invalid_argument", message: $6),
#json(json$7) =>
match $3 {
"SubmitEvent" =>
@definy.accept-submit-event(request: $7, accept_accounts: $1, accept_any_account: $9),
"UploadContent" =>
@definy.accept-upload-content(request: $7),
_ =>
match @definy.handle-rpc(method: @core.string-concat(left: "EventService/", right: $3), request: $0) {
#some(handler$8) =>
$8(request: $7),
#none(_) =>
@definy.rpc-error(
code: "unimplemented",
message: @core.string-concat(
left: "Endpoint ",
right: @core.string-concat(left: @http.path(request: $0), right: " is not implemented")
)
)
}
}
}
)
)
}