heavy-duty / znap

Performance-first Rust Framework to build APIs compatible with the Solana Actions Spec.
Apache License 2.0
60 stars 1 forks source link

Env context struct #84

Closed SergioRibera closed 1 month ago

SergioRibera commented 1 month ago

In this PR I am adding a structure to the context, for now it only contains information about the identity extracted from the corresponding environment variables IDENTITY_KEYPAIR_PATH or IDENTITY_KEYPAIR.

Additionally I removed the prelude file since it is not part of the convention to have such a file.

I also made the identity variable optional in the Znap.toml manifest, this might add the ability to detect if it is a path or a content.

SergioRibera commented 1 month ago

On another note, why are we removing the prelude?

I didn't remove it, I just moved it to the lib.rs this module is usually placed in the lib.rs file and the rest of the stuff is distributed in other modules so that the lib.rs is the module that exposes the types, libraries and so on.

Here are some examples:

[!NOTE] Although it should probably go in another PR