[package]
name        = "saa-common"
description = "Common types and utilities for smart account auth"
edition     = { workspace = true }
authors     = { workspace = true }
license     = { workspace = true }
repository  = { workspace = true }
version     = { workspace = true }


[dependencies]
saa-schema          = { workspace = true }
thiserror           = { workspace = true }


cosmwasm-std        = { version = "3.0.2",  optional = true }
cosmwasm-std-v1     = { version = "1.5.11", optional = true, package = "cosmwasm-std" }
secretwasm-std      = { version = "1.1.11", optional = true, package = "secret-cosmwasm-std" }
ink                 = { version = "5.1.1", optional = true, default-features = false }
scale-info          = { workspace = true, optional = true }
scale               = { workspace = true, optional = true }
borsh               = { workspace = true, optional = true }
cosmwasm-crypto     = { workspace = true, optional = true }
bech32              = { workspace = true, optional = true }
base64              = { workspace = true }
serde               = { workspace = true }
strum               = { workspace = true }
serde-json-wasm     = { workspace = true }
cw-schema           = { workspace = true , optional = true }
serde_json          = { workspace = true, optional = true }
getrandom           = { version = "0.2.16",  default-features = false, features = ["custom"] }


[features]
default     = [
    "std", 
    "replay",
]
solana      = [
    "dep:borsh", 
    "saa-schema/solana"
]
cosmwasm    = [
    "dep:cw-schema",
    "cosmwasm-std/std",
    "saa-schema/cosmwasm",
    "std",
    "wasm",
]
cosmwasm_v1 = [
    "dep:cosmwasm-std-v1",
    "wasm"
]
secretwasm  = [
    "dep:secretwasm-std",
    "wasm",
]
substrate   = [
    "dep:ink", 
    "dep:scale",
    "dep:scale-info",
    "saa-schema/substrate",
]
std         = [
    "serde-json-wasm/std",
    "ink?/std",
    "scale?/std",
    "scale-info?/std",
    "saa-schema/std",
]
native     = [
    "dep:cosmwasm-crypto",
]
session    = []
wasm       = [
    "saa-schema/wasm",
]
replay     = []
types      = [
    "saa-schema/cosmwasm",
]
ed25519         =  []
secp256k1       =  []
secp256r1       =  []
passkeys        =  []
eth_personal    =  []
eth_typed_data  =  ["dep:serde_json",  "std"]
cosmos_arb      =  ["dep:bech32"]