[package]
name = "pump-rust-client"
version = "0.1.4"
edition = "2021"
rust-version = "1.86"
# `resolver = "3"` requires Cargo's unstable `edition2024` (rejected by solana-verify / cargo 1.81).
resolver = "2"
description = "Rust SDK for the pump and pump_amm Solana programs: instruction builders, quoting, PDA helpers, and optional RPC client features."
license = "MIT"

[lib]
name = "pump_rust_client"
crate-type = ["lib"]

[features]
default = []
client = ["dep:solana-sdk", "dep:solana-client"]
local-validator = [
    "client",
    "dep:solana-test-validator",
    "dep:solana-faucet",
    "dep:solana-streamer",
    "dep:solana-rpc",
    "dep:spl-token",
    "dep:spl-token-2022",
    "dep:tokio",
    "dep:serde",
    "dep:serde_json",
    "dep:bincode",
    "dep:zstd",
    "dep:crossbeam-channel",
    "dep:dotenvy",
]

[dependencies]
fastrand = "2"
anchor-lang = { version = "0.31", features = ["event-cpi", "init-if-needed", "allow-missing-optionals"] }
anchor-spl = { version = "0.31", features = ["metadata", "spl-token-group-interface", "token_2022", "spl-token-metadata-interface", "token_2022_extensions", "spl-token-2022"] }
solana-program = "2.1.21"

solana-sdk = { version = "2.1.21", optional = true }
solana-client = { version = "2.1.21", optional = true }

# Optional deps used only when the `local-validator` feature is enabled.
solana-test-validator = { version = "2.1.21", optional = true }
solana-faucet = { version = "2.1.21", optional = true }
solana-streamer = { version = "2.1.21", optional = true }
solana-rpc = { version = "2.1.21", optional = true }
spl-token = { version = "=7.0.0", optional = true }
spl-token-2022 = { version = "=6.0.0", optional = true }
tokio = { version = "1.44.1", features = ["full"], optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }
bincode = { version = "1.3", optional = true }
zstd = { version = "0.13", optional = true }
crossbeam-channel = { version = "0.5", optional = true }
dotenvy = { version = "0.15", optional = true }

[[bin]]
name = "local-validator"
path = "src/bin/local_validator/main.rs"
required-features = ["local-validator"]

[[bin]]
name = "clone_devnet_accounts"
path = "src/bin/clone_devnet_accounts/main.rs"
required-features = ["local-validator"]

[[example]]
name = "create_v2"
path = "examples/create_v2.rs"
required-features = ["local-validator"]

[[example]]
name = "create_v2_and_buy"
path = "examples/create_v2_and_buy.rs"
required-features = ["local-validator"]

[[example]]
name = "buy_v2"
path = "examples/buy_v2.rs"
required-features = ["local-validator"]

[[example]]
name = "sell_v2"
path = "examples/sell_v2.rs"
required-features = ["local-validator"]

[[example]]
name = "buy_amm"
path = "examples/buy_amm.rs"
required-features = ["local-validator"]

[[example]]
name = "sell_amm"
path = "examples/sell_amm.rs"
required-features = ["local-validator"]

[dev-dependencies]
solana-sdk = "2.1.21"
solana-client = "2.1.21"
tokio = { version = "1.44.1", features = ["full"] }
