{"id":24367789,"url":"https://github.com/bgreni/helius-rust-sdk","last_synced_at":"2025-04-10T16:05:51.280Z","repository":{"id":158238481,"uuid":"633596158","full_name":"bgreni/helius-rust-sdk","owner":"bgreni","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-23T22:24:06.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-24T17:05:55.892Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgreni.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":"2023-04-27T21:25:07.000Z","updated_at":"2023-09-24T21:21:10.000Z","dependencies_parsed_at":"2024-01-20T21:31:01.596Z","dependency_job_id":"e40d1bac-f7dd-4aa1-838a-01c5ecca4307","html_url":"https://github.com/bgreni/helius-rust-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgreni%2Fhelius-rust-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgreni%2Fhelius-rust-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgreni%2Fhelius-rust-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgreni%2Fhelius-rust-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgreni","download_url":"https://codeload.github.com/bgreni/helius-rust-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248250744,"owners_count":21072682,"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":"2025-01-19T02:55:06.312Z","updated_at":"2025-04-10T16:05:51.248Z","avatar_url":"https://github.com/bgreni.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unofficial Helius SDK Written in Rust\nFor more in depth details about Helius features, please consult\nthe [official Typescript SDK](https://github.com/helius-labs/helius-sdk)\n\nThis README will largely present what functionality is available in this implementation\n\n## Disclaimer\nI'm not ready to commit to no breaking changes yet so will be making `0.x.x` releases for now\n\n## Getting Started\n### Installation And Usage\n```commandline\ncargo add helius-sdk\n```\n```rust\nuse helius_sdk::*;\n\nfn main() {\n    let client = Helius::new(env::var(\"API_KEY\").unwrap(), Cluster::MainnetBeta);\n}\n```\n## `Other` variant for Enums\nMost enums in this crate have an `Other(String)` options if new variants have been added to the helius API that have\nnot yet been included in this crate. When using these variants, do keep in mind there is a high chance that upgrading \nto a new version will break your code if you have logic around receiving a response of this form. As they will then\nhave a proper distinct value in the enum for deserialization. \n## Webhooks\n### Create Webhook\n```rust\nlet hook = client.create_webhook(\u0026CreateWebhookRequest {\n        data: WebhookData {\n            webhook_url: \"insert url here\".to_string(),\n            transaction_types: vec![TransactionType::NftBid, TransactionType::NftBidCancelled],\n            account_addresses: vec![\"M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K\".to_string()],\n            webhook_type: Some(WebhookType::Discord),\n            auth_header: None,\n            txn_status: None,\n            encoding: None\n        },\n    });\n```\n### Get All Webhooks\nRetrieve all webhook for the current user account\n```rust\nlet hooks = client.get_all_webhooks();\n```\n### Get Webhook by ID\n```rust\nlet hook = client.get_webhook_by_id(\"insert webhook id here\"));\n```\n### Edit Webhook\n```rust\nlet mut hook = client.get_webhook_by_id(hook.webhook_id.as_str()).unwrap();\nhook.webhook_data.webhook_type = WebhookType::Discord.into();\nlet ehook = client.edit_webhook(EditWebhookRequest{\n    webhook_id: hook.webhook_id,\n    data: hook.webhook_data,\n});\n\n```\n### Delete Webhook\n```rust\nclient.delete_webhook(\"insert webhook id here\");\n```\n### Create Collection Webhook\nA convenience method, not actually a part of the helius rest interface.\n```rust\nlet res = client.create_collection_webhook(\u0026CreateCollectionWebhookRequest {\n    data: WebhookData {\n        webhook_url: \"insert url here\".to_string(),\n        transaction_types: vec![TransactionType::NftSale],\n        account_addresses: vec![],\n        webhook_type: Some(WebhookType::Discord),\n        auth_header: None,\n        txn_status: None,\n        encoding: None\n    },\n    collection_query: CollectionIdentifier::FirstVerifiedCreators(vec![\"GVkb5GuwGKydA4xXLT9PNpx63h7bhFNrDLQSxi6j5NuF\".to_string()]),\n});\n```\n## Enhanced Transactions API-\n### Parse transactions\n```rust\nlet res = client.parse_transaction(\n    \u0026ParseTransactionsRequest{\n        transactions: vec![\"insert txn id here\".to_string()]\n    }\n);\n```\n## NFT API\n### Get All Tokens For Collection\n```rust\nlet res = client.get_mintlist(MintlistRequest {\n    query: CollectionIdentifier::FirstVerifiedCreators(vec![\"GVkb5GuwGKydA4xXLT9PNpx63h7bhFNrDLQSxi6j5NuF\".into()]),\n    options: HeliusOptions {limit: 1000.into(), pagination_token: None}.into()\n});\n```\n## Token Metadata API\n### Get Token Metadata\n```rust\nlet res = client.get_token_metadata(\u0026TokenMetadataRequest{\n        mint_accounts: vec![\"insert token mint address\"],\n        include_off_chain: true,\n        disable_cache: false\n    });\n```\n## RPC Abstractions\nHelper methods for common RPC operations\n### Get Solana TPS\n```rust\nclient.rpc.get_tps();\n```\n### Request Airdrop\n```rust\nlet key = Pubkey::new_unique();\nclient.rpc.airdrop(\u0026key, 10 * LAMPORTS_PER_SOL).expect();\n```\n### Access Solana Connection\nUsers can also access the underlying solana_sdk rpc client to make \nother standard rpc calls.\n```rust\nlet conn = client.rpc.connection();\nlet inflation = conn.get_inflation_rate();\n```\n## Todo\n- Beta/Alpha endpoints?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgreni%2Fhelius-rust-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgreni%2Fhelius-rust-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgreni%2Fhelius-rust-sdk/lists"}