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

fix(misc): Various Fixes to Prepare For a New Version #92

Merged
merged 5 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"] }

Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/enhanced_websocket_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion src/optimized_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions src/types/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T = ()> = Result<T, HeliusError>;
Expand Down
Loading