Skip to content

Integrate with FastAPI #2761

@fubuloubu

Description

@fubuloubu

Describe

It'd be really nice to have an easy way to integrate Ape with a framework like FastAPI, so that certain network requests could be handled within a specific network context (including request body validation)

Specification

Not sure how this would work in practice, but something like:

@app.post("/{ecosystem}/{network}/...")
@ape.networks.wrap_context()
def send_transaction(body: ParsedWithApeConverts):
    tx = body.target.method(*body.args, sender=settings.sender)
    return tx.hash

Dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions