{"id":21870045,"url":"https://github.com/heavy-duty/znap","last_synced_at":"2025-07-21T04:31:28.645Z","repository":{"id":246071966,"uuid":"814833207","full_name":"heavy-duty/znap","owner":"heavy-duty","description":"Performance-first Rust Framework to build APIs compatible with the Solana Actions Spec.","archived":false,"fork":false,"pushed_at":"2024-10-29T20:27:43.000Z","size":25538,"stargazers_count":69,"open_issues_count":15,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-01T07:47:40.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heavy-duty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-13T19:56:43.000Z","updated_at":"2025-05-20T17:46:09.000Z","dependencies_parsed_at":"2024-06-25T18:18:29.555Z","dependency_job_id":"a91b94ce-83d3-483f-b0aa-e4edb7764836","html_url":"https://github.com/heavy-duty/znap","commit_stats":null,"previous_names":["heavy-duty/znap"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/heavy-duty/znap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavy-duty%2Fznap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavy-duty%2Fznap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavy-duty%2Fznap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavy-duty%2Fznap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heavy-duty","download_url":"https://codeload.github.com/heavy-duty/znap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavy-duty%2Fznap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266240773,"owners_count":23898062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T06:10:00.791Z","updated_at":"2025-07-21T04:31:28.289Z","avatar_url":"https://github.com/heavy-duty.png","language":"Rust","funding_links":[],"categories":["Developer Tools"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \n  [![Watch the demo](https://res.cloudinary.com/andresmgsl/image/upload/q_auto/f_auto/w_450/v1718845551/ZNAP_cuckvf.png)](https://youtu.be/pmuwP9fWa3M)\n  \u003ch1\u003eZnap\u003c/h1\u003e\n  \n  [Watch the demo](https://youtu.be/pmuwP9fWa3M)\n  \u003cp\u003e\n    \u003cstrong\u003ePerformance-first Rust Framework to build APIs compatible with the Solana Actions Spec.\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/heavy-duty/znap/tree/master/examples/my-actions\"\u003e\u003cimg alt=\"Tutorials\" src=\"https://img.shields.io/badge/docs-tutorials-blue\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nZnap is an innovative Rust-based framework designed to simplify the creation of [Solana Actions](#) on the Solana blockchain.\n\n- Rust eDSL for writing Solana actions\n- Macro collection\n- CLI and workspace management for developing complete Solana actions\n\nIf you're familiar with developing using the Anchor framework, then the experience will be familiar.\n\n## Getting Started\n\n1. `cargo install znap-cli`\n2. `znap init \u003cmy-project-name\u003e`\n3. `cd \u003cmy-project-name\u003e`\n4. `znap new \u003ccollection-name\u003e`\n\n## Packages\n\n| Package                 | Description                                              | Version                                                                                                                          | Docs                                                                                                            |\n| :---------------------- | :------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------- |\n| `znap`           | Znap framework's core library to create Solana actions           | [![Crates.io](https://img.shields.io/crates/v/znap?color=blue)](https://crates.io/crates/znap)                     | [![Docs.rs](https://docs.rs/anchor-lang/badge.svg)](https://docs.rs/znap/latest/znap/)                                |\n| `znap-syn`           | Parsing and generating code for macros in Rust           | [![Crates.io](https://img.shields.io/crates/v/znap-syn?color=blue)](https://crates.io/crates/znap-syn)                     | [![Docs.rs](https://docs.rs/anchor-lang/badge.svg)](https://docs.rs/znap-syn/latest/znap_syn/)                                |\n| `znap-macros`           | Macro collection for creating Solana actions           | [![Crates.io](https://img.shields.io/crates/v/znap-macros?color=blue)](https://crates.io/crates/znap-macros)                     | [![Docs.rs](https://docs.rs/anchor-lang/badge.svg)](https://docs.rs/znap-macros/latest/znap_macros/)                                |\n| `znap-cli`           | Znap CLI to interact with a znap workspace.           | [![Crates.io](https://img.shields.io/crates/v/znap-cli?color=blue)](https://crates.io/crates/znap-cli)                     | [![Docs.rs](https://docs.rs/anchor-lang/badge.svg)](https://docs.rs/znap-cli/latest/znap_cli/)                                |\n\n## Example\n\n```rust\nuse solana_sdk::{\n    message::Message, native_token::LAMPORTS_PER_SOL, pubkey::Pubkey, system_instruction::transfer,\n    transaction::Transaction,\n};\nuse std::str::FromStr;\nuse znap::prelude::*;\n\n#[collection]\npub mod my_actions {\n    use super::*;\n\n    pub fn send_donation(ctx: Context\u003cSendDonationAction\u003e) -\u003e Result\u003cActionTransaction\u003e {\n        let account_pubkey = Pubkey::from_str(\u0026ctx.payload.account)\n            .or_else(|_| Err(Error::from(ActionError::InvalidAccountPublicKey)))?;\n        let receiver_pubkey = Pubkey::from_str(\u0026ctx.params.receiver_address)\n            .or_else(|_| Err(Error::from(ActionError::InvalidReceiverPublicKey)))?;\n        let transfer_instruction = transfer(\n            \u0026account_pubkey,\n            \u0026receiver_pubkey,\n            ctx.query.amount * LAMPORTS_PER_SOL,\n        );\n        let transaction_message = Message::new(\u0026[transfer_instruction], None);\n        let transaction = Transaction::new_unsigned(transaction_message);\n\n        Ok(ActionTransaction {\n            transaction,\n            message: Some(\"send donation to alice\".to_string()),\n        })\n    }\n}\n\n#[derive(Action)]\n#[action(\n    icon = \"https://media.discordapp.net/attachments/1205590693041541181/1212566609202520065/icon.png?ex=667eb568\u0026is=667d63e8\u0026hm=0f247078545828c0a5cf8300a5601c56bbc9b59d3d87a0c74b082df0f3a6d6bd\u0026=\u0026format=webp\u0026quality=lossless\u0026width=660\u0026height=660\",\n    title = \"Send a Donation to {{params.receiver_address}}\",\n    description = \"Send a donation to {{params.receiver_address}} using the Solana blockchain via a Blink.\",\n    label = \"Send\",\n    link = {\n        label = \"Send 1 SOL\",\n        href = \"/api/send_donation/{{params.receiver_address}}?amount=1\",\n    },\n    link = {\n        label = \"Send 5 SOL\",\n        href = \"/api/send_donation/{{params.receiver_address}}?amount=5\",\n    },\n    link = {\n        label = \"Send SOL\",\n        href = \"/api/send_donation/{{params.receiver_address}}?amount={amount}\",\n        parameter = { label = \"Amount in SOL\", name = \"amount\" }\n    },\n)]\n#[query(amount: u64)]\n#[params(receiver_address: String)]\npub struct SendDonationAction;\n\n#[derive(ErrorCode)]\nenum ActionError {\n    #[error(msg = \"Invalid account public key\")]\n    InvalidAccountPublicKey,\n    #[error(msg = \"Invalid receiver public key\")]\n    InvalidReceiverPublicKey,\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheavy-duty%2Fznap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheavy-duty%2Fznap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheavy-duty%2Fznap/lists"}