[package]
description = "Move types for Aftermath's `AfOracle` package"
name        = "af-oracle"
version     = "0.19.0"

authors.workspace      = true
categories.workspace   = true
edition.workspace      = true
license.workspace      = true
repository.workspace   = true
rust-version.workspace = true

[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="-Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo +nightly doc --all-features --no-deps --open
all-features = true
rustdoc-args = [
  # Generate links to definition in rustdoc source code pages
  # https://github.com/rust-lang/rust/pull/84176
  "--generate-link-to-definition",
  "-Zunstable-options",
]

[lints]
workspace = true

[features]
graphql = [
  "dep:async-stream",
  "dep:bcs",
  "dep:cynic",
  "dep:enum-as-inner",
  "dep:extension-traits",
  "dep:futures",
  "dep:graphql-extract",
  "dep:sui-gql-client",
  "dep:sui-gql-schema",
  "dep:trait-variant",
  "sui-gql-client/move-type",
  "sui-gql-client/queries",
  "sui-gql-schema/build",
]


[dependencies]
# Public dependencies; a SemVer-breaking bump in one of these must come with a SemVer-breaking bump
# to this crate
# https://rust-lang.github.io/rfcs/3516-public-private-dependencies.html
af-move-type      = { version = "0.10.0", public = true, path = "../af-move-type" }
af-sui-pkg-sdk    = { version = "0.10.0", public = true, path = "../af-sui-pkg-sdk" }
sui-framework-sdk = { version = "0.12.0", public = true, path = "../sui-framework-sdk" }
sui-gql-client    = { version = "0.17.0", public = true, optional = true, default-features = false, path = "../sui-gql-client" }
sui-sdk-types     = { version = "0.0.4", public = true }

af-sui-types = { version = "0.10.0", path = "../af-sui-types" }
af-utilities = { version = "0.10.0", path = "../af-utilities" }

derive_more = { version = "2", features = ["display", "from", "is_variant", "try_into"] }
remain      = "0.2"
serde       = "1"
serde_json  = "1"
thiserror   = "2"

bcs              = { version = "0.1", optional = true }
extension-traits = { version = "2", optional = true }
trait-variant    = { version = "0.1", optional = true }

# GraphQL RPC (optional)
async-stream    = { version = "0.3", optional = true }
cynic           = { version = "3", optional = true }
enum-as-inner   = { version = "0.6", optional = true }
futures         = { version = "0.3", optional = true }
graphql-extract = { version = "0.0.8", path = "../graphql-extract", optional = true }


[build-dependencies.sui-gql-schema]
default-features = false
features         = ["build"]
optional         = true
path             = "../sui-gql-schema"
version = "0.11"


[dev-dependencies]
clap             = { version = "4", features = ["derive"] }
color-eyre       = "0.6"
indicatif        = "0.17"
insta            = "1"
reqwest          = "0.12"
rustdoc-json     = "0.9.5"
rustup-toolchain = "0.1.10"
sui-gql-client   = { path = "../sui-gql-client", features = ["reqwest"] }
tokio            = { version = "1", features = ["full"] }
tokio-test       = "0.4"

[[example]]
name              = "price-feeds"
path              = "examples/price_feeds.rs"
required-features = ["graphql"]

[[example]]
name              = "price-feed-for-source"
path              = "examples/price_feed_for_source.rs"
required-features = ["graphql"]
