diff --git a/Cargo.toml b/Cargo.toml index c626daa..42037cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ futures-util = "0.3.30" mpl-token-metadata = { version = "5.0.0-beta.0" } phf = { version = "0.11.2", features = ["macros"] } rand = "0.8.5" -reqwest = { version = "0.12.8", features = ["json"], default-features = false } +reqwest = { version = "0.12.8", features = ["json", "native-tls"] } semver = "1.0.23" serde = "1.0.198" serde-enum-str = "0.4.0" @@ -32,9 +32,9 @@ solana-rpc-client-api = "2.0" solana-sdk = "2.0" solana-transaction-status = "2.0" thiserror = "1.0.58" -tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread", "net"] } +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread", "net", "time"] } tokio-stream = "0.1.15" -tokio-tungstenite = { version = "0.24.0", features = ["native-tls", "handshake"] } +tokio-tungstenite = { version = "0.24.0", features = ["native-tls"] } url = "2.5.0" spl-token = { version = "6.0", features = ["no-entrypoint"] } @@ -43,8 +43,14 @@ mockito = "1.4.0" [features] default = ["native-tls"] -native-tls = ["reqwest/native-tls"] -rustls = ["reqwest/rustls-tls"] +native-tls = [ + "reqwest/native-tls", + "tokio-tungstenite/native-tls" +] +rustls = [ + "reqwest/rustls-tls", + "tokio-tungstenite/rustls-tls-webpki-roots" +] [patch.crates-io] # https://github.com/solana-labs/solana/issues/26688#issuecomment-2136066879 diff --git a/README.md b/README.md index b2fda5f..d47b67f 100644 --- a/README.md +++ b/README.md @@ -133,19 +133,19 @@ Our SDK is designed to provide a seamless developer experience when building on - [`remove_addresses_from_webhook`](https://github.com/helius-labs/helius-rust-sdk/blob/bf24259e3333ae93126bb65b342c2c63e80e07a6/src/webhook.rs#L75-L105) - Removes a list of addresses from an existing webhook by its ID ### Smart Transactions -- [`create_smart_transaction`](https://github.com/helius-labs/helius-rust-sdk/blob/705d66fb7d4004fc32c2a5f0d6ca4a1f2a7b175d/src/optimized_transaction.rs#L113-L312) - Creates an optimized transaction based on the provided configuration -- [`get_compute_units`](https://github.com/helius-labs/helius-rust-sdk/blob/a79a751e1a064125010bdb359068a366d635d005/src/optimized_transaction.rs#L29-L75) - Simulates a transaction to get the total compute units consumed -- [`poll_transaction_confirmation`](https://github.com/helius-labs/helius-rust-sdk/blob/a79a751e1a064125010bdb359068a366d635d005/src/optimized_transaction.rs#L77-L112) - Polls a transaction to check whether it has been confirmed in 5 second intervals with a 15 second timeout -- [`send_smart_transaction`](https://github.com/helius-labs/helius-rust-sdk/blob/705d66fb7d4004fc32c2a5f0d6ca4a1f2a7b175d/src/optimized_transaction.rs#L314-L374) - Builds and sends an optimized transaction, and handles its confirmation status -- [`send_and_confirm_transaction`] - Sends a transaction and handles its confirmation status with retry logic -- [`send_smart_transaction_with_seeds`]() - Sends a smart transaction using seed bytes +- [`create_smart_transaction`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/optimized_transaction.rs#L131-L331) - Creates an optimized transaction based on the provided configuration +- [`get_compute_units`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/optimized_transaction.rs#L34-L87) - Simulates a transaction to get the total compute units consumed +- [`poll_transaction_confirmation`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/optimized_transaction.rs#L89-L129) - Polls a transaction to check whether it has been confirmed in 5 second intervals with a 15 second timeout +- [`send_smart_transaction`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/optimized_transaction.rs#L333-L364) - Builds and sends an optimized transaction, and handles its confirmation status +- [`send_and_confirm_transaction`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/optimized_transaction.rs#L366-L412) - Sends a transaction and handles its confirmation status with retry logic +- [`send_smart_transaction_with_seeds`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/optimized_transaction.rs#L414-L487) - Sends a smart transaction using seed bytes ### Jito Smart Transactions and Helper Methods - [`add_tip_instruction`](https://github.com/helius-labs/helius-rust-sdk/blob/02b351a5ee3fe16a36078b40f92dc72d0ad077ed/src/jito.rs#L66-L83) - Adds a tip instruction to the instructions provided -- [`create_smart_transaction_with_tip`](https://github.com/helius-labs/helius-rust-sdk/blob/02b351a5ee3fe16a36078b40f92dc72d0ad077ed/src/jito.rs#L85-L124) - Creates a smart transaction with a Jito tip -- [`get_bundle_statuses`](https://github.com/helius-labs/helius-rust-sdk/blob/02b351a5ee3fe16a36078b40f92dc72d0ad077ed/src/jito.rs#L169-L202) - Get the status of Jito bundles -- [`send_jito_bundle`](https://github.com/helius-labs/helius-rust-sdk/blob/02b351a5ee3fe16a36078b40f92dc72d0ad077ed/src/jito.rs#L126-L167) - Sends a bundle of transactions to the Jito Block Engine -- [`send_smart_transaction_with_tip`](https://github.com/helius-labs/helius-rust-sdk/blob/02b351a5ee3fe16a36078b40f92dc72d0ad077ed/src/jito.rs#L204-L269) - Sends a smart transaction as a Jito bundle with a tip +- [`create_smart_transaction_with_tip`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/jito.rs#L85-L125) - Creates a smart transaction with a Jito tip +- [`get_bundle_statuses`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/jito.rs#L170-L203) - Get the status of Jito bundles +- [`send_jito_bundle`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/jito.rs#L127-L168) - Sends a bundle of transactions to the Jito Block Engine +- [`send_smart_transaction_with_tip`](https://github.com/helius-labs/helius-rust-sdk/blob/bd9e0b10c81ab9ea56dfcd286336b086f6737b64/src/jito.rs#L205-L270) - Sends a smart transaction as a Jito bundle with a tip ### Helper Methods - [`get_priority_fee_estimate`](https://docs.helius.dev/solana-rpc-nodes/alpha-priority-fee-api) - Gets an estimate of the priority fees required for a transaction to be processed more quickly diff --git a/examples/enhanced_websocket_accounts.rs b/examples/enhanced_websocket_accounts.rs index 5357bdc..9a4af96 100644 --- a/examples/enhanced_websocket_accounts.rs +++ b/examples/enhanced_websocket_accounts.rs @@ -9,7 +9,7 @@ async fn main() -> Result<()> { let api_key: &str = "your_api_key"; let cluster: Cluster = Cluster::MainnetBeta; - let helius: Helius = Helius::new_with_ws(api_key, cluster).await.unwrap(); + let helius: Helius = Helius::new_with_ws(api_key, cluster).await?; let key: pubkey::Pubkey = pubkey!("BtsmiEEvnSuUnKxqXj2PZRYpPJAc7C34mGz8gtJ1DAaH"); diff --git a/src/optimized_transaction.rs b/src/optimized_transaction.rs index a066058..108885a 100644 --- a/src/optimized_transaction.rs +++ b/src/optimized_transaction.rs @@ -13,7 +13,7 @@ use solana_client::{ rpc_config::{RpcSendTransactionConfig, RpcSimulateTransactionConfig}, rpc_response::{Response, RpcSimulateTransactionResult}, }; -use solana_sdk::signature::{keypair_from_seed, Keypair}; +use solana_sdk::signature::keypair_from_seed; use solana_sdk::{ address_lookup_table::AddressLookupTableAccount, bs58::encode, diff --git a/src/types/enums.rs b/src/types/enums.rs index 01a82ad..4e17fa5 100644 --- a/src/types/enums.rs +++ b/src/types/enums.rs @@ -29,13 +29,6 @@ pub enum Interface { ProgrammableNFT, #[serde(rename = "FungibleToken")] FungibleToken, - #[serde(rename = "V1_PRINT")] - V1PRINT, - #[allow(non_camel_case_types)] - #[serde(rename = "LEGACY_NFT")] - LEGACY_NFT, - #[serde(rename = "V2_NFT")] - Nft, #[serde(rename = "MplCoreAsset")] MplCoreAsset, #[serde(rename = "MplCoreCollection")] diff --git a/src/websocket.rs b/src/websocket.rs index 86558b6..fc6c43c 100644 --- a/src/websocket.rs +++ b/src/websocket.rs @@ -29,7 +29,7 @@ use tokio_tungstenite::{ MaybeTlsStream, WebSocketStream, }; -pub const ENHANCED_WEBSOCKET_URL: &str = "wss://atlas-mainnet.helius-rpc.com?api-key="; +pub const ENHANCED_WEBSOCKET_URL: &str = "wss://atlas-mainnet.helius-rpc.com/?api-key="; const DEFAULT_PING_DURATION_SECONDS: u64 = 10; // pub type Result = Result;