[package]
description = "Light-weight Sui JSON-RPC client by Aftermath Finance"
name        = "sui-jsonrpc"
version     = "0.22.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]
client = [
  "client-api",
  "dep:async-stream",
  "dep:futures-core",
  "dep:futures-util",
  "dep:http",
  "dep:jsonrpsee-http-client",
  "jsonrpsee/ws-client",
]
client-api = [
  "dep:extension-traits",
  "dep:jsonrpsee-core",
  "dep:jsonrpsee-types",
  "jsonrpsee/client-core",
  "jsonrpsee/macros",
]
default = ["client"]

[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
futures-core          = { version = "0.3", public = true, optional = true }
jsonrpsee-core        = { version = "0.26", public = true, optional = true }
jsonrpsee-http-client = { version = "0.26", public = true, optional = true }
jsonrpsee-types       = { version = "0.26", public = true, optional = true }
serde                 = { version = "1", public = true }
serde_json            = { version = "1", public = true }
sui-sdk-types         = { version = "0.0.8", public = true, features = ["hash", "serde"] }

base64ct      = "1"
bcs           = "0.1"
bs58          = "0.5"
colored       = "3"
derive_more   = { version = "2", features = ["from"] }
enum_dispatch = "0.3"
itertools     = "0.14"
json_to_table = "0.6"
regex         = "1"
serde_with    = { version = "3", features = ["base64"] }
tabled        = "0.12"
thiserror     = "2"

async-stream     = { version = "0.3", optional = true }
extension-traits = { version = "2", optional = true }
futures-util     = { version = "0.3", optional = true }
http             = { version = "1", optional = true }
jsonrpsee        = { version = "0.26", optional = true }
rustversion      = "1"

[dev-dependencies]
color-eyre = "0.6"
futures    = "0.3"
tokio      = { version = "1", features = ["full"] }

[[example]]
name              = "jrpc-get-object"
path              = "examples/get_object.rs"
required-features = ["client"]

[[example]]
name              = "jrpc-get-chain-id"
path              = "examples/get_chain_identifier.rs"
required-features = ["client"]

[[example]]
name              = "jrpc-get-dfs"
path              = "examples/get_dynamic_fields.rs"
required-features = ["client"]

[[example]]
name              = "jrpc-get-df"
path              = "examples/get_dynamic_field_object.rs"
required-features = ["client"]
