Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM Vixen #41

Open
kespinola opened this issue Nov 11, 2024 · 0 comments
Open

WASM Vixen #41

kespinola opened this issue Nov 11, 2024 · 0 comments

Comments

@kespinola
Copy link
Collaborator

kespinola commented Nov 11, 2024

Goal

We have received many requests for interacting with vixen change event streams within nodejs environment.

What people are doing is migrating from ws to grpc.

Strategy

Expose the parsing logic of vixen through wasm lib. Clients subscribe to dragon's mouth in their code since wasm can't do I/O but once change event received can call the parse function exposed from the wasm lib to get the parsed change event. The caller is free to work in the language of their chose to be the handler for the vixen object.

fn parse(change_event:  ChangeEventUpdate): String {
vixen::wasm::builder()
        .account(Wasm::new(TokenExtensionProgramAccParser))
        .account(Wasm::new(TokenProgramAccParser))
        .account(Wasm::new(OrcaAccParser))
        .account(Wasm::new(RaydiumAccParser))
        .instruction(Wasm::new(TokenProgramIxParser))
        .instruction(Wasm::new(TokenExtensionProgramIxParser))
        .instruction(Wasm::new(OrcaIxParser))
        .instruction(Wasm::new(RaydiumIxParser))
        .build()
        .parse(change_event)
}
var { parse } = fs.readFileSync('vixen-parsers.wasm');

// construct dragon mouth subscription in nodejs
// run messages through the wasm parser
// handle the vixen object
@kespinola kespinola changed the title Distribute Vixen WASM Vixen Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant