[package]
name = "rialo-s-program"
description = "Solana Program"
documentation = "https://docs.rs/rialo-s-program"
readme = "README.md"
version = "0.1.7"
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = "1.79.0" # solana platform-tools rust version
publish = { workspace = true }

[dependencies]
bincode = { workspace = true }
blake3 = { workspace = true, features = ["traits-preview"] }
borsh = { workspace = true, optional = true }
borsh0-10 = { workspace = true, optional = true }
bs58 = { workspace = true, features = ["alloc"] }
bytemuck = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
memoffset = { workspace = true }
num-derive = { workspace = true }
num-traits = { workspace = true, features = ["i128"] }
serde = { workspace = true }
serde_bytes = { workspace = true }
serde_derive = { workspace = true }
rialo-s-account-info = { workspace = true, features = ["bincode"] }
rialo-atomic-u64 = { workspace = true }
rialo-s-big-mod-exp = { workspace = true }
rialo-s-bincode = { workspace = true }
rialo-s-blake3-hasher = { workspace = true, features = ["blake3"] }
rialo-s-borsh = { workspace = true, optional = true }
rialo-s-clock = { workspace = true, features = ["serde", "sysvar"] }
rialo-s-cpi = { workspace = true }
rialo-s-decode-error = { workspace = true }
rialo-s-epoch-schedule = { workspace = true, features = ["serde", "sysvar"] }
rialo-s-feature-gate-interface = { workspace = true, features = ["bincode"] }
rialo-s-fee-calculator = { workspace = true, features = ["serde"] }
rialo-frozen-abi = { workspace = true, optional = true, features = [
    "frozen-abi",
] }
rialo-frozen-abi-macro = { workspace = true, optional = true, features = [
    "frozen-abi",
] }
rialo-hash = { workspace = true, features = ["bytemuck", "serde", "std"] }
rialo-s-instruction = { workspace = true, default-features = false, features = [
    "bincode",
    "serde",
    "std",
] }
rialo-s-instructions-sysvar = { workspace = true }
rialo-s-keccak-hasher = { workspace = true, features = ["sha3"] }
rialo-s-loader-v2-interface = { workspace = true, features = ["bincode"] }
rialo-s-loader-v3-interface = { workspace = true, features = ["bincode"] }
rialo-s-loader-v4-interface = { workspace = true, features = ["bincode"] }
rialo-s-message = { workspace = true, features = ["bincode", "blake3"] }
rialo-s-msg = { workspace = true }
rialo-s-native-token = { workspace = true }
rialo-s-nonce = { workspace = true, features = ["serde"] }
rialo-s-program-entrypoint = { workspace = true }
rialo-s-program-error = { workspace = true, features = ["serde"] }
rialo-s-program-memory = { workspace = true }
rialo-s-program-option = { workspace = true }
rialo-s-program-pack = { workspace = true }
rialo-s-pubkey = { workspace = true, features = [
    "bytemuck",
    "curve25519",
    "serde",
    "std",
] }
rialo-s-rent = { workspace = true, features = ["serde", "sysvar"] }
rialo-sanitize = { workspace = true }
rialo-s-sdk-ids = { workspace = true }
rialo-s-sdk-macro = { workspace = true }
rialo-s-secp256k1-recover = { workspace = true }
rialo-s-serde-varint = { workspace = true }
rialo-s-serialize-utils = { workspace = true }
rialo-s-sha256-hasher = { workspace = true, features = ["sha2"] }
rialo-s-short-vec = { workspace = true }
rialo-s-slot-hashes = { workspace = true, features = ["serde", "sysvar"] }
rialo-s-slot-history = { workspace = true, features = ["serde", "sysvar"] }
rialo-s-stable-layout = { workspace = true }
rialo-s-stake-interface = { workspace = true, features = ["bincode"] }
rialo-s-system-interface = { workspace = true, features = ["bincode"] }
rialo-s-sysvar = { workspace = true, features = ["bincode", "bytemuck"] }
rialo-s-sysvar-id = { workspace = true }
thiserror = { workspace = true }

# This is currently needed to build on-chain programs reliably.
# Borsh 0.10 may pull in hashbrown 0.13, which uses ahash 0.8, which uses
# getrandom 0.2 underneath. This explicit dependency allows for no-std if cargo
# upgrades Borsh's dependency to hashbrown 0.13.
# Remove this once borsh 0.11 or 1.0 is released, which correctly declares the
# hashbrown dependency as optional.
[target.'cfg(target_os = "solana")'.dependencies]
getrandom = { workspace = true, features = ["custom"] }
rialo-s-define-syscall = { workspace = true }

[target.'cfg(not(target_os = "solana"))'.dependencies]
num-bigint = { workspace = true }
rand = { workspace = true }
rialo-s-example-mocks = { workspace = true }

[target.'cfg(not(target_os = "solana"))'.dev-dependencies]
arbitrary = { workspace = true, features = ["derive"] }
rialo-s-logger = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = { workspace = true }
console_log = { workspace = true }
getrandom = { workspace = true, features = ["js", "wasm-bindgen"] }
wasm-bindgen = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
all-features = true
rustdoc-args = ["--cfg=docsrs"]

[lib]
# NOTE: We specifically disable cdylib crate-type as this fails our testing
# infrastructure due to probable Cargo bug (https://github.com/rust-lang/cargo/issues/6313)
crate-type = ["rlib"]

[[example]]
name = "rialo-s-program"
crate-type = ["cdylib"]
path = "src/lib.rs"

[features]
default = ["borsh"]
borsh = [
    "dep:borsh",
    "dep:borsh0-10",
    "dep:rialo-s-borsh",
    "rialo-hash/borsh",
    "rialo-s-instruction/borsh",
    "rialo-s-program-error/borsh",
    "rialo-s-pubkey/borsh",
    "rialo-s-stake-interface/borsh",
]
dev-context-only-utils = []
frozen-abi = [
    "dep:rialo-frozen-abi",
    "dep:rialo-frozen-abi-macro",
    "rialo-s-epoch-schedule/frozen-abi",
    "rialo-s-fee-calculator/frozen-abi",
    "rialo-hash/frozen-abi",
    "rialo-s-instruction/frozen-abi",
    "rialo-s-message/frozen-abi",
    "rialo-s-pubkey/frozen-abi",
    "rialo-s-rent/frozen-abi",
    "rialo-s-short-vec/frozen-abi",
    "rialo-s-stake-interface/frozen-abi",
    "rialo-s-sysvar/frozen-abi",
]

[lints]
workspace = true
