[package]
name = "anchor-lang"
version.workspace = true
publish = true
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/otter-sec/anchor"
edition = "2021"
rust-version = "1.89"
license = "Apache-2.0"
description = "Solana Sealevel eDSL"

[package.metadata.docs.rs]
workspace = true

[features]
allow-missing-optionals = ["anchor-derive-accounts/allow-missing-optionals"]
anchor-debug = [
    "anchor-attribute-account/anchor-debug",
    "anchor-attribute-constant/anchor-debug",
    "anchor-attribute-error/anchor-debug",
    "anchor-attribute-event/anchor-debug",
    "anchor-attribute-program/anchor-debug",
    "anchor-derive-accounts/anchor-debug",
]
derive = []
event-cpi = [
    "anchor-attribute-event/event-cpi",
    "anchor-attribute-account/event-cpi",
]
idl-build = [
    "anchor-attribute-account/idl-build",
    "anchor-attribute-constant/idl-build",
    "anchor-attribute-event/idl-build",
    "anchor-attribute-error/idl-build",
    "anchor-attribute-program/idl-build",
    "anchor-derive-accounts/idl-build",
    "anchor-derive-serde/idl-build",
    "anchor-lang-idl/build",
]
init-if-needed = ["anchor-derive-accounts/init-if-needed"]
lazy-account = [
    "anchor-attribute-account/lazy-account",
    "anchor-derive-serde/lazy-account",
]

[dependencies]
anchor-attribute-access-control = { workspace = true }
anchor-attribute-account = { workspace = true }
anchor-attribute-constant = { workspace = true }
anchor-attribute-error = { workspace = true }
anchor-attribute-event = { workspace = true }
anchor-attribute-program = { workspace = true }
anchor-derive-accounts = { workspace = true }
anchor-derive-serde = { workspace = true }
anchor-derive-space = { workspace = true }
anchor-lang-error = { workspace = true }

# `anchor-lang-idl` should only be included with `idl-build` feature
anchor-lang-idl = { workspace = true, optional = true }

base64 = "0.21"
bincode = "1"
borsh = "1.5.7"
bytemuck = { version = "1", features = ["derive"] }
const-crypto = "0.3.0"

solana-account-info.workspace = true
solana-clock.workspace = true
solana-cpi.workspace = true
solana-define-syscall.workspace = true
solana-feature-gate-interface.workspace = true
solana-instruction.workspace = true
solana-instructions-sysvar.workspace = true
solana-invoke.workspace = true
solana-loader-v3-interface = { workspace = true, features = ["bincode"] }
solana-msg.workspace = true
solana-program-entrypoint.workspace = true
solana-program-error = { workspace = true, features = ["borsh"] }
solana-program-memory.workspace = true
solana-program-option.workspace = true
solana-program-pack.workspace = true
solana-pubkey = { workspace = true, features = ["borsh", "bytemuck", "serde"] }
solana-sdk-ids.workspace = true
solana-stake-interface = { workspace = true, features = ["sysvar", "bincode"] }
solana-system-interface.workspace = true
solana-sysvar = { workspace = true, features = ["bincode"] }
solana-sysvar-id.workspace = true

thiserror = "1"

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ['cfg(target_os, values("solana"))']
