diff --git a/Cargo.lock b/Cargo.lock index 42034796d1f0b..70e1e71311ba5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,7 +185,7 @@ dependencies = [ "serde_json", "socket2 0.5.6", "tap", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util 0.7.10", "tower 0.4.13", @@ -214,7 +214,7 @@ dependencies = [ "prettyplease", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -776,7 +776,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -889,7 +889,7 @@ dependencies = [ "serde_urlencoded", "static_assertions_next", "tempfile", - "thiserror", + "thiserror 1.0.64", "tracing", "tracing-futures", ] @@ -925,8 +925,8 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "strum 0.25.0", - "syn 2.0.79", - "thiserror", + "syn 2.0.87", + "thiserror 1.0.64", ] [[package]] @@ -971,7 +971,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -993,7 +993,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1009,7 +1009,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1673,7 +1673,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1838,7 +1838,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b6598a2f5d564fb7855dc6b06fd1c38cff5a72bd8b863a4d021938497b440a" dependencies = [ "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1877,7 +1877,7 @@ dependencies = [ "byteorder", "ff 0.13.0", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1954,7 +1954,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1981,7 +1981,16 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec 0.8.0", ] [[package]] @@ -1990,6 +1999,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitcoin-private" version = "0.1.0" @@ -2325,7 +2340,7 @@ dependencies = [ "instant", "lazy_static", "once_cell", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -2390,7 +2405,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -2404,7 +2419,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -2569,7 +2584,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2623,7 +2638,7 @@ dependencies = [ "k256 0.13.1", "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -2639,7 +2654,7 @@ dependencies = [ "pbkdf2 0.12.1", "rand 0.8.5", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -2659,7 +2674,7 @@ dependencies = [ "serde_derive", "sha2 0.10.8", "sha3 0.10.6", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -2800,7 +2815,7 @@ dependencies = [ "tap", "telemetry-subscribers", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-rustls 0.26.0", "tokio-stream", @@ -2939,7 +2954,7 @@ dependencies = [ "serde", "serde_json", "tar", - "thiserror", + "thiserror 1.0.64", "tokio", "url", ] @@ -2950,15 +2965,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "copy_dir" version = "0.1.3" @@ -3304,7 +3310,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3376,7 +3382,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3393,8 +3399,8 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "strsim 0.10.0", - "syn 2.0.79", - "thiserror", + "syn 2.0.87", + "thiserror 1.0.64", ] [[package]] @@ -3417,7 +3423,7 @@ dependencies = [ "cynic-codegen", "darling 0.20.3", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3489,7 +3495,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "strsim 0.10.0", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3522,7 +3528,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3693,7 +3699,7 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case 0.4.0", + "convert_case", "proc-macro2 1.0.87", "quote 1.0.37", "rustc_version", @@ -3717,7 +3723,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", "unicode-xid 0.2.4", ] @@ -3777,7 +3783,7 @@ dependencies = [ "dsl_auto_type", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3797,7 +3803,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3963,7 +3969,7 @@ dependencies = [ "serde", "serde_json", "tar", - "thiserror", + "thiserror 1.0.64", "url", ] @@ -3979,30 +3985,6 @@ dependencies = [ "serde_with 2.1.0", ] -[[package]] -name = "documented" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feadfed35b96a5634e08fc503677ded669549ae2cf7f0b01d5964f09d95487fd" -dependencies = [ - "documented-macros", - "phf", - "thiserror", -] - -[[package]] -name = "documented-macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973659d4a62084e32a7f9332509455436d33684b316bb3bc2bb6dcea51a68c63" -dependencies = [ - "convert_case 0.6.0", - "optfield", - "proc-macro2 1.0.87", - "quote 1.0.37", - "syn 2.0.79", -] - [[package]] name = "dotenvy" version = "0.15.7" @@ -4032,7 +4014,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4051,7 +4033,7 @@ dependencies = [ "nom", "rust_decimal", "serde", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -4119,7 +4101,7 @@ dependencies = [ "rand_core 0.6.4", "serde", "sha2 0.9.9", - "thiserror", + "thiserror 1.0.64", "zeroize", ] @@ -4248,7 +4230,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4310,7 +4292,7 @@ checksum = "3bf679796c0322556351f287a51b49e48f7c4986e727b5dd78c972d30e2e16cc" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4397,7 +4379,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "sha3 0.10.6", - "thiserror", + "thiserror 1.0.64", "uuid 0.8.2", ] @@ -4414,7 +4396,7 @@ dependencies = [ "serde", "serde_json", "sha3 0.10.6", - "thiserror", + "thiserror 1.0.64", "uint", ] @@ -4493,7 +4475,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -4515,7 +4497,7 @@ dependencies = [ "reqwest 0.11.20", "serde", "serde_json", - "syn 2.0.79", + "syn 2.0.87", "toml 0.8.16", "walkdir", ] @@ -4533,7 +4515,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "serde_json", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4559,9 +4541,9 @@ dependencies = [ "serde", "serde_json", "strum 0.26.3", - "syn 2.0.79", + "syn 2.0.87", "tempfile", - "thiserror", + "thiserror 1.0.64", "tiny-keccak", "unicode-xid 0.2.4", ] @@ -4578,7 +4560,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tracing", ] @@ -4602,7 +4584,7 @@ dependencies = [ "reqwest 0.11.20", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "tracing-futures", @@ -4635,7 +4617,7 @@ dependencies = [ "reqwest 0.11.20", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-tungstenite 0.20.1", "tracing", @@ -4662,7 +4644,7 @@ dependencies = [ "ethers-core", "rand 0.8.5", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", "tracing", ] @@ -4690,7 +4672,7 @@ dependencies = [ "serde_json", "solang-parser", "svm-rs", - "thiserror", + "thiserror 1.0.64", "tiny-keccak", "tokio", "tracing", @@ -4804,7 +4786,7 @@ dependencies = [ "sha3 0.10.6", "signature 2.2.0", "static_assertions", - "thiserror", + "thiserror 1.0.64", "tokio", "typenum", "zeroize", @@ -5089,7 +5071,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" dependencies = [ "nonempty 0.7.0", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5216,7 +5198,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -5283,7 +5265,7 @@ dependencies = [ "reqwest 0.11.20", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "time", "tokio", "tokio-stream", @@ -5311,7 +5293,7 @@ dependencies = [ "rustls-pemfile 2.1.2", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "tracing-futures", @@ -5611,7 +5593,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6184,7 +6166,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -6413,7 +6395,7 @@ dependencies = [ "dyn-clone", "lazy_static", "newline-converter", - "thiserror", + "thiserror 1.0.64", "unicode-segmentation", "unicode-width", ] @@ -6633,7 +6615,7 @@ dependencies = [ "pest_derive", "regex", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6673,7 +6655,7 @@ dependencies = [ "pin-project", "rustls-native-certs 0.6.2", "soketto", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-rustls 0.23.4", "tokio-util 0.7.10", @@ -6703,7 +6685,7 @@ dependencies = [ "serde", "serde_json", "soketto", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -6721,7 +6703,7 @@ dependencies = [ "rustc-hash 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -6768,7 +6750,7 @@ dependencies = [ "beef", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tracing", ] @@ -6907,7 +6889,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml 0.9.21", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util 0.7.10", "tower 0.5.1", @@ -6928,7 +6910,7 @@ dependencies = [ "serde", "serde-value", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6938,7 +6920,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", - "bit-set", + "bit-set 0.5.3", "ena", "itertools 0.11.0", "lalrpop-util", @@ -7195,7 +7177,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "regex-syntax 0.8.2", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -7381,7 +7363,7 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", - "thiserror", + "thiserror 1.0.64", "unicode-width", ] @@ -7393,7 +7375,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -7502,7 +7484,7 @@ dependencies = [ "skeptic", "smallvec", "tagptr", - "thiserror", + "thiserror 1.0.64", "triomphe", "uuid 1.2.2", ] @@ -7788,13 +7770,13 @@ dependencies = [ "once_cell", "primitive-types 0.10.1", "proptest", - "proptest-derive", + "proptest-derive 0.3.0", "rand 0.8.5", "ref-cast", "serde", "serde_bytes", "serde_with 3.9.0", - "thiserror", + "thiserror 1.0.64", "uint", ] @@ -7974,7 +7956,7 @@ version = "0.1.0" dependencies = [ "enum-compat-util", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -8539,7 +8521,7 @@ dependencies = [ "libc", "once_cell", "parking_lot 0.12.1", - "thiserror", + "thiserror 1.0.64", "widestring", "winapi", ] @@ -8956,7 +8938,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -8968,7 +8950,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -9089,17 +9071,6 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "openapiv3" -version = "2.0.0" -source = "git+https://github.com/bmwill/openapiv3.git?rev=ca4b4845b7c159a39f5c68ad8f7f76cb6f4d6963#ca4b4845b7c159a39f5c68ad8f7f76cb6f4d6963" -dependencies = [ - "indexmap 2.2.6", - "schemars", - "serde", - "serde_json", -] - [[package]] name = "openssl-probe" version = "0.1.5" @@ -9118,7 +9089,7 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", - "thiserror", + "thiserror 1.0.64", "urlencoding", ] @@ -9133,7 +9104,7 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -9149,7 +9120,7 @@ dependencies = [ "opentelemetry-proto", "opentelemetry_sdk", "prost 0.13.3", - "thiserror", + "thiserror 1.0.64", "tokio", "tonic 0.12.3", ] @@ -9184,22 +9155,11 @@ dependencies = [ "percent-encoding", "rand 0.8.5", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", ] -[[package]] -name = "optfield" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa59f025cde9c698fcb4fcb3533db4621795374065bee908215263488f2d2a1d" -dependencies = [ - "proc-macro2 1.0.87", - "quote 1.0.37", - "syn 2.0.79", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -9247,7 +9207,7 @@ dependencies = [ "proc-macro-error", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -9261,7 +9221,7 @@ dependencies = [ "proc-macro2 1.0.87", "proc-macro2-diagnostics", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -9646,7 +9606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.64", "ucd-trie", ] @@ -9782,7 +9742,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -9956,7 +9916,7 @@ dependencies = [ "smallvec", "symbolic-demangle", "tempfile", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -10020,7 +9980,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" dependencies = [ "proc-macro2 1.0.87", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -10078,7 +10038,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "thiserror", + "thiserror 1.0.64", "toml 0.5.11", ] @@ -10138,7 +10098,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", "version_check", "yansi 1.0.1", ] @@ -10155,7 +10115,7 @@ dependencies = [ "memchr", "parking_lot 0.12.1", "protobuf", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -10194,12 +10154,12 @@ dependencies = [ [[package]] name = "proptest" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ - "bit-set", - "bit-vec", + "bit-set 0.8.0", + "bit-vec 0.8.0", "bitflags 2.4.1", "lazy_static", "num-traits", @@ -10223,6 +10183,17 @@ dependencies = [ "syn 0.15.44", ] +[[package]] +name = "proptest-derive" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" +dependencies = [ + "proc-macro2 1.0.87", + "quote 1.0.37", + "syn 2.0.87", +] + [[package]] name = "prost" version = "0.12.3" @@ -10260,7 +10231,7 @@ dependencies = [ "prost 0.13.3", "prost-types 0.13.3", "regex", - "syn 2.0.79", + "syn 2.0.87", "tempfile", ] @@ -10274,7 +10245,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -10287,7 +10258,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -10342,7 +10313,7 @@ dependencies = [ "prost-reflect", "prost-types 0.13.3", "protox-parse", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -10354,7 +10325,7 @@ dependencies = [ "logos", "miette", "prost-types 0.13.3", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -10438,7 +10409,7 @@ dependencies = [ "quinn-udp", "rustc-hash 1.1.0", "rustls 0.23.12", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -10455,7 +10426,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "slab", - "thiserror", + "thiserror 1.0.64", "tinyvec", "tracing", ] @@ -10707,7 +10678,7 @@ checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom 0.2.15", "redox_syscall 0.2.16", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -10727,7 +10698,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -10878,7 +10849,7 @@ dependencies = [ "http 1.1.0", "reqwest 0.12.5", "serde", - "thiserror", + "thiserror 1.0.64", "tower-service", ] @@ -11005,9 +10976,9 @@ dependencies = [ [[package]] name = "roaring" -version = "0.10.6" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4b84ba6e838ceb47b41de5194a60244fac43d9fe03b71dbe8c5a201081d6d1" +checksum = "41589aba99537475bf697f2118357cad1c31590c5a1b9f6d9fc4ad6d07503661" dependencies = [ "bytemuck", "byteorder", @@ -11215,7 +11186,7 @@ dependencies = [ "sha1", "sha2 0.10.8", "subtle", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util 0.7.10", ] @@ -11239,7 +11210,7 @@ dependencies = [ "aes", "async-trait", "bcrypt-pbkdf", - "bit-vec", + "bit-vec 0.6.3", "block-padding 0.3.2", "byteorder", "cbc", @@ -11260,7 +11231,7 @@ dependencies = [ "russh-cryptovec", "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "yasna", @@ -11601,7 +11572,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "serde_derive_internals", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -11805,7 +11776,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b5b14ebbcc4e4f2b3642fa99c388649da58d1dc3308c7d109f39f565d1710f0" dependencies = [ "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -11816,7 +11787,7 @@ checksum = "f05a5f801ac62a51a49d378fdb3884480041b99aced450b28990673e8ff99895" dependencies = [ "once_cell", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -11846,7 +11817,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -11857,7 +11828,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -11890,7 +11861,7 @@ checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" dependencies = [ "percent-encoding", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -11980,7 +11951,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -12210,7 +12181,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint 0.4.4", "num-traits", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -12365,7 +12336,7 @@ dependencies = [ "serde", "serde_json", "snowflake-jwt", - "thiserror", + "thiserror 1.0.64", "tokio", "url", "uuid 1.2.2", @@ -12382,7 +12353,7 @@ dependencies = [ "rsa 0.9.1", "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -12432,7 +12403,7 @@ dependencies = [ "lalrpop", "lalrpop-util", "phf", - "thiserror", + "thiserror 1.0.64", "unicode-xid 0.2.4", ] @@ -12570,7 +12541,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "structmeta-derive", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -12581,7 +12552,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -12634,7 +12605,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "rustversion", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -12647,7 +12618,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "rustversion", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -12754,14 +12725,14 @@ dependencies = [ "sui-swarm", "sui-swarm-config", "sui-test-transaction-builder", - "sui-transaction-builder", + "sui-transaction-builder 0.0.0", "sui-types", "tabled", "tap", "telemetry-subscribers", "tempfile", "test-cluster", - "thiserror", + "thiserror 1.0.64", "tokio", "toml 0.7.4", "tower 0.4.13", @@ -12934,7 +12905,7 @@ dependencies = [ "tap", "telemetry-subscribers", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tracing", @@ -13021,7 +12992,7 @@ dependencies = [ "sui-swarm-config", "sui-types", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -13354,7 +13325,7 @@ dependencies = [ "telemetry-subscribers", "tempfile", "test-fuzz", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-retry", "tokio-stream", @@ -13547,6 +13518,7 @@ dependencies = [ "sui-swarm-config", "sui-test-transaction-builder", "sui-tool", + "sui-transaction-builder 0.1.0", "sui-types", "telemetry-subscribers", "tempfile", @@ -13631,7 +13603,7 @@ dependencies = [ "clap", "expect-test", "tempfile", - "thiserror", + "thiserror 1.0.64", "toml 0.7.4", "toml_edit 0.19.10", ] @@ -13665,7 +13637,7 @@ dependencies = [ "telemetry-subscribers", "tempfile", "test-cluster", - "thiserror", + "thiserror 1.0.64", "tokio", "tonic 0.12.3", "tower 0.4.13", @@ -13860,7 +13832,7 @@ dependencies = [ "telemetry-subscribers", "tempfile", "test-cluster", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util 0.7.10", "toml 0.7.4", @@ -13880,7 +13852,7 @@ dependencies = [ "reqwest 0.12.5", "serde_json", "sui-graphql-rpc-headers", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -13953,13 +13925,13 @@ dependencies = [ "sui-swarm-config", "sui-synthetic-ingestion", "sui-test-transaction-builder", - "sui-transaction-builder", + "sui-transaction-builder 0.0.0", "sui-types", "tap", "telemetry-subscribers", "tempfile", "test-cluster", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tokio-util 0.7.10", @@ -14026,7 +13998,7 @@ dependencies = [ "sui-types", "telemetry-subscribers", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tokio-util 0.7.10", @@ -14050,7 +14022,7 @@ dependencies = [ "sui-pg-db", "sui-types", "telemetry-subscribers", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "url", @@ -14180,11 +14152,11 @@ dependencies = [ "sui-open-rpc-macros", "sui-protocol-config", "sui-storage", - "sui-transaction-builder", + "sui-transaction-builder 0.0.0", "sui-types", "tap", "telemetry-subscribers", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util 0.7.10", "tower 0.4.13", @@ -14609,7 +14581,7 @@ dependencies = [ "telemetry-subscribers", "tempfile", "test-cluster", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util 0.7.10", "toml 0.7.4", @@ -14804,7 +14776,7 @@ dependencies = [ "sui-json-rpc-types", "sui-sdk", "sui-types", - "thiserror", + "thiserror 1.0.64", "tracing", ] @@ -14827,7 +14799,7 @@ dependencies = [ "sui-move-build", "sui-rpc-api", "sui-types", - "thiserror", + "thiserror 1.0.64", "tokio", "tower 0.4.13", ] @@ -14857,7 +14829,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "sui-enum-compat-util", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -14971,7 +14943,7 @@ dependencies = [ "sui-types", "tabled", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util 0.7.10", "tracing", @@ -15016,7 +14988,7 @@ dependencies = [ "telemetry-subscribers", "tempfile", "test-cluster", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "typed-store", @@ -15032,7 +15004,6 @@ dependencies = [ "bcs", "bytes", "diffy", - "documented", "fastcrypto", "http 1.1.0", "itertools 0.13.0", @@ -15040,7 +15011,6 @@ dependencies = [ "move-binary-format", "move-core-types", "mysten-network", - "openapiv3", "paste", "prometheus", "proptest", @@ -15050,17 +15020,16 @@ dependencies = [ "rand 0.8.5", "reqwest 0.12.5", "roaring", - "schemars", "serde", "serde_json", "serde_with 3.9.0", - "serde_yaml 0.8.26", "sui-protocol-config", "sui-sdk-types", + "sui-transaction-builder 0.1.0", "sui-types", "tap", "test-strategy", - "thiserror", + "thiserror 1.0.64", "tokio", "tonic 0.12.3", "tonic-build", @@ -15127,10 +15096,10 @@ dependencies = [ "sui-json-rpc-api", "sui-json-rpc-types", "sui-keys", - "sui-transaction-builder", + "sui-transaction-builder 0.0.0", "sui-types", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -15138,7 +15107,7 @@ dependencies = [ [[package]] name = "sui-sdk-types" version = "0.0.1" -source = "git+https://github.com/MystenLabs/sui-rust-sdk.git?rev=24c34933c421319e9aa1c48b3b7108c756e1422f#24c34933c421319e9aa1c48b3b7108c756e1422f" +source = "git+https://github.com/MystenLabs/sui-rust-sdk.git?rev=cb174b66714ea643e4b78bbfadb3f9c17e635460#cb174b66714ea643e4b78bbfadb3f9c17e635460" dependencies = [ "base64ct", "bcs", @@ -15148,7 +15117,6 @@ dependencies = [ "hex", "proptest", "roaring", - "schemars", "serde", "serde_derive", "serde_json", @@ -15293,7 +15261,7 @@ dependencies = [ "tar", "tempfile", "test-cluster", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "ureq", @@ -15603,6 +15571,20 @@ dependencies = [ "sui-types", ] +[[package]] +name = "sui-transaction-builder" +version = "0.1.0" +source = "git+https://github.com/MystenLabs/sui-rust-sdk.git?rev=cb174b66714ea643e4b78bbfadb3f9c17e635460#cb174b66714ea643e4b78bbfadb3f9c17e635460" +dependencies = [ + "base64ct", + "bcs", + "serde", + "serde_json", + "serde_with 3.9.0", + "sui-sdk-types", + "thiserror 2.0.9", +] + [[package]] name = "sui-transaction-checks" version = "0.1.0" @@ -15713,7 +15695,7 @@ dependencies = [ "passkey-types", "prometheus", "proptest", - "proptest-derive", + "proptest-derive 0.5.1", "rand 0.8.5", "roaring", "schemars", @@ -15732,7 +15714,7 @@ dependencies = [ "sui-protocol-config", "sui-sdk-types", "tap", - "thiserror", + "thiserror 1.0.64", "tokio", "tonic 0.12.3", "tracing", @@ -15899,7 +15881,7 @@ dependencies = [ "strum 0.24.1", "tabled", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", "toml_edit 0.19.10", "tracing", @@ -15942,7 +15924,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", "url", "zip", ] @@ -15994,9 +15976,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", @@ -16035,7 +16017,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -16308,7 +16290,7 @@ dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", "structmeta", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -16328,7 +16310,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +dependencies = [ + "thiserror-impl 2.0.9", ] [[package]] @@ -16339,7 +16330,18 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +dependencies = [ + "proc-macro2 1.0.87", + "quote 1.0.37", + "syn 2.0.87", ] [[package]] @@ -16417,7 +16419,7 @@ dependencies = [ "rand 0.8.5", "rustc-hash 1.1.0", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", "unicode-normalization", "wasm-bindgen", "zeroize", @@ -16520,7 +16522,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -16530,7 +16532,7 @@ source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=d46208cb11 dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -16859,7 +16861,7 @@ dependencies = [ "prost-build", "prost-types 0.13.3", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -17040,7 +17042,7 @@ dependencies = [ "governor", "http 1.1.0", "pin-project", - "thiserror", + "thiserror 1.0.64", "tower 0.5.1", "tracing", ] @@ -17076,7 +17078,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -17201,7 +17203,7 @@ dependencies = [ "move-core-types", "once_cell", "proptest", - "proptest-derive", + "proptest-derive 0.5.1", "rand 0.8.5", "sui-core", "sui-move-build", @@ -17266,7 +17268,7 @@ dependencies = [ "rand 0.8.5", "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.64", "url", "utf-8", ] @@ -17285,7 +17287,7 @@ dependencies = [ "log", "rand 0.8.5", "sha1", - "thiserror", + "thiserror 1.0.64", "url", "utf-8", ] @@ -17327,7 +17329,7 @@ dependencies = [ "syn 1.0.107", "tap", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "typed-store-derive", @@ -17351,7 +17353,7 @@ name = "typed-store-error" version = "0.4.0" dependencies = [ "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -17367,7 +17369,7 @@ dependencies = [ "quote 1.0.37", "regex", "regex-syntax 0.7.2", - "syn 2.0.79", + "syn 2.0.87", "zstd-sys", ] @@ -17396,7 +17398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a615d6c2764852a2e88a4f16e9ce1ea49bb776b5872956309e170d63a042a34f" dependencies = [ "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -17764,7 +17766,7 @@ dependencies = [ "once_cell", "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -17798,7 +17800,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -18244,7 +18246,7 @@ dependencies = [ "pharos", "rustc_version", "send_wrapper 0.6.0", - "thiserror", + "thiserror 1.0.64", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -18291,7 +18293,7 @@ dependencies = [ "ring 0.17.8", "signature 2.2.0", "spki 0.7.3", - "thiserror", + "thiserror 1.0.64", "zeroize", ] @@ -18309,7 +18311,7 @@ dependencies = [ "nom", "oid-registry", "rusticata-macros", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -18363,7 +18365,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", "num-bigint 0.4.4", "time", ] @@ -18388,7 +18390,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", "synstructure 0.13.1", ] @@ -18436,7 +18438,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -18456,7 +18458,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", "synstructure 0.13.1", ] @@ -18500,7 +18502,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2 1.0.87", "quote 1.0.37", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8904e028a211c..b7ffaf614990d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -418,8 +418,8 @@ prometheus-http-query = { version = "0.8", default-features = false, features = "rustls-tls", ] } prometheus-parse = { git = "https://github.com/asonnino/prometheus-parser.git", rev = "75334db" } -proptest = "1.1.0" -proptest-derive = "0.3.0" +proptest = "1.6.0" +proptest-derive = "0.5" prost = "0.13" prost-build = "0.13" prost-types = "0.13.1" @@ -599,7 +599,8 @@ anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f769 # core-types with json format for REST api # sui-sdk-types = { version = "0.0.1", features = ["hash", "serde", "schemars"] } -sui-sdk-types = { git = "https://github.com/MystenLabs/sui-rust-sdk.git", rev = "24c34933c421319e9aa1c48b3b7108c756e1422f", features = ["hash", "serde", "schemars"] } +sui-sdk-types = { git = "https://github.com/MystenLabs/sui-rust-sdk.git", rev = "cb174b66714ea643e4b78bbfadb3f9c17e635460", features = ["hash", "serde"] } +sui-sdk-transaction-builder = { git = "https://github.com/MystenLabs/sui-rust-sdk.git", rev = "cb174b66714ea643e4b78bbfadb3f9c17e635460", package = "sui-transaction-builder" } ### Workspace Members ### anemo-benchmark = { path = "crates/anemo-benchmark" } diff --git a/crates/sui-e2e-tests/Cargo.toml b/crates/sui-e2e-tests/Cargo.toml index b0e257f024c16..c15b6509bb83f 100644 --- a/crates/sui-e2e-tests/Cargo.toml +++ b/crates/sui-e2e-tests/Cargo.toml @@ -66,6 +66,7 @@ sui-keys.workspace = true sui-rpc-api.workspace = true shared-crypto.workspace = true sui-sdk-types.workspace = true +sui-sdk-transaction-builder.workspace = true passkey-types.workspace = true passkey-client.workspace = true diff --git a/crates/sui-e2e-tests/tests/rpc/committee.rs b/crates/sui-e2e-tests/tests/rpc/committee.rs index f6cfe05d5a867..da5ebfe8dc3cb 100644 --- a/crates/sui-e2e-tests/tests/rpc/committee.rs +++ b/crates/sui-e2e-tests/tests/rpc/committee.rs @@ -38,5 +38,5 @@ async fn get_committee() { assert_eq!(latest_committee, epoch_0_committee); // ensure we can convert proto committee type to sdk_types committee - sui_sdk_types::types::ValidatorCommittee::try_from(&latest_committee).unwrap(); + sui_sdk_types::ValidatorCommittee::try_from(&latest_committee).unwrap(); } diff --git a/crates/sui-e2e-tests/tests/rpc/execute.rs b/crates/sui-e2e-tests/tests/rpc/execute.rs index 0999327df1d6d..8cf4375598e21 100644 --- a/crates/sui-e2e-tests/tests/rpc/execute.rs +++ b/crates/sui-e2e-tests/tests/rpc/execute.rs @@ -4,7 +4,7 @@ use sui_macros::sim_test; use sui_rpc_api::types::ExecuteTransactionOptions; use sui_rpc_api::Client; -use sui_sdk_types::types::BalanceChange; +use sui_sdk_types::BalanceChange; use sui_test_transaction_builder::make_transfer_sui_transaction; use sui_types::base_types::SuiAddress; use sui_types::effects::TransactionEffectsAPI; diff --git a/crates/sui-e2e-tests/tests/rpc/main.rs b/crates/sui-e2e-tests/tests/rpc/main.rs index 7f8ab35b7a3f8..aa1280746b51f 100644 --- a/crates/sui-e2e-tests/tests/rpc/main.rs +++ b/crates/sui-e2e-tests/tests/rpc/main.rs @@ -11,7 +11,7 @@ mod transactions; async fn transfer_coin( context: &sui_sdk::wallet_context::WalletContext, -) -> sui_sdk_types::types::TransactionDigest { +) -> sui_sdk_types::TransactionDigest { let gas_price = context.get_reference_gas_price().await.unwrap(); let accounts_and_objs = context.get_all_accounts_and_gas_objects().await.unwrap(); let sender = accounts_and_objs[0].0; @@ -29,7 +29,7 @@ async fn transfer_coin( async fn stake_with_validator( cluster: &test_cluster::TestCluster, -) -> sui_sdk_types::types::TransactionDigest { +) -> sui_sdk_types::TransactionDigest { let context = &cluster.wallet; let gas_price = context.get_reference_gas_price().await.unwrap(); let accounts_and_objs = context.get_all_accounts_and_gas_objects().await.unwrap(); diff --git a/crates/sui-e2e-tests/tests/rpc/objects.rs b/crates/sui-e2e-tests/tests/rpc/objects.rs index c9d62e692df8a..6cd48f4c0bfd8 100644 --- a/crates/sui-e2e-tests/tests/rpc/objects.rs +++ b/crates/sui-e2e-tests/tests/rpc/objects.rs @@ -8,7 +8,7 @@ use sui_rpc_api::proto::node::node_client::NodeClient; use sui_rpc_api::proto::node::GetObjectOptions; use sui_rpc_api::proto::node::GetObjectRequest; use sui_rpc_api::proto::node::GetObjectResponse; -use sui_sdk_types::types::ObjectId; +use sui_sdk_types::ObjectId; use test_cluster::TestClusterBuilder; #[sim_test] diff --git a/crates/sui-e2e-tests/tests/rpc/resolve.rs b/crates/sui-e2e-tests/tests/rpc/resolve.rs index 6de508bcfd4c7..157be937d44eb 100644 --- a/crates/sui-e2e-tests/tests/rpc/resolve.rs +++ b/crates/sui-e2e-tests/tests/rpc/resolve.rs @@ -8,10 +8,10 @@ use sui_rpc_api::client::reqwest::StatusCode; use sui_rpc_api::client::sdk::Client as RestClient; use sui_rpc_api::rest::transactions::ResolveTransactionQueryParameters; use sui_rpc_api::Client; -use sui_sdk_types::types::unresolved; -use sui_sdk_types::types::Argument; -use sui_sdk_types::types::Command; -use sui_sdk_types::types::TransactionExpiration; +use sui_sdk_transaction_builder::unresolved; +use sui_sdk_types::Argument; +use sui_sdk_types::Command; +use sui_sdk_types::TransactionExpiration; use sui_types::base_types::SuiAddress; use sui_types::effects::TransactionEffectsAPI; use test_cluster::TestClusterBuilder; @@ -40,12 +40,10 @@ async fn resolve_transaction_simple_transfer() { ..Default::default() }, ], - commands: vec![Command::TransferObjects( - sui_sdk_types::types::TransferObjects { - objects: vec![Argument::Input(0)], - address: Argument::Input(1), - }, - )], + commands: vec![Command::TransferObjects(sui_sdk_types::TransferObjects { + objects: vec![Argument::Input(0)], + address: Argument::Input(1), + })], }, sender: sender.into(), gas_payment: None, @@ -104,12 +102,10 @@ async fn resolve_transaction_transfer_with_sponsor() { ..Default::default() }, ], - commands: vec![Command::TransferObjects( - sui_sdk_types::types::TransferObjects { - objects: vec![Argument::Input(0)], - address: Argument::Input(1), - }, - )], + commands: vec![Command::TransferObjects(sui_sdk_types::TransferObjects { + objects: vec![Argument::Input(0)], + address: Argument::Input(1), + })], }, sender: sender.into(), gas_payment: Some(unresolved::GasPayment { @@ -179,7 +175,7 @@ async fn resolve_transaction_borrowed_shared_object() { object_id: Some("0x6".parse().unwrap()), ..Default::default() }], - commands: vec![Command::MoveCall(sui_sdk_types::types::MoveCall { + commands: vec![Command::MoveCall(sui_sdk_types::MoveCall { package: "0x2".parse().unwrap(), module: "clock".parse().unwrap(), function: "timestamp_ms".parse().unwrap(), @@ -252,7 +248,7 @@ async fn resolve_transaction_mutable_shared_object() { ..Default::default() }, ], - commands: vec![Command::MoveCall(sui_sdk_types::types::MoveCall { + commands: vec![Command::MoveCall(sui_sdk_types::MoveCall { package: "0x3".parse().unwrap(), module: "sui_system".parse().unwrap(), function: "request_add_stake".parse().unwrap(), @@ -305,7 +301,7 @@ async fn resolve_transaction_insufficient_gas() { object_id: Some("0x6".parse().unwrap()), ..Default::default() }], - commands: vec![Command::MoveCall(sui_sdk_types::types::MoveCall { + commands: vec![Command::MoveCall(sui_sdk_types::MoveCall { package: "0x2".parse().unwrap(), module: "clock".parse().unwrap(), function: "timestamp_ms".parse().unwrap(), diff --git a/crates/sui-rpc-api/Cargo.toml b/crates/sui-rpc-api/Cargo.toml index 1c03e8c3b753c..60e141c9ce034 100644 --- a/crates/sui-rpc-api/Cargo.toml +++ b/crates/sui-rpc-api/Cargo.toml @@ -15,7 +15,6 @@ reqwest.workspace = true url.workspace = true serde.workspace = true serde_json.workspace = true -serde_yaml.workspace = true serde_with.workspace = true tap.workspace = true thiserror.workspace = true @@ -23,10 +22,8 @@ tokio.workspace = true async-trait.workspace = true itertools.workspace = true sui-sdk-types.workspace = true +sui-sdk-transaction-builder.workspace = true prometheus.workspace = true -openapiv3 = { git = "https://github.com/bmwill/openapiv3.git", rev = "ca4b4845b7c159a39f5c68ad8f7f76cb6f4d6963" } -schemars.workspace = true -documented = "0.6.0" http.workspace = true tower.workspace = true diff --git a/crates/sui-rpc-api/openapi/elements.html b/crates/sui-rpc-api/openapi/elements.html deleted file mode 100644 index 976a2c280615d..0000000000000 --- a/crates/sui-rpc-api/openapi/elements.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - Sui Node Api - - - - - - - - - - diff --git a/crates/sui-rpc-api/openapi/openapi.json b/crates/sui-rpc-api/openapi/openapi.json deleted file mode 100644 index 69e0258d09681..0000000000000 --- a/crates/sui-rpc-api/openapi/openapi.json +++ /dev/null @@ -1,6450 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Sui Node Api", - "description": "REST Api for interacting with the Sui Blockchain", - "contact": { - "name": "Mysten Labs", - "url": "https://github.com/MystenLabs/sui" - }, - "license": { - "name": "Apache 2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "unknown" - }, - "servers": [ - { - "url": "/v2" - } - ], - "paths": { - "/": { - "get": { - "tags": [ - "General" - ], - "description": "[![stable](https://img.shields.io/badge/api-stable-53b576?style=for-the-badge)](#)\n\nGet basic information about the state of a Node", - "operationId": "Get NodeInfo", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NodeInfo" - } - } - } - }, - "500": { - "description": "" - } - } - } - }, - "/-/health": { - "get": { - "tags": [ - "General" - ], - "description": "[![stable](https://img.shields.io/badge/api-stable-53b576?style=for-the-badge)](#)\n\nPerform a service health check\n\nBy default the health check only verifies that the latest checkpoint can be fetched from the\nnode's store before returning a 200. Optionally the `threshold_seconds` parameter can be\nprovided to test for how up to date the node needs to be to be considered healthy.", - "operationId": "Health Check", - "parameters": [ - { - "in": "query", - "name": "threshold_seconds", - "description": "The threshold, or delta, between the server's system time and the timestamp in the most recently executed checkpoint for which the server is considered to be healthy.\n\nIf not provided, the server will be considered healthy if it can simply fetch the latest checkpoint from its store.", - "schema": { - "description": "The threshold, or delta, between the server's system time and the timestamp in the most recently executed checkpoint for which the server is considered to be healthy.\n\nIf not provided, the server will be considered healthy if it can simply fetch the latest checkpoint from its store.", - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "text/plain; charset=utf-8": {} - } - }, - "500": { - "description": "" - } - } - } - }, - "/checkpoints/{checkpoint}": { - "get": { - "tags": [ - "Checkpoint" - ], - "description": "[![stable](https://img.shields.io/badge/api-stable-53b576?style=for-the-badge)](#)\n\nFetch a Checkpoint\n\nFetch a checkpoint either by `CheckpointSequenceNumber` (checkpoint height) or by\n`CheckpointDigest` and optionally request its contents.\n\nIf the checkpoint has been pruned and is not available, a 410 will be returned.", - "operationId": "Get Checkpoint", - "parameters": [ - { - "in": "path", - "name": "checkpoint", - "required": true, - "schema": { - "$ref": "#/components/schemas/CheckpointId" - }, - "style": "simple" - }, - { - "in": "query", - "name": "contents", - "description": "Request `CheckpointContents` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `CheckpointContents` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "contents_bcs", - "description": "Request `CheckpointContents` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `CheckpointContents` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "signature", - "description": "Request `ValidatorAggregatedSignature` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `ValidatorAggregatedSignature` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "summary", - "description": "Request `CheckpointSummary` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `CheckpointSummary` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "summary_bcs", - "description": "Request `CheckpointSummary` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `CheckpointSummary` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CheckpointResponse" - } - } - } - }, - "404": { - "description": "" - }, - "410": { - "description": "" - }, - "500": { - "description": "" - } - } - } - }, - "/accounts/{account}/objects": { - "get": { - "tags": [ - "Account" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "ListAccountObjects", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "$ref": "#/components/schemas/Address" - }, - "style": "simple" - }, - { - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "style": "form" - }, - { - "in": "query", - "name": "start", - "schema": { - "$ref": "#/components/schemas/ObjectId" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "headers": { - "x-sui-cursor": { - "style": "simple", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccountOwnedObjectInfo" - } - } - } - } - } - } - } - }, - "/objects/{object_id}": { - "get": { - "tags": [ - "Objects" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetObject", - "parameters": [ - { - "in": "path", - "name": "object_id", - "required": true, - "schema": { - "$ref": "#/components/schemas/ObjectId" - }, - "style": "simple" - }, - { - "in": "query", - "name": "object", - "description": "Request that `Object` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request that `Object` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "object_bcs", - "description": "Request that `Object` formated as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request that `Object` formated as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ObjectResponse" - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/objects/{object_id}/version/{version}": { - "get": { - "tags": [ - "Objects" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetObjectWithVersion", - "parameters": [ - { - "in": "path", - "name": "object_id", - "required": true, - "schema": { - "$ref": "#/components/schemas/ObjectId" - }, - "style": "simple" - }, - { - "in": "path", - "name": "version", - "required": true, - "schema": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "style": "simple" - }, - { - "in": "query", - "name": "object", - "description": "Request that `Object` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request that `Object` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "object_bcs", - "description": "Request that `Object` formated as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request that `Object` formated as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ObjectResponse" - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/objects/{object_id}/dynamic-fields": { - "get": { - "tags": [ - "Objects" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "ListDynamicFields", - "parameters": [ - { - "in": "path", - "name": "object_id", - "required": true, - "schema": { - "$ref": "#/components/schemas/ObjectId" - }, - "style": "simple" - }, - { - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "style": "form" - }, - { - "in": "query", - "name": "start", - "schema": { - "$ref": "#/components/schemas/ObjectId" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "headers": { - "x-sui-cursor": { - "style": "simple", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DynamicFieldInfo" - } - } - } - } - } - } - } - }, - "/checkpoints": { - "get": { - "tags": [ - "Checkpoint" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\nList Checkpoints\n\nRequest a page of checkpoints, and optionally their contents, ordered by\n`CheckpointSequenceNumber`.\n\nIf the requested page is below the Node's `lowest_available_checkpoint`, a 410 will be\nreturned.", - "operationId": "List Checkpoints", - "parameters": [ - { - "in": "query", - "name": "direction", - "description": "The direction to paginate in.\n\nDefaults to `descending` if not provided.", - "schema": { - "description": "The direction to paginate in.\n\nDefaults to `descending` if not provided.", - "allOf": [ - { - "$ref": "#/components/schemas/Direction" - } - ] - }, - "style": "form" - }, - { - "in": "query", - "name": "limit", - "description": "Page size limit for the response.\n\nDefaults to `50` if not provided with a maximum page size of `100`.", - "schema": { - "description": "Page size limit for the response.\n\nDefaults to `50` if not provided with a maximum page size of `100`.", - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "style": "form" - }, - { - "in": "query", - "name": "start", - "description": "The checkpoint to start listing from.\n\nDefaults to the latest checkpoint if not provided.", - "schema": { - "description": "The checkpoint to start listing from.\n\nDefaults to the latest checkpoint if not provided.", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "style": "form" - }, - { - "in": "query", - "name": "contents", - "description": "Request `CheckpointContents` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `CheckpointContents` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "contents_bcs", - "description": "Request `CheckpointContents` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `CheckpointContents` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "signature", - "description": "Request `ValidatorAggregatedSignature` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `ValidatorAggregatedSignature` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "summary", - "description": "Request `CheckpointSummary` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `CheckpointSummary` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "summary_bcs", - "description": "Request `CheckpointSummary` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `CheckpointSummary` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "headers": { - "x-sui-cursor": { - "style": "simple", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CheckpointResponse" - } - } - } - } - }, - "410": { - "description": "" - }, - "500": { - "description": "" - } - } - } - }, - "/transactions/{transaction}": { - "get": { - "tags": [ - "Transactions" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetTransaction", - "parameters": [ - { - "in": "path", - "name": "transaction", - "required": true, - "schema": { - "$ref": "#/components/schemas/TransactionDigest" - }, - "style": "simple" - }, - { - "in": "query", - "name": "effects", - "description": "Request `TransactionEffects` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEffects` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "effects_bcs", - "description": "Request `TransactionEffects` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEffects` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "events", - "description": "Request `TransactionEvents` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEvents` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "events_bcs", - "description": "Request `TransactionEvents` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEvents` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "signatures", - "description": "Request `Vec` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `Vec` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "signatures_bytes", - "description": "Request `Vec` encoded as bytes be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `Vec` encoded as bytes be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "transaction", - "description": "Request `Transaction` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `Transaction` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "transaction_bcs", - "description": "Request `Transaction` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `Transaction` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionResponse" - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/transactions": { - "get": { - "tags": [ - "Transactions" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "ListTransactions", - "parameters": [ - { - "in": "query", - "name": "direction", - "schema": { - "$ref": "#/components/schemas/Direction" - }, - "style": "form" - }, - { - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "style": "form" - }, - { - "in": "query", - "name": "start", - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "effects", - "description": "Request `TransactionEffects` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEffects` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "effects_bcs", - "description": "Request `TransactionEffects` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEffects` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "events", - "description": "Request `TransactionEvents` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEvents` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "events_bcs", - "description": "Request `TransactionEvents` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEvents` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "signatures", - "description": "Request `Vec` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `Vec` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "signatures_bytes", - "description": "Request `Vec` encoded as bytes be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `Vec` encoded as bytes be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "transaction", - "description": "Request `Transaction` be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `Transaction` be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "transaction_bcs", - "description": "Request `Transaction` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `Transaction` encoded as BCS be included in the response\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "headers": { - "x-sui-cursor": { - "style": "simple", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransactionResponse" - } - } - } - } - }, - "410": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Transactions" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "ExecuteTransaction", - "parameters": [ - { - "in": "query", - "name": "balance_changes", - "description": "Request `BalanceChanges` be included in the Response.\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `BalanceChanges` be included in the Response.\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "effects", - "description": "Request `TransactionEffects` be included in the Response.\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEffects` be included in the Response.\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "effects_bcs", - "description": "Request `TransactionEffects` encoded as BCS be included in the Response.\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEffects` encoded as BCS be included in the Response.\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "events", - "description": "Request `TransactionEvents` be included in the Response.\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEvents` be included in the Response.\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "events_bcs", - "description": "Request `TransactionEvents` encoded as BCS be included in the Response.\n\nDefaults to `false` if not provided.", - "schema": { - "description": "Request `TransactionEvents` encoded as BCS be included in the Response.\n\nDefaults to `false` if not provided.", - "type": "boolean" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "application/bcs": {} - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExecuteTransactionResponse" - } - } - } - } - } - } - }, - "/system/committee/{epoch}": { - "get": { - "tags": [ - "System" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetCommittee", - "parameters": [ - { - "in": "path", - "name": "epoch", - "required": true, - "schema": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "style": "simple" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidatorCommittee" - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/system/committee": { - "get": { - "tags": [ - "System" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetLatestCommittee", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidatorCommittee" - } - } - } - } - } - } - }, - "/system": { - "get": { - "tags": [ - "System" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetSystemStateSummary", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SystemStateSummary" - } - } - } - } - } - } - }, - "/system/protocol": { - "get": { - "tags": [ - "System" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetCurrentProtocolConfig", - "responses": { - "200": { - "description": "", - "headers": { - "x-sui-min-supported-protocol-version": { - "style": "simple", - "schema": { - "type": "string" - } - }, - "x-sui-max-supported-protocol-version": { - "style": "simple", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProtocolConfig" - } - } - } - } - } - } - }, - "/system/protocol/{version}": { - "get": { - "tags": [ - "System" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetProtocolConfig", - "parameters": [ - { - "in": "path", - "name": "version", - "required": true, - "schema": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "style": "simple" - } - ], - "responses": { - "200": { - "description": "", - "headers": { - "x-sui-min-supported-protocol-version": { - "style": "simple", - "schema": { - "type": "string" - } - }, - "x-sui-max-supported-protocol-version": { - "style": "simple", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProtocolConfig" - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/system/gas": { - "get": { - "tags": [ - "System" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetGasInfo", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GasInfo" - } - } - } - } - } - } - }, - "/transactions/simulate": { - "post": { - "tags": [ - "Transactions" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "SimulateTransaction", - "parameters": [ - { - "in": "query", - "name": "balance_changes", - "description": "Request `BalanceChanges` be included in the Response.", - "schema": { - "description": "Request `BalanceChanges` be included in the Response.", - "default": "false", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "input_objects", - "description": "Request input `Object`s be included in the Response.", - "schema": { - "description": "Request input `Object`s be included in the Response.", - "default": "false", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "output_objects", - "description": "Request output `Object`s be included in the Response.", - "schema": { - "description": "Request output `Object`s be included in the Response.", - "default": "false", - "type": "boolean" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "application/bcs": {} - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionSimulationResponse" - } - } - } - } - } - } - }, - "/transactions/resolve": { - "post": { - "tags": [ - "Transactions" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "ResolveTransaction", - "parameters": [ - { - "in": "query", - "name": "balance_changes", - "description": "Request `BalanceChanges` be included in the Response.", - "schema": { - "description": "Request `BalanceChanges` be included in the Response.", - "default": "false", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "input_objects", - "description": "Request input `Object`s be included in the Response.", - "schema": { - "description": "Request input `Object`s be included in the Response.", - "default": "false", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "output_objects", - "description": "Request output `Object`s be included in the Response.", - "schema": { - "description": "Request output `Object`s be included in the Response.", - "default": "false", - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "simulate", - "description": "Request that the fully resolved transaction be simulated and have its results sent back in the response.", - "schema": { - "description": "Request that the fully resolved transaction be simulated and have its results sent back in the response.", - "default": false, - "type": "boolean" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnresolvedTransaction" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveTransactionResponse" - } - } - } - } - } - } - }, - "/coins/{coin_type}": { - "get": { - "tags": [ - "Coins" - ], - "description": "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n", - "operationId": "GetCoinInfo", - "parameters": [ - { - "in": "path", - "name": "coin_type", - "required": true, - "schema": { - "$ref": "#/components/schemas/StructTag" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CoinInfo" - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/openapi": { - "get": { - "tags": [ - "OpenAPI" - ], - "description": "[![stable](https://img.shields.io/badge/api-stable-53b576?style=for-the-badge)](#)\n\nProvides a web UI for exploring the OpenAPI v3.1.0 definition for this service", - "operationId": "OpenAPI Explorer", - "responses": { - "200": { - "description": "", - "content": { - "text/html; charset=utf-8": {} - } - } - } - } - }, - "/openapi.json": { - "get": { - "tags": [ - "OpenAPI" - ], - "description": "[![stable](https://img.shields.io/badge/api-stable-53b576?style=for-the-badge)](#)\n\nReturn the OpenAPI v3.1.0 definition for this service as a JSON document", - "operationId": "openapi.json", - "responses": { - "200": { - "description": "", - "content": { - "application/json": {} - } - } - } - } - }, - "/openapi.yaml": { - "get": { - "tags": [ - "OpenAPI" - ], - "description": "[![stable](https://img.shields.io/badge/api-stable-53b576?style=for-the-badge)](#)\n\nReturn the OpenAPI v3.1.0 definition for this service as a YAML document", - "operationId": "openapi.yaml", - "responses": { - "200": { - "description": "", - "content": { - "text/plain; charset=utf-8": {} - } - } - } - } - } - }, - "components": { - "schemas": { - "AccountOwnedObjectInfo": { - "type": "object", - "required": [ - "object_id", - "owner", - "type", - "version" - ], - "properties": { - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "owner": { - "$ref": "#/components/schemas/Address" - }, - "type": { - "$ref": "#/components/schemas/StructTag" - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "ActiveJwk": { - "type": "object", - "required": [ - "epoch", - "jwk", - "jwk_id" - ], - "properties": { - "epoch": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "jwk": { - "$ref": "#/components/schemas/Jwk" - }, - "jwk_id": { - "$ref": "#/components/schemas/JwkId" - } - } - }, - "Address": { - "title": "Address", - "description": "A 32-byte Sui address, encoded as a hex string.", - "examples": [ - "0x0000000000000000000000000000000000000000000000000000000000000002" - ], - "type": "string", - "format": "hex", - "maxLength": 66, - "pattern": "0x[a-z0-9]{1,64}" - }, - "Argument": { - "anyOf": [ - { - "title": "Gas", - "type": "string", - "enum": [ - "gas" - ] - }, - { - "title": "Input", - "type": "object", - "required": [ - "input" - ], - "properties": { - "input": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - } - }, - { - "title": "Result", - "type": "object", - "required": [ - "result" - ], - "properties": { - "result": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - } - }, - { - "title": "NestedResult", - "type": "object", - "required": [ - "result" - ], - "properties": { - "result": { - "type": "array", - "items": [ - { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - ], - "maxItems": 2, - "minItems": 2 - } - } - } - ] - }, - "BalanceChange": { - "type": "object", - "required": [ - "address", - "amount", - "coin_type" - ], - "properties": { - "address": { - "description": "Owner of the balance change", - "allOf": [ - { - "$ref": "#/components/schemas/Address" - } - ] - }, - "amount": { - "description": "The amount indicate the balance value changes.\n\nA negative amount means spending coin value and positive means receiving coin value.", - "type": "string", - "format": "i128" - }, - "coin_type": { - "description": "Type of the Coin", - "allOf": [ - { - "$ref": "#/components/schemas/TypeTag" - } - ] - } - } - }, - "Bls12381PublicKey": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "Bls12381Signature": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "Bn254FieldElement": { - "description": "Radix-10 encoded 256-bit unsigned integer", - "type": "string", - "format": "u256" - }, - "CancelledTransaction": { - "type": "object", - "required": [ - "digest", - "version_assignments" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/TransactionDigest" - }, - "version_assignments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VersionAssignment" - } - } - } - }, - "ChangedObject": { - "type": "object", - "required": [ - "id_operation", - "input_state", - "object_id", - "output_state" - ], - "properties": { - "id_operation": { - "description": "Whether this object ID is created or deleted in this transaction. This information isn't required by the protocol but is useful for providing more detailed semantics on object changes.", - "allOf": [ - { - "$ref": "#/components/schemas/IdOperation" - } - ] - }, - "input_state": { - "description": "State of the object in the store prior to this transaction.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectIn" - } - ] - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "output_state": { - "description": "State of the object in the store after this transaction.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectOut" - } - ] - } - } - }, - "CheckpointCommitment": { - "oneOf": [ - { - "type": "object", - "required": [ - "digest", - "type" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/Digest" - }, - "type": { - "type": "string", - "enum": [ - "ecmh_live_object_set" - ] - } - } - } - ] - }, - "CheckpointContents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CheckpointTransactionInfo" - } - }, - "CheckpointContentsDigest": { - "$ref": "#/components/schemas/Digest" - }, - "CheckpointDigest": { - "$ref": "#/components/schemas/Digest" - }, - "CheckpointId": { - "anyOf": [ - { - "title": "SequenceNumber", - "description": "Sequence number or height of a Checkpoint", - "examples": [ - 0 - ], - "type": "string", - "format": "u64" - }, - { - "title": "Digest", - "description": "Base58 encoded 32-byte digest of a Checkpoint", - "examples": [ - "4btiuiMPvEENsttpZC7CZ53DruC3MAgfznDbASZ7DR6S" - ], - "allOf": [ - { - "$ref": "#/components/schemas/CheckpointDigest" - } - ] - } - ] - }, - "CheckpointResponse": { - "type": "object", - "required": [ - "digest", - "sequence_number" - ], - "properties": { - "contents": { - "$ref": "#/components/schemas/CheckpointContents" - }, - "contents_bcs": { - "type": "string" - }, - "digest": { - "$ref": "#/components/schemas/CheckpointDigest" - }, - "sequence_number": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "signature": { - "$ref": "#/components/schemas/ValidatorAggregatedSignature" - }, - "summary": { - "$ref": "#/components/schemas/CheckpointSummary" - }, - "summary_bcs": { - "type": "string" - } - } - }, - "CheckpointSummary": { - "type": "object", - "required": [ - "content_digest", - "epoch", - "epoch_rolling_gas_cost_summary", - "network_total_transactions", - "sequence_number", - "timestamp_ms" - ], - "properties": { - "checkpoint_commitments": { - "description": "Commitments to checkpoint-specific state (e.g. txns in checkpoint, objects read/written in checkpoint).", - "type": "array", - "items": { - "$ref": "#/components/schemas/CheckpointCommitment" - } - }, - "content_digest": { - "$ref": "#/components/schemas/CheckpointContentsDigest" - }, - "end_of_epoch_data": { - "description": "Present only on the final checkpoint of the epoch.", - "allOf": [ - { - "$ref": "#/components/schemas/EndOfEpochData" - } - ] - }, - "epoch": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "epoch_rolling_gas_cost_summary": { - "description": "The running total gas costs of all transactions included in the current epoch so far until this checkpoint.", - "allOf": [ - { - "$ref": "#/components/schemas/GasCostSummary" - } - ] - }, - "network_total_transactions": { - "description": "Total number of transactions committed since genesis, including those in this checkpoint.", - "type": "string", - "format": "u64" - }, - "previous_digest": { - "$ref": "#/components/schemas/CheckpointDigest" - }, - "sequence_number": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "timestamp_ms": { - "description": "Timestamp of the checkpoint - number of milliseconds from the Unix epoch Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent checkpoints can have same timestamp if they originate from the same underlining consensus commit", - "type": "string", - "format": "u64" - }, - "version_specific_data": { - "description": "CheckpointSummary is not an evolvable structure - it must be readable by any version of the code. Therefore, in order to allow extensions to be added to CheckpointSummary, we allow opaque data to be added to checkpoints which can be deserialized based on the current protocol version.", - "type": "string", - "format": "base64" - } - } - }, - "CheckpointTransactionInfo": { - "type": "object", - "required": [ - "effects", - "signatures", - "transaction" - ], - "properties": { - "effects": { - "$ref": "#/components/schemas/TransactionEffectsDigest" - }, - "signatures": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserSignature" - } - }, - "transaction": { - "$ref": "#/components/schemas/TransactionDigest" - } - } - }, - "CircomG1": { - "description": "A G1 point in BN254 serialized as a vector of three strings which is the canonical decimal representation of the projective coordinates in Fq.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Bn254FieldElement" - }, - "maxItems": 3, - "minItems": 3 - }, - "CircomG2": { - "description": "A G2 point in BN254 serialized as a vector of three vectors each being a vector of two strings which are the canonical decimal representation of the coefficients of the projective coordinates in Fq2.", - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Bn254FieldElement" - }, - "maxItems": 2, - "minItems": 2 - }, - "maxItems": 3, - "minItems": 3 - }, - "Claim": { - "description": "A claim consists of value and index_mod_4.", - "type": "object", - "required": [ - "index_mod_4", - "value" - ], - "properties": { - "index_mod_4": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - }, - "value": { - "type": "string" - } - } - }, - "CoinInfo": { - "type": "object", - "required": [ - "coin_type" - ], - "properties": { - "coin_type": { - "$ref": "#/components/schemas/StructTag" - }, - "metadata": { - "$ref": "#/components/schemas/CoinMetadata" - }, - "treasury": { - "$ref": "#/components/schemas/CoinTreasury" - } - } - }, - "CoinMetadata": { - "type": "object", - "required": [ - "decimals", - "description", - "id", - "name", - "symbol" - ], - "properties": { - "decimals": { - "description": "Number of decimal places the coin uses.", - "type": "integer", - "format": "uint8", - "minimum": 0.0 - }, - "description": { - "description": "Description of the token", - "type": "string" - }, - "icon_url": { - "description": "URL for the token logo", - "type": "string" - }, - "id": { - "$ref": "#/components/schemas/ObjectId" - }, - "name": { - "description": "Name for the token", - "type": "string" - }, - "symbol": { - "description": "Symbol for the token", - "type": "string" - } - } - }, - "CoinTreasury": { - "type": "object", - "required": [ - "total_supply" - ], - "properties": { - "id": { - "$ref": "#/components/schemas/ObjectId" - }, - "total_supply": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "Command": { - "description": "A single command in a programmable transaction.", - "oneOf": [ - { - "description": "A call to either an entry or a public Move function", - "type": "object", - "required": [ - "arguments", - "command", - "function", - "module", - "package", - "type_arguments" - ], - "properties": { - "arguments": { - "description": "The arguments to the function.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Argument" - } - }, - "command": { - "type": "string", - "enum": [ - "move_call" - ] - }, - "function": { - "description": "The function to be called.", - "allOf": [ - { - "$ref": "#/components/schemas/Identifier" - } - ] - }, - "module": { - "description": "The specific module in the package containing the function.", - "allOf": [ - { - "$ref": "#/components/schemas/Identifier" - } - ] - }, - "package": { - "description": "The package containing the module and function.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "type_arguments": { - "description": "The type arguments to the function.", - "type": "array", - "items": { - "$ref": "#/components/schemas/TypeTag" - } - } - } - }, - { - "description": "`(Vec, address)` It sends n-objects to the specified address. These objects must have store (public transfer) and either the previous owner must be an address or the object must be newly created.", - "type": "object", - "required": [ - "address", - "command", - "objects" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/Argument" - }, - "command": { - "type": "string", - "enum": [ - "transfer_objects" - ] - }, - "objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Argument" - } - } - } - }, - { - "description": "`(&mut Coin, Vec)` -> `Vec>` It splits off some amounts into a new coins with those amounts", - "type": "object", - "required": [ - "amounts", - "coin", - "command" - ], - "properties": { - "amounts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Argument" - } - }, - "coin": { - "$ref": "#/components/schemas/Argument" - }, - "command": { - "type": "string", - "enum": [ - "split_coins" - ] - } - } - }, - { - "description": "`(&mut Coin, Vec>)` It merges n-coins into the first coin", - "type": "object", - "required": [ - "coin", - "coins_to_merge", - "command" - ], - "properties": { - "coin": { - "$ref": "#/components/schemas/Argument" - }, - "coins_to_merge": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Argument" - } - }, - "command": { - "type": "string", - "enum": [ - "merge_coins" - ] - } - } - }, - { - "description": "Publishes a Move package. It takes the package bytes and a list of the package's transitive dependencies to link against on-chain.", - "type": "object", - "required": [ - "command", - "dependencies", - "modules" - ], - "properties": { - "command": { - "type": "string", - "enum": [ - "publish" - ] - }, - "dependencies": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectId" - } - }, - "modules": { - "type": "array", - "items": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - } - } - } - }, - { - "description": "`forall T: Vec -> vector` Given n-values of the same type, it constructs a vector. For non objects or an empty vector, the type tag must be specified.", - "type": "object", - "required": [ - "command", - "elements" - ], - "properties": { - "command": { - "type": "string", - "enum": [ - "make_move_vector" - ] - }, - "elements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Argument" - } - }, - "type": { - "$ref": "#/components/schemas/TypeTag" - } - } - }, - { - "description": "Upgrades a Move package Takes (in order): 1. A vector of serialized modules for the package. 2. A vector of object ids for the transitive dependencies of the new package. 3. The object ID of the package being upgraded. 4. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same programmable transaction.", - "type": "object", - "required": [ - "command", - "dependencies", - "modules", - "package", - "ticket" - ], - "properties": { - "command": { - "type": "string", - "enum": [ - "upgrade" - ] - }, - "dependencies": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectId" - } - }, - "modules": { - "type": "array", - "items": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - } - }, - "package": { - "$ref": "#/components/schemas/ObjectId" - }, - "ticket": { - "$ref": "#/components/schemas/Argument" - } - } - } - ] - }, - "CommandArgumentError": { - "oneOf": [ - { - "description": "The type of the value does not match the expected type", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "type_mismatch" - ] - } - } - }, - { - "description": "The argument cannot be deserialized into a value of the specified type", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "invalid_bcs_bytes" - ] - } - } - }, - { - "description": "The argument cannot be instantiated from raw bytes", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "invalid_usage_of_pure_argument" - ] - } - } - }, - { - "description": "Invalid argument to private entry function. Private entry functions cannot take arguments from other Move functions.", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "invalid_argument_to_private_entry_function" - ] - } - } - }, - { - "description": "Out of bounds access to input or results", - "type": "object", - "required": [ - "index", - "kind" - ], - "properties": { - "index": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "kind": { - "type": "string", - "enum": [ - "index_out_of_bounds" - ] - } - } - }, - { - "description": "Out of bounds access to subresult", - "type": "object", - "required": [ - "kind", - "result", - "subresult" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "secondary_index_out_of_bounds" - ] - }, - "result": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "subresult": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - } - }, - { - "description": "Invalid usage of result. Expected a single result but found either no return value or multiple.", - "type": "object", - "required": [ - "kind", - "result" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "invalid_result_arity" - ] - }, - "result": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - } - }, - { - "description": "Invalid usage of Gas coin. The Gas coin can only be used by-value with a TransferObjects command.", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "invalid_gas_coin_usage" - ] - } - } - }, - { - "description": "Invalid usage of move value.", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "invalid_value_usage" - ] - } - } - }, - { - "description": "Immutable objects cannot be passed by-value.", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "invalid_object_by_value" - ] - } - } - }, - { - "description": "Immutable objects cannot be passed by mutable reference, &mut.", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "invalid_object_by_mut_ref" - ] - } - } - }, - { - "description": "Shared object operations such a wrapping, freezing, or converting to owned are not allowed.", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "shared_object_operation_not_allowed" - ] - } - } - } - ] - }, - "ConsensusCommitDigest": { - "$ref": "#/components/schemas/Digest" - }, - "ConsensusDeterminedVersionAssignments": { - "oneOf": [ - { - "description": "Cancelled transaction version assignment.", - "type": "object", - "required": [ - "cancelled_transactions", - "kind" - ], - "properties": { - "cancelled_transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CancelledTransaction" - } - }, - "kind": { - "type": "string", - "enum": [ - "cancelled_transactions" - ] - } - } - } - ] - }, - "Digest": { - "description": "A representation of a 32 byte digest", - "type": "string", - "format": "base58" - }, - "Direction": { - "type": "string", - "enum": [ - "ascending", - "descending" - ] - }, - "DynamicFieldInfo": { - "description": "DynamicFieldInfo", - "type": "object", - "required": [ - "dynamic_field_type", - "field_id", - "name_type", - "name_value", - "parent" - ], - "properties": { - "dynamic_field_type": { - "$ref": "#/components/schemas/DynamicFieldType" - }, - "dynamic_object_id": { - "description": "ObjectId of the child object when `dynamic_field_type == DynamicFieldType::Object`", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "field_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "name_type": { - "$ref": "#/components/schemas/TypeTag" - }, - "name_value": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - } - }, - "parent": { - "$ref": "#/components/schemas/ObjectId" - } - } - }, - "DynamicFieldType": { - "type": "string", - "enum": [ - "field", - "object" - ] - }, - "Ed25519PublicKey": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "Ed25519Signature": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "EffectsAuxiliaryDataDigest": { - "$ref": "#/components/schemas/Digest" - }, - "EffectsFinality": { - "oneOf": [ - { - "type": "object", - "required": [ - "finality", - "signature" - ], - "properties": { - "finality": { - "type": "string", - "enum": [ - "certified" - ] - }, - "signature": { - "description": "Validator aggregated signature", - "allOf": [ - { - "$ref": "#/components/schemas/ValidatorAggregatedSignature" - } - ] - } - } - }, - { - "type": "object", - "required": [ - "checkpoint", - "finality" - ], - "properties": { - "checkpoint": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "finality": { - "type": "string", - "enum": [ - "checkpointed" - ] - } - } - }, - { - "type": "object", - "required": [ - "finality" - ], - "properties": { - "finality": { - "type": "string", - "enum": [ - "quorum_executed" - ] - } - } - } - ] - }, - "EndOfEpochData": { - "type": "object", - "required": [ - "epoch_commitments", - "next_epoch_committee", - "next_epoch_protocol_version" - ], - "properties": { - "epoch_commitments": { - "description": "Commitments to epoch specific state (e.g. live object set)", - "type": "array", - "items": { - "$ref": "#/components/schemas/CheckpointCommitment" - } - }, - "next_epoch_committee": { - "description": "next_epoch_committee is `Some` if and only if the current checkpoint is the last checkpoint of an epoch. Therefore next_epoch_committee can be used to pick the last checkpoint of an epoch, which is often useful to get epoch level summary stats like total gas cost of an epoch, or the total number of transactions from genesis to the end of an epoch. The committee is stored as a vector of validator pub key and stake pairs. The vector should be sorted based on the Committee data structure.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidatorCommitteeMember" - } - }, - "next_epoch_protocol_version": { - "description": "The protocol version that is in effect during the epoch that starts immediately after this checkpoint.", - "type": "string", - "format": "u64" - } - } - }, - "EndOfEpochTransactionKind": { - "description": "EndOfEpochTransactionKind", - "oneOf": [ - { - "type": "object", - "required": [ - "computation_charge", - "epoch", - "epoch_start_timestamp_ms", - "kind", - "non_refundable_storage_fee", - "protocol_version", - "storage_charge", - "storage_rebate", - "system_packages" - ], - "properties": { - "computation_charge": { - "description": "The total amount of gas charged for computation during the epoch.", - "type": "string", - "format": "u64" - }, - "epoch": { - "description": "The next (to become) epoch ID.", - "type": "string", - "format": "u64" - }, - "epoch_start_timestamp_ms": { - "description": "Unix timestamp when epoch started", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "change_epoch" - ] - }, - "non_refundable_storage_fee": { - "description": "The non-refundable storage fee.", - "type": "string", - "format": "u64" - }, - "protocol_version": { - "description": "The protocol version in effect in the new epoch.", - "type": "string", - "format": "u64" - }, - "storage_charge": { - "description": "The total amount of gas charged for storage during the epoch.", - "type": "string", - "format": "u64" - }, - "storage_rebate": { - "description": "The amount of storage rebate refunded to the txn senders.", - "type": "string", - "format": "u64" - }, - "system_packages": { - "description": "System packages (specifically framework and move stdlib) that are written before the new epoch starts. This tracks framework upgrades on chain. When executing the ChangeEpoch txn, the validator must write out the modules below. Modules are provided with the version they will be upgraded to, their modules in serialized form (which include their package ID), and a list of their transitive dependencies.", - "type": "array", - "items": { - "$ref": "#/components/schemas/SystemPackage" - } - } - } - }, - { - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "authenticator_state_create" - ] - } - } - }, - { - "type": "object", - "required": [ - "authenticator_object_initial_shared_version", - "kind", - "min_epoch" - ], - "properties": { - "authenticator_object_initial_shared_version": { - "description": "The initial version of the authenticator object that it was shared at.", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "authenticator_state_expire" - ] - }, - "min_epoch": { - "description": "expire JWKs that have a lower epoch than this", - "type": "string", - "format": "u64" - } - } - }, - { - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "randomness_state_create" - ] - } - } - }, - { - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "deny_list_state_create" - ] - } - } - }, - { - "type": "object", - "required": [ - "chain_id", - "kind" - ], - "properties": { - "chain_id": { - "$ref": "#/components/schemas/CheckpointDigest" - }, - "kind": { - "type": "string", - "enum": [ - "bridge_state_create" - ] - } - } - }, - { - "type": "object", - "required": [ - "bridge_object_version", - "kind" - ], - "properties": { - "bridge_object_version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "bridge_committee_init" - ] - } - } - } - ] - }, - "Event": { - "description": "Specific type of event", - "type": "object", - "required": [ - "contents", - "module", - "package_id", - "sender", - "type" - ], - "properties": { - "contents": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "module": { - "$ref": "#/components/schemas/Identifier" - }, - "package_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "sender": { - "$ref": "#/components/schemas/Address" - }, - "type": { - "$ref": "#/components/schemas/StructTag" - } - } - }, - "ExecuteTransactionResponse": { - "description": "Response type for the execute transaction endpoint", - "type": "object", - "required": [ - "finality" - ], - "properties": { - "balance_changes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BalanceChange" - } - }, - "effects": { - "$ref": "#/components/schemas/TransactionEffects" - }, - "effects_bcs": { - "type": "string" - }, - "events": { - "$ref": "#/components/schemas/TransactionEvents" - }, - "events_bcs": { - "type": "string" - }, - "finality": { - "$ref": "#/components/schemas/EffectsFinality" - } - } - }, - "ExecutionError": { - "oneOf": [ - { - "description": "Insufficient Gas", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "insufficient_gas" - ] - } - } - }, - { - "description": "Invalid Gas Object.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "invalid_gas_object" - ] - } - } - }, - { - "description": "Invariant Violation", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "invariant_violation" - ] - } - } - }, - { - "description": "Attempted to used feature that is not supported yet", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "feature_not_yet_supported" - ] - } - } - }, - { - "description": "Move object is larger than the maximum allowed size", - "type": "object", - "required": [ - "error", - "max_object_size", - "object_size" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "object_too_big" - ] - }, - "max_object_size": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "object_size": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "description": "Package is larger than the maximum allowed size", - "type": "object", - "required": [ - "error", - "max_object_size", - "object_size" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "package_too_big" - ] - }, - "max_object_size": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "object_size": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "description": "Circular Object Ownership", - "type": "object", - "required": [ - "error", - "object" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "circular_object_ownership" - ] - }, - "object": { - "$ref": "#/components/schemas/ObjectId" - } - } - }, - { - "description": "Insufficient coin balance for requested operation", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "insufficient_coin_balance" - ] - } - } - }, - { - "description": "Coin balance overflowed an u64", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "coin_balance_overflow" - ] - } - } - }, - { - "description": "Publish Error, Non-zero Address. The modules in the package must have their self-addresses set to zero.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "publish_error_non_zero_address" - ] - } - } - }, - { - "description": "Sui Move Bytecode Verification Error.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "sui_move_verification_error" - ] - } - } - }, - { - "description": "Error from a non-abort instruction. Possible causes: Arithmetic error, stack overflow, max value depth, etc.\"", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "move_primitive_runtime_error" - ] - }, - "location": { - "$ref": "#/components/schemas/MoveLocation" - } - } - }, - { - "description": "Move runtime abort", - "type": "object", - "required": [ - "code", - "error", - "location" - ], - "properties": { - "code": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "error": { - "type": "string", - "enum": [ - "move_abort" - ] - }, - "location": { - "$ref": "#/components/schemas/MoveLocation" - } - } - }, - { - "description": "Bytecode verification error.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "vm_verification_or_deserialization_error" - ] - } - } - }, - { - "description": "MoveVm invariant violation", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "vm_invariant_violation" - ] - } - } - }, - { - "description": "Function not found", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "function_not_found" - ] - } - } - }, - { - "description": "Arity mismatch for Move function. The number of arguments does not match the number of parameters", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "arity_mismatch" - ] - } - } - }, - { - "description": "Type arity mismatch for Move function. Mismatch between the number of actual versus expected type arguments.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "type_arity_mismatch" - ] - } - } - }, - { - "description": "Non Entry Function Invoked. Move Call must start with an entry function.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "non_entry_function_invoked" - ] - } - } - }, - { - "description": "Invalid command argument", - "type": "object", - "required": [ - "argument", - "error", - "kind" - ], - "properties": { - "argument": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "error": { - "type": "string", - "enum": [ - "command_argument_error" - ] - }, - "kind": { - "$ref": "#/components/schemas/CommandArgumentError" - } - } - }, - { - "description": "Type argument error", - "type": "object", - "required": [ - "error", - "kind", - "type_argument" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "type_argument_error" - ] - }, - "kind": { - "$ref": "#/components/schemas/TypeArgumentError" - }, - "type_argument": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - } - }, - { - "description": "Unused result without the drop ability.", - "type": "object", - "required": [ - "error", - "result", - "subresult" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "unused_value_without_drop" - ] - }, - "result": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "subresult": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - } - }, - { - "description": "Invalid public Move function signature. Unsupported return type for return value", - "type": "object", - "required": [ - "error", - "index" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "invalid_public_function_return_type" - ] - }, - "index": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - } - }, - { - "description": "Invalid Transfer Object, object does not have public transfer.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "invalid_transfer_object" - ] - } - } - }, - { - "description": "Effects from the transaction are too large", - "type": "object", - "required": [ - "current_size", - "error", - "max_size" - ], - "properties": { - "current_size": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "error": { - "type": "string", - "enum": [ - "effects_too_large" - ] - }, - "max_size": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "description": "Publish or Upgrade is missing dependency", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "publish_upgrade_missing_dependency" - ] - } - } - }, - { - "description": "Publish or Upgrade dependency downgrade.\n\nIndirect (transitive) dependency of published or upgraded package has been assigned an on-chain version that is less than the version required by one of the package's transitive dependencies.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "publish_upgrade_dependency_downgrade" - ] - } - } - }, - { - "title": "PackageUpgradeError", - "description": "Invalid package upgrade", - "type": "object", - "required": [ - "error", - "kind" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "package_upgrade_error" - ] - }, - "kind": { - "$ref": "#/components/schemas/PackageUpgradeError" - } - } - }, - { - "description": "Indicates the transaction tried to write objects too large to storage", - "type": "object", - "required": [ - "error", - "max_object_size", - "object_size" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "written_objects_too_large" - ] - }, - "max_object_size": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "object_size": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "description": "Certificate is on the deny list", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "certificate_denied" - ] - } - } - }, - { - "description": "Sui Move Bytecode verification timed out.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "sui_move_verification_timedout" - ] - } - } - }, - { - "description": "The requested shared object operation is not allowed", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "shared_object_operation_not_allowed" - ] - } - } - }, - { - "description": "Requested shared object has been deleted", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "input_object_deleted" - ] - } - } - }, - { - "description": "Certificate is cancelled due to congestion on shared objects", - "type": "object", - "required": [ - "congested_objects", - "error" - ], - "properties": { - "congested_objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectId" - } - }, - "error": { - "type": "string", - "enum": [ - "execution_cancelled_due_to_shared_object_congestion" - ] - } - } - }, - { - "description": "Address is denied for this coin type", - "type": "object", - "required": [ - "address", - "coin_type", - "error" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/Address" - }, - "coin_type": { - "type": "string" - }, - "error": { - "type": "string", - "enum": [ - "address_denied_for_coin" - ] - } - } - }, - { - "description": "Coin type is globally paused for use", - "type": "object", - "required": [ - "coin_type", - "error" - ], - "properties": { - "coin_type": { - "type": "string" - }, - "error": { - "type": "string", - "enum": [ - "coin_type_global_pause" - ] - } - } - }, - { - "description": "Certificate is cancelled because randomness could not be generated this epoch", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "execution_cancelled_due_to_randomness_unavailable" - ] - } - } - } - ] - }, - "FailureStatus": { - "type": "object", - "required": [ - "error" - ], - "properties": { - "command": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "error": { - "$ref": "#/components/schemas/ExecutionError" - } - } - }, - "GasCostSummary": { - "description": "Summary of gas charges.\n\nStorage is charged independently of computation. There are 3 parts to the storage charges: `storage_cost`: it is the charge of storage at the time the transaction is executed. The cost of storage is the number of bytes of the objects being mutated multiplied by a variable storage cost per byte `storage_rebate`: this is the amount a user gets back when manipulating an object. The `storage_rebate` is the `storage_cost` for an object minus fees. `non_refundable_storage_fee`: not all the value of the object storage cost is given back to user and there is a small fraction that is kept by the system. This value tracks that charge.\n\nWhen looking at a gas cost summary the amount charged to the user is `computation_cost + storage_cost - storage_rebate` and that is the amount that is deducted from the gas coins. `non_refundable_storage_fee` is collected from the objects being mutated/deleted and it is tracked by the system in storage funds.\n\nObjects deleted, including the older versions of objects mutated, have the storage field on the objects added up to a pool of \"potential rebate\". This rebate then is reduced by the \"nonrefundable rate\" such that: `potential_rebate(storage cost of deleted/mutated objects) = storage_rebate + non_refundable_storage_fee`", - "type": "object", - "required": [ - "computation_cost", - "non_refundable_storage_fee", - "storage_cost", - "storage_rebate" - ], - "properties": { - "computation_cost": { - "description": "Cost of computation/execution", - "type": "string", - "format": "u64" - }, - "non_refundable_storage_fee": { - "description": "The fee for the rebate. The portion of the storage rebate kept by the system.", - "type": "string", - "format": "u64" - }, - "storage_cost": { - "description": "Storage cost, it's the sum of all storage cost for all objects created or mutated.", - "type": "string", - "format": "u64" - }, - "storage_rebate": { - "description": "The amount of storage cost refunded to the user for all objects deleted or mutated in the transaction.", - "type": "string", - "format": "u64" - } - } - }, - "GasInfo": { - "type": "object", - "required": [ - "reference_gas_price" - ], - "properties": { - "reference_gas_price": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "GasPayment": { - "type": "object", - "required": [ - "budget", - "objects", - "owner", - "price" - ], - "properties": { - "budget": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectReference" - } - }, - "owner": { - "$ref": "#/components/schemas/Address" - }, - "price": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "GenesisObject": { - "type": "object", - "anyOf": [ - { - "$ref": "#/components/schemas/MoveStruct" - }, - { - "$ref": "#/components/schemas/Package" - } - ], - "required": [ - "object_id", - "owner", - "type", - "version" - ], - "properties": { - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "owner": { - "$ref": "#/components/schemas/Owner" - }, - "type": { - "type": "string" - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "IdOperation": { - "type": "string", - "enum": [ - "none", - "created", - "deleted" - ] - }, - "Identifier": { - "title": "Identifier", - "description": "A Move Identifier", - "examples": [ - "sui" - ], - "type": "string", - "pattern": "(?:[a-zA-Z][a-zA-Z0-9_]{0,127})|(?:_[a-zA-Z0-9_]{0,127})" - }, - "Input": { - "oneOf": [ - { - "type": "object", - "required": [ - "type", - "value" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "pure" - ] - }, - "value": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - } - } - }, - { - "type": "object", - "required": [ - "digest", - "object_id", - "type", - "version" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "type": { - "type": "string", - "enum": [ - "immutable_or_owned" - ] - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "type": "object", - "required": [ - "initial_shared_version", - "mutable", - "object_id", - "type" - ], - "properties": { - "initial_shared_version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "mutable": { - "type": "boolean" - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "type": { - "type": "string", - "enum": [ - "shared" - ] - } - } - }, - { - "type": "object", - "required": [ - "digest", - "object_id", - "type", - "version" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "type": { - "type": "string", - "enum": [ - "receiving" - ] - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - } - ] - }, - "Jwk": { - "description": "Struct that contains info for a JWK. A list of them for different kids can be retrieved from the JWK endpoint (e.g. ). The JWK is used to verify the JWT token.", - "type": "object", - "required": [ - "alg", - "e", - "kty", - "n" - ], - "properties": { - "alg": { - "description": "Algorithm parameter, ", - "type": "string" - }, - "e": { - "description": "RSA public exponent, ", - "type": "string" - }, - "kty": { - "description": "Key type parameter, ", - "type": "string" - }, - "n": { - "description": "RSA modulus, ", - "type": "string" - } - } - }, - "JwkId": { - "description": "Key to identify a JWK, consists of iss and kid.", - "type": "object", - "required": [ - "iss", - "kid" - ], - "properties": { - "iss": { - "description": "iss string that identifies the OIDC provider.", - "type": "string" - }, - "kid": { - "description": "kid string that identifies the JWK.", - "type": "string" - } - } - }, - "ModifiedAtVersion": { - "type": "object", - "required": [ - "object_id", - "version" - ], - "properties": { - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "MoveLocation": { - "type": "object", - "required": [ - "function", - "instruction", - "module", - "package" - ], - "properties": { - "function": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "function_name": { - "$ref": "#/components/schemas/Identifier" - }, - "instruction": { - "description": "Index into the code stream for a jump. The offset is relative to the beginning of the instruction stream.", - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "module": { - "$ref": "#/components/schemas/Identifier" - }, - "package": { - "$ref": "#/components/schemas/ObjectId" - } - } - }, - "MoveStruct": { - "type": "object", - "required": [ - "contents", - "has_public_transfer" - ], - "properties": { - "contents": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "has_public_transfer": { - "type": "boolean" - } - } - }, - "MultisigCommittee": { - "type": "object", - "required": [ - "members", - "threshold" - ], - "properties": { - "members": { - "description": "A list of committee members and their corresponding weight.", - "type": "array", - "items": { - "$ref": "#/components/schemas/MultisigMember" - } - }, - "threshold": { - "description": "If the total weight of the public keys corresponding to verified signatures is larger than threshold, the Multisig is verified.", - "type": "integer", - "format": "uint16", - "minimum": 0.0 - } - } - }, - "MultisigMember": { - "type": "object", - "required": [ - "public_key", - "weight" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/MultisigMemberPublicKey" - }, - "weight": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - } - } - }, - "MultisigMemberPublicKey": { - "oneOf": [ - { - "type": "object", - "required": [ - "public_key", - "scheme" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Ed25519PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "ed25519" - ] - } - } - }, - { - "type": "object", - "required": [ - "public_key", - "scheme" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Secp256k1PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "secp256k1" - ] - } - } - }, - { - "type": "object", - "required": [ - "public_key", - "scheme" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Secp256r1PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "secp256r1" - ] - } - } - }, - { - "description": "A wrapper struct to retrofit in [enum PublicKey] for zkLogin. Useful to construct [struct MultiSigPublicKey].", - "type": "object", - "required": [ - "address_seed", - "iss", - "scheme" - ], - "properties": { - "address_seed": { - "$ref": "#/components/schemas/Bn254FieldElement" - }, - "iss": { - "type": "string" - }, - "scheme": { - "type": "string", - "enum": [ - "zklogin" - ] - } - } - } - ] - }, - "MultisigMemberSignature": { - "oneOf": [ - { - "type": "object", - "required": [ - "scheme", - "signature" - ], - "properties": { - "scheme": { - "type": "string", - "enum": [ - "ed25519" - ] - }, - "signature": { - "$ref": "#/components/schemas/Ed25519Signature" - } - } - }, - { - "type": "object", - "required": [ - "scheme", - "signature" - ], - "properties": { - "scheme": { - "type": "string", - "enum": [ - "secp256k1" - ] - }, - "signature": { - "$ref": "#/components/schemas/Secp256k1Signature" - } - } - }, - { - "type": "object", - "required": [ - "scheme", - "signature" - ], - "properties": { - "scheme": { - "type": "string", - "enum": [ - "secp256r1" - ] - }, - "signature": { - "$ref": "#/components/schemas/Secp256r1Signature" - } - } - }, - { - "description": "An zk login authenticator with all the necessary fields.", - "type": "object", - "required": [ - "inputs", - "max_epoch", - "scheme", - "signature" - ], - "properties": { - "inputs": { - "$ref": "#/components/schemas/ZkLoginInputs" - }, - "max_epoch": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "scheme": { - "type": "string", - "enum": [ - "zklogin" - ] - }, - "signature": { - "$ref": "#/components/schemas/SimpleSignature" - } - } - } - ] - }, - "NodeInfo": { - "description": "Basic information about the state of a Node", - "type": "object", - "required": [ - "chain", - "chain_id", - "checkpoint_height", - "epoch", - "software_version", - "timestamp_ms" - ], - "properties": { - "chain": { - "description": "Human readable name of the chain that this Node is on", - "type": "string" - }, - "chain_id": { - "description": "The chain identifier of the chain that this Node is on", - "allOf": [ - { - "$ref": "#/components/schemas/CheckpointDigest" - } - ] - }, - "checkpoint_height": { - "description": "Checkpoint height of the most recently executed checkpoint", - "type": "string", - "format": "u64" - }, - "epoch": { - "description": "Current epoch of the Node based on its highest executed checkpoint", - "type": "string", - "format": "u64" - }, - "lowest_available_checkpoint": { - "description": "The lowest checkpoint for which checkpoints and transaction data is available", - "type": "string", - "format": "u64" - }, - "lowest_available_checkpoint_objects": { - "description": "The lowest checkpoint for which object data is available", - "type": "string", - "format": "u64" - }, - "software_version": { - "type": "string" - }, - "timestamp_ms": { - "description": "Unix timestamp of the most recently executed checkpoint", - "type": "string", - "format": "u64" - } - } - }, - "Object": { - "type": "object", - "anyOf": [ - { - "$ref": "#/components/schemas/MoveStruct" - }, - { - "$ref": "#/components/schemas/Package" - } - ], - "required": [ - "object_id", - "owner", - "previous_transaction", - "storage_rebate", - "type", - "version" - ], - "properties": { - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "owner": { - "$ref": "#/components/schemas/Owner" - }, - "previous_transaction": { - "$ref": "#/components/schemas/TransactionDigest" - }, - "storage_rebate": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "type": { - "type": "string" - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "ObjectDigest": { - "$ref": "#/components/schemas/Digest" - }, - "ObjectId": { - "$ref": "#/components/schemas/Address" - }, - "ObjectIn": { - "description": "If an object exists (at root-level) in the store prior to this transaction, it should be Exist, otherwise it's NonExist, e.g. wrapped objects should be NonExist.", - "oneOf": [ - { - "type": "object", - "required": [ - "state" - ], - "properties": { - "state": { - "type": "string", - "enum": [ - "not_exist" - ] - } - } - }, - { - "description": "The old version, digest and owner.", - "type": "object", - "required": [ - "digest", - "owner", - "state", - "version" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "owner": { - "$ref": "#/components/schemas/Owner" - }, - "state": { - "type": "string", - "enum": [ - "exist" - ] - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - } - ] - }, - "ObjectOut": { - "oneOf": [ - { - "description": "Same definition as in ObjectIn.", - "type": "object", - "required": [ - "state" - ], - "properties": { - "state": { - "type": "string", - "enum": [ - "not_exist" - ] - } - } - }, - { - "description": "Any written object, including all of mutated, created, unwrapped today.", - "type": "object", - "required": [ - "digest", - "owner", - "state" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "owner": { - "$ref": "#/components/schemas/Owner" - }, - "state": { - "type": "string", - "enum": [ - "object_write" - ] - } - } - }, - { - "description": "Packages writes need to be tracked separately with version because we don't use lamport version for package publish and upgrades.", - "type": "object", - "required": [ - "digest", - "state", - "version" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "state": { - "type": "string", - "enum": [ - "package_write" - ] - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - } - ] - }, - "ObjectReference": { - "type": "object", - "required": [ - "digest", - "object_id", - "version" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "ObjectReferenceWithOwner": { - "type": "object", - "required": [ - "owner", - "reference" - ], - "properties": { - "owner": { - "$ref": "#/components/schemas/Owner" - }, - "reference": { - "$ref": "#/components/schemas/ObjectReference" - } - } - }, - "ObjectResponse": { - "type": "object", - "required": [ - "digest", - "object_id", - "version" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "object": { - "$ref": "#/components/schemas/Object" - }, - "object_bcs": { - "type": "string" - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "Owner": { - "oneOf": [ - { - "title": "Address Owned", - "description": "Object is exclusively owned by a single address, and is mutable.", - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/Address" - } - }, - "additionalProperties": false - }, - { - "title": "Object Owned", - "description": "Object is exclusively owned by a single object, and is mutable.", - "type": "object", - "required": [ - "object" - ], - "properties": { - "object": { - "$ref": "#/components/schemas/ObjectId" - } - }, - "additionalProperties": false - }, - { - "title": "Shared Object", - "description": "Object is shared, can be used by any address, and is mutable.", - "type": "object", - "required": [ - "shared" - ], - "properties": { - "shared": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - }, - "additionalProperties": false - }, - { - "title": "Immutable", - "description": "Object is immutable, and hence ownership doesn't matter.", - "type": "string", - "enum": [ - "immutable" - ] - } - ] - }, - "Package": { - "type": "object", - "required": [ - "linkage_table", - "modules", - "type_origin_table" - ], - "properties": { - "linkage_table": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/UpgradeInfo" - } - }, - "modules": { - "type": "object", - "additionalProperties": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - } - }, - "type_origin_table": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TypeOrigin" - } - } - } - }, - "PackageUpgradeError": { - "oneOf": [ - { - "description": "Unable to fetch package", - "type": "object", - "required": [ - "kind", - "package_id" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "unable_to_fetch_package" - ] - }, - "package_id": { - "$ref": "#/components/schemas/ObjectId" - } - } - }, - { - "description": "Object is not a package", - "type": "object", - "required": [ - "kind", - "object_id" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "not_a_package" - ] - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - } - } - }, - { - "description": "Package upgrade is incompatible with previous version", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "incompatible_upgrade" - ] - } - } - }, - { - "description": "Digest in upgrade ticket and computed digest differ", - "type": "object", - "required": [ - "digest", - "kind" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/Digest" - }, - "kind": { - "type": "string", - "enum": [ - "digest_does_not_match" - ] - } - } - }, - { - "description": "Upgrade policy is not valid", - "type": "object", - "required": [ - "kind", - "policy" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "unknown_upgrade_policy" - ] - }, - "policy": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - } - } - }, - { - "description": "PackageId does not matach PackageId in upgrade ticket", - "type": "object", - "required": [ - "kind", - "package_id", - "ticket_id" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "package_id_does_not_match" - ] - }, - "package_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "ticket_id": { - "$ref": "#/components/schemas/ObjectId" - } - } - } - ] - }, - "ProtocolConfig": { - "type": "object", - "required": [ - "attributes", - "feature_flags", - "protocol_version" - ], - "properties": { - "attributes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "feature_flags": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - }, - "protocol_version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "ResolveTransactionResponse": { - "description": "Response type for the execute transaction endpoint", - "type": "object", - "required": [ - "transaction" - ], - "properties": { - "simulation": { - "$ref": "#/components/schemas/TransactionSimulationResponse" - }, - "transaction": { - "$ref": "#/components/schemas/Transaction" - } - } - }, - "Secp256k1PublicKey": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "Secp256k1Signature": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "Secp256r1PublicKey": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "Secp256r1Signature": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "SimpleSignature": { - "oneOf": [ - { - "type": "object", - "required": [ - "public_key", - "scheme", - "signature" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Ed25519PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "ed25519" - ] - }, - "signature": { - "$ref": "#/components/schemas/Ed25519Signature" - } - } - }, - { - "type": "object", - "required": [ - "public_key", - "scheme", - "signature" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Secp256k1PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "secp256k1" - ] - }, - "signature": { - "$ref": "#/components/schemas/Secp256k1Signature" - } - } - }, - { - "type": "object", - "required": [ - "public_key", - "scheme", - "signature" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Secp256r1PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "secp256r1" - ] - }, - "signature": { - "$ref": "#/components/schemas/Secp256r1Signature" - } - } - } - ] - }, - "StructTag": { - "title": "StructTag", - "description": "A Move StructTag", - "examples": [ - "0x2::coin::Coin<0x2::sui::SUI>" - ], - "type": "string" - }, - "SystemPackage": { - "type": "object", - "required": [ - "dependencies", - "modules", - "version" - ], - "properties": { - "dependencies": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectId" - } - }, - "modules": { - "type": "array", - "items": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - } - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "SystemStateSummary": { - "type": "object", - "required": [ - "active_validators", - "at_risk_validators", - "epoch", - "epoch_duration_ms", - "epoch_start_timestamp_ms", - "inactive_pools_id", - "inactive_pools_size", - "max_validator_count", - "min_validator_joining_stake", - "pending_active_validators_id", - "pending_active_validators_size", - "pending_removals", - "protocol_version", - "reference_gas_price", - "safe_mode", - "safe_mode_computation_rewards", - "safe_mode_non_refundable_storage_fee", - "safe_mode_storage_rebates", - "safe_mode_storage_rewards", - "stake_subsidy_balance", - "stake_subsidy_current_distribution_amount", - "stake_subsidy_decrease_rate", - "stake_subsidy_distribution_counter", - "stake_subsidy_period_length", - "stake_subsidy_start_epoch", - "staking_pool_mappings_id", - "staking_pool_mappings_size", - "storage_fund_non_refundable_balance", - "storage_fund_total_object_storage_rebates", - "system_state_version", - "total_stake", - "validator_candidates_id", - "validator_candidates_size", - "validator_low_stake_grace_period", - "validator_low_stake_threshold", - "validator_report_records", - "validator_very_low_stake_threshold" - ], - "properties": { - "active_validators": { - "description": "The list of active validators in the current epoch.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidatorSummary" - } - }, - "at_risk_validators": { - "description": "Map storing the number of epochs for which each validator has been below the low stake threshold.", - "type": "array", - "items": { - "type": "array", - "items": [ - { - "$ref": "#/components/schemas/Address" - }, - { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - ], - "maxItems": 2, - "minItems": 2 - } - }, - "epoch": { - "description": "The current epoch ID, starting from 0.", - "type": "string", - "format": "u64" - }, - "epoch_duration_ms": { - "description": "The duration of an epoch, in milliseconds.", - "type": "string", - "format": "u64" - }, - "epoch_start_timestamp_ms": { - "description": "Unix timestamp of the current epoch start", - "type": "string", - "format": "u64" - }, - "inactive_pools_id": { - "description": "ID of the object that maps from a staking pool ID to the inactive validator that has that pool as its staking pool.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "inactive_pools_size": { - "description": "Number of inactive staking pools.", - "type": "string", - "format": "u64" - }, - "max_validator_count": { - "description": "Maximum number of active validators at any moment. We do not allow the number of validators in any epoch to go above this.", - "type": "string", - "format": "u64" - }, - "min_validator_joining_stake": { - "description": "Lower-bound on the amount of stake required to become a validator.", - "type": "string", - "format": "u64" - }, - "pending_active_validators_id": { - "description": "ID of the object that contains the list of new validators that will join at the end of the epoch.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "pending_active_validators_size": { - "description": "Number of new validators that will join at the end of the epoch.", - "type": "string", - "format": "u64" - }, - "pending_removals": { - "description": "Removal requests from the validators. Each element is an index pointing to `active_validators`.", - "type": "array", - "items": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - }, - "protocol_version": { - "description": "The current protocol version, starting from 1.", - "type": "string", - "format": "u64" - }, - "reference_gas_price": { - "description": "The reference gas price for the current epoch.", - "type": "string", - "format": "u64" - }, - "safe_mode": { - "description": "Whether the system is running in a downgraded safe mode due to a non-recoverable bug. This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode. It can be reset once we are able to successfully execute advance_epoch.", - "type": "boolean" - }, - "safe_mode_computation_rewards": { - "description": "Amount of computation rewards accumulated (and not yet distributed) during safe mode.", - "type": "string", - "format": "u64" - }, - "safe_mode_non_refundable_storage_fee": { - "description": "Amount of non-refundable storage fee accumulated during safe mode.", - "type": "string", - "format": "u64" - }, - "safe_mode_storage_rebates": { - "description": "Amount of storage rebates accumulated (and not yet burned) during safe mode.", - "type": "string", - "format": "u64" - }, - "safe_mode_storage_rewards": { - "description": "Amount of storage rewards accumulated (and not yet distributed) during safe mode.", - "type": "string", - "format": "u64" - }, - "stake_subsidy_balance": { - "description": "Balance of SUI set aside for stake subsidies that will be drawn down over time.", - "type": "string", - "format": "u64" - }, - "stake_subsidy_current_distribution_amount": { - "description": "The amount of stake subsidy to be drawn down per epoch. This amount decays and decreases over time.", - "type": "string", - "format": "u64" - }, - "stake_subsidy_decrease_rate": { - "description": "The rate at which the distribution amount decays at the end of each period. Expressed in basis points.", - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "stake_subsidy_distribution_counter": { - "description": "This counter may be different from the current epoch number if in some epochs we decide to skip the subsidy.", - "type": "string", - "format": "u64" - }, - "stake_subsidy_period_length": { - "description": "Number of distributions to occur before the distribution amount decays.", - "type": "string", - "format": "u64" - }, - "stake_subsidy_start_epoch": { - "description": "The starting epoch in which stake subsidies start being paid out", - "type": "string", - "format": "u64" - }, - "staking_pool_mappings_id": { - "description": "ID of the object that maps from staking pool's ID to the sui address of a validator.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "staking_pool_mappings_size": { - "description": "Number of staking pool mappings.", - "type": "string", - "format": "u64" - }, - "storage_fund_non_refundable_balance": { - "description": "The non-refundable portion of the storage fund coming from storage reinvestment, non-refundable storage rebates and any leftover staking rewards.", - "type": "string", - "format": "u64" - }, - "storage_fund_total_object_storage_rebates": { - "description": "The storage rebates of all the objects on-chain stored in the storage fund.", - "type": "string", - "format": "u64" - }, - "system_state_version": { - "description": "The current version of the system state data structure type.", - "type": "string", - "format": "u64" - }, - "total_stake": { - "description": "Total amount of stake from all active validators at the beginning of the epoch.", - "type": "string", - "format": "u64" - }, - "validator_candidates_id": { - "description": "ID of the object that stores preactive validators, mapping their addresses to their `Validator` structs.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "validator_candidates_size": { - "description": "Number of preactive validators.", - "type": "string", - "format": "u64" - }, - "validator_low_stake_grace_period": { - "description": "A validator can have stake below `validator_low_stake_threshold` for this many epochs before being kicked out.", - "type": "string", - "format": "u64" - }, - "validator_low_stake_threshold": { - "description": "Validators with stake amount below `validator_low_stake_threshold` are considered to have low stake and will be escorted out of the validator set after being below this threshold for more than `validator_low_stake_grace_period` number of epochs.", - "type": "string", - "format": "u64" - }, - "validator_report_records": { - "description": "A map storing the records of validator reporting each other.", - "type": "array", - "items": { - "type": "array", - "items": [ - { - "$ref": "#/components/schemas/Address" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/Address" - } - } - ], - "maxItems": 2, - "minItems": 2 - } - }, - "validator_very_low_stake_threshold": { - "description": "Validators with stake below `validator_very_low_stake_threshold` will be removed immediately at epoch change, no grace period.", - "type": "string", - "format": "u64" - } - } - }, - "Transaction": { - "oneOf": [ - { - "type": "object", - "required": [ - "expiration", - "gas_payment", - "kind", - "sender", - "version" - ], - "properties": { - "expiration": { - "$ref": "#/components/schemas/TransactionExpiration" - }, - "gas_payment": { - "$ref": "#/components/schemas/GasPayment" - }, - "kind": { - "$ref": "#/components/schemas/TransactionKind" - }, - "sender": { - "$ref": "#/components/schemas/Address" - }, - "version": { - "type": "string", - "enum": [ - "1" - ] - } - } - } - ] - }, - "TransactionDigest": { - "$ref": "#/components/schemas/Digest" - }, - "TransactionEffects": { - "description": "The response from processing a transaction or a certified transaction", - "oneOf": [ - { - "description": "The response from processing a transaction or a certified transaction", - "type": "object", - "required": [ - "created", - "deleted", - "dependencies", - "epoch", - "gas_object", - "gas_used", - "modified_at_versions", - "mutated", - "shared_objects", - "success", - "transaction_digest", - "unwrapped", - "unwrapped_then_deleted", - "version", - "wrapped" - ], - "properties": { - "created": { - "description": "ObjectReference and owner of new objects created.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectReferenceWithOwner" - } - }, - "deleted": { - "description": "Object Refs of objects now deleted (the new refs).", - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectReference" - } - }, - "dependencies": { - "description": "The set of transaction digests this transaction depends on.", - "type": "array", - "items": { - "$ref": "#/components/schemas/TransactionDigest" - } - }, - "epoch": { - "description": "The epoch when this transaction was executed.", - "type": "string", - "format": "u64" - }, - "events_digest": { - "description": "The digest of the events emitted during execution, can be None if the transaction does not emit any event.", - "allOf": [ - { - "$ref": "#/components/schemas/TransactionEventsDigest" - } - ] - }, - "gas_object": { - "description": "The updated gas object reference. Have a dedicated field for convenient access. It's also included in mutated.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectReferenceWithOwner" - } - ] - }, - "gas_used": { - "$ref": "#/components/schemas/GasCostSummary" - }, - "modified_at_versions": { - "description": "The version that every modified (mutated or deleted) object had before it was modified by this transaction.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ModifiedAtVersion" - } - }, - "mutated": { - "description": "ObjectReference and owner of mutated objects, including gas object.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectReferenceWithOwner" - } - }, - "shared_objects": { - "description": "The object references of the shared objects used in this transaction. Empty if no shared objects were used.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectReference" - } - }, - "status": { - "$ref": "#/components/schemas/FailureStatus" - }, - "success": { - "type": "boolean" - }, - "transaction_digest": { - "description": "The transaction digest", - "allOf": [ - { - "$ref": "#/components/schemas/TransactionDigest" - } - ] - }, - "unwrapped": { - "description": "ObjectReference and owner of objects that are unwrapped in this transaction. Unwrapped objects are objects that were wrapped into other objects in the past, and just got extracted out.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectReferenceWithOwner" - } - }, - "unwrapped_then_deleted": { - "description": "Object refs of objects previously wrapped in other objects but now deleted.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectReference" - } - }, - "version": { - "type": "string", - "enum": [ - "1" - ] - }, - "wrapped": { - "description": "Object refs of objects now wrapped in other objects.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ObjectReference" - } - } - } - }, - { - "description": "The response from processing a transaction or a certified transaction", - "type": "object", - "required": [ - "changed_objects", - "dependencies", - "epoch", - "gas_used", - "lamport_version", - "success", - "transaction_digest", - "unchanged_shared_objects", - "version" - ], - "properties": { - "auxiliary_data_digest": { - "description": "Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately. Storing it separately allows us to avoid bloating the effects with data that are not critical. It also provides more flexibility on the format and type of the data.", - "allOf": [ - { - "$ref": "#/components/schemas/EffectsAuxiliaryDataDigest" - } - ] - }, - "changed_objects": { - "description": "Objects whose state are changed in the object store.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ChangedObject" - } - }, - "dependencies": { - "description": "The set of transaction digests this transaction depends on.", - "type": "array", - "items": { - "$ref": "#/components/schemas/TransactionDigest" - } - }, - "epoch": { - "description": "The epoch when this transaction was executed.", - "type": "string", - "format": "u64" - }, - "events_digest": { - "description": "The digest of the events emitted during execution, can be None if the transaction does not emit any event.", - "allOf": [ - { - "$ref": "#/components/schemas/TransactionEventsDigest" - } - ] - }, - "gas_object_index": { - "description": "The updated gas object reference, as an index into the `changed_objects` vector. Having a dedicated field for convenient access. System transaction that don't require gas will leave this as None.", - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "gas_used": { - "$ref": "#/components/schemas/GasCostSummary" - }, - "lamport_version": { - "description": "The version number of all the written Move objects by this transaction.", - "type": "string", - "format": "u64" - }, - "status": { - "$ref": "#/components/schemas/FailureStatus" - }, - "success": { - "type": "boolean" - }, - "transaction_digest": { - "description": "The transaction digest", - "allOf": [ - { - "$ref": "#/components/schemas/TransactionDigest" - } - ] - }, - "unchanged_shared_objects": { - "description": "Shared objects that are not mutated in this transaction. Unlike owned objects, read-only shared objects' version are not committed in the transaction, and in order for a node to catch up and execute it without consensus sequencing, the version needs to be committed in the effects.", - "type": "array", - "items": { - "$ref": "#/components/schemas/UnchangedSharedObject" - } - }, - "version": { - "type": "string", - "enum": [ - "2" - ] - } - } - } - ] - }, - "TransactionEffectsDigest": { - "$ref": "#/components/schemas/Digest" - }, - "TransactionEvents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Event" - } - }, - "TransactionEventsDigest": { - "$ref": "#/components/schemas/Digest" - }, - "TransactionExpiration": { - "oneOf": [ - { - "description": "Validators wont sign a transaction unless the expiration Epoch is greater than or equal to the current epoch", - "type": "object", - "required": [ - "epoch" - ], - "properties": { - "epoch": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "TransactionKind": { - "oneOf": [ - { - "description": "A series of commands where the results of one command can be used in future commands", - "type": "object", - "required": [ - "commands", - "inputs", - "kind" - ], - "properties": { - "commands": { - "description": "The commands to be executed sequentially. A failure in any command will result in the failure of the entire transaction.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Command" - } - }, - "inputs": { - "description": "Input objects or primitive values", - "type": "array", - "items": { - "$ref": "#/components/schemas/Input" - } - }, - "kind": { - "type": "string", - "enum": [ - "programmable_transaction" - ] - } - } - }, - { - "type": "object", - "required": [ - "computation_charge", - "epoch", - "epoch_start_timestamp_ms", - "kind", - "non_refundable_storage_fee", - "protocol_version", - "storage_charge", - "storage_rebate", - "system_packages" - ], - "properties": { - "computation_charge": { - "description": "The total amount of gas charged for computation during the epoch.", - "type": "string", - "format": "u64" - }, - "epoch": { - "description": "The next (to become) epoch ID.", - "type": "string", - "format": "u64" - }, - "epoch_start_timestamp_ms": { - "description": "Unix timestamp when epoch started", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "change_epoch" - ] - }, - "non_refundable_storage_fee": { - "description": "The non-refundable storage fee.", - "type": "string", - "format": "u64" - }, - "protocol_version": { - "description": "The protocol version in effect in the new epoch.", - "type": "string", - "format": "u64" - }, - "storage_charge": { - "description": "The total amount of gas charged for storage during the epoch.", - "type": "string", - "format": "u64" - }, - "storage_rebate": { - "description": "The amount of storage rebate refunded to the txn senders.", - "type": "string", - "format": "u64" - }, - "system_packages": { - "description": "System packages (specifically framework and move stdlib) that are written before the new epoch starts. This tracks framework upgrades on chain. When executing the ChangeEpoch txn, the validator must write out the modules below. Modules are provided with the version they will be upgraded to, their modules in serialized form (which include their package ID), and a list of their transitive dependencies.", - "type": "array", - "items": { - "$ref": "#/components/schemas/SystemPackage" - } - } - } - }, - { - "type": "object", - "required": [ - "kind", - "objects" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "genesis" - ] - }, - "objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GenesisObject" - } - } - } - }, - { - "description": "Only commit_timestamp_ms is passed to the move call currently. However we include epoch and round to make sure each ConsensusCommitPrologue has a unique tx digest.", - "type": "object", - "required": [ - "commit_timestamp_ms", - "epoch", - "kind", - "round" - ], - "properties": { - "commit_timestamp_ms": { - "description": "Unix timestamp from consensus", - "type": "string", - "format": "u64" - }, - "epoch": { - "description": "Epoch of the commit prologue transaction", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "consensus_commit_prologue" - ] - }, - "round": { - "description": "Consensus round of the commit", - "type": "string", - "format": "u64" - } - } - }, - { - "type": "object", - "required": [ - "authenticator_obj_initial_shared_version", - "epoch", - "kind", - "new_active_jwks", - "round" - ], - "properties": { - "authenticator_obj_initial_shared_version": { - "description": "The initial version of the authenticator object that it was shared at.", - "type": "string", - "format": "u64" - }, - "epoch": { - "description": "Epoch of the authenticator state update transaction", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "authenticator_state_update" - ] - }, - "new_active_jwks": { - "description": "newly active jwks", - "type": "array", - "items": { - "$ref": "#/components/schemas/ActiveJwk" - } - }, - "round": { - "description": "Consensus round of the authenticator state update", - "type": "string", - "format": "u64" - } - } - }, - { - "type": "object", - "required": [ - "commands", - "kind" - ], - "properties": { - "commands": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EndOfEpochTransactionKind" - } - }, - "kind": { - "type": "string", - "enum": [ - "end_of_epoch" - ] - } - } - }, - { - "type": "object", - "required": [ - "epoch", - "kind", - "random_bytes", - "randomness_obj_initial_shared_version", - "randomness_round" - ], - "properties": { - "epoch": { - "description": "Epoch of the randomness state update transaction", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "randomness_state_update" - ] - }, - "random_bytes": { - "description": "Updated random bytes", - "type": "string", - "format": "base64" - }, - "randomness_obj_initial_shared_version": { - "description": "The initial version of the randomness object that it was shared at.", - "type": "string", - "format": "u64" - }, - "randomness_round": { - "description": "Randomness round of the update", - "type": "string", - "format": "u64" - } - } - }, - { - "type": "object", - "required": [ - "commit_timestamp_ms", - "consensus_commit_digest", - "epoch", - "kind", - "round" - ], - "properties": { - "commit_timestamp_ms": { - "description": "Unix timestamp from consensus", - "type": "string", - "format": "u64" - }, - "consensus_commit_digest": { - "description": "Digest of consensus output", - "allOf": [ - { - "$ref": "#/components/schemas/ConsensusCommitDigest" - } - ] - }, - "epoch": { - "description": "Epoch of the commit prologue transaction", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "consensus_commit_prologue_v2" - ] - }, - "round": { - "description": "Consensus round of the commit", - "type": "string", - "format": "u64" - } - } - }, - { - "type": "object", - "required": [ - "commit_timestamp_ms", - "consensus_commit_digest", - "consensus_determined_version_assignments", - "epoch", - "kind", - "round" - ], - "properties": { - "commit_timestamp_ms": { - "description": "Unix timestamp from consensus", - "type": "string", - "format": "u64" - }, - "consensus_commit_digest": { - "description": "Digest of consensus output", - "allOf": [ - { - "$ref": "#/components/schemas/ConsensusCommitDigest" - } - ] - }, - "consensus_determined_version_assignments": { - "description": "Stores consensus handler determined shared object version assignments.", - "allOf": [ - { - "$ref": "#/components/schemas/ConsensusDeterminedVersionAssignments" - } - ] - }, - "epoch": { - "description": "Epoch of the commit prologue transaction", - "type": "string", - "format": "u64" - }, - "kind": { - "type": "string", - "enum": [ - "consensus_commit_prologue_v3" - ] - }, - "round": { - "description": "Consensus round of the commit", - "type": "string", - "format": "u64" - }, - "sub_dag_index": { - "description": "The sub DAG index of the consensus commit. This field will be populated if there are multiple consensus commits per round.", - "type": "string", - "format": "u64" - } - } - } - ] - }, - "TransactionResponse": { - "type": "object", - "required": [ - "digest" - ], - "properties": { - "checkpoint": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "digest": { - "$ref": "#/components/schemas/TransactionDigest" - }, - "effects": { - "$ref": "#/components/schemas/TransactionEffects" - }, - "effects_bcs": { - "type": "string" - }, - "events": { - "$ref": "#/components/schemas/TransactionEvents" - }, - "events_bcs": { - "type": "string" - }, - "signatures": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserSignature" - } - }, - "signatures_bytes": { - "type": "array", - "items": { - "type": "string" - } - }, - "timestamp_ms": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "transaction": { - "$ref": "#/components/schemas/Transaction" - }, - "transaction_bcs": { - "type": "string" - } - } - }, - "TransactionSimulationResponse": { - "description": "Response type for the transaction simulation endpoint", - "type": "object", - "required": [ - "effects" - ], - "properties": { - "balance_changes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BalanceChange" - } - }, - "effects": { - "$ref": "#/components/schemas/TransactionEffects" - }, - "events": { - "$ref": "#/components/schemas/TransactionEvents" - }, - "input_objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Object" - } - }, - "output_objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Object" - } - } - } - }, - "TypeArgumentError": { - "oneOf": [ - { - "description": "A type was not found in the module specified", - "type": "string", - "enum": [ - "type_not_found" - ] - }, - { - "description": "A type provided did not match the specified constraint", - "type": "string", - "enum": [ - "constraint_not_satisfied" - ] - } - ] - }, - "TypeOrigin": { - "description": "Identifies a struct and the module it was defined in", - "type": "object", - "required": [ - "module_name", - "package", - "struct_name" - ], - "properties": { - "module_name": { - "$ref": "#/components/schemas/Identifier" - }, - "package": { - "$ref": "#/components/schemas/ObjectId" - }, - "struct_name": { - "$ref": "#/components/schemas/Identifier" - } - } - }, - "TypeTag": { - "title": "TypeTag", - "description": "A Move TypeTag", - "examples": [ - "vector" - ], - "type": "string" - }, - "UnchangedSharedKind": { - "oneOf": [ - { - "description": "Read-only shared objects from the input. We don't really need ObjectDigest for protocol correctness, but it will make it easier to verify untrusted read.", - "type": "object", - "required": [ - "digest", - "kind", - "version" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "kind": { - "type": "string", - "enum": [ - "read_only_root" - ] - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "description": "Deleted shared objects that appear mutably/owned in the input.", - "type": "object", - "required": [ - "kind", - "version" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "mutate_deleted" - ] - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "description": "Deleted shared objects that appear as read-only in the input.", - "type": "object", - "required": [ - "kind", - "version" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "read_deleted" - ] - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "description": "Shared objects in cancelled transaction. The sequence number embed cancellation reason.", - "type": "object", - "required": [ - "kind", - "version" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "cancelled" - ] - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - { - "description": "Read of a per-epoch config object that should remain the same during an epoch.", - "type": "object", - "required": [ - "kind" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "per_epoch_config" - ] - } - } - } - ] - }, - "UnchangedSharedObject": { - "type": "object", - "required": [ - "kind", - "object_id" - ], - "properties": { - "kind": { - "$ref": "#/components/schemas/UnchangedSharedKind" - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - } - } - }, - "UnresolvedGasPayment": { - "type": "object", - "required": [ - "owner" - ], - "properties": { - "budget": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UnresolvedObjectReference" - } - }, - "owner": { - "$ref": "#/components/schemas/Address" - }, - "price": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "UnresolvedInput": { - "description": "A potentially unresolved transaction input. Note that one can construct a fully resolved input using the provided constructors, but this struct is also useful when the input data is not complete.\n\nIf used in the context of transaction builder, make sure to call `tx.resolve` function on the transaction builder to resolve all unresolved inputs.", - "type": "object", - "properties": { - "digest": { - "description": "The digest of this object. This field is only relevant for owned/immutable/receiving inputs.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectDigest" - } - ] - }, - "kind": { - "$ref": "#/components/schemas/UnresolvedInputKind" - }, - "mutable": { - "description": "Whether this object is mutable. This field is only relevant for shared objects.", - "type": "boolean" - }, - "object_id": { - "description": "Unique identifier for this object.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "value": { - "$ref": "#/components/schemas/UnresolvedValue" - }, - "version": { - "description": "Either the `initial_shared_version` if object is a shared object, or the `version` if this is an owned object. The semantics of version can change depending on whether the object is shared or not. For shared objects, this is the initial version the object was shared at. For all other objects, this is the version of the object.", - "type": "string", - "format": "u64" - } - } - }, - "UnresolvedInputKind": { - "type": "string", - "enum": [ - "pure", - "shared", - "receiving", - "immutable_or_owned", - "literal" - ] - }, - "UnresolvedObjectReference": { - "type": "object", - "required": [ - "object_id" - ], - "properties": { - "digest": { - "$ref": "#/components/schemas/ObjectDigest" - }, - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "UnresolvedTransaction": { - "type": "object", - "required": [ - "commands", - "expiration", - "inputs", - "sender" - ], - "properties": { - "commands": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Command" - } - }, - "expiration": { - "$ref": "#/components/schemas/TransactionExpiration" - }, - "gas_payment": { - "$ref": "#/components/schemas/UnresolvedGasPayment" - }, - "inputs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UnresolvedInput" - } - }, - "sender": { - "$ref": "#/components/schemas/Address" - } - } - }, - "UnresolvedValue": { - "anyOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/UnresolvedValue" - } - } - ] - }, - "UpgradeInfo": { - "description": "Upgraded package info for the linkage table", - "type": "object", - "required": [ - "upgraded_id", - "upgraded_version" - ], - "properties": { - "upgraded_id": { - "description": "Id of the upgraded packages", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "upgraded_version": { - "description": "Version of the upgraded package", - "type": "string", - "format": "u64" - } - } - }, - "UserSignature": { - "oneOf": [ - { - "type": "object", - "required": [ - "public_key", - "scheme", - "signature" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Ed25519PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "ed25519" - ] - }, - "signature": { - "$ref": "#/components/schemas/Ed25519Signature" - } - } - }, - { - "type": "object", - "required": [ - "public_key", - "scheme", - "signature" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Secp256k1PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "secp256k1" - ] - }, - "signature": { - "$ref": "#/components/schemas/Secp256k1Signature" - } - } - }, - { - "type": "object", - "required": [ - "public_key", - "scheme", - "signature" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Secp256r1PublicKey" - }, - "scheme": { - "type": "string", - "enum": [ - "secp256r1" - ] - }, - "signature": { - "$ref": "#/components/schemas/Secp256r1Signature" - } - } - }, - { - "description": "The struct that contains signatures and public keys necessary for authenticating a Multisig.", - "type": "object", - "required": [ - "bitmap", - "committee", - "scheme", - "signatures" - ], - "properties": { - "bitmap": { - "description": "A bitmap that indicates the position of which public key the signature should be authenticated with.", - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "committee": { - "description": "The public key encoded with each public key with its signature scheme used along with the corresponding weight.", - "allOf": [ - { - "$ref": "#/components/schemas/MultisigCommittee" - } - ] - }, - "legacy_bitmap": { - "description": "Legacy encoding for the bitmap.", - "type": "string", - "format": "base64" - }, - "scheme": { - "type": "string", - "enum": [ - "multisig" - ] - }, - "signatures": { - "description": "The plain signature encoded with signature scheme.\n\nThe signatures must be in the same order as they are listed in the committee.", - "type": "array", - "items": { - "$ref": "#/components/schemas/MultisigMemberSignature" - } - } - } - }, - { - "description": "An zk login authenticator with all the necessary fields.", - "type": "object", - "required": [ - "inputs", - "max_epoch", - "scheme", - "signature" - ], - "properties": { - "inputs": { - "$ref": "#/components/schemas/ZkLoginInputs" - }, - "max_epoch": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "scheme": { - "type": "string", - "enum": [ - "zklogin" - ] - }, - "signature": { - "$ref": "#/components/schemas/SimpleSignature" - } - } - }, - { - "type": "object", - "required": [ - "authenticator_data", - "client_data_json", - "scheme", - "signature" - ], - "properties": { - "authenticator_data": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - } - }, - "client_data_json": { - "type": "string" - }, - "scheme": { - "type": "string", - "enum": [ - "passkey" - ] - }, - "signature": { - "$ref": "#/components/schemas/SimpleSignature" - } - } - } - ] - }, - "ValidatorAggregatedSignature": { - "type": "object", - "required": [ - "bitmap", - "epoch", - "signature" - ], - "properties": { - "bitmap": { - "description": "Base64 encoded data", - "type": "string", - "format": "base64" - }, - "epoch": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "signature": { - "$ref": "#/components/schemas/Bls12381Signature" - } - } - }, - "ValidatorCommittee": { - "type": "object", - "required": [ - "epoch", - "members" - ], - "properties": { - "epoch": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "members": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidatorCommitteeMember" - } - } - } - }, - "ValidatorCommitteeMember": { - "type": "object", - "required": [ - "public_key", - "stake" - ], - "properties": { - "public_key": { - "$ref": "#/components/schemas/Bls12381PublicKey" - }, - "stake": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "ValidatorSummary": { - "description": "This is the REST type for the sui validator. It flattens all inner structures to top-level fields so that they are decoupled from the internal definitions.", - "type": "object", - "required": [ - "address", - "commission_rate", - "description", - "exchange_rates_id", - "exchange_rates_size", - "gas_price", - "image_url", - "name", - "net_address", - "network_public_key", - "next_epoch_commission_rate", - "next_epoch_gas_price", - "next_epoch_stake", - "operation_cap_id", - "p2p_address", - "pending_pool_token_withdraw", - "pending_stake", - "pending_total_sui_withdraw", - "pool_token_balance", - "primary_address", - "project_url", - "proof_of_possession_bytes", - "protocol_public_key", - "rewards_pool", - "staking_pool_id", - "staking_pool_sui_balance", - "voting_power", - "worker_address", - "worker_public_key" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/Address" - }, - "commission_rate": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "description": { - "type": "string" - }, - "exchange_rates_id": { - "description": "ID of the exchange rate table object.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "exchange_rates_size": { - "description": "Number of exchange rates in the table.", - "type": "string", - "format": "u64" - }, - "gas_price": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "image_url": { - "type": "string" - }, - "name": { - "type": "string" - }, - "net_address": { - "type": "string" - }, - "network_public_key": { - "$ref": "#/components/schemas/Ed25519PublicKey" - }, - "next_epoch_commission_rate": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "next_epoch_gas_price": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "next_epoch_net_address": { - "type": "string" - }, - "next_epoch_network_public_key": { - "$ref": "#/components/schemas/Ed25519PublicKey" - }, - "next_epoch_p2p_address": { - "type": "string" - }, - "next_epoch_primary_address": { - "type": "string" - }, - "next_epoch_proof_of_possession": { - "default": null, - "type": "string" - }, - "next_epoch_protocol_public_key": { - "$ref": "#/components/schemas/Bls12381PublicKey" - }, - "next_epoch_stake": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "next_epoch_worker_address": { - "type": "string" - }, - "next_epoch_worker_public_key": { - "$ref": "#/components/schemas/Ed25519PublicKey" - }, - "operation_cap_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "p2p_address": { - "type": "string" - }, - "pending_pool_token_withdraw": { - "description": "Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.", - "type": "string", - "format": "u64" - }, - "pending_stake": { - "description": "Pending stake amount for this epoch.", - "type": "string", - "format": "u64" - }, - "pending_total_sui_withdraw": { - "description": "Pending stake withdrawn during the current epoch, emptied at epoch boundaries.", - "type": "string", - "format": "u64" - }, - "pool_token_balance": { - "description": "Total number of pool tokens issued by the pool.", - "type": "string", - "format": "u64" - }, - "primary_address": { - "type": "string" - }, - "project_url": { - "type": "string" - }, - "proof_of_possession_bytes": { - "type": "string" - }, - "protocol_public_key": { - "$ref": "#/components/schemas/Bls12381PublicKey" - }, - "rewards_pool": { - "description": "The epoch stake rewards will be added here at the end of each epoch.", - "type": "string", - "format": "u64" - }, - "staking_pool_activation_epoch": { - "description": "The epoch at which this pool became active.", - "default": null, - "type": "string", - "format": "u64" - }, - "staking_pool_deactivation_epoch": { - "description": "The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},", - "default": null, - "type": "string", - "format": "u64" - }, - "staking_pool_id": { - "description": "ID of the staking pool object.", - "allOf": [ - { - "$ref": "#/components/schemas/ObjectId" - } - ] - }, - "staking_pool_sui_balance": { - "description": "The total number of SUI tokens in this pool.", - "type": "string", - "format": "u64" - }, - "voting_power": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - }, - "worker_address": { - "type": "string" - }, - "worker_public_key": { - "$ref": "#/components/schemas/Ed25519PublicKey" - } - } - }, - "VersionAssignment": { - "type": "object", - "required": [ - "object_id", - "version" - ], - "properties": { - "object_id": { - "$ref": "#/components/schemas/ObjectId" - }, - "version": { - "description": "Radix-10 encoded 64-bit unsigned integer", - "type": "string", - "format": "u64" - } - } - }, - "ZkLoginInputs": { - "description": "All inputs required for the zk login proof verification and other public inputs.", - "type": "object", - "required": [ - "address_seed", - "header_base64", - "iss_base64_details", - "proof_points" - ], - "properties": { - "address_seed": { - "$ref": "#/components/schemas/Bn254FieldElement" - }, - "header_base64": { - "type": "string" - }, - "iss_base64_details": { - "$ref": "#/components/schemas/Claim" - }, - "proof_points": { - "$ref": "#/components/schemas/ZkLoginProof" - } - } - }, - "ZkLoginProof": { - "description": "The struct for zk login proof.", - "type": "object", - "required": [ - "a", - "b", - "c" - ], - "properties": { - "a": { - "$ref": "#/components/schemas/CircomG1" - }, - "b": { - "$ref": "#/components/schemas/CircomG2" - }, - "c": { - "$ref": "#/components/schemas/CircomG1" - } - } - } - } - }, - "tags": [ - { - "name": "Account" - }, - { - "name": "Checkpoint" - }, - { - "name": "Coins" - }, - { - "name": "General" - }, - { - "name": "Objects" - }, - { - "name": "OpenAPI" - }, - { - "name": "System" - }, - { - "name": "Transactions" - } - ] -} diff --git a/crates/sui-rpc-api/openapi/swagger.html b/crates/sui-rpc-api/openapi/swagger.html deleted file mode 100644 index 7172ca0e3f0bc..0000000000000 --- a/crates/sui-rpc-api/openapi/swagger.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - SwaggerUI - - - -
- - - - diff --git a/crates/sui-rpc-api/src/client/mod.rs b/crates/sui-rpc-api/src/client/mod.rs index 966a7ca813635..0d847555c2259 100644 --- a/crates/sui-rpc-api/src/client/mod.rs +++ b/crates/sui-rpc-api/src/client/mod.rs @@ -163,7 +163,7 @@ impl Client { version: Option, ) -> Result { let request = crate::proto::node::GetObjectRequest { - object_id: Some(sui_sdk_types::types::ObjectId::from(object_id).into()), + object_id: Some(sui_sdk_types::ObjectId::from(object_id).into()), version, options: Some(crate::proto::node::GetObjectOptions { object: Some(false), @@ -224,7 +224,7 @@ pub struct TransactionExecutionResponse { pub effects: TransactionEffects, pub events: Option, - pub balance_changes: Option>, + pub balance_changes: Option>, } /// Attempts to parse `CertifiedCheckpointSummary` from the bcs fields in `GetCheckpointResponse` @@ -238,7 +238,7 @@ fn certified_checkpoint_summary_try_from_proto( .map_err(TryFromProtoError::from_error)?; let signature = sui_types::crypto::AuthorityStrongQuorumSignInfo::from( - sui_sdk_types::types::ValidatorAggregatedSignature::try_from( + sui_sdk_types::ValidatorAggregatedSignature::try_from( signature .as_ref() .ok_or_else(|| TryFromProtoError::missing("signature"))?, diff --git a/crates/sui-rpc-api/src/client/response_ext.rs b/crates/sui-rpc-api/src/client/response_ext.rs index 787bb078b01bc..3bfc5c8382eb1 100644 --- a/crates/sui-rpc-api/src/client/response_ext.rs +++ b/crates/sui-rpc-api/src/client/response_ext.rs @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use sui_sdk_types::types::CheckpointDigest; +use sui_sdk_types::CheckpointDigest; /// Extension trait used to facilitate retrieval of Sui specific data from responses pub trait ResponseExt { diff --git a/crates/sui-rpc-api/src/client/sdk.rs b/crates/sui-rpc-api/src/client/sdk.rs index add6e1049b20a..fe98485929ed3 100644 --- a/crates/sui-rpc-api/src/client/sdk.rs +++ b/crates/sui-rpc-api/src/client/sdk.rs @@ -4,20 +4,20 @@ use reqwest::header::HeaderValue; use reqwest::StatusCode; use reqwest::Url; -use sui_sdk_types::types::unresolved::Transaction as UnresolvedTransaction; -use sui_sdk_types::types::Address; -use sui_sdk_types::types::CheckpointDigest; -use sui_sdk_types::types::CheckpointSequenceNumber; -use sui_sdk_types::types::EpochId; -use sui_sdk_types::types::Object; -use sui_sdk_types::types::ObjectId; -use sui_sdk_types::types::SignedCheckpointSummary; -use sui_sdk_types::types::SignedTransaction; -use sui_sdk_types::types::StructTag; -use sui_sdk_types::types::Transaction; -use sui_sdk_types::types::TransactionDigest; -use sui_sdk_types::types::ValidatorCommittee; -use sui_sdk_types::types::Version; +use sui_sdk_transaction_builder::unresolved::Transaction as UnresolvedTransaction; +use sui_sdk_types::Address; +use sui_sdk_types::CheckpointDigest; +use sui_sdk_types::CheckpointSequenceNumber; +use sui_sdk_types::EpochId; +use sui_sdk_types::Object; +use sui_sdk_types::ObjectId; +use sui_sdk_types::SignedCheckpointSummary; +use sui_sdk_types::SignedTransaction; +use sui_sdk_types::StructTag; +use sui_sdk_types::Transaction; +use sui_sdk_types::TransactionDigest; +use sui_sdk_types::ValidatorCommittee; +use sui_sdk_types::Version; use tap::Pipe; use crate::rest::accounts::AccountOwnedObjectInfo; diff --git a/crates/sui-rpc-api/src/grpc.rs b/crates/sui-rpc-api/src/grpc.rs index 0d32eeaabc38e..3c0091047d6f6 100644 --- a/crates/sui-rpc-api/src/grpc.rs +++ b/crates/sui-rpc-api/src/grpc.rs @@ -226,7 +226,7 @@ impl crate::proto::node::node_server::Node for crate::RpcService { )) } }; - let mut signatures: Vec = Vec::new(); + let mut signatures: Vec = Vec::new(); if let Some(proto_signatures) = request.signatures { let from_proto_signatures = proto_signatures @@ -248,7 +248,7 @@ impl crate::proto::node::node_server::Node for crate::RpcService { let from_bytes_signatures = signatures_bytes .signatures .iter() - .map(|bytes| sui_sdk_types::types::UserSignature::from_bytes(bytes)) + .map(|bytes| sui_sdk_types::UserSignature::from_bytes(bytes)) .collect::, _>>() .map_err(|e| { tonic::Status::new( @@ -260,7 +260,7 @@ impl crate::proto::node::node_server::Node for crate::RpcService { signatures.extend(from_bytes_signatures); } - let signed_transaction = sui_sdk_types::types::SignedTransaction { + let signed_transaction = sui_sdk_types::SignedTransaction { transaction, signatures, }; diff --git a/crates/sui-rpc-api/src/lib.rs b/crates/sui-rpc-api/src/lib.rs index 9a7b25670784c..6935f7797c1b0 100644 --- a/crates/sui-rpc-api/src/lib.rs +++ b/crates/sui-rpc-api/src/lib.rs @@ -148,7 +148,7 @@ impl RpcService { } } -#[derive(Debug, Copy, Clone, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, Copy, Clone, serde::Serialize, serde::Deserialize)] #[serde(rename_all = "lowercase")] pub enum Direction { Ascending, diff --git a/crates/sui-rpc-api/src/proto/node.rs b/crates/sui-rpc-api/src/proto/node.rs index 5d8169ad46b7e..10075c0363fe6 100644 --- a/crates/sui-rpc-api/src/proto/node.rs +++ b/crates/sui-rpc-api/src/proto/node.rs @@ -29,8 +29,8 @@ pub use file_descriptor_set::FILE_DESCRIPTOR_SET; // BalanceChange // -impl From for BalanceChange { - fn from(value: sui_sdk_types::types::BalanceChange) -> Self { +impl From for BalanceChange { + fn from(value: sui_sdk_types::BalanceChange) -> Self { Self { address: Some(value.address.into()), coin_type: Some(value.coin_type.into()), @@ -39,7 +39,7 @@ impl From for BalanceChange { } } -impl TryFrom<&BalanceChange> for sui_sdk_types::types::BalanceChange { +impl TryFrom<&BalanceChange> for sui_sdk_types::BalanceChange { type Error = TryFromProtoError; fn try_from(value: &BalanceChange) -> Result { diff --git a/crates/sui-rpc-api/src/proto/proptests.rs b/crates/sui-rpc-api/src/proto/proptests.rs index 6d1eb67e18189..609b4a8305d2e 100644 --- a/crates/sui-rpc-api/src/proto/proptests.rs +++ b/crates/sui-rpc-api/src/proto/proptests.rs @@ -1,5 +1,5 @@ use super::types as proto; -use sui_sdk_types::types::*; +use sui_sdk_types::*; use test_strategy::proptest; macro_rules! protobuf_roundtrip_test { diff --git a/crates/sui-rpc-api/src/proto/types/checkpoint.rs b/crates/sui-rpc-api/src/proto/types/checkpoint.rs index 255d5b62a60ef..54d3122128cc4 100644 --- a/crates/sui-rpc-api/src/proto/types/checkpoint.rs +++ b/crates/sui-rpc-api/src/proto/types/checkpoint.rs @@ -5,9 +5,9 @@ use tap::Pipe; // CheckpointSummary // -impl From for super::CheckpointSummary { +impl From for super::CheckpointSummary { fn from( - sui_sdk_types::types::CheckpointSummary { + sui_sdk_types::CheckpointSummary { epoch, sequence_number, network_total_transactions, @@ -18,7 +18,7 @@ impl From for super::CheckpointSummary checkpoint_commitments, end_of_epoch_data, version_specific_data, - }: sui_sdk_types::types::CheckpointSummary, + }: sui_sdk_types::CheckpointSummary, ) -> Self { Self { epoch: Some(epoch), @@ -35,7 +35,7 @@ impl From for super::CheckpointSummary } } -impl TryFrom<&super::CheckpointSummary> for sui_sdk_types::types::CheckpointSummary { +impl TryFrom<&super::CheckpointSummary> for sui_sdk_types::CheckpointSummary { type Error = TryFromProtoError; fn try_from( @@ -107,14 +107,14 @@ impl TryFrom<&super::CheckpointSummary> for sui_sdk_types::types::CheckpointSumm // GasCostSummary // -impl From for super::GasCostSummary { +impl From for super::GasCostSummary { fn from( - sui_sdk_types::types::GasCostSummary { + sui_sdk_types::GasCostSummary { computation_cost, storage_cost, storage_rebate, non_refundable_storage_fee, - }: sui_sdk_types::types::GasCostSummary, + }: sui_sdk_types::GasCostSummary, ) -> Self { Self { computation_cost: Some(computation_cost), @@ -125,7 +125,7 @@ impl From for super::GasCostSummary { } } -impl TryFrom<&super::GasCostSummary> for sui_sdk_types::types::GasCostSummary { +impl TryFrom<&super::GasCostSummary> for sui_sdk_types::GasCostSummary { type Error = TryFromProtoError; fn try_from( @@ -157,10 +157,10 @@ impl TryFrom<&super::GasCostSummary> for sui_sdk_types::types::GasCostSummary { // CheckpointCommitment // -impl From for super::CheckpointCommitment { - fn from(value: sui_sdk_types::types::CheckpointCommitment) -> Self { +impl From for super::CheckpointCommitment { + fn from(value: sui_sdk_types::CheckpointCommitment) -> Self { let commitment = match value { - sui_sdk_types::types::CheckpointCommitment::EcmhLiveObjectSet { digest } => { + sui_sdk_types::CheckpointCommitment::EcmhLiveObjectSet { digest } => { super::checkpoint_commitment::Commitment::EcmhLiveObjectSet(digest.into()) } }; @@ -171,7 +171,7 @@ impl From for super::CheckpointCommi } } -impl TryFrom<&super::CheckpointCommitment> for sui_sdk_types::types::CheckpointCommitment { +impl TryFrom<&super::CheckpointCommitment> for sui_sdk_types::CheckpointCommitment { type Error = TryFromProtoError; fn try_from(value: &super::CheckpointCommitment) -> Result { @@ -194,13 +194,13 @@ impl TryFrom<&super::CheckpointCommitment> for sui_sdk_types::types::CheckpointC // EndOfEpochData // -impl From for super::EndOfEpochData { +impl From for super::EndOfEpochData { fn from( - sui_sdk_types::types::EndOfEpochData { + sui_sdk_types::EndOfEpochData { next_epoch_committee, next_epoch_protocol_version, epoch_commitments, - }: sui_sdk_types::types::EndOfEpochData, + }: sui_sdk_types::EndOfEpochData, ) -> Self { Self { next_epoch_committee: next_epoch_committee.into_iter().map(Into::into).collect(), @@ -210,7 +210,7 @@ impl From for super::EndOfEpochData { } } -impl TryFrom<&super::EndOfEpochData> for sui_sdk_types::types::EndOfEpochData { +impl TryFrom<&super::EndOfEpochData> for sui_sdk_types::EndOfEpochData { type Error = TryFromProtoError; fn try_from( @@ -241,8 +241,8 @@ impl TryFrom<&super::EndOfEpochData> for sui_sdk_types::types::EndOfEpochData { // CheckpointedTransactionInfo // -impl From for super::CheckpointedTransactionInfo { - fn from(value: sui_sdk_types::types::CheckpointTransactionInfo) -> Self { +impl From for super::CheckpointedTransactionInfo { + fn from(value: sui_sdk_types::CheckpointTransactionInfo) -> Self { Self { transaction: Some(value.transaction.into()), effects: Some(value.effects.into()), @@ -251,9 +251,7 @@ impl From for super::Checkpoint } } -impl TryFrom<&super::CheckpointedTransactionInfo> - for sui_sdk_types::types::CheckpointTransactionInfo -{ +impl TryFrom<&super::CheckpointedTransactionInfo> for sui_sdk_types::CheckpointTransactionInfo { type Error = TryFromProtoError; fn try_from(value: &super::CheckpointedTransactionInfo) -> Result { @@ -287,8 +285,8 @@ impl TryFrom<&super::CheckpointedTransactionInfo> // CheckpointContents // -impl From for super::CheckpointContents { - fn from(value: sui_sdk_types::types::CheckpointContents) -> Self { +impl From for super::CheckpointContents { + fn from(value: sui_sdk_types::CheckpointContents) -> Self { let contents = super::checkpoint_contents::Contents::V1(super::checkpoint_contents::V1 { transactions: value.into_v1().into_iter().map(Into::into).collect(), }); @@ -299,7 +297,7 @@ impl From for super::CheckpointContent } } -impl TryFrom<&super::CheckpointContents> for sui_sdk_types::types::CheckpointContents { +impl TryFrom<&super::CheckpointContents> for sui_sdk_types::CheckpointContents { type Error = TryFromProtoError; fn try_from(value: &super::CheckpointContents) -> Result { diff --git a/crates/sui-rpc-api/src/proto/types/effects.rs b/crates/sui-rpc-api/src/proto/types/effects.rs index 1c20d4acef63e..2431fab587857 100644 --- a/crates/sui-rpc-api/src/proto/types/effects.rs +++ b/crates/sui-rpc-api/src/proto/types/effects.rs @@ -5,10 +5,10 @@ use tap::Pipe; // TransactionEffects // -impl From for super::TransactionEffects { - fn from(value: sui_sdk_types::types::TransactionEffects) -> Self { +impl From for super::TransactionEffects { + fn from(value: sui_sdk_types::TransactionEffects) -> Self { use super::transaction_effects::Version; - use sui_sdk_types::types::TransactionEffects::*; + use sui_sdk_types::TransactionEffects::*; let version = match value { V1(v1) => Version::V1((*v1).into()), @@ -21,7 +21,7 @@ impl From for super::TransactionEffect } } -impl TryFrom<&super::TransactionEffects> for sui_sdk_types::types::TransactionEffects { +impl TryFrom<&super::TransactionEffects> for sui_sdk_types::TransactionEffects { type Error = TryFromProtoError; fn try_from(value: &super::TransactionEffects) -> Result { @@ -43,9 +43,9 @@ impl TryFrom<&super::TransactionEffects> for sui_sdk_types::types::TransactionEf // TransactionEffectsV1 // -impl From for super::TransactionEffectsV1 { +impl From for super::TransactionEffectsV1 { fn from( - sui_sdk_types::types::TransactionEffectsV1 { + sui_sdk_types::TransactionEffectsV1 { status, epoch, gas_used, @@ -61,7 +61,7 @@ impl From for super::TransactionEffe gas_object, events_digest, dependencies, - }: sui_sdk_types::types::TransactionEffectsV1, + }: sui_sdk_types::TransactionEffectsV1, ) -> Self { Self { status: Some(status.into()), @@ -83,7 +83,7 @@ impl From for super::TransactionEffe } } -impl TryFrom<&super::TransactionEffectsV1> for sui_sdk_types::types::TransactionEffectsV1 { +impl TryFrom<&super::TransactionEffectsV1> for sui_sdk_types::TransactionEffectsV1 { type Error = TryFromProtoError; fn try_from( @@ -196,9 +196,9 @@ impl TryFrom<&super::TransactionEffectsV1> for sui_sdk_types::types::Transaction // TransactionEffectsV2 // -impl From for super::TransactionEffectsV2 { +impl From for super::TransactionEffectsV2 { fn from( - sui_sdk_types::types::TransactionEffectsV2 { + sui_sdk_types::TransactionEffectsV2 { status, epoch, gas_used, @@ -210,7 +210,7 @@ impl From for super::TransactionEffe changed_objects, unchanged_shared_objects, auxiliary_data_digest, - }: sui_sdk_types::types::TransactionEffectsV2, + }: sui_sdk_types::TransactionEffectsV2, ) -> Self { Self { status: Some(status.into()), @@ -231,7 +231,7 @@ impl From for super::TransactionEffe } } -impl TryFrom<&super::TransactionEffectsV2> for sui_sdk_types::types::TransactionEffectsV2 { +impl TryFrom<&super::TransactionEffectsV2> for sui_sdk_types::TransactionEffectsV2 { type Error = TryFromProtoError; fn try_from( @@ -310,8 +310,8 @@ impl TryFrom<&super::TransactionEffectsV2> for sui_sdk_types::types::Transaction // ModifiedAtVersion // -impl From for super::ModifiedAtVersion { - fn from(value: sui_sdk_types::types::ModifiedAtVersion) -> Self { +impl From for super::ModifiedAtVersion { + fn from(value: sui_sdk_types::ModifiedAtVersion) -> Self { Self { object_id: Some(value.object_id.into()), version: Some(value.version), @@ -319,7 +319,7 @@ impl From for super::ModifiedAtVersion } } -impl TryFrom<&super::ModifiedAtVersion> for sui_sdk_types::types::ModifiedAtVersion { +impl TryFrom<&super::ModifiedAtVersion> for sui_sdk_types::ModifiedAtVersion { type Error = TryFromProtoError; fn try_from(value: &super::ModifiedAtVersion) -> Result { @@ -340,8 +340,8 @@ impl TryFrom<&super::ModifiedAtVersion> for sui_sdk_types::types::ModifiedAtVers // ObjectReferenceWithOwner // -impl From for super::ObjectReferenceWithOwner { - fn from(value: sui_sdk_types::types::ObjectReferenceWithOwner) -> Self { +impl From for super::ObjectReferenceWithOwner { + fn from(value: sui_sdk_types::ObjectReferenceWithOwner) -> Self { Self { reference: Some(value.reference.into()), owner: Some(value.owner.into()), @@ -349,7 +349,7 @@ impl From for super::ObjectRefer } } -impl TryFrom<&super::ObjectReferenceWithOwner> for sui_sdk_types::types::ObjectReferenceWithOwner { +impl TryFrom<&super::ObjectReferenceWithOwner> for sui_sdk_types::ObjectReferenceWithOwner { type Error = TryFromProtoError; fn try_from(value: &super::ObjectReferenceWithOwner) -> Result { @@ -373,18 +373,18 @@ impl TryFrom<&super::ObjectReferenceWithOwner> for sui_sdk_types::types::ObjectR // ChangedObject // -impl From for super::ChangedObject { - fn from(value: sui_sdk_types::types::ChangedObject) -> Self { +impl From for super::ChangedObject { + fn from(value: sui_sdk_types::ChangedObject) -> Self { Self { object_id: Some(value.object_id.into()), - input_state: Some(value.change.input_state.into()), - output_state: Some(value.change.output_state.into()), - id_operation: Some(value.change.id_operation.into()), + input_state: Some(value.input_state.into()), + output_state: Some(value.output_state.into()), + id_operation: Some(value.id_operation.into()), } } } -impl TryFrom<&super::ChangedObject> for sui_sdk_types::types::ChangedObject { +impl TryFrom<&super::ChangedObject> for sui_sdk_types::ChangedObject { type Error = TryFromProtoError; fn try_from(value: &super::ChangedObject) -> Result { @@ -414,11 +414,9 @@ impl TryFrom<&super::ChangedObject> for sui_sdk_types::types::ChangedObject { Ok(Self { object_id, - change: sui_sdk_types::types::EffectsObjectChange { - input_state, - output_state, - id_operation, - }, + input_state, + output_state, + id_operation, }) } } @@ -427,11 +425,11 @@ impl TryFrom<&super::ChangedObject> for sui_sdk_types::types::ChangedObject { // InputState // -impl From for super::changed_object::InputState { - fn from(value: sui_sdk_types::types::ObjectIn) -> Self { +impl From for super::changed_object::InputState { + fn from(value: sui_sdk_types::ObjectIn) -> Self { match value { - sui_sdk_types::types::ObjectIn::NotExist => Self::NotExist(()), - sui_sdk_types::types::ObjectIn::Exist { + sui_sdk_types::ObjectIn::NotExist => Self::NotExist(()), + sui_sdk_types::ObjectIn::Exist { version, digest, owner, @@ -444,7 +442,7 @@ impl From for super::changed_object::InputState } } -impl TryFrom<&super::changed_object::InputState> for sui_sdk_types::types::ObjectIn { +impl TryFrom<&super::changed_object::InputState> for sui_sdk_types::ObjectIn { type Error = TryFromProtoError; fn try_from(value: &super::changed_object::InputState) -> Result { @@ -476,9 +474,9 @@ impl TryFrom<&super::changed_object::InputState> for sui_sdk_types::types::Objec // OutputState // -impl From for super::changed_object::OutputState { - fn from(value: sui_sdk_types::types::ObjectOut) -> Self { - use sui_sdk_types::types::ObjectOut::*; +impl From for super::changed_object::OutputState { + fn from(value: sui_sdk_types::ObjectOut) -> Self { + use sui_sdk_types::ObjectOut::*; match value { NotExist => Self::Removed(()), ObjectWrite { digest, owner } => Self::ObjectWrite(super::ObjectWrite { @@ -493,7 +491,7 @@ impl From for super::changed_object::OutputStat } } -impl TryFrom<&super::changed_object::OutputState> for sui_sdk_types::types::ObjectOut { +impl TryFrom<&super::changed_object::OutputState> for sui_sdk_types::ObjectOut { type Error = TryFromProtoError; fn try_from(value: &super::changed_object::OutputState) -> Result { @@ -528,9 +526,9 @@ impl TryFrom<&super::changed_object::OutputState> for sui_sdk_types::types::Obje // IdOperation // -impl From for super::changed_object::IdOperation { - fn from(value: sui_sdk_types::types::IdOperation) -> Self { - use sui_sdk_types::types::IdOperation::*; +impl From for super::changed_object::IdOperation { + fn from(value: sui_sdk_types::IdOperation) -> Self { + use sui_sdk_types::IdOperation::*; match value { None => Self::None(()), @@ -540,7 +538,7 @@ impl From for super::changed_object::IdOperat } } -impl TryFrom<&super::changed_object::IdOperation> for sui_sdk_types::types::IdOperation { +impl TryFrom<&super::changed_object::IdOperation> for sui_sdk_types::IdOperation { type Error = TryFromProtoError; fn try_from(value: &super::changed_object::IdOperation) -> Result { @@ -559,8 +557,8 @@ impl TryFrom<&super::changed_object::IdOperation> for sui_sdk_types::types::IdOp // UnchangedSharedObject // -impl From for super::UnchangedSharedObject { - fn from(value: sui_sdk_types::types::UnchangedSharedObject) -> Self { +impl From for super::UnchangedSharedObject { + fn from(value: sui_sdk_types::UnchangedSharedObject) -> Self { Self { object_id: Some(value.object_id.into()), kind: Some(value.kind.into()), @@ -568,7 +566,7 @@ impl From for super::UnchangedShare } } -impl TryFrom<&super::UnchangedSharedObject> for sui_sdk_types::types::UnchangedSharedObject { +impl TryFrom<&super::UnchangedSharedObject> for sui_sdk_types::UnchangedSharedObject { type Error = TryFromProtoError; fn try_from(value: &super::UnchangedSharedObject) -> Result { @@ -592,9 +590,9 @@ impl TryFrom<&super::UnchangedSharedObject> for sui_sdk_types::types::UnchangedS // UnchangedSharedKind // -impl From for super::unchanged_shared_object::Kind { - fn from(value: sui_sdk_types::types::UnchangedSharedKind) -> Self { - use sui_sdk_types::types::UnchangedSharedKind::*; +impl From for super::unchanged_shared_object::Kind { + fn from(value: sui_sdk_types::UnchangedSharedKind) -> Self { + use sui_sdk_types::UnchangedSharedKind::*; match value { ReadOnlyRoot { version, digest } => Self::ReadOnlyRoot(super::ReadOnlyRoot { @@ -609,7 +607,7 @@ impl From for super::unchanged_shared } } -impl TryFrom<&super::unchanged_shared_object::Kind> for sui_sdk_types::types::UnchangedSharedKind { +impl TryFrom<&super::unchanged_shared_object::Kind> for sui_sdk_types::UnchangedSharedKind { type Error = TryFromProtoError; fn try_from(value: &super::unchanged_shared_object::Kind) -> Result { diff --git a/crates/sui-rpc-api/src/proto/types/events.rs b/crates/sui-rpc-api/src/proto/types/events.rs index 3b0b9e057c4cf..7775031bea459 100644 --- a/crates/sui-rpc-api/src/proto/types/events.rs +++ b/crates/sui-rpc-api/src/proto/types/events.rs @@ -4,8 +4,8 @@ use super::TryFromProtoError; // Event // -impl From for super::Event { - fn from(value: sui_sdk_types::types::Event) -> Self { +impl From for super::Event { + fn from(value: sui_sdk_types::Event) -> Self { Self { package_id: Some(value.package_id.into()), module: Some(value.module.into()), @@ -16,7 +16,7 @@ impl From for super::Event { } } -impl TryFrom<&super::Event> for sui_sdk_types::types::Event { +impl TryFrom<&super::Event> for sui_sdk_types::Event { type Error = TryFromProtoError; fn try_from(value: &super::Event) -> Result { @@ -64,15 +64,15 @@ impl TryFrom<&super::Event> for sui_sdk_types::types::Event { // TransactionEvents // -impl From for super::TransactionEvents { - fn from(value: sui_sdk_types::types::TransactionEvents) -> Self { +impl From for super::TransactionEvents { + fn from(value: sui_sdk_types::TransactionEvents) -> Self { Self { events: value.0.into_iter().map(Into::into).collect(), } } } -impl TryFrom<&super::TransactionEvents> for sui_sdk_types::types::TransactionEvents { +impl TryFrom<&super::TransactionEvents> for sui_sdk_types::TransactionEvents { type Error = TryFromProtoError; fn try_from(value: &super::TransactionEvents) -> Result { diff --git a/crates/sui-rpc-api/src/proto/types/execution_status.rs b/crates/sui-rpc-api/src/proto/types/execution_status.rs index 8c0586452c200..bd1a2bae91939 100644 --- a/crates/sui-rpc-api/src/proto/types/execution_status.rs +++ b/crates/sui-rpc-api/src/proto/types/execution_status.rs @@ -5,14 +5,14 @@ use tap::Pipe; // ExecutionStatus // -impl From for super::ExecutionStatus { - fn from(value: sui_sdk_types::types::ExecutionStatus) -> Self { +impl From for super::ExecutionStatus { + fn from(value: sui_sdk_types::ExecutionStatus) -> Self { match value { - sui_sdk_types::types::ExecutionStatus::Success => Self { + sui_sdk_types::ExecutionStatus::Success => Self { success: Some(true), status: None, }, - sui_sdk_types::types::ExecutionStatus::Failure { error, command } => Self { + sui_sdk_types::ExecutionStatus::Failure { error, command } => Self { success: Some(false), status: Some(super::FailureStatus { command, @@ -23,7 +23,7 @@ impl From for super::ExecutionStatus { } } -impl TryFrom<&super::ExecutionStatus> for sui_sdk_types::types::ExecutionStatus { +impl TryFrom<&super::ExecutionStatus> for sui_sdk_types::ExecutionStatus { type Error = TryFromProtoError; fn try_from(value: &super::ExecutionStatus) -> Result { @@ -57,9 +57,9 @@ impl TryFrom<&super::ExecutionStatus> for sui_sdk_types::types::ExecutionStatus // ExecutionError // -impl From for super::failure_status::ExecutionError { - fn from(value: sui_sdk_types::types::ExecutionError) -> Self { - use sui_sdk_types::types::ExecutionError::*; +impl From for super::failure_status::ExecutionError { + fn from(value: sui_sdk_types::ExecutionError) -> Self { + use sui_sdk_types::ExecutionError::*; match value { InsufficientGas => Self::InsufficientGas(()), InvalidGasObject => Self::InvalidGasObject(()), @@ -165,7 +165,7 @@ impl From for super::failure_status::Execu } } -impl TryFrom<&super::failure_status::ExecutionError> for sui_sdk_types::types::ExecutionError { +impl TryFrom<&super::failure_status::ExecutionError> for sui_sdk_types::ExecutionError { type Error = TryFromProtoError; fn try_from(value: &super::failure_status::ExecutionError) -> Result { @@ -306,9 +306,9 @@ impl TryFrom<&super::failure_status::ExecutionError> for sui_sdk_types::types::E // CommandArgumentError // -impl From for super::command_argument_error::Kind { - fn from(value: sui_sdk_types::types::CommandArgumentError) -> Self { - use sui_sdk_types::types::CommandArgumentError::*; +impl From for super::command_argument_error::Kind { + fn from(value: sui_sdk_types::CommandArgumentError) -> Self { + use sui_sdk_types::CommandArgumentError::*; match value { TypeMismatch => Self::TypeMismatch(()), @@ -334,7 +334,7 @@ impl From for super::command_argumen } } -impl TryFrom<&super::command_argument_error::Kind> for sui_sdk_types::types::CommandArgumentError { +impl TryFrom<&super::command_argument_error::Kind> for sui_sdk_types::CommandArgumentError { type Error = TryFromProtoError; fn try_from(value: &super::command_argument_error::Kind) -> Result { @@ -378,9 +378,9 @@ impl TryFrom<&super::command_argument_error::Kind> for sui_sdk_types::types::Com // TypeArgumentError // -impl From for super::type_argument_error::Kind { - fn from(value: sui_sdk_types::types::TypeArgumentError) -> Self { - use sui_sdk_types::types::TypeArgumentError::*; +impl From for super::type_argument_error::Kind { + fn from(value: sui_sdk_types::TypeArgumentError) -> Self { + use sui_sdk_types::TypeArgumentError::*; match value { TypeNotFound => Self::TypeNotFound(()), @@ -389,7 +389,7 @@ impl From for super::type_argument_erro } } -impl TryFrom<&super::type_argument_error::Kind> for sui_sdk_types::types::TypeArgumentError { +impl TryFrom<&super::type_argument_error::Kind> for sui_sdk_types::TypeArgumentError { type Error = TryFromProtoError; fn try_from(value: &super::type_argument_error::Kind) -> Result { @@ -407,9 +407,9 @@ impl TryFrom<&super::type_argument_error::Kind> for sui_sdk_types::types::TypeAr // PackageUpgradeError // -impl From for super::package_upgrade_error::Kind { - fn from(value: sui_sdk_types::types::PackageUpgradeError) -> Self { - use sui_sdk_types::types::PackageUpgradeError::*; +impl From for super::package_upgrade_error::Kind { + fn from(value: sui_sdk_types::PackageUpgradeError) -> Self { + use sui_sdk_types::PackageUpgradeError::*; match value { UnableToFetchPackage { package_id } => Self::UnableToFetchPackage(package_id.into()), @@ -428,7 +428,7 @@ impl From for super::package_upgrade_ } } -impl TryFrom<&super::package_upgrade_error::Kind> for sui_sdk_types::types::PackageUpgradeError { +impl TryFrom<&super::package_upgrade_error::Kind> for sui_sdk_types::PackageUpgradeError { type Error = TryFromProtoError; fn try_from(value: &super::package_upgrade_error::Kind) -> Result { @@ -469,8 +469,8 @@ impl TryFrom<&super::package_upgrade_error::Kind> for sui_sdk_types::types::Pack // MoveLocation // -impl From for super::MoveLocation { - fn from(value: sui_sdk_types::types::MoveLocation) -> Self { +impl From for super::MoveLocation { + fn from(value: sui_sdk_types::MoveLocation) -> Self { Self { package: Some(value.package.into()), module: Some(value.module.into()), @@ -481,7 +481,7 @@ impl From for super::MoveLocation { } } -impl TryFrom<&super::MoveLocation> for sui_sdk_types::types::MoveLocation { +impl TryFrom<&super::MoveLocation> for sui_sdk_types::MoveLocation { type Error = TryFromProtoError; fn try_from(value: &super::MoveLocation) -> Result { diff --git a/crates/sui-rpc-api/src/proto/types/mod.rs b/crates/sui-rpc-api/src/proto/types/mod.rs index c0614f2a44e87..bcdd6323f3d6e 100644 --- a/crates/sui-rpc-api/src/proto/types/mod.rs +++ b/crates/sui-rpc-api/src/proto/types/mod.rs @@ -18,15 +18,15 @@ mod transaction_convert; // Address // -impl From for Address { - fn from(value: sui_sdk_types::types::Address) -> Self { +impl From for Address { + fn from(value: sui_sdk_types::Address) -> Self { Self { address: Some(value.as_bytes().to_vec().into()), } } } -impl TryFrom<&Address> for sui_sdk_types::types::Address { +impl TryFrom<&Address> for sui_sdk_types::Address { type Error = TryFromProtoError; fn try_from(Address { address }: &Address) -> Result { @@ -44,15 +44,15 @@ impl TryFrom<&Address> for sui_sdk_types::types::Address { // ObjectId // -impl From for ObjectId { - fn from(value: sui_sdk_types::types::ObjectId) -> Self { +impl From for ObjectId { + fn from(value: sui_sdk_types::ObjectId) -> Self { Self { object_id: Some(value.as_bytes().to_vec().into()), } } } -impl TryFrom<&ObjectId> for sui_sdk_types::types::ObjectId { +impl TryFrom<&ObjectId> for sui_sdk_types::ObjectId { type Error = TryFromProtoError; fn try_from(ObjectId { object_id }: &ObjectId) -> Result { @@ -70,15 +70,15 @@ impl TryFrom<&ObjectId> for sui_sdk_types::types::ObjectId { // Digest // -impl From for Digest { - fn from(value: sui_sdk_types::types::Digest) -> Self { +impl From for Digest { + fn from(value: sui_sdk_types::Digest) -> Self { Self { digest: Some(value.as_bytes().to_vec().into()), } } } -impl TryFrom<&Digest> for sui_sdk_types::types::Digest { +impl TryFrom<&Digest> for sui_sdk_types::Digest { type Error = TryFromProtoError; fn try_from(Digest { digest }: &Digest) -> Result { @@ -94,17 +94,17 @@ impl TryFrom<&Digest> for sui_sdk_types::types::Digest { macro_rules! impl_digest_proto { ($t:ident) => { - impl From for Digest { - fn from(value: sui_sdk_types::types::$t) -> Self { - sui_sdk_types::types::Digest::from(value).into() + impl From for Digest { + fn from(value: sui_sdk_types::$t) -> Self { + sui_sdk_types::Digest::from(value).into() } } - impl TryFrom<&Digest> for sui_sdk_types::types::$t { + impl TryFrom<&Digest> for sui_sdk_types::$t { type Error = TryFromProtoError; fn try_from(digest: &Digest) -> Result { - sui_sdk_types::types::Digest::try_from(digest).map(Into::into) + sui_sdk_types::Digest::try_from(digest).map(Into::into) } } }; diff --git a/crates/sui-rpc-api/src/proto/types/move_types.rs b/crates/sui-rpc-api/src/proto/types/move_types.rs index 5d704fa94e06b..82d12acb892eb 100644 --- a/crates/sui-rpc-api/src/proto/types/move_types.rs +++ b/crates/sui-rpc-api/src/proto/types/move_types.rs @@ -5,15 +5,15 @@ use tap::Pipe; // Identifier // -impl From for super::Identifier { - fn from(value: sui_sdk_types::types::Identifier) -> Self { +impl From for super::Identifier { + fn from(value: sui_sdk_types::Identifier) -> Self { Self { identifier: Some(value.into_inner().into()), } } } -impl TryFrom<&super::Identifier> for sui_sdk_types::types::Identifier { +impl TryFrom<&super::Identifier> for sui_sdk_types::Identifier { type Error = TryFromProtoError; fn try_from(value: &super::Identifier) -> Result { @@ -30,8 +30,8 @@ impl TryFrom<&super::Identifier> for sui_sdk_types::types::Identifier { // StructTag // -impl From for super::StructTag { - fn from(value: sui_sdk_types::types::StructTag) -> Self { +impl From for super::StructTag { + fn from(value: sui_sdk_types::StructTag) -> Self { Self { address: Some(value.address.into()), module: Some(value.module.into()), @@ -41,7 +41,7 @@ impl From for super::StructTag { } } -impl TryFrom<&super::StructTag> for sui_sdk_types::types::StructTag { +impl TryFrom<&super::StructTag> for sui_sdk_types::StructTag { type Error = TryFromProtoError; fn try_from(value: &super::StructTag) -> Result { @@ -79,10 +79,10 @@ impl TryFrom<&super::StructTag> for sui_sdk_types::types::StructTag { // TypeTag // -impl From for super::TypeTag { - fn from(value: sui_sdk_types::types::TypeTag) -> Self { +impl From for super::TypeTag { + fn from(value: sui_sdk_types::TypeTag) -> Self { use super::type_tag::Tag; - use sui_sdk_types::types::TypeTag; + use sui_sdk_types::TypeTag; let tag = match value { TypeTag::U8 => Tag::U8(()), @@ -102,7 +102,7 @@ impl From for super::TypeTag { } } -impl TryFrom<&super::TypeTag> for sui_sdk_types::types::TypeTag { +impl TryFrom<&super::TypeTag> for sui_sdk_types::TypeTag { type Error = TryFromProtoError; fn try_from(value: &super::TypeTag) -> Result { diff --git a/crates/sui-rpc-api/src/proto/types/object.rs b/crates/sui-rpc-api/src/proto/types/object.rs index 6a7f434d40a0b..db2180cf372ce 100644 --- a/crates/sui-rpc-api/src/proto/types/object.rs +++ b/crates/sui-rpc-api/src/proto/types/object.rs @@ -5,8 +5,8 @@ use tap::Pipe; // ObjectReference // -impl From for super::ObjectReference { - fn from(value: sui_sdk_types::types::ObjectReference) -> Self { +impl From for super::ObjectReference { + fn from(value: sui_sdk_types::ObjectReference) -> Self { let (object_id, version, digest) = value.into_parts(); Self { object_id: Some(object_id.into()), @@ -16,7 +16,7 @@ impl From for super::ObjectReference { } } -impl TryFrom<&super::ObjectReference> for sui_sdk_types::types::ObjectReference { +impl TryFrom<&super::ObjectReference> for sui_sdk_types::ObjectReference { type Error = TryFromProtoError; fn try_from(value: &super::ObjectReference) -> Result { @@ -44,8 +44,8 @@ impl TryFrom<&super::ObjectReference> for sui_sdk_types::types::ObjectReference // Object // -impl From for super::Object { - fn from(value: sui_sdk_types::types::Object) -> Self { +impl From for super::Object { + fn from(value: sui_sdk_types::Object) -> Self { Self { object_id: Some(value.object_id().into()), version: Some(value.version()), @@ -57,7 +57,7 @@ impl From for super::Object { } } -impl TryFrom<&super::Object> for sui_sdk_types::types::Object { +impl TryFrom<&super::Object> for sui_sdk_types::Object { type Error = TryFromProtoError; fn try_from(value: &super::Object) -> Result { @@ -94,10 +94,10 @@ impl TryFrom<&super::Object> for sui_sdk_types::types::Object { // Owner // -impl From for super::Owner { - fn from(value: sui_sdk_types::types::Owner) -> Self { +impl From for super::Owner { + fn from(value: sui_sdk_types::Owner) -> Self { use super::owner::Kind; - use sui_sdk_types::types::Owner::*; + use sui_sdk_types::Owner::*; let kind = match value { Address(address) => Kind::Address(address.into()), @@ -110,7 +110,7 @@ impl From for super::Owner { } } -impl TryFrom<&super::Owner> for sui_sdk_types::types::Owner { +impl TryFrom<&super::Owner> for sui_sdk_types::Owner { type Error = TryFromProtoError; fn try_from(value: &super::Owner) -> Result { @@ -134,10 +134,10 @@ impl TryFrom<&super::Owner> for sui_sdk_types::types::Owner { // ObjectData // -impl From for super::ObjectData { - fn from(value: sui_sdk_types::types::ObjectData) -> Self { +impl From for super::ObjectData { + fn from(value: sui_sdk_types::ObjectData) -> Self { use super::object_data::Kind; - use sui_sdk_types::types::ObjectData::*; + use sui_sdk_types::ObjectData::*; let kind = match value { Struct(s) => Kind::Struct(s.into()), @@ -148,7 +148,7 @@ impl From for super::ObjectData { } } -impl TryFrom<&super::ObjectData> for sui_sdk_types::types::ObjectData { +impl TryFrom<&super::ObjectData> for sui_sdk_types::ObjectData { type Error = TryFromProtoError; fn try_from(value: &super::ObjectData) -> Result { @@ -170,8 +170,8 @@ impl TryFrom<&super::ObjectData> for sui_sdk_types::types::ObjectData { // MoveStruct // -impl From for super::MoveStruct { - fn from(value: sui_sdk_types::types::MoveStruct) -> Self { +impl From for super::MoveStruct { + fn from(value: sui_sdk_types::MoveStruct) -> Self { Self { object_id: Some(value.object_id().into()), object_type: Some(value.object_type().to_owned().into()), @@ -182,7 +182,7 @@ impl From for super::MoveStruct { } } -impl TryFrom<&super::MoveStruct> for sui_sdk_types::types::MoveStruct { +impl TryFrom<&super::MoveStruct> for sui_sdk_types::MoveStruct { type Error = TryFromProtoError; fn try_from( @@ -216,8 +216,8 @@ impl TryFrom<&super::MoveStruct> for sui_sdk_types::types::MoveStruct { // MovePackage // -impl From for super::MovePackage { - fn from(value: sui_sdk_types::types::MovePackage) -> Self { +impl From for super::MovePackage { + fn from(value: sui_sdk_types::MovePackage) -> Self { let modules = value .modules .into_iter() @@ -239,7 +239,7 @@ impl From for super::MovePackage { .map( |( original_id, - sui_sdk_types::types::UpgradeInfo { + sui_sdk_types::UpgradeInfo { upgraded_id, upgraded_version, }, @@ -263,7 +263,7 @@ impl From for super::MovePackage { } } -impl TryFrom<&super::MovePackage> for sui_sdk_types::types::MovePackage { +impl TryFrom<&super::MovePackage> for sui_sdk_types::MovePackage { type Error = TryFromProtoError; fn try_from(value: &super::MovePackage) -> Result { @@ -320,7 +320,7 @@ impl TryFrom<&super::MovePackage> for sui_sdk_types::types::MovePackage { Ok(( original_id, - sui_sdk_types::types::UpgradeInfo { + sui_sdk_types::UpgradeInfo { upgraded_id, upgraded_version, }, @@ -346,8 +346,8 @@ impl TryFrom<&super::MovePackage> for sui_sdk_types::types::MovePackage { // TypeOrigin // -impl From for super::TypeOrigin { - fn from(value: sui_sdk_types::types::TypeOrigin) -> Self { +impl From for super::TypeOrigin { + fn from(value: sui_sdk_types::TypeOrigin) -> Self { Self { module_name: Some(value.module_name.into()), struct_name: Some(value.struct_name.into()), @@ -356,7 +356,7 @@ impl From for super::TypeOrigin { } } -impl TryFrom<&super::TypeOrigin> for sui_sdk_types::types::TypeOrigin { +impl TryFrom<&super::TypeOrigin> for sui_sdk_types::TypeOrigin { type Error = TryFromProtoError; fn try_from(value: &super::TypeOrigin) -> Result { @@ -390,8 +390,8 @@ impl TryFrom<&super::TypeOrigin> for sui_sdk_types::types::TypeOrigin { // GenesisObject // -impl From for super::GenesisObject { - fn from(value: sui_sdk_types::types::GenesisObject) -> Self { +impl From for super::GenesisObject { + fn from(value: sui_sdk_types::GenesisObject) -> Self { Self { object_id: Some(value.object_id().into()), version: Some(value.version()), @@ -401,7 +401,7 @@ impl From for super::GenesisObject { } } -impl TryFrom<&super::GenesisObject> for sui_sdk_types::types::GenesisObject { +impl TryFrom<&super::GenesisObject> for sui_sdk_types::GenesisObject { type Error = TryFromProtoError; fn try_from(value: &super::GenesisObject) -> Result { diff --git a/crates/sui-rpc-api/src/proto/types/signatures.rs b/crates/sui-rpc-api/src/proto/types/signatures.rs index 8996e84b801a6..e38763502a2f7 100644 --- a/crates/sui-rpc-api/src/proto/types/signatures.rs +++ b/crates/sui-rpc-api/src/proto/types/signatures.rs @@ -6,10 +6,8 @@ use tap::Pipe; // ValidatorAggregatedSignature // -impl From - for super::ValidatorAggregatedSignature -{ - fn from(value: sui_sdk_types::types::ValidatorAggregatedSignature) -> Self { +impl From for super::ValidatorAggregatedSignature { + fn from(value: sui_sdk_types::ValidatorAggregatedSignature) -> Self { Self { epoch: Some(value.epoch), signature: Some(value.signature.as_bytes().to_vec().into()), @@ -18,9 +16,7 @@ impl From } } -impl TryFrom<&super::ValidatorAggregatedSignature> - for sui_sdk_types::types::ValidatorAggregatedSignature -{ +impl TryFrom<&super::ValidatorAggregatedSignature> for sui_sdk_types::ValidatorAggregatedSignature { type Error = TryFromProtoError; fn try_from(value: &super::ValidatorAggregatedSignature) -> Result { @@ -32,7 +28,7 @@ impl TryFrom<&super::ValidatorAggregatedSignature> .as_ref() .ok_or_else(|| TryFromProtoError::missing("signature"))? .as_ref() - .pipe(sui_sdk_types::types::Bls12381Signature::from_bytes) + .pipe(sui_sdk_types::Bls12381Signature::from_bytes) .map_err(TryFromProtoError::from_error)?; let bitmap = value .bitmap @@ -88,8 +84,8 @@ impl TryFrom<&super::RoaringBitmap> for roaring::RoaringBitmap { // ValidatorCommitteeMember // -impl From for super::ValidatorCommitteeMember { - fn from(value: sui_sdk_types::types::ValidatorCommitteeMember) -> Self { +impl From for super::ValidatorCommitteeMember { + fn from(value: sui_sdk_types::ValidatorCommitteeMember) -> Self { Self { public_key: Some(value.public_key.as_bytes().to_vec().into()), stake: Some(value.stake), @@ -97,7 +93,7 @@ impl From for super::ValidatorCo } } -impl TryFrom<&super::ValidatorCommitteeMember> for sui_sdk_types::types::ValidatorCommitteeMember { +impl TryFrom<&super::ValidatorCommitteeMember> for sui_sdk_types::ValidatorCommitteeMember { type Error = TryFromProtoError; fn try_from( @@ -107,7 +103,7 @@ impl TryFrom<&super::ValidatorCommitteeMember> for sui_sdk_types::types::Validat .as_ref() .ok_or_else(|| TryFromProtoError::missing("public_key"))? .as_ref() - .pipe(sui_sdk_types::types::Bls12381PublicKey::from_bytes) + .pipe(sui_sdk_types::Bls12381PublicKey::from_bytes) .map_err(TryFromProtoError::from_error)?; let stake = stake.ok_or_else(|| TryFromProtoError::missing("stake"))?; Ok(Self { public_key, stake }) @@ -118,8 +114,8 @@ impl TryFrom<&super::ValidatorCommitteeMember> for sui_sdk_types::types::Validat // ValidatorCommittee // -impl From for super::ValidatorCommittee { - fn from(value: sui_sdk_types::types::ValidatorCommittee) -> Self { +impl From for super::ValidatorCommittee { + fn from(value: sui_sdk_types::ValidatorCommittee) -> Self { Self { epoch: Some(value.epoch), members: value.members.into_iter().map(Into::into).collect(), @@ -127,7 +123,7 @@ impl From for super::ValidatorCommitte } } -impl TryFrom<&super::ValidatorCommittee> for sui_sdk_types::types::ValidatorCommittee { +impl TryFrom<&super::ValidatorCommittee> for sui_sdk_types::ValidatorCommittee { type Error = TryFromProtoError; fn try_from(value: &super::ValidatorCommittee) -> Result { @@ -149,15 +145,15 @@ impl TryFrom<&super::ValidatorCommittee> for sui_sdk_types::types::ValidatorComm // Bn254FieldElement // -impl From for super::Bn254FieldElement { - fn from(value: sui_sdk_types::types::Bn254FieldElement) -> Self { +impl From for super::Bn254FieldElement { + fn from(value: sui_sdk_types::Bn254FieldElement) -> Self { Self { element: Some(value.padded().to_vec().into()), } } } -impl TryFrom<&super::Bn254FieldElement> for sui_sdk_types::types::Bn254FieldElement { +impl TryFrom<&super::Bn254FieldElement> for sui_sdk_types::Bn254FieldElement { type Error = TryFromProtoError; fn try_from(value: &super::Bn254FieldElement) -> Result { @@ -177,8 +173,8 @@ impl TryFrom<&super::Bn254FieldElement> for sui_sdk_types::types::Bn254FieldElem // CircomG1 // -impl From for super::CircomG1 { - fn from(value: sui_sdk_types::types::CircomG1) -> Self { +impl From for super::CircomG1 { + fn from(value: sui_sdk_types::CircomG1) -> Self { let [e0, e1, e2] = value.0; Self { @@ -189,7 +185,7 @@ impl From for super::CircomG1 { } } -impl TryFrom<&super::CircomG1> for sui_sdk_types::types::CircomG1 { +impl TryFrom<&super::CircomG1> for sui_sdk_types::CircomG1 { type Error = TryFromProtoError; fn try_from(value: &super::CircomG1) -> Result { @@ -217,8 +213,8 @@ impl TryFrom<&super::CircomG1> for sui_sdk_types::types::CircomG1 { // CircomG2 // -impl From for super::CircomG2 { - fn from(value: sui_sdk_types::types::CircomG2) -> Self { +impl From for super::CircomG2 { + fn from(value: sui_sdk_types::CircomG2) -> Self { let [[e00, e01], [e10, e11], [e20, e21]] = value.0; Self { @@ -232,7 +228,7 @@ impl From for super::CircomG2 { } } -impl TryFrom<&super::CircomG2> for sui_sdk_types::types::CircomG2 { +impl TryFrom<&super::CircomG2> for sui_sdk_types::CircomG2 { type Error = TryFromProtoError; fn try_from(value: &super::CircomG2) -> Result { @@ -277,10 +273,8 @@ impl TryFrom<&super::CircomG2> for sui_sdk_types::types::CircomG2 { // ZkLoginClaim // -impl From for super::ZkLoginClaim { - fn from( - sui_sdk_types::types::Claim { value, index_mod_4 }: sui_sdk_types::types::Claim, - ) -> Self { +impl From for super::ZkLoginClaim { + fn from(sui_sdk_types::Claim { value, index_mod_4 }: sui_sdk_types::Claim) -> Self { Self { value: Some(value), index_mod_4: Some(index_mod_4.into()), @@ -288,7 +282,7 @@ impl From for super::ZkLoginClaim { } } -impl TryFrom<&super::ZkLoginClaim> for sui_sdk_types::types::Claim { +impl TryFrom<&super::ZkLoginClaim> for sui_sdk_types::Claim { type Error = TryFromProtoError; fn try_from( @@ -310,8 +304,8 @@ impl TryFrom<&super::ZkLoginClaim> for sui_sdk_types::types::Claim { // ZkLoginProof // -impl From for super::ZkLoginProof { - fn from(value: sui_sdk_types::types::ZkLoginProof) -> Self { +impl From for super::ZkLoginProof { + fn from(value: sui_sdk_types::ZkLoginProof) -> Self { Self { a: Some(value.a.into()), b: Some(value.b.into()), @@ -320,7 +314,7 @@ impl From for super::ZkLoginProof { } } -impl TryFrom<&super::ZkLoginProof> for sui_sdk_types::types::ZkLoginProof { +impl TryFrom<&super::ZkLoginProof> for sui_sdk_types::ZkLoginProof { type Error = TryFromProtoError; fn try_from(value: &super::ZkLoginProof) -> Result { @@ -348,14 +342,14 @@ impl TryFrom<&super::ZkLoginProof> for sui_sdk_types::types::ZkLoginProof { // ZkLoginInputs // -impl From for super::ZkLoginInputs { +impl From for super::ZkLoginInputs { fn from( - sui_sdk_types::types::ZkLoginInputs { + sui_sdk_types::ZkLoginInputs { proof_points, iss_base64_details, header_base64, address_seed, - }: sui_sdk_types::types::ZkLoginInputs, + }: sui_sdk_types::ZkLoginInputs, ) -> Self { Self { proof_points: Some(proof_points.into()), @@ -366,7 +360,7 @@ impl From for super::ZkLoginInputs { } } -impl TryFrom<&super::ZkLoginInputs> for sui_sdk_types::types::ZkLoginInputs { +impl TryFrom<&super::ZkLoginInputs> for sui_sdk_types::ZkLoginInputs { type Error = TryFromProtoError; fn try_from(value: &super::ZkLoginInputs) -> Result { @@ -404,8 +398,8 @@ impl TryFrom<&super::ZkLoginInputs> for sui_sdk_types::types::ZkLoginInputs { // ZkLoginAuthenticator // -impl From for super::ZkLoginAuthenticator { - fn from(value: sui_sdk_types::types::ZkLoginAuthenticator) -> Self { +impl From for super::ZkLoginAuthenticator { + fn from(value: sui_sdk_types::ZkLoginAuthenticator) -> Self { Self { inputs: Some(value.inputs.into()), max_epoch: Some(value.max_epoch), @@ -414,7 +408,7 @@ impl From for super::ZkLoginAuthenti } } -impl TryFrom<&super::ZkLoginAuthenticator> for sui_sdk_types::types::ZkLoginAuthenticator { +impl TryFrom<&super::ZkLoginAuthenticator> for sui_sdk_types::ZkLoginAuthenticator { type Error = TryFromProtoError; fn try_from(value: &super::ZkLoginAuthenticator) -> Result { @@ -444,8 +438,8 @@ impl TryFrom<&super::ZkLoginAuthenticator> for sui_sdk_types::types::ZkLoginAuth // ZkLoginPublicIdentifier // -impl From<&sui_sdk_types::types::ZkLoginPublicIdentifier> for super::ZkLoginPublicIdentifier { - fn from(value: &sui_sdk_types::types::ZkLoginPublicIdentifier) -> Self { +impl From<&sui_sdk_types::ZkLoginPublicIdentifier> for super::ZkLoginPublicIdentifier { + fn from(value: &sui_sdk_types::ZkLoginPublicIdentifier) -> Self { Self { iss: Some(value.iss().to_owned()), address_seed: Some(value.address_seed().to_owned().into()), @@ -453,7 +447,7 @@ impl From<&sui_sdk_types::types::ZkLoginPublicIdentifier> for super::ZkLoginPubl } } -impl TryFrom<&super::ZkLoginPublicIdentifier> for sui_sdk_types::types::ZkLoginPublicIdentifier { +impl TryFrom<&super::ZkLoginPublicIdentifier> for sui_sdk_types::ZkLoginPublicIdentifier { type Error = TryFromProtoError; fn try_from(value: &super::ZkLoginPublicIdentifier) -> Result { @@ -478,9 +472,9 @@ impl TryFrom<&super::ZkLoginPublicIdentifier> for sui_sdk_types::types::ZkLoginP // SignatureScheme // -impl From for super::SignatureScheme { - fn from(value: sui_sdk_types::types::SignatureScheme) -> Self { - use sui_sdk_types::types::SignatureScheme::*; +impl From for super::SignatureScheme { + fn from(value: sui_sdk_types::SignatureScheme) -> Self { + use sui_sdk_types::SignatureScheme::*; match value { Ed25519 => Self::Ed25519, @@ -494,7 +488,7 @@ impl From for super::SignatureScheme { } } -impl TryFrom<&super::SignatureScheme> for sui_sdk_types::types::SignatureScheme { +impl TryFrom<&super::SignatureScheme> for sui_sdk_types::SignatureScheme { type Error = TryFromProtoError; fn try_from(value: &super::SignatureScheme) -> Result { @@ -522,19 +516,19 @@ impl TryFrom<&super::SignatureScheme> for sui_sdk_types::types::SignatureScheme // SimpleSignature // -impl From for super::SimpleSignature { - fn from(value: sui_sdk_types::types::SimpleSignature) -> Self { +impl From for super::SimpleSignature { + fn from(value: sui_sdk_types::SimpleSignature) -> Self { let scheme: super::SignatureScheme = value.scheme().into(); let (signature, public_key) = match &value { - sui_sdk_types::types::SimpleSignature::Ed25519 { + sui_sdk_types::SimpleSignature::Ed25519 { signature, public_key, } => (signature.as_bytes(), public_key.as_bytes()), - sui_sdk_types::types::SimpleSignature::Secp256k1 { + sui_sdk_types::SimpleSignature::Secp256k1 { signature, public_key, } => (signature.as_bytes(), public_key.as_bytes()), - sui_sdk_types::types::SimpleSignature::Secp256r1 { + sui_sdk_types::SimpleSignature::Secp256r1 { signature, public_key, } => (signature.as_bytes(), public_key.as_bytes()), @@ -548,13 +542,13 @@ impl From for super::SimpleSignature { } } -impl TryFrom<&super::SimpleSignature> for sui_sdk_types::types::SimpleSignature { +impl TryFrom<&super::SimpleSignature> for sui_sdk_types::SimpleSignature { type Error = TryFromProtoError; fn try_from(value: &super::SimpleSignature) -> Result { use super::SignatureScheme::*; - use sui_sdk_types::types::{Ed25519PublicKey, Ed25519Signature}; - use sui_sdk_types::types::{ + use sui_sdk_types::{Ed25519PublicKey, Ed25519Signature}; + use sui_sdk_types::{ Secp256k1PublicKey, Secp256k1Signature, Secp256r1PublicKey, Secp256r1Signature, }; @@ -594,8 +588,8 @@ impl TryFrom<&super::SimpleSignature> for sui_sdk_types::types::SimpleSignature // PasskeyAuthenticator // -impl From for super::PasskeyAuthenticator { - fn from(value: sui_sdk_types::types::PasskeyAuthenticator) -> Self { +impl From for super::PasskeyAuthenticator { + fn from(value: sui_sdk_types::PasskeyAuthenticator) -> Self { Self { authenticator_data: Some(value.authenticator_data().to_vec().into()), client_data_json: Some(value.client_data_json().to_owned()), @@ -604,7 +598,7 @@ impl From for super::PasskeyAuthenti } } -impl TryFrom<&super::PasskeyAuthenticator> for sui_sdk_types::types::PasskeyAuthenticator { +impl TryFrom<&super::PasskeyAuthenticator> for sui_sdk_types::PasskeyAuthenticator { type Error = TryFromProtoError; fn try_from(value: &super::PasskeyAuthenticator) -> Result { @@ -634,10 +628,10 @@ impl TryFrom<&super::PasskeyAuthenticator> for sui_sdk_types::types::PasskeyAuth // MultisigMemberPublicKey // -impl From<&sui_sdk_types::types::MultisigMemberPublicKey> for super::MultisigMemberPublicKey { - fn from(value: &sui_sdk_types::types::MultisigMemberPublicKey) -> Self { +impl From<&sui_sdk_types::MultisigMemberPublicKey> for super::MultisigMemberPublicKey { + fn from(value: &sui_sdk_types::MultisigMemberPublicKey) -> Self { use super::multisig_member_public_key::Scheme; - use sui_sdk_types::types::MultisigMemberPublicKey::*; + use sui_sdk_types::MultisigMemberPublicKey::*; let scheme = match value { Ed25519(public_key) => Scheme::Ed25519(public_key.as_bytes().to_vec().into()), @@ -652,12 +646,12 @@ impl From<&sui_sdk_types::types::MultisigMemberPublicKey> for super::MultisigMem } } -impl TryFrom<&super::MultisigMemberPublicKey> for sui_sdk_types::types::MultisigMemberPublicKey { +impl TryFrom<&super::MultisigMemberPublicKey> for sui_sdk_types::MultisigMemberPublicKey { type Error = TryFromProtoError; fn try_from(value: &super::MultisigMemberPublicKey) -> Result { use super::multisig_member_public_key::Scheme; - use sui_sdk_types::types::{Ed25519PublicKey, Secp256k1PublicKey, Secp256r1PublicKey}; + use sui_sdk_types::{Ed25519PublicKey, Secp256k1PublicKey, Secp256r1PublicKey}; match value .scheme @@ -681,8 +675,8 @@ impl TryFrom<&super::MultisigMemberPublicKey> for sui_sdk_types::types::Multisig // MultisigMember // -impl From<&sui_sdk_types::types::MultisigMember> for super::MultisigMember { - fn from(value: &sui_sdk_types::types::MultisigMember) -> Self { +impl From<&sui_sdk_types::MultisigMember> for super::MultisigMember { + fn from(value: &sui_sdk_types::MultisigMember) -> Self { Self { public_key: Some(value.public_key().into()), weight: Some(value.weight().into()), @@ -690,7 +684,7 @@ impl From<&sui_sdk_types::types::MultisigMember> for super::MultisigMember { } } -impl TryFrom<&super::MultisigMember> for sui_sdk_types::types::MultisigMember { +impl TryFrom<&super::MultisigMember> for sui_sdk_types::MultisigMember { type Error = TryFromProtoError; fn try_from(value: &super::MultisigMember) -> Result { @@ -712,8 +706,8 @@ impl TryFrom<&super::MultisigMember> for sui_sdk_types::types::MultisigMember { // MultisigCommittee // -impl From<&sui_sdk_types::types::MultisigCommittee> for super::MultisigCommittee { - fn from(value: &sui_sdk_types::types::MultisigCommittee) -> Self { +impl From<&sui_sdk_types::MultisigCommittee> for super::MultisigCommittee { + fn from(value: &sui_sdk_types::MultisigCommittee) -> Self { Self { members: value.members().iter().map(Into::into).collect(), threshold: Some(value.threshold().into()), @@ -721,7 +715,7 @@ impl From<&sui_sdk_types::types::MultisigCommittee> for super::MultisigCommittee } } -impl TryFrom<&super::MultisigCommittee> for sui_sdk_types::types::MultisigCommittee { +impl TryFrom<&super::MultisigCommittee> for sui_sdk_types::MultisigCommittee { type Error = TryFromProtoError; fn try_from(value: &super::MultisigCommittee) -> Result { @@ -743,10 +737,10 @@ impl TryFrom<&super::MultisigCommittee> for sui_sdk_types::types::MultisigCommit // MultisigMemberSignature // -impl From<&sui_sdk_types::types::MultisigMemberSignature> for super::MultisigMemberSignature { - fn from(value: &sui_sdk_types::types::MultisigMemberSignature) -> Self { +impl From<&sui_sdk_types::MultisigMemberSignature> for super::MultisigMemberSignature { + fn from(value: &sui_sdk_types::MultisigMemberSignature) -> Self { use super::multisig_member_signature::Signature; - use sui_sdk_types::types::MultisigMemberSignature::*; + use sui_sdk_types::MultisigMemberSignature::*; let signature = match value { Ed25519(signautre) => Signature::Ed25519(signautre.as_bytes().to_vec().into()), @@ -761,12 +755,12 @@ impl From<&sui_sdk_types::types::MultisigMemberSignature> for super::MultisigMem } } -impl TryFrom<&super::MultisigMemberSignature> for sui_sdk_types::types::MultisigMemberSignature { +impl TryFrom<&super::MultisigMemberSignature> for sui_sdk_types::MultisigMemberSignature { type Error = TryFromProtoError; fn try_from(value: &super::MultisigMemberSignature) -> Result { use super::multisig_member_signature::Signature; - use sui_sdk_types::types::{Ed25519Signature, Secp256k1Signature, Secp256r1Signature}; + use sui_sdk_types::{Ed25519Signature, Secp256k1Signature, Secp256r1Signature}; match value .signature @@ -792,10 +786,8 @@ impl TryFrom<&super::MultisigMemberSignature> for sui_sdk_types::types::Multisig // MultisigAggregatedSignature // -impl From<&sui_sdk_types::types::MultisigAggregatedSignature> - for super::MultisigAggregatedSignature -{ - fn from(value: &sui_sdk_types::types::MultisigAggregatedSignature) -> Self { +impl From<&sui_sdk_types::MultisigAggregatedSignature> for super::MultisigAggregatedSignature { + fn from(value: &sui_sdk_types::MultisigAggregatedSignature) -> Self { Self { signatures: value.signatures().iter().map(Into::into).collect(), bitmap: Some(value.bitmap().into()), @@ -805,9 +797,7 @@ impl From<&sui_sdk_types::types::MultisigAggregatedSignature> } } -impl TryFrom<&super::MultisigAggregatedSignature> - for sui_sdk_types::types::MultisigAggregatedSignature -{ +impl TryFrom<&super::MultisigAggregatedSignature> for sui_sdk_types::MultisigAggregatedSignature { type Error = TryFromProtoError; fn try_from(value: &super::MultisigAggregatedSignature) -> Result { @@ -845,10 +835,10 @@ impl TryFrom<&super::MultisigAggregatedSignature> // UserSignature // -impl From for super::UserSignature { - fn from(value: sui_sdk_types::types::UserSignature) -> Self { +impl From for super::UserSignature { + fn from(value: sui_sdk_types::UserSignature) -> Self { use super::user_signature::Signature; - use sui_sdk_types::types::UserSignature::*; + use sui_sdk_types::UserSignature::*; let signature = match value { Simple(simple) => Signature::Simple(simple.into()), @@ -863,7 +853,7 @@ impl From for super::UserSignature { } } -impl TryFrom<&super::UserSignature> for sui_sdk_types::types::UserSignature { +impl TryFrom<&super::UserSignature> for sui_sdk_types::UserSignature { type Error = TryFromProtoError; fn try_from(value: &super::UserSignature) -> Result { diff --git a/crates/sui-rpc-api/src/proto/types/transaction_convert.rs b/crates/sui-rpc-api/src/proto/types/transaction_convert.rs index 38914a2433dd1..35769850d20b9 100644 --- a/crates/sui-rpc-api/src/proto/types/transaction_convert.rs +++ b/crates/sui-rpc-api/src/proto/types/transaction_convert.rs @@ -5,8 +5,8 @@ use tap::Pipe; // Transaction // -impl From for super::Transaction { - fn from(value: sui_sdk_types::types::Transaction) -> Self { +impl From for super::Transaction { + fn from(value: sui_sdk_types::Transaction) -> Self { let version = super::transaction::Version::V1(value.into()); Self { @@ -15,7 +15,7 @@ impl From for super::Transaction { } } -impl TryFrom<&super::Transaction> for sui_sdk_types::types::Transaction { +impl TryFrom<&super::Transaction> for sui_sdk_types::Transaction { type Error = TryFromProtoError; fn try_from(value: &super::Transaction) -> Result { @@ -34,8 +34,8 @@ impl TryFrom<&super::Transaction> for sui_sdk_types::types::Transaction { // TransactionV1 // -impl From for super::transaction::TransactionV1 { - fn from(value: sui_sdk_types::types::Transaction) -> Self { +impl From for super::transaction::TransactionV1 { + fn from(value: sui_sdk_types::Transaction) -> Self { Self { kind: Some(value.kind.into()), sender: Some(value.sender.into()), @@ -45,7 +45,7 @@ impl From for super::transaction::Transaction } } -impl TryFrom<&super::transaction::TransactionV1> for sui_sdk_types::types::Transaction { +impl TryFrom<&super::transaction::TransactionV1> for sui_sdk_types::Transaction { type Error = TryFromProtoError; fn try_from(value: &super::transaction::TransactionV1) -> Result { @@ -86,8 +86,8 @@ impl TryFrom<&super::transaction::TransactionV1> for sui_sdk_types::types::Trans // GasPayment // -impl From for super::GasPayment { - fn from(value: sui_sdk_types::types::GasPayment) -> Self { +impl From for super::GasPayment { + fn from(value: sui_sdk_types::GasPayment) -> Self { Self { objects: value.objects.into_iter().map(Into::into).collect(), owner: Some(value.owner.into()), @@ -97,7 +97,7 @@ impl From for super::GasPayment { } } -impl TryFrom<&super::GasPayment> for sui_sdk_types::types::GasPayment { +impl TryFrom<&super::GasPayment> for sui_sdk_types::GasPayment { type Error = TryFromProtoError; fn try_from(value: &super::GasPayment) -> Result { @@ -131,10 +131,10 @@ impl TryFrom<&super::GasPayment> for sui_sdk_types::types::GasPayment { // TransactionExpiration // -impl From for super::TransactionExpiration { - fn from(value: sui_sdk_types::types::TransactionExpiration) -> Self { +impl From for super::TransactionExpiration { + fn from(value: sui_sdk_types::TransactionExpiration) -> Self { use super::transaction_expiration::Expiration; - use sui_sdk_types::types::TransactionExpiration::*; + use sui_sdk_types::TransactionExpiration::*; let expiration = match value { None => Expiration::None(()), @@ -147,7 +147,7 @@ impl From for super::TransactionExp } } -impl TryFrom<&super::TransactionExpiration> for sui_sdk_types::types::TransactionExpiration { +impl TryFrom<&super::TransactionExpiration> for sui_sdk_types::TransactionExpiration { type Error = TryFromProtoError; fn try_from(value: &super::TransactionExpiration) -> Result { @@ -169,10 +169,10 @@ impl TryFrom<&super::TransactionExpiration> for sui_sdk_types::types::Transactio // TransactionKind // -impl From for super::TransactionKind { - fn from(value: sui_sdk_types::types::TransactionKind) -> Self { +impl From for super::TransactionKind { + fn from(value: sui_sdk_types::TransactionKind) -> Self { use super::transaction_kind::Kind; - use sui_sdk_types::types::TransactionKind::*; + use sui_sdk_types::TransactionKind::*; let kind = match value { ProgrammableTransaction(ptb) => Kind::ProgrammableTransaction(ptb.into()), @@ -192,7 +192,7 @@ impl From for super::TransactionKind { } } -impl TryFrom<&super::TransactionKind> for sui_sdk_types::types::TransactionKind { +impl TryFrom<&super::TransactionKind> for sui_sdk_types::TransactionKind { type Error = TryFromProtoError; fn try_from(value: &super::TransactionKind) -> Result { @@ -234,8 +234,8 @@ impl TryFrom<&super::TransactionKind> for sui_sdk_types::types::TransactionKind // ConsensusCommitPrologue // -impl From for super::ConsensusCommitPrologue { - fn from(value: sui_sdk_types::types::ConsensusCommitPrologue) -> Self { +impl From for super::ConsensusCommitPrologue { + fn from(value: sui_sdk_types::ConsensusCommitPrologue) -> Self { Self { epoch: Some(value.epoch), round: Some(value.round), @@ -247,7 +247,7 @@ impl From for super::ConsensusCom } } -impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::types::ConsensusCommitPrologue { +impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::ConsensusCommitPrologue { type Error = TryFromProtoError; fn try_from(value: &super::ConsensusCommitPrologue) -> Result { @@ -269,8 +269,8 @@ impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::types::Consensu } } -impl From for super::ConsensusCommitPrologue { - fn from(value: sui_sdk_types::types::ConsensusCommitPrologueV2) -> Self { +impl From for super::ConsensusCommitPrologue { + fn from(value: sui_sdk_types::ConsensusCommitPrologueV2) -> Self { Self { epoch: Some(value.epoch), round: Some(value.round), @@ -282,7 +282,7 @@ impl From for super::ConsensusC } } -impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::types::ConsensusCommitPrologueV2 { +impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::ConsensusCommitPrologueV2 { type Error = TryFromProtoError; fn try_from(value: &super::ConsensusCommitPrologue) -> Result { @@ -311,8 +311,8 @@ impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::types::Consensu } } -impl From for super::ConsensusCommitPrologue { - fn from(value: sui_sdk_types::types::ConsensusCommitPrologueV3) -> Self { +impl From for super::ConsensusCommitPrologue { + fn from(value: sui_sdk_types::ConsensusCommitPrologueV3) -> Self { Self { epoch: Some(value.epoch), round: Some(value.round), @@ -326,7 +326,7 @@ impl From for super::ConsensusC } } -impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::types::ConsensusCommitPrologueV3 { +impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::ConsensusCommitPrologueV3 { type Error = TryFromProtoError; fn try_from(value: &super::ConsensusCommitPrologue) -> Result { @@ -367,12 +367,12 @@ impl TryFrom<&super::ConsensusCommitPrologue> for sui_sdk_types::types::Consensu // ConsensusDeterminedVersionAssignments // -impl From +impl From for super::ConsensusDeterminedVersionAssignments { - fn from(value: sui_sdk_types::types::ConsensusDeterminedVersionAssignments) -> Self { + fn from(value: sui_sdk_types::ConsensusDeterminedVersionAssignments) -> Self { use super::consensus_determined_version_assignments::Kind; - use sui_sdk_types::types::ConsensusDeterminedVersionAssignments::*; + use sui_sdk_types::ConsensusDeterminedVersionAssignments::*; let kind = match value { CancelledTransactions { @@ -390,7 +390,7 @@ impl From } impl TryFrom<&super::ConsensusDeterminedVersionAssignments> - for sui_sdk_types::types::ConsensusDeterminedVersionAssignments + for sui_sdk_types::ConsensusDeterminedVersionAssignments { type Error = TryFromProtoError; @@ -419,8 +419,8 @@ impl TryFrom<&super::ConsensusDeterminedVersionAssignments> // CancelledTransaction // -impl From for super::CancelledTransaction { - fn from(value: sui_sdk_types::types::CancelledTransaction) -> Self { +impl From for super::CancelledTransaction { + fn from(value: sui_sdk_types::CancelledTransaction) -> Self { Self { digest: Some(value.digest.into()), version_assignments: value @@ -432,7 +432,7 @@ impl From for super::CancelledTransa } } -impl TryFrom<&super::CancelledTransaction> for sui_sdk_types::types::CancelledTransaction { +impl TryFrom<&super::CancelledTransaction> for sui_sdk_types::CancelledTransaction { type Error = TryFromProtoError; fn try_from(value: &super::CancelledTransaction) -> Result { @@ -459,8 +459,8 @@ impl TryFrom<&super::CancelledTransaction> for sui_sdk_types::types::CancelledTr // VersionAssignment // -impl From for super::VersionAssignment { - fn from(value: sui_sdk_types::types::VersionAssignment) -> Self { +impl From for super::VersionAssignment { + fn from(value: sui_sdk_types::VersionAssignment) -> Self { Self { object_id: Some(value.object_id.into()), version: Some(value.version), @@ -468,7 +468,7 @@ impl From for super::VersionAssignment } } -impl TryFrom<&super::VersionAssignment> for sui_sdk_types::types::VersionAssignment { +impl TryFrom<&super::VersionAssignment> for sui_sdk_types::VersionAssignment { type Error = TryFromProtoError; fn try_from(value: &super::VersionAssignment) -> Result { @@ -489,15 +489,15 @@ impl TryFrom<&super::VersionAssignment> for sui_sdk_types::types::VersionAssignm // GenesisTransaction // -impl From for super::GenesisTransaction { - fn from(value: sui_sdk_types::types::GenesisTransaction) -> Self { +impl From for super::GenesisTransaction { + fn from(value: sui_sdk_types::GenesisTransaction) -> Self { Self { objects: value.objects.into_iter().map(Into::into).collect(), } } } -impl TryFrom<&super::GenesisTransaction> for sui_sdk_types::types::GenesisTransaction { +impl TryFrom<&super::GenesisTransaction> for sui_sdk_types::GenesisTransaction { type Error = TryFromProtoError; fn try_from(value: &super::GenesisTransaction) -> Result { @@ -515,8 +515,8 @@ impl TryFrom<&super::GenesisTransaction> for sui_sdk_types::types::GenesisTransa // RandomnessStateUpdate // -impl From for super::RandomnessStateUpdate { - fn from(value: sui_sdk_types::types::RandomnessStateUpdate) -> Self { +impl From for super::RandomnessStateUpdate { + fn from(value: sui_sdk_types::RandomnessStateUpdate) -> Self { Self { epoch: Some(value.epoch), randomness_round: Some(value.randomness_round), @@ -528,7 +528,7 @@ impl From for super::RandomnessStat } } -impl TryFrom<&super::RandomnessStateUpdate> for sui_sdk_types::types::RandomnessStateUpdate { +impl TryFrom<&super::RandomnessStateUpdate> for sui_sdk_types::RandomnessStateUpdate { type Error = TryFromProtoError; fn try_from( @@ -563,8 +563,8 @@ impl TryFrom<&super::RandomnessStateUpdate> for sui_sdk_types::types::Randomness // AuthenticatorStateUpdate // -impl From for super::AuthenticatorStateUpdate { - fn from(value: sui_sdk_types::types::AuthenticatorStateUpdate) -> Self { +impl From for super::AuthenticatorStateUpdate { + fn from(value: sui_sdk_types::AuthenticatorStateUpdate) -> Self { Self { epoch: Some(value.epoch), round: Some(value.round), @@ -576,7 +576,7 @@ impl From for super::Authenticat } } -impl TryFrom<&super::AuthenticatorStateUpdate> for sui_sdk_types::types::AuthenticatorStateUpdate { +impl TryFrom<&super::AuthenticatorStateUpdate> for sui_sdk_types::AuthenticatorStateUpdate { type Error = TryFromProtoError; fn try_from( @@ -609,8 +609,8 @@ impl TryFrom<&super::AuthenticatorStateUpdate> for sui_sdk_types::types::Authent // Jwk // -impl From for super::Jwk { - fn from(sui_sdk_types::types::Jwk { kty, e, n, alg }: sui_sdk_types::types::Jwk) -> Self { +impl From for super::Jwk { + fn from(sui_sdk_types::Jwk { kty, e, n, alg }: sui_sdk_types::Jwk) -> Self { Self { kty: Some(kty), e: Some(e), @@ -620,7 +620,7 @@ impl From for super::Jwk { } } -impl TryFrom<&super::Jwk> for sui_sdk_types::types::Jwk { +impl TryFrom<&super::Jwk> for sui_sdk_types::Jwk { type Error = TryFromProtoError; fn try_from(super::Jwk { kty, e, n, alg }: &super::Jwk) -> Result { @@ -648,8 +648,8 @@ impl TryFrom<&super::Jwk> for sui_sdk_types::types::Jwk { // JwkId // -impl From for super::JwkId { - fn from(sui_sdk_types::types::JwkId { iss, kid }: sui_sdk_types::types::JwkId) -> Self { +impl From for super::JwkId { + fn from(sui_sdk_types::JwkId { iss, kid }: sui_sdk_types::JwkId) -> Self { Self { iss: Some(iss), kid: Some(kid), @@ -657,7 +657,7 @@ impl From for super::JwkId { } } -impl TryFrom<&super::JwkId> for sui_sdk_types::types::JwkId { +impl TryFrom<&super::JwkId> for sui_sdk_types::JwkId { type Error = TryFromProtoError; fn try_from(super::JwkId { iss, kid }: &super::JwkId) -> Result { @@ -677,8 +677,8 @@ impl TryFrom<&super::JwkId> for sui_sdk_types::types::JwkId { // ActiveJwk // -impl From for super::ActiveJwk { - fn from(value: sui_sdk_types::types::ActiveJwk) -> Self { +impl From for super::ActiveJwk { + fn from(value: sui_sdk_types::ActiveJwk) -> Self { Self { id: Some(value.jwk_id.into()), jwk: Some(value.jwk.into()), @@ -687,7 +687,7 @@ impl From for super::ActiveJwk { } } -impl TryFrom<&super::ActiveJwk> for sui_sdk_types::types::ActiveJwk { +impl TryFrom<&super::ActiveJwk> for sui_sdk_types::ActiveJwk { type Error = TryFromProtoError; fn try_from(value: &super::ActiveJwk) -> Result { @@ -715,8 +715,8 @@ impl TryFrom<&super::ActiveJwk> for sui_sdk_types::types::ActiveJwk { // ChangeEpoch // -impl From for super::ChangeEpoch { - fn from(value: sui_sdk_types::types::ChangeEpoch) -> Self { +impl From for super::ChangeEpoch { + fn from(value: sui_sdk_types::ChangeEpoch) -> Self { Self { epoch: Some(value.epoch), protocol_version: Some(value.protocol_version), @@ -730,7 +730,7 @@ impl From for super::ChangeEpoch { } } -impl TryFrom<&super::ChangeEpoch> for sui_sdk_types::types::ChangeEpoch { +impl TryFrom<&super::ChangeEpoch> for sui_sdk_types::ChangeEpoch { type Error = TryFromProtoError; fn try_from( @@ -779,8 +779,8 @@ impl TryFrom<&super::ChangeEpoch> for sui_sdk_types::types::ChangeEpoch { // SystemPackage // -impl From for super::SystemPackage { - fn from(value: sui_sdk_types::types::SystemPackage) -> Self { +impl From for super::SystemPackage { + fn from(value: sui_sdk_types::SystemPackage) -> Self { Self { version: Some(value.version), modules: value.modules.into_iter().map(Into::into).collect(), @@ -789,7 +789,7 @@ impl From for super::SystemPackage { } } -impl TryFrom<&super::SystemPackage> for sui_sdk_types::types::SystemPackage { +impl TryFrom<&super::SystemPackage> for sui_sdk_types::SystemPackage { type Error = TryFromProtoError; fn try_from(value: &super::SystemPackage) -> Result { @@ -811,10 +811,10 @@ impl TryFrom<&super::SystemPackage> for sui_sdk_types::types::SystemPackage { // EndOfEpochTransactionkind // -impl From for super::EndOfEpochTransactionKind { - fn from(value: sui_sdk_types::types::EndOfEpochTransactionKind) -> Self { +impl From for super::EndOfEpochTransactionKind { + fn from(value: sui_sdk_types::EndOfEpochTransactionKind) -> Self { use super::end_of_epoch_transaction_kind::Kind; - use sui_sdk_types::types::EndOfEpochTransactionKind::*; + use sui_sdk_types::EndOfEpochTransactionKind::*; let kind = match value { ChangeEpoch(change_epoch) => Kind::ChangeEpoch(change_epoch.into()), @@ -832,9 +832,7 @@ impl From for super::EndOfEpoch } } -impl TryFrom<&super::EndOfEpochTransactionKind> - for sui_sdk_types::types::EndOfEpochTransactionKind -{ +impl TryFrom<&super::EndOfEpochTransactionKind> for sui_sdk_types::EndOfEpochTransactionKind { type Error = TryFromProtoError; fn try_from(value: &super::EndOfEpochTransactionKind) -> Result { @@ -867,8 +865,8 @@ impl TryFrom<&super::EndOfEpochTransactionKind> // AuthenticatorStateExpire // -impl From for super::AuthenticatorStateExpire { - fn from(value: sui_sdk_types::types::AuthenticatorStateExpire) -> Self { +impl From for super::AuthenticatorStateExpire { + fn from(value: sui_sdk_types::AuthenticatorStateExpire) -> Self { Self { min_epoch: Some(value.min_epoch), authenticator_object_initial_shared_version: Some( @@ -878,7 +876,7 @@ impl From for super::Authenticat } } -impl TryFrom<&super::AuthenticatorStateExpire> for sui_sdk_types::types::AuthenticatorStateExpire { +impl TryFrom<&super::AuthenticatorStateExpire> for sui_sdk_types::AuthenticatorStateExpire { type Error = TryFromProtoError; fn try_from( @@ -903,8 +901,8 @@ impl TryFrom<&super::AuthenticatorStateExpire> for sui_sdk_types::types::Authent // ProgrammableTransaction // -impl From for super::ProgrammableTransaction { - fn from(value: sui_sdk_types::types::ProgrammableTransaction) -> Self { +impl From for super::ProgrammableTransaction { + fn from(value: sui_sdk_types::ProgrammableTransaction) -> Self { Self { inputs: value.inputs.into_iter().map(Into::into).collect(), commands: value.commands.into_iter().map(Into::into).collect(), @@ -912,7 +910,7 @@ impl From for super::Programmable } } -impl TryFrom<&super::ProgrammableTransaction> for sui_sdk_types::types::ProgrammableTransaction { +impl TryFrom<&super::ProgrammableTransaction> for sui_sdk_types::ProgrammableTransaction { type Error = TryFromProtoError; fn try_from(value: &super::ProgrammableTransaction) -> Result { @@ -935,10 +933,10 @@ impl TryFrom<&super::ProgrammableTransaction> for sui_sdk_types::types::Programm // Input // -impl From for super::Input { - fn from(value: sui_sdk_types::types::Input) -> Self { +impl From for super::Input { + fn from(value: sui_sdk_types::Input) -> Self { use super::input::Kind; - use sui_sdk_types::types::Input::*; + use sui_sdk_types::Input::*; let kind = match value { Pure { value } => Kind::Pure(value.into()), @@ -959,7 +957,7 @@ impl From for super::Input { } } -impl TryFrom<&super::Input> for sui_sdk_types::types::Input { +impl TryFrom<&super::Input> for sui_sdk_types::Input { type Error = TryFromProtoError; fn try_from(value: &super::Input) -> Result { @@ -1000,10 +998,10 @@ impl TryFrom<&super::Input> for sui_sdk_types::types::Input { // Argument // -impl From for super::Argument { - fn from(value: sui_sdk_types::types::Argument) -> Self { +impl From for super::Argument { + fn from(value: sui_sdk_types::Argument) -> Self { use super::argument::Kind; - use sui_sdk_types::types::Argument::*; + use sui_sdk_types::Argument::*; let kind = match value { Gas => Kind::Gas(()), @@ -1019,7 +1017,7 @@ impl From for super::Argument { } } -impl TryFrom<&super::Argument> for sui_sdk_types::types::Argument { +impl TryFrom<&super::Argument> for sui_sdk_types::Argument { type Error = TryFromProtoError; fn try_from(value: &super::Argument) -> Result { @@ -1050,10 +1048,10 @@ impl TryFrom<&super::Argument> for sui_sdk_types::types::Argument { // Command // -impl From for super::Command { - fn from(value: sui_sdk_types::types::Command) -> Self { +impl From for super::Command { + fn from(value: sui_sdk_types::Command) -> Self { use super::command::Command; - use sui_sdk_types::types::Command::*; + use sui_sdk_types::Command::*; let command = match value { MoveCall(move_call) => Command::MoveCall(move_call.into()), @@ -1071,7 +1069,7 @@ impl From for super::Command { } } -impl TryFrom<&super::Command> for sui_sdk_types::types::Command { +impl TryFrom<&super::Command> for sui_sdk_types::Command { type Error = TryFromProtoError; fn try_from(value: &super::Command) -> Result { @@ -1102,8 +1100,8 @@ impl TryFrom<&super::Command> for sui_sdk_types::types::Command { // MoveCall // -impl From for super::MoveCall { - fn from(value: sui_sdk_types::types::MoveCall) -> Self { +impl From for super::MoveCall { + fn from(value: sui_sdk_types::MoveCall) -> Self { Self { package: Some(value.package.into()), module: Some(value.module.into()), @@ -1114,7 +1112,7 @@ impl From for super::MoveCall { } } -impl TryFrom<&super::MoveCall> for sui_sdk_types::types::MoveCall { +impl TryFrom<&super::MoveCall> for sui_sdk_types::MoveCall { type Error = TryFromProtoError; fn try_from(value: &super::MoveCall) -> Result { @@ -1161,8 +1159,8 @@ impl TryFrom<&super::MoveCall> for sui_sdk_types::types::MoveCall { // TransferObjects // -impl From for super::TransferObjects { - fn from(value: sui_sdk_types::types::TransferObjects) -> Self { +impl From for super::TransferObjects { + fn from(value: sui_sdk_types::TransferObjects) -> Self { Self { objects: value.objects.into_iter().map(Into::into).collect(), address: Some(value.address.into()), @@ -1170,7 +1168,7 @@ impl From for super::TransferObjects { } } -impl TryFrom<&super::TransferObjects> for sui_sdk_types::types::TransferObjects { +impl TryFrom<&super::TransferObjects> for sui_sdk_types::TransferObjects { type Error = TryFromProtoError; fn try_from(value: &super::TransferObjects) -> Result { @@ -1194,8 +1192,8 @@ impl TryFrom<&super::TransferObjects> for sui_sdk_types::types::TransferObjects // SplitCoins // -impl From for super::SplitCoins { - fn from(value: sui_sdk_types::types::SplitCoins) -> Self { +impl From for super::SplitCoins { + fn from(value: sui_sdk_types::SplitCoins) -> Self { Self { coin: Some(value.coin.into()), amounts: value.amounts.into_iter().map(Into::into).collect(), @@ -1203,7 +1201,7 @@ impl From for super::SplitCoins { } } -impl TryFrom<&super::SplitCoins> for sui_sdk_types::types::SplitCoins { +impl TryFrom<&super::SplitCoins> for sui_sdk_types::SplitCoins { type Error = TryFromProtoError; fn try_from(value: &super::SplitCoins) -> Result { @@ -1227,8 +1225,8 @@ impl TryFrom<&super::SplitCoins> for sui_sdk_types::types::SplitCoins { // MergeCoins // -impl From for super::MergeCoins { - fn from(value: sui_sdk_types::types::MergeCoins) -> Self { +impl From for super::MergeCoins { + fn from(value: sui_sdk_types::MergeCoins) -> Self { Self { coin: Some(value.coin.into()), coins_to_merge: value.coins_to_merge.into_iter().map(Into::into).collect(), @@ -1236,7 +1234,7 @@ impl From for super::MergeCoins { } } -impl TryFrom<&super::MergeCoins> for sui_sdk_types::types::MergeCoins { +impl TryFrom<&super::MergeCoins> for sui_sdk_types::MergeCoins { type Error = TryFromProtoError; fn try_from(value: &super::MergeCoins) -> Result { @@ -1263,8 +1261,8 @@ impl TryFrom<&super::MergeCoins> for sui_sdk_types::types::MergeCoins { // Publish // -impl From for super::Publish { - fn from(value: sui_sdk_types::types::Publish) -> Self { +impl From for super::Publish { + fn from(value: sui_sdk_types::Publish) -> Self { Self { modules: value.modules.into_iter().map(Into::into).collect(), dependencies: value.dependencies.into_iter().map(Into::into).collect(), @@ -1272,7 +1270,7 @@ impl From for super::Publish { } } -impl TryFrom<&super::Publish> for sui_sdk_types::types::Publish { +impl TryFrom<&super::Publish> for sui_sdk_types::Publish { type Error = TryFromProtoError; fn try_from(value: &super::Publish) -> Result { @@ -1295,8 +1293,8 @@ impl TryFrom<&super::Publish> for sui_sdk_types::types::Publish { // MakeMoveVector // -impl From for super::MakeMoveVector { - fn from(value: sui_sdk_types::types::MakeMoveVector) -> Self { +impl From for super::MakeMoveVector { + fn from(value: sui_sdk_types::MakeMoveVector) -> Self { Self { element_type: value.type_.map(Into::into), elements: value.elements.into_iter().map(Into::into).collect(), @@ -1304,7 +1302,7 @@ impl From for super::MakeMoveVector { } } -impl TryFrom<&super::MakeMoveVector> for sui_sdk_types::types::MakeMoveVector { +impl TryFrom<&super::MakeMoveVector> for sui_sdk_types::MakeMoveVector { type Error = TryFromProtoError; fn try_from(value: &super::MakeMoveVector) -> Result { @@ -1331,8 +1329,8 @@ impl TryFrom<&super::MakeMoveVector> for sui_sdk_types::types::MakeMoveVector { // Upgrade // -impl From for super::Upgrade { - fn from(value: sui_sdk_types::types::Upgrade) -> Self { +impl From for super::Upgrade { + fn from(value: sui_sdk_types::Upgrade) -> Self { Self { modules: value.modules.into_iter().map(Into::into).collect(), dependencies: value.dependencies.into_iter().map(Into::into).collect(), @@ -1342,7 +1340,7 @@ impl From for super::Upgrade { } } -impl TryFrom<&super::Upgrade> for sui_sdk_types::types::Upgrade { +impl TryFrom<&super::Upgrade> for sui_sdk_types::Upgrade { type Error = TryFromProtoError; fn try_from(value: &super::Upgrade) -> Result { diff --git a/crates/sui-rpc-api/src/reader.rs b/crates/sui-rpc-api/src/reader.rs index 6384d143c3cd5..6b1306fbe774b 100644 --- a/crates/sui-rpc-api/src/reader.rs +++ b/crates/sui-rpc-api/src/reader.rs @@ -3,10 +3,8 @@ use std::sync::Arc; -use sui_sdk_types::types::{ - CheckpointSequenceNumber, EpochId, SignedTransaction, ValidatorCommittee, -}; -use sui_sdk_types::types::{Object, ObjectId, Version}; +use sui_sdk_types::{CheckpointSequenceNumber, EpochId, SignedTransaction, ValidatorCommittee}; +use sui_sdk_types::{Object, ObjectId, Version}; use sui_types::storage::error::{Error as StorageError, Result}; use sui_types::storage::ObjectStore; use sui_types::storage::RpcStateReader; @@ -66,11 +64,11 @@ impl StateReader { pub fn get_transaction( &self, - digest: sui_sdk_types::types::TransactionDigest, + digest: sui_sdk_types::TransactionDigest, ) -> crate::Result<( - sui_sdk_types::types::SignedTransaction, - sui_sdk_types::types::TransactionEffects, - Option, + sui_sdk_types::SignedTransaction, + sui_sdk_types::TransactionEffects, + Option, )> { use super::rest::transactions::TransactionNotFoundError; use sui_types::effects::TransactionEffectsAPI; @@ -115,7 +113,7 @@ impl StateReader { pub fn get_transaction_read( &self, - digest: sui_sdk_types::types::TransactionDigest, + digest: sui_sdk_types::TransactionDigest, ) -> crate::Result { let ( SignedTransaction { @@ -165,11 +163,11 @@ impl StateReader { #[derive(Debug)] pub struct TransactionRead { - pub digest: sui_sdk_types::types::TransactionDigest, - pub transaction: sui_sdk_types::types::Transaction, - pub signatures: Vec, - pub effects: sui_sdk_types::types::TransactionEffects, - pub events: Option, + pub digest: sui_sdk_types::TransactionDigest, + pub transaction: sui_sdk_types::Transaction, + pub signatures: Vec, + pub effects: sui_sdk_types::TransactionEffects, + pub events: Option, pub checkpoint: Option, pub timestamp_ms: Option, } diff --git a/crates/sui-rpc-api/src/rest/accounts.rs b/crates/sui-rpc-api/src/rest/accounts.rs index d618048b40f5b..3fe7758372ea2 100644 --- a/crates/sui-rpc-api/src/rest/accounts.rs +++ b/crates/sui-rpc-api/src/rest/accounts.rs @@ -1,15 +1,14 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +use super::{ApiEndpoint, RouteHandler}; use crate::reader::StateReader; -use crate::rest::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}; use crate::Result; use crate::{rest::PageCursor, RpcService, RpcServiceError}; use axum::extract::Query; use axum::extract::{Path, State}; use axum::Json; -use openapiv3::v3_1::Operation; -use sui_sdk_types::types::{Address, ObjectId, StructTag, Version}; +use sui_sdk_types::{Address, ObjectId, StructTag, Version}; use sui_types::sui_sdk_types_conversions::struct_tag_core_to_sdk; use tap::Pipe; @@ -24,23 +23,7 @@ impl ApiEndpoint for ListAccountObjects { "/accounts/{account}/objects" } - fn operation(&self, generator: &mut schemars::gen::SchemaGenerator) -> Operation { - OperationBuilder::new() - .tag("Account") - .operation_id("ListAccountObjects") - .path_parameter::
("account", generator) - .query_parameters::(generator) - .response( - 200, - ResponseBuilder::new() - .json_content::>(generator) - .header::(crate::types::X_SUI_CURSOR, generator) - .build(), - ) - .build() - } - - fn handler(&self) -> crate::rest::openapi::RouteHandler { + fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), list_account_objects) } } @@ -82,7 +65,7 @@ async fn list_account_objects( Ok((PageCursor(cursor), Json(object_info))) } -#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct ListAccountOwnedObjectsQueryParameters { pub limit: Option, pub start: Option, @@ -101,12 +84,11 @@ impl ListAccountOwnedObjectsQueryParameters { } #[serde_with::serde_as] -#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct AccountOwnedObjectInfo { pub owner: Address, pub object_id: ObjectId, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "crate::rest::_schemars::U64")] pub version: Version, #[serde(rename = "type")] pub type_: StructTag, diff --git a/crates/sui-rpc-api/src/rest/checkpoints.rs b/crates/sui-rpc-api/src/rest/checkpoints.rs index 57f3cf4ffc8eb..c2eb6e0037988 100644 --- a/crates/sui-rpc-api/src/rest/checkpoints.rs +++ b/crates/sui-rpc-api/src/rest/checkpoints.rs @@ -4,17 +4,16 @@ use axum::extract::Query; use axum::extract::{Path, State}; use axum::Json; -use sui_sdk_types::types::{CheckpointSequenceNumber, SignedCheckpointSummary}; +use sui_sdk_types::{CheckpointSequenceNumber, SignedCheckpointSummary}; use sui_types::storage::ReadStore; +use super::{ApiEndpoint, RouteHandler}; use crate::reader::StateReader; -use crate::rest::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}; use crate::rest::PageCursor; use crate::service::checkpoints::CheckpointId; use crate::types::{CheckpointResponse, GetCheckpointOptions}; use crate::Result; use crate::{Direction, RpcService}; -use documented::Documented; /// Fetch a Checkpoint /// @@ -22,7 +21,6 @@ use documented::Documented; /// `CheckpointDigest` and optionally request its contents. /// /// If the checkpoint has been pruned and is not available, a 410 will be returned. -#[derive(Documented)] pub struct GetCheckpoint; impl ApiEndpoint for GetCheckpoint { @@ -34,32 +32,6 @@ impl ApiEndpoint for GetCheckpoint { "/checkpoints/{checkpoint}" } - fn stable(&self) -> bool { - true - } - - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Checkpoint") - .operation_id("Get Checkpoint") - .description(Self::DOCS) - .path_parameter::("checkpoint", generator) - .query_parameters::(generator) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .response(404, ResponseBuilder::new().build()) - .response(410, ResponseBuilder::new().build()) - .response(500, ResponseBuilder::new().build()) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_checkpoint) } @@ -74,7 +46,7 @@ async fn get_checkpoint( } /// Query parameters for the GetCheckpoint endpoint -#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct GetCheckpointQueryParameters { /// Request `CheckpointContents` be included in the response #[serde(default)] @@ -88,7 +60,6 @@ pub struct GetCheckpointQueryParameters { /// /// If the requested page is below the Node's `lowest_available_checkpoint`, a 410 will be /// returned. -#[derive(Documented)] pub struct ListCheckpoints; impl ApiEndpoint for ListCheckpoints { @@ -100,34 +71,6 @@ impl ApiEndpoint for ListCheckpoints { "/checkpoints" } - fn stable(&self) -> bool { - // Before making this api stable we'll need to properly handle the options that can be - // provided as inputs. - false - } - - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Checkpoint") - .operation_id("List Checkpoints") - .description(Self::DOCS) - .query_parameters::(generator) - .query_parameters::(generator) - .response( - 200, - ResponseBuilder::new() - .json_content::>(generator) - .header::(crate::types::X_SUI_CURSOR, generator) - .build(), - ) - .response(410, ResponseBuilder::new().build()) - .response(500, ResponseBuilder::new().build()) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), list_checkpoints) } @@ -199,7 +142,7 @@ async fn list_checkpoints( Ok((PageCursor(cursor), Json(checkpoints))) } -#[derive(Debug, Default, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, Default, serde::Serialize, serde::Deserialize)] pub struct ListCheckpointsPaginationParameters { /// Page size limit for the response. /// diff --git a/crates/sui-rpc-api/src/rest/coins.rs b/crates/sui-rpc-api/src/rest/coins.rs index 4bd1bd2c6dbe5..cef5719cbfe2f 100644 --- a/crates/sui-rpc-api/src/rest/coins.rs +++ b/crates/sui-rpc-api/src/rest/coins.rs @@ -1,15 +1,14 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::rest::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}; +use super::{ApiEndpoint, RouteHandler}; use crate::RpcService; use crate::RpcServiceError; use crate::{reader::StateReader, Result}; use axum::extract::{Path, State}; use axum::Json; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use sui_sdk_types::types::{ObjectId, StructTag}; +use sui_sdk_types::{ObjectId, StructTag}; use sui_types::sui_sdk_types_conversions::struct_tag_sdk_to_core; pub struct GetCoinInfo; @@ -23,25 +22,7 @@ impl ApiEndpoint for GetCoinInfo { "/coins/{coin_type}" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Coins") - .operation_id("GetCoinInfo") - .path_parameter::("coin_type", generator) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .response(404, ResponseBuilder::new().build()) - .build() - } - - fn handler(&self) -> crate::rest::openapi::RouteHandler { + fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_coin_info) } } @@ -127,14 +108,14 @@ impl From for crate::RpcServiceError { } } -#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CoinInfo { pub coin_type: StructTag, pub metadata: Option, pub treasury: Option, } -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, JsonSchema)] +#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] pub struct CoinMetadata { pub id: ObjectId, /// Number of decimal places the coin uses. @@ -163,11 +144,10 @@ impl From for CoinMetadata { } #[serde_with::serde_as] -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, JsonSchema)] +#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] pub struct CoinTreasury { pub id: Option, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "crate::rest::_schemars::U64")] pub total_supply: u64, } diff --git a/crates/sui-rpc-api/src/rest/committee.rs b/crates/sui-rpc-api/src/rest/committee.rs index 6e2a98df41ac3..d31ff3b3b339b 100644 --- a/crates/sui-rpc-api/src/rest/committee.rs +++ b/crates/sui-rpc-api/src/rest/committee.rs @@ -1,15 +1,13 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::{ - rest::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}, - Result, RpcService, -}; +use super::{ApiEndpoint, RouteHandler}; +use crate::{Result, RpcService}; use axum::{ extract::{Path, State}, Json, }; -use sui_sdk_types::types::{EpochId, ValidatorCommittee}; +use sui_sdk_types::{EpochId, ValidatorCommittee}; pub struct GetLatestCommittee; @@ -22,22 +20,6 @@ impl ApiEndpoint for GetLatestCommittee { "/system/committee" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("System") - .operation_id("GetLatestCommittee") - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_latest_committee) } @@ -58,24 +40,6 @@ impl ApiEndpoint for GetCommittee { "/system/committee/{epoch}" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("System") - .operation_id("GetCommittee") - .path_parameter::("epoch", generator) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .response(404, ResponseBuilder::new().build()) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_committee) } diff --git a/crates/sui-rpc-api/src/rest/health.rs b/crates/sui-rpc-api/src/rest/health.rs index 39864de11f955..e4930227979bc 100644 --- a/crates/sui-rpc-api/src/rest/health.rs +++ b/crates/sui-rpc-api/src/rest/health.rs @@ -1,19 +1,15 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::{ - rest::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}, - RpcService, -}; +use super::{ApiEndpoint, RouteHandler}; +use crate::RpcService; use axum::extract::{Query, State}; -use documented::Documented; /// Perform a service health check /// /// By default the health check only verifies that the latest checkpoint can be fetched from the /// node's store before returning a 200. Optionally the `threshold_seconds` parameter can be /// provided to test for how up to date the node needs to be to be considered healthy. -#[derive(Documented)] pub struct HealthCheck; impl ApiEndpoint for HealthCheck { @@ -25,30 +21,12 @@ impl ApiEndpoint for HealthCheck { "/-/health" } - fn stable(&self) -> bool { - true - } - - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("General") - .operation_id("Health Check") - .description(Self::DOCS) - .query_parameters::(generator) - .response(200, ResponseBuilder::new().text_content().build()) - .response(500, ResponseBuilder::new().build()) - .build() - } - - fn handler(&self) -> crate::rest::openapi::RouteHandler { + fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), health) } } -#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Threshold { /// The threshold, or delta, between the server's system time and the timestamp in the most /// recently executed checkpoint for which the server is considered to be healthy. diff --git a/crates/sui-rpc-api/src/rest/info.rs b/crates/sui-rpc-api/src/rest/info.rs index 435f91bb80d42..4ce320989cfe4 100644 --- a/crates/sui-rpc-api/src/rest/info.rs +++ b/crates/sui-rpc-api/src/rest/info.rs @@ -1,15 +1,13 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::rest::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}; +use super::{ApiEndpoint, RouteHandler}; use crate::types::NodeInfo; use crate::{Result, RpcService}; use axum::extract::State; use axum::Json; -use documented::Documented; /// Get basic information about the state of a Node -#[derive(Documented)] pub struct GetNodeInfo; impl ApiEndpoint for GetNodeInfo { @@ -21,29 +19,7 @@ impl ApiEndpoint for GetNodeInfo { "/" } - fn stable(&self) -> bool { - true - } - - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("General") - .operation_id("Get NodeInfo") - .description(Self::DOCS) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .response(500, ResponseBuilder::new().build()) - .build() - } - - fn handler(&self) -> crate::rest::openapi::RouteHandler { + fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_node_info) } } diff --git a/crates/sui-rpc-api/src/rest/mod.rs b/crates/sui-rpc-api/src/rest/mod.rs index 03a80ebe7dd8b..60c191d267fb0 100644 --- a/crates/sui-rpc-api/src/rest/mod.rs +++ b/crates/sui-rpc-api/src/rest/mod.rs @@ -3,6 +3,7 @@ use std::sync::Arc; +use axum::{handler::Handler, http::Method, routing::MethodRouter}; use axum::{ response::{Redirect, ResponseParts}, routing::get, @@ -10,7 +11,6 @@ use axum::{ }; use crate::{reader::StateReader, RpcService}; -use openapi::ApiEndpoint; pub mod accept; pub mod accounts; @@ -21,7 +21,6 @@ pub mod content_type; pub mod health; pub mod info; pub mod objects; -pub mod openapi; pub mod system; pub mod transactions; @@ -30,11 +29,9 @@ pub const APPLICATION_BCS: &str = "application/bcs"; pub const APPLICATION_JSON: &str = "application/json"; pub const ENDPOINTS: &[&dyn ApiEndpoint] = &[ - // stable APIs &info::GetNodeInfo, &health::HealthCheck, &checkpoints::GetCheckpoint, - // unstable APIs &accounts::ListAccountObjects, &objects::GetObject, &objects::GetObjectWithVersion, @@ -55,12 +52,21 @@ pub const ENDPOINTS: &[&dyn ApiEndpoint] = &[ ]; pub fn build_rest_router(service: RpcService) -> axum::Router { - let mut api = openapi::Api::new(info(service.software_version())); + let mut api = Router::new(); - api.register_endpoints(ENDPOINTS.iter().copied()); + for endpoint in ENDPOINTS { + let handler = endpoint.handler(); + assert_eq!(handler.method(), endpoint.method()); + + // we need to replace any path parameters wrapped in braces to be prefaced by a colon + // until axum updates matchit: https://github.com/tokio-rs/axum/pull/2645 + let path = endpoint.path().replace('{', ":").replace('}', ""); + + api = api.route(&path, handler.handler); + } Router::new() - .nest("/v2/", api.to_router().with_state(service)) + .nest("/v2/", api.with_state(service)) .route("/v2", get(|| async { Redirect::permanent("/v2/") })) // Previously the service used to be hosted at `/rest`. In an effort to migrate folks // to the new versioned route, we'll issue redirects from `/rest` -> `/v2`. @@ -110,60 +116,34 @@ impl axum::extract::FromRef } } -pub fn info(version: &'static str) -> openapiv3::v3_1::Info { - use openapiv3::v3_1::Contact; - use openapiv3::v3_1::License; - - openapiv3::v3_1::Info { - title: "Sui Node Api".to_owned(), - description: Some("REST Api for interacting with the Sui Blockchain".to_owned()), - contact: Some(Contact { - name: Some("Mysten Labs".to_owned()), - url: Some("https://github.com/MystenLabs/sui".to_owned()), - ..Default::default() - }), - license: Some(License { - name: "Apache 2.0".to_owned(), - url: Some("https://www.apache.org/licenses/LICENSE-2.0.html".to_owned()), - ..Default::default() - }), - version: version.to_owned(), - ..Default::default() - } -} - async fn redirect(axum::extract::Path(path): axum::extract::Path) -> Redirect { Redirect::permanent(&format!("/v2/{path}")) } -pub(crate) mod _schemars { - use schemars::schema::InstanceType; - use schemars::schema::Metadata; - use schemars::schema::SchemaObject; - use schemars::JsonSchema; - - pub(crate) struct U64; - - impl JsonSchema for U64 { - fn schema_name() -> String { - "u64".to_owned() - } - - fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { - SchemaObject { - metadata: Some(Box::new(Metadata { - description: Some("Radix-10 encoded 64-bit unsigned integer".to_owned()), - ..Default::default() - })), - instance_type: Some(InstanceType::String.into()), - format: Some("u64".to_owned()), - ..Default::default() - } - .into() - } - - fn is_referenceable() -> bool { - false - } +pub trait ApiEndpoint { + fn method(&self) -> Method; + fn path(&self) -> &'static str; + fn handler(&self) -> RouteHandler; +} + +pub struct RouteHandler { + method: axum::http::Method, + handler: MethodRouter, +} + +impl RouteHandler { + pub fn new(method: axum::http::Method, handler: H) -> Self + where + H: Handler, + T: 'static, + S: Send + Sync + 'static, + { + let handler = MethodRouter::new().on(method.clone().try_into().unwrap(), handler); + + Self { method, handler } + } + + pub fn method(&self) -> &axum::http::Method { + &self.method } } diff --git a/crates/sui-rpc-api/src/rest/objects.rs b/crates/sui-rpc-api/src/rest/objects.rs index ab8391a5009f6..151ad0c65b6fb 100644 --- a/crates/sui-rpc-api/src/rest/objects.rs +++ b/crates/sui-rpc-api/src/rest/objects.rs @@ -1,18 +1,14 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +use super::{ApiEndpoint, RouteHandler}; use crate::types::{GetObjectOptions, ObjectResponse}; -use crate::{ - reader::StateReader, - rest::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}, - rest::PageCursor, - Result, RpcService, RpcServiceError, -}; +use crate::{reader::StateReader, rest::PageCursor, Result, RpcService, RpcServiceError}; use axum::extract::Query; use axum::extract::{Path, State}; use axum::Json; use serde::{Deserialize, Serialize}; -use sui_sdk_types::types::{ObjectId, TypeTag, Version}; +use sui_sdk_types::{ObjectId, TypeTag, Version}; use sui_types::sui_sdk_types_conversions::type_tag_core_to_sdk; use sui_types::{ storage::{DynamicFieldIndexInfo, DynamicFieldKey}, @@ -31,26 +27,7 @@ impl ApiEndpoint for GetObject { "/objects/{object_id}" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Objects") - .operation_id("GetObject") - .path_parameter::("object_id", generator) - .query_parameters::(generator) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .response(404, ResponseBuilder::new().build()) - .build() - } - - fn handler(&self) -> crate::rest::openapi::RouteHandler { + fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_object) } } @@ -76,27 +53,7 @@ impl ApiEndpoint for GetObjectWithVersion { "/objects/{object_id}/version/{version}" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Objects") - .operation_id("GetObjectWithVersion") - .path_parameter::("object_id", generator) - .path_parameter::("version", generator) - .query_parameters::(generator) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .response(404, ResponseBuilder::new().build()) - .build() - } - - fn handler(&self) -> crate::rest::openapi::RouteHandler { + fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_object_with_version) } } @@ -122,26 +79,7 @@ impl ApiEndpoint for ListDynamicFields { "/objects/{object_id}/dynamic-fields" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Objects") - .operation_id("ListDynamicFields") - .path_parameter::("object_id", generator) - .query_parameters::(generator) - .response( - 200, - ResponseBuilder::new() - .json_content::>(generator) - .header::(crate::types::X_SUI_CURSOR, generator) - .build(), - ) - .build() - } - - fn handler(&self) -> crate::rest::openapi::RouteHandler { + fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), list_dynamic_fields) } } @@ -181,7 +119,7 @@ async fn list_dynamic_fields( Ok((PageCursor(cursor), Json(dynamic_fields))) } -#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct ListDynamicFieldsQueryParameters { pub limit: Option, pub start: Option, @@ -199,7 +137,7 @@ impl ListDynamicFieldsQueryParameters { } } -#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug, schemars::JsonSchema)] +#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug)] /// DynamicFieldInfo pub struct DynamicFieldInfo { pub parent: ObjectId, @@ -236,9 +174,7 @@ impl TryFrom<(DynamicFieldKey, DynamicFieldIndexInfo)> for DynamicFieldInfo { } } -#[derive( - Clone, Serialize, Deserialize, Ord, PartialOrd, Eq, PartialEq, Debug, schemars::JsonSchema, -)] +#[derive(Clone, Serialize, Deserialize, Ord, PartialOrd, Eq, PartialEq, Debug)] #[serde(rename_all = "lowercase")] pub enum DynamicFieldType { Field, diff --git a/crates/sui-rpc-api/src/rest/openapi.rs b/crates/sui-rpc-api/src/rest/openapi.rs deleted file mode 100644 index 2544bfc805362..0000000000000 --- a/crates/sui-rpc-api/src/rest/openapi.rs +++ /dev/null @@ -1,698 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -use std::{ - collections::HashSet, - sync::{Arc, OnceLock}, -}; - -use axum::{ - body::Bytes, - extract::State, - handler::Handler, - http::Method, - response::Html, - routing::{get, MethodRouter}, - Router, -}; -use documented::Documented; -use openapiv3::v3_1::{ - Components, Header, Info, MediaType, OpenApi, Operation, Parameter, ParameterData, PathItem, - Paths, ReferenceOr, RequestBody, Response, SchemaObject, Tag, -}; -use schemars::{gen::SchemaGenerator, JsonSchema}; -use tap::Pipe; - -const STABLE_BADGE_MARKDOWN: &str = - "[![stable](https://img.shields.io/badge/api-stable-53b576?style=for-the-badge)](#)\n\n"; - -const UNSTABLE_BADGE_MARKDOWN: &str = - "[![unstable](https://img.shields.io/badge/api-unstable-red?style=for-the-badge)](#) _Api subject to change; use at your own risk_\n\n"; - -pub trait ApiEndpoint { - fn method(&self) -> Method; - fn path(&self) -> &'static str; - fn hidden(&self) -> bool { - false - } - - /// Indicates the stability of the API - /// - /// Stable APIs are enabled in the REST service by default, unstable ones need to be explicitly - /// configured to be enabled via config. - /// - /// Both stable and unstable APIs have a badge, indicating the api's stability, added to the - /// top of the description field of their OpenAPI definition. - /// - /// By default all apis are unstable, individual apis need to explicitly opt-in to being stable - fn stable(&self) -> bool { - false - } - - fn operation(&self, _generator: &mut SchemaGenerator) -> Operation { - Operation::default() - } - - fn handler(&self) -> RouteHandler; -} - -pub struct RouteHandler { - method: axum::http::Method, - handler: MethodRouter, -} - -impl RouteHandler { - pub fn new(method: axum::http::Method, handler: H) -> Self - where - H: Handler, - T: 'static, - S: Send + Sync + 'static, - { - let handler = MethodRouter::new().on(method.clone().try_into().unwrap(), handler); - - Self { method, handler } - } - - pub fn method(&self) -> &axum::http::Method { - &self.method - } -} - -pub struct Api<'a, S> { - endpoints: Vec<&'a dyn ApiEndpoint>, - info: Info, -} - -impl<'a, S> Api<'a, S> { - pub fn new(info: Info) -> Self { - Self { - endpoints: Vec::new(), - info, - } - } - - pub fn register_endpoints>>( - &mut self, - endpoints: I, - ) { - self.endpoints.extend(endpoints); - } - - pub fn to_router(&self) -> axum::Router - where - S: Clone + Send + Sync + 'static, - { - let mut router = OpenApiDocument::new(self.openapi()).into_router(); - for endpoint in &self.endpoints { - let handler = endpoint.handler(); - assert_eq!(handler.method(), endpoint.method()); - - // we need to replace any path parameters wrapped in braces to be prefaced by a colon - // until axum updates matchit: https://github.com/tokio-rs/axum/pull/2645 - let path = endpoint.path().replace('{', ":").replace('}', ""); - - router = router.route(&path, handler.handler); - } - - router - } - - pub fn openapi(&self) -> openapiv3::versioned::OpenApi { - self.gen_openapi(self.info.clone()) - } - - /// Internal routine for constructing the OpenAPI definition describing this - /// API in its JSON form. - fn gen_openapi(&self, info: Info) -> openapiv3::versioned::OpenApi { - let mut openapi = OpenApi { - info, - ..Default::default() - }; - - let settings = schemars::gen::SchemaSettings::draft07().with(|s| { - s.definitions_path = "#/components/schemas/".into(); - s.option_add_null_type = false; - }); - let mut generator = schemars::gen::SchemaGenerator::new(settings); - let mut tags = HashSet::new(); - - let paths = openapi - .paths - .get_or_insert(openapiv3::v3_1::Paths::default()); - - for endpoint in &self.endpoints { - // Skip hidden endpoints - if endpoint.hidden() { - continue; - } - - Self::register_endpoint(*endpoint, &mut generator, paths, &mut tags); - } - - // Add OpenApi routes themselves - let openapi_endpoints: [&dyn ApiEndpoint<_>; 3] = - [&OpenApiExplorer, &OpenApiJson, &OpenApiYaml]; - for endpoint in openapi_endpoints { - Self::register_endpoint(endpoint, &mut generator, paths, &mut tags); - } - - let components = &mut openapi.components.get_or_insert_with(Components::default); - - // Add the schemas for which we generated references. - let schemas = &mut components.schemas; - - generator - .into_root_schema_for::<()>() - .definitions - .into_iter() - .for_each(|(key, schema)| { - let schema_object = SchemaObject { - json_schema: schema, - external_docs: None, - example: None, - }; - schemas.insert(key, schema_object); - }); - - openapi.tags = tags - .into_iter() - .map(|tag| Tag { - name: tag, - ..Default::default() - }) - .collect(); - // Sort the tags for stability - openapi.tags.sort_by(|a, b| a.name.cmp(&b.name)); - - openapi.servers = vec![openapiv3::v3_1::Server { - url: "/v2".into(), - ..Default::default() - }]; - - openapiv3::versioned::OpenApi::Version31(openapi) - } - - fn register_endpoint( - endpoint: &dyn ApiEndpoint, - generator: &mut schemars::gen::SchemaGenerator, - paths: &mut Paths, - tags: &mut HashSet, - ) { - let path = paths - .paths - .entry(endpoint.path().to_owned()) - .or_insert(ReferenceOr::Item(PathItem::default())); - - let pathitem = match path { - openapiv3::v3_1::ReferenceOr::Item(ref mut item) => item, - _ => panic!("reference not expected"), - }; - - let method_ref = match endpoint.method() { - Method::DELETE => &mut pathitem.delete, - Method::GET => &mut pathitem.get, - Method::HEAD => &mut pathitem.head, - Method::OPTIONS => &mut pathitem.options, - Method::PATCH => &mut pathitem.patch, - Method::POST => &mut pathitem.post, - Method::PUT => &mut pathitem.put, - Method::TRACE => &mut pathitem.trace, - other => panic!("unexpected method `{}`", other), - }; - - let mut operation = endpoint.operation(generator); - - if endpoint.stable() { - operation - .description - .get_or_insert_with(String::new) - .insert_str(0, STABLE_BADGE_MARKDOWN); - } else { - operation - .description - .get_or_insert_with(String::new) - .insert_str(0, UNSTABLE_BADGE_MARKDOWN); - } - - // Collect tags defined by this operation - tags.extend(operation.tags.clone()); - - method_ref.replace(operation); - } -} - -pub struct OpenApiDocument { - openapi: openapiv3::versioned::OpenApi, - json: OnceLock, - yaml: OnceLock, - ui: &'static str, -} - -impl OpenApiDocument { - pub fn new(openapi: openapiv3::versioned::OpenApi) -> Self { - const OPENAPI_UI: &str = include_str!("../../openapi/elements.html"); - // const OPENAPI_UI: &str = include_str!("../../openapi/swagger.html"); - - Self { - openapi, - json: OnceLock::new(), - yaml: OnceLock::new(), - ui: OPENAPI_UI, - } - } - - fn openapi(&self) -> &openapiv3::versioned::OpenApi { - &self.openapi - } - - fn json(&self) -> Bytes { - self.json - .get_or_init(|| { - self.openapi() - .pipe(serde_json::to_string_pretty) - .unwrap() - .pipe(Bytes::from) - }) - .clone() - } - - fn yaml(&self) -> Bytes { - self.yaml - .get_or_init(|| { - self.openapi() - .pipe(serde_yaml::to_string) - .unwrap() - .pipe(Bytes::from) - }) - .clone() - } - - fn ui(&self) -> &'static str { - self.ui - } - - pub fn into_router(self) -> Router { - Router::new() - .route("/openapi", get(openapi_ui)) - .route("/openapi.json", get(openapi_json)) - .route("/openapi.yaml", get(openapi_yaml)) - .with_state(Arc::new(self)) - } -} - -/// Return the OpenAPI v3.1.0 definition for this service as a JSON document -#[derive(Documented)] -pub struct OpenApiJson; - -impl ApiEndpoint> for OpenApiJson { - fn method(&self) -> axum::http::Method { - axum::http::Method::GET - } - - fn path(&self) -> &'static str { - "/openapi.json" - } - - fn stable(&self) -> bool { - true - } - - fn operation( - &self, - _generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("OpenAPI") - .operation_id("openapi.json") - .description(Self::DOCS) - .response( - 200, - ResponseBuilder::new() - .content(mime::APPLICATION_JSON.as_ref(), MediaType::default()) - .build(), - ) - .build() - } - - fn handler(&self) -> RouteHandler> { - RouteHandler::new(self.method(), openapi_json) - } -} - -/// Return the OpenAPI v3.1.0 definition for this service as a YAML document -#[derive(Documented)] -pub struct OpenApiYaml; - -impl ApiEndpoint> for OpenApiYaml { - fn method(&self) -> axum::http::Method { - axum::http::Method::GET - } - - fn path(&self) -> &'static str { - "/openapi.yaml" - } - - fn stable(&self) -> bool { - true - } - - fn operation( - &self, - _generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("OpenAPI") - .operation_id("openapi.yaml") - .description(Self::DOCS) - .response( - 200, - ResponseBuilder::new() - .content(mime::TEXT_PLAIN_UTF_8.as_ref(), MediaType::default()) - .build(), - ) - .build() - } - - fn handler(&self) -> RouteHandler> { - RouteHandler::new(self.method(), openapi_yaml) - } -} - -/// Provides a web UI for exploring the OpenAPI v3.1.0 definition for this service -#[derive(Documented)] -pub struct OpenApiExplorer; - -impl ApiEndpoint> for OpenApiExplorer { - fn method(&self) -> axum::http::Method { - axum::http::Method::GET - } - - fn path(&self) -> &'static str { - "/openapi" - } - - fn stable(&self) -> bool { - true - } - - fn operation( - &self, - _generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("OpenAPI") - .operation_id("OpenAPI Explorer") - .description(Self::DOCS) - .response( - 200, - ResponseBuilder::new() - .content(mime::TEXT_HTML_UTF_8.as_ref(), MediaType::default()) - .build(), - ) - .build() - } - - fn handler(&self) -> RouteHandler> { - RouteHandler::new(self.method(), openapi_ui) - } -} - -async fn openapi_json( - State(document): State>, -) -> impl axum::response::IntoResponse { - ( - [( - axum::http::header::CONTENT_TYPE, - axum::http::HeaderValue::from_static(mime::APPLICATION_JSON.as_ref()), - )], - document.json(), - ) -} - -async fn openapi_yaml( - State(document): State>, -) -> impl axum::response::IntoResponse { - ( - [( - axum::http::header::CONTENT_TYPE, - axum::http::HeaderValue::from_static(mime::TEXT_PLAIN_UTF_8.as_ref()), - )], - document.yaml(), - ) -} - -async fn openapi_ui(State(document): State>) -> Html<&'static str> { - Html(document.ui()) -} - -fn path_parameter( - name: &str, - generator: &mut SchemaGenerator, -) -> ReferenceOr { - let schema_object = SchemaObject { - json_schema: generator.subschema_for::(), - external_docs: None, - example: None, - }; - - let parameter_data = ParameterData { - name: name.into(), - required: true, - format: openapiv3::v3_1::ParameterSchemaOrContent::Schema(schema_object), - description: None, - deprecated: None, - example: None, - examples: Default::default(), - explode: None, - extensions: Default::default(), - }; - - ReferenceOr::Item(Parameter::Path { - parameter_data, - style: openapiv3::v3_1::PathStyle::Simple, - }) -} - -fn query_parameters(generator: &mut SchemaGenerator) -> Vec> { - let mut params = Vec::new(); - - let schema = generator.root_schema_for::().schema; - - let Some(object) = &schema.object else { - return params; - }; - - for (name, schema) in &object.properties { - let s = schema.clone().into_object(); - - params.push(ReferenceOr::Item(Parameter::Query { - parameter_data: ParameterData { - name: name.clone(), - description: s.metadata.as_ref().and_then(|m| m.description.clone()), - required: object.required.contains(name), - format: openapiv3::v3_1::ParameterSchemaOrContent::Schema(SchemaObject { - json_schema: s.into(), - example: None, - external_docs: None, - }), - extensions: Default::default(), - deprecated: None, - example: None, - examples: Default::default(), - explode: None, - }, - allow_reserved: false, - style: openapiv3::v3_1::QueryStyle::Form, - allow_empty_value: None, - })); - } - - params -} - -#[derive(Default)] -pub struct OperationBuilder { - inner: Operation, -} - -impl OperationBuilder { - pub fn new() -> Self { - Self { - inner: Default::default(), - } - } - - pub fn build(&mut self) -> Operation { - self.inner.clone() - } - - pub fn tag>(&mut self, tag: T) -> &mut Self { - self.inner.tags.push(tag.into()); - self - } - - pub fn summary>(&mut self, summary: T) -> &mut Self { - self.inner.summary = Some(summary.into()); - self - } - - pub fn description>(&mut self, description: T) -> &mut Self { - self.inner.description = Some(description.into()); - self - } - - pub fn operation_id>(&mut self, operation_id: T) -> &mut Self { - self.inner.operation_id = Some(operation_id.into()); - self - } - - pub fn path_parameter( - &mut self, - name: &str, - generator: &mut SchemaGenerator, - ) -> &mut Self { - self.inner - .parameters - .push(path_parameter::(name, generator)); - self - } - - pub fn query_parameters( - &mut self, - generator: &mut SchemaGenerator, - ) -> &mut Self { - self.inner - .parameters - .extend(query_parameters::(generator)); - self - } - - pub fn response(&mut self, status_code: u16, response: Response) -> &mut Self { - let responses = self.inner.responses.get_or_insert(Default::default()); - responses.responses.insert( - openapiv3::v3_1::StatusCode::Code(status_code), - ReferenceOr::Item(response), - ); - - self - } - - pub fn request_body(&mut self, request_body: RequestBody) -> &mut Self { - self.inner.request_body = Some(ReferenceOr::Item(request_body)); - self - } -} - -#[derive(Default)] -pub struct ResponseBuilder { - inner: Response, -} - -impl ResponseBuilder { - pub fn new() -> Self { - Self { - inner: Default::default(), - } - } - - pub fn build(&mut self) -> Response { - self.inner.clone() - } - - pub fn header( - &mut self, - name: &str, - generator: &mut SchemaGenerator, - ) -> &mut Self { - let schema_object = SchemaObject { - json_schema: generator.subschema_for::(), - external_docs: None, - example: None, - }; - - let header = ReferenceOr::Item(Header { - description: None, - style: Default::default(), - required: false, - deprecated: None, - format: openapiv3::v3_1::ParameterSchemaOrContent::Schema(schema_object), - example: None, - examples: Default::default(), - extensions: Default::default(), - }); - - self.inner.headers.insert(name.into(), header); - self - } - - pub fn content>( - &mut self, - content_type: T, - media_type: MediaType, - ) -> &mut Self { - self.inner.content.insert(content_type.into(), media_type); - self - } - - pub fn json_content(&mut self, generator: &mut SchemaGenerator) -> &mut Self { - let schema_object = SchemaObject { - json_schema: generator.subschema_for::(), - external_docs: None, - example: None, - }; - let media_type = MediaType { - schema: Some(schema_object), - ..Default::default() - }; - - self.content(mime::APPLICATION_JSON.as_ref(), media_type) - } - - pub fn text_content(&mut self) -> &mut Self { - self.content(mime::TEXT_PLAIN_UTF_8.as_ref(), MediaType::default()) - } -} - -#[derive(Default)] -pub struct RequestBodyBuilder { - inner: RequestBody, -} - -impl RequestBodyBuilder { - pub fn new() -> Self { - Self { - inner: Default::default(), - } - } - - pub fn build(&mut self) -> RequestBody { - self.inner.clone() - } - - pub fn content>( - &mut self, - content_type: T, - media_type: MediaType, - ) -> &mut Self { - self.inner.content.insert(content_type.into(), media_type); - self - } - - pub fn json_content(&mut self, generator: &mut SchemaGenerator) -> &mut Self { - let schema_object = SchemaObject { - json_schema: generator.subschema_for::(), - external_docs: None, - example: None, - }; - let media_type = MediaType { - schema: Some(schema_object), - ..Default::default() - }; - - self.content(mime::APPLICATION_JSON.as_ref(), media_type) - } - - pub fn bcs_content(&mut self) -> &mut Self { - self.content(crate::rest::APPLICATION_BCS, MediaType::default()) - } -} diff --git a/crates/sui-rpc-api/src/rest/system.rs b/crates/sui-rpc-api/src/rest/system.rs index fb07fb323d4ec..9cefc1d242ca7 100644 --- a/crates/sui-rpc-api/src/rest/system.rs +++ b/crates/sui-rpc-api/src/rest/system.rs @@ -1,22 +1,16 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::{ - reader::StateReader, - rest::_schemars::U64, - rest::accept::AcceptFormat, - rest::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}, - Result, RpcService, RpcServiceError, -}; +use super::{ApiEndpoint, RouteHandler}; +use crate::{reader::StateReader, rest::accept::AcceptFormat, Result, RpcService, RpcServiceError}; use axum::{ extract::{Path, State}, Json, }; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use sui_protocol_config::{ProtocolConfig, ProtocolConfigValue, ProtocolVersion}; -use sui_sdk_types::types::{Address, ObjectId}; +use sui_sdk_types::{Address, ObjectId}; pub struct GetSystemStateSummary; @@ -29,22 +23,6 @@ impl ApiEndpoint for GetSystemStateSummary { "/system" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("System") - .operation_id("GetSystemStateSummary") - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_system_state_summary) } @@ -70,32 +48,26 @@ async fn get_system_state_summary( } #[serde_with::serde_as] -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, JsonSchema)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct SystemStateSummary { /// The current epoch ID, starting from 0. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub epoch: u64, /// The current protocol version, starting from 1. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub protocol_version: u64, /// The current version of the system state data structure type. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub system_state_version: u64, /// The storage rebates of all the objects on-chain stored in the storage fund. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub storage_fund_total_object_storage_rebates: u64, /// The non-refundable portion of the storage fund coming from storage reinvestment, non-refundable /// storage rebates and any leftover staking rewards. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub storage_fund_non_refundable_balance: u64, /// The reference gas price for the current epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub reference_gas_price: u64, /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug. /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode. @@ -103,84 +75,68 @@ pub struct SystemStateSummary { pub safe_mode: bool, /// Amount of storage rewards accumulated (and not yet distributed) during safe mode. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub safe_mode_storage_rewards: u64, /// Amount of computation rewards accumulated (and not yet distributed) during safe mode. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub safe_mode_computation_rewards: u64, /// Amount of storage rebates accumulated (and not yet burned) during safe mode. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub safe_mode_storage_rebates: u64, /// Amount of non-refundable storage fee accumulated during safe mode. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub safe_mode_non_refundable_storage_fee: u64, /// Unix timestamp of the current epoch start #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub epoch_start_timestamp_ms: u64, // System parameters /// The duration of an epoch, in milliseconds. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub epoch_duration_ms: u64, /// The starting epoch in which stake subsidies start being paid out #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub stake_subsidy_start_epoch: u64, /// Maximum number of active validators at any moment. /// We do not allow the number of validators in any epoch to go above this. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub max_validator_count: u64, /// Lower-bound on the amount of stake required to become a validator. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub min_validator_joining_stake: u64, /// Validators with stake amount below `validator_low_stake_threshold` are considered to /// have low stake and will be escorted out of the validator set after being below this /// threshold for more than `validator_low_stake_grace_period` number of epochs. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub validator_low_stake_threshold: u64, /// Validators with stake below `validator_very_low_stake_threshold` will be removed /// immediately at epoch change, no grace period. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub validator_very_low_stake_threshold: u64, /// A validator can have stake below `validator_low_stake_threshold` /// for this many epochs before being kicked out. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub validator_low_stake_grace_period: u64, // Stake subsidy information /// Balance of SUI set aside for stake subsidies that will be drawn down over time. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub stake_subsidy_balance: u64, /// This counter may be different from the current epoch number if /// in some epochs we decide to skip the subsidy. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub stake_subsidy_distribution_counter: u64, /// The amount of stake subsidy to be drawn down per epoch. /// This amount decays and decreases over time. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub stake_subsidy_current_distribution_amount: u64, /// Number of distributions to occur before the distribution amount decays. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub stake_subsidy_period_length: u64, /// The rate at which the distribution amount decays at the end of each /// period. Expressed in basis points. @@ -189,7 +145,6 @@ pub struct SystemStateSummary { // Validator set /// Total amount of stake from all active validators at the beginning of the epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub total_stake: u64, /// The list of active validators in the current epoch. pub active_validators: Vec, @@ -197,34 +152,28 @@ pub struct SystemStateSummary { pub pending_active_validators_id: ObjectId, /// Number of new validators that will join at the end of the epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub pending_active_validators_size: u64, /// Removal requests from the validators. Each element is an index /// pointing to `active_validators`. #[serde_as(as = "Vec>")] - #[schemars(with = "Vec")] pub pending_removals: Vec, /// ID of the object that maps from staking pool's ID to the sui address of a validator. pub staking_pool_mappings_id: ObjectId, /// Number of staking pool mappings. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub staking_pool_mappings_size: u64, /// ID of the object that maps from a staking pool ID to the inactive validator that has that pool as its staking pool. pub inactive_pools_id: ObjectId, /// Number of inactive staking pools. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub inactive_pools_size: u64, /// ID of the object that stores preactive validators, mapping their addresses to their `Validator` structs. pub validator_candidates_id: ObjectId, /// Number of preactive validators. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub validator_candidates_size: u64, /// Map storing the number of epochs for which each validator has been below the low stake threshold. #[serde_as(as = "Vec<(_, sui_types::sui_serde::BigInt)>")] - #[schemars(with = "Vec<(Address, U64)>")] pub at_risk_validators: Vec<(Address, u64)>, /// A map storing the records of validator reporting each other. pub validator_report_records: Vec<(Address, Vec
)>, @@ -233,15 +182,14 @@ pub struct SystemStateSummary { /// This is the REST type for the sui validator. It flattens all inner structures /// to top-level fields so that they are decoupled from the internal definitions. #[serde_with::serde_as] -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, JsonSchema)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct ValidatorSummary { // Metadata pub address: Address, - pub protocol_public_key: sui_sdk_types::types::Bls12381PublicKey, - pub network_public_key: sui_sdk_types::types::Ed25519PublicKey, - pub worker_public_key: sui_sdk_types::types::Ed25519PublicKey, + pub protocol_public_key: sui_sdk_types::Bls12381PublicKey, + pub network_public_key: sui_sdk_types::Ed25519PublicKey, + pub worker_public_key: sui_sdk_types::Ed25519PublicKey, #[serde_as(as = "fastcrypto::encoding::Base64")] - #[schemars(with = "String")] pub proof_of_possession_bytes: Vec, pub name: String, pub description: String, @@ -251,11 +199,10 @@ pub struct ValidatorSummary { pub p2p_address: String, pub primary_address: String, pub worker_address: String, - pub next_epoch_protocol_public_key: Option, - pub next_epoch_network_public_key: Option, - pub next_epoch_worker_public_key: Option, + pub next_epoch_protocol_public_key: Option, + pub next_epoch_network_public_key: Option, + pub next_epoch_worker_public_key: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] pub next_epoch_proof_of_possession: Option>, pub next_epoch_net_address: Option, pub next_epoch_p2p_address: Option, @@ -263,23 +210,17 @@ pub struct ValidatorSummary { pub next_epoch_worker_address: Option, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub voting_power: u64, pub operation_cap_id: ObjectId, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub gas_price: u64, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub commission_rate: u64, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub next_epoch_stake: u64, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub next_epoch_gas_price: u64, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub next_epoch_commission_rate: u64, // Staking pool information @@ -287,41 +228,32 @@ pub struct ValidatorSummary { pub staking_pool_id: ObjectId, /// The epoch at which this pool became active. #[serde_as(as = "Option>")] - #[schemars(with = "Option")] pub staking_pool_activation_epoch: Option, /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active}, #[serde_as(as = "Option>")] - #[schemars(with = "Option")] pub staking_pool_deactivation_epoch: Option, /// The total number of SUI tokens in this pool. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub staking_pool_sui_balance: u64, /// The epoch stake rewards will be added here at the end of each epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub rewards_pool: u64, /// Total number of pool tokens issued by the pool. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub pool_token_balance: u64, /// Pending stake amount for this epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub pending_stake: u64, /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub pending_total_sui_withdraw: u64, /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub pending_pool_token_withdraw: u64, /// ID of the exchange rate table object. pub exchange_rates_id: ObjectId, /// Number of exchange rates in the table. #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "U64")] pub exchange_rates_size: u64, } @@ -375,18 +307,14 @@ impl From for GetCurrentProtocolConfig { "/system/protocol" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("System") - .operation_id("GetCurrentProtocolConfig") - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .header::(X_SUI_MIN_SUPPORTED_PROTOCOL_VERSION, generator) - .header::(X_SUI_MAX_SUPPORTED_PROTOCOL_VERSION, generator) - .build(), - ) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_current_protocol_config) } @@ -598,26 +508,6 @@ impl ApiEndpoint for GetProtocolConfig { "/system/protocol/{version}" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("System") - .operation_id("GetProtocolConfig") - .path_parameter::("version", generator) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .header::(X_SUI_MIN_SUPPORTED_PROTOCOL_VERSION, generator) - .header::(X_SUI_MAX_SUPPORTED_PROTOCOL_VERSION, generator) - .build(), - ) - .response(404, ResponseBuilder::new().build()) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_protocol_config) } @@ -692,11 +582,10 @@ fn supported_protocol_headers() -> SupportedProtocolHeaders { ] } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] #[serde(rename = "ProtocolConfig")] pub struct ProtocolConfigResponse { #[serde(with = "serde_with::As::")] - #[schemars(with = "U64")] pub protocol_version: u64, pub feature_flags: BTreeMap, pub attributes: BTreeMap, @@ -738,22 +627,6 @@ impl ApiEndpoint for GetGasInfo { "/system/gas" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("System") - .operation_id("GetGasInfo") - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_gas_info) } @@ -780,9 +653,8 @@ async fn get_gas_info( })) } -#[derive(serde::Serialize, serde::Deserialize, JsonSchema)] +#[derive(serde::Serialize, serde::Deserialize)] pub struct GasInfo { #[serde(with = "serde_with::As::")] - #[schemars(with = "U64")] pub reference_gas_price: u64, } diff --git a/crates/sui-rpc-api/src/rest/transactions/execution.rs b/crates/sui-rpc-api/src/rest/transactions/execution.rs index 141126ee71e42..70d44e483b4db 100644 --- a/crates/sui-rpc-api/src/rest/transactions/execution.rs +++ b/crates/sui-rpc-api/src/rest/transactions/execution.rs @@ -1,18 +1,15 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +use super::{ApiEndpoint, RouteHandler}; use crate::response::Bcs; -use crate::rest::openapi::{ - ApiEndpoint, OperationBuilder, RequestBodyBuilder, ResponseBuilder, RouteHandler, -}; use crate::types::ExecuteTransactionOptions; use crate::types::ExecuteTransactionResponse; use crate::{Result, RpcService}; use axum::extract::{Query, State}; use axum::Json; -use schemars::JsonSchema; use std::net::SocketAddr; -use sui_sdk_types::types::{ +use sui_sdk_types::{ BalanceChange, Object, SignedTransaction, Transaction, TransactionEffects, TransactionEvents, }; @@ -27,24 +24,6 @@ impl ApiEndpoint for ExecuteTransaction { "/transactions" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Transactions") - .operation_id("ExecuteTransaction") - .query_parameters::(generator) - .request_body(RequestBodyBuilder::new().bcs_content().build()) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), execute_transaction) } @@ -78,24 +57,6 @@ impl ApiEndpoint for SimulateTransaction { "/transactions/simulate" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Transactions") - .operation_id("SimulateTransaction") - .query_parameters::(generator) - .request_body(RequestBodyBuilder::new().bcs_content().build()) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), simulate_transaction) } @@ -113,7 +74,7 @@ async fn simulate_transaction( } /// Response type for the transaction simulation endpoint -#[derive(Debug, serde::Serialize, serde::Deserialize, JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct TransactionSimulationResponse { pub effects: TransactionEffects, pub events: Option, @@ -123,21 +84,18 @@ pub struct TransactionSimulationResponse { } /// Query parameters for the simulate transaction endpoint -#[derive(Debug, Default, serde::Serialize, serde::Deserialize, JsonSchema)] +#[derive(Debug, Default, serde::Serialize, serde::Deserialize)] pub struct SimulateTransactionQueryParameters { /// Request `BalanceChanges` be included in the Response. #[serde(default)] #[serde(with = "serde_with::As::")] - #[schemars(with = "bool")] pub balance_changes: bool, /// Request input `Object`s be included in the Response. #[serde(default)] #[serde(with = "serde_with::As::")] - #[schemars(with = "bool")] pub input_objects: bool, /// Request output `Object`s be included in the Response. #[serde(default)] #[serde(with = "serde_with::As::")] - #[schemars(with = "bool")] pub output_objects: bool, } diff --git a/crates/sui-rpc-api/src/rest/transactions/mod.rs b/crates/sui-rpc-api/src/rest/transactions/mod.rs index 1ae447ac4d08a..2f5cedd8ab1e1 100644 --- a/crates/sui-rpc-api/src/rest/transactions/mod.rs +++ b/crates/sui-rpc-api/src/rest/transactions/mod.rs @@ -15,14 +15,11 @@ pub use resolve::ResolveTransactionResponse; use axum::extract::{Path, Query, State}; use axum::http::StatusCode; -use sui_sdk_types::types::CheckpointSequenceNumber; -use sui_sdk_types::types::TransactionDigest; +use sui_sdk_types::CheckpointSequenceNumber; +use sui_sdk_types::TransactionDigest; use tap::Pipe; -use crate::rest::openapi::ApiEndpoint; -use crate::rest::openapi::OperationBuilder; -use crate::rest::openapi::ResponseBuilder; -use crate::rest::openapi::RouteHandler; +use super::{ApiEndpoint, RouteHandler}; use crate::rest::PageCursor; use crate::types::GetTransactionOptions; use crate::types::TransactionResponse; @@ -42,25 +39,6 @@ impl ApiEndpoint for GetTransaction { "/transactions/{transaction}" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Transactions") - .operation_id("GetTransaction") - .path_parameter::("transaction", generator) - .query_parameters::(generator) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .response(404, ResponseBuilder::new().build()) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_transaction) } @@ -104,26 +82,6 @@ impl ApiEndpoint for ListTransactions { "/transactions" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Transactions") - .operation_id("ListTransactions") - .query_parameters::(generator) - .query_parameters::(generator) - .response( - 200, - ResponseBuilder::new() - .json_content::>(generator) - .header::(crate::types::X_SUI_CURSOR, generator) - .build(), - ) - .response(410, ResponseBuilder::new().build()) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), list_transactions) } @@ -250,10 +208,9 @@ impl serde::Serialize for TransactionCursor { } } -#[derive(Debug, Default, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, Default, serde::Serialize, serde::Deserialize)] pub struct ListTransactionsCursorParameters { pub limit: Option, - #[schemars(with = "Option")] pub start: Option, pub direction: Option, } diff --git a/crates/sui-rpc-api/src/rest/transactions/resolve/literal.rs b/crates/sui-rpc-api/src/rest/transactions/resolve/literal.rs index e64dffc00a4e4..e9e43b76f3842 100644 --- a/crates/sui-rpc-api/src/rest/transactions/resolve/literal.rs +++ b/crates/sui-rpc-api/src/rest/transactions/resolve/literal.rs @@ -7,9 +7,9 @@ use super::NormalizedPackage; use crate::Result; use crate::RpcServiceError; use move_binary_format::normalized::Type; -use sui_sdk_types::types::unresolved::Value; -use sui_sdk_types::types::Command; -use sui_sdk_types::types::ObjectId; +use sui_sdk_transaction_builder::unresolved::Value; +use sui_sdk_types::Command; +use sui_sdk_types::ObjectId; use sui_types::base_types::ObjectID; use sui_types::base_types::STD_ASCII_MODULE_NAME; use sui_types::base_types::STD_ASCII_STRUCT_NAME; diff --git a/crates/sui-rpc-api/src/rest/transactions/resolve/mod.rs b/crates/sui-rpc-api/src/rest/transactions/resolve/mod.rs index 631fb8196ef3a..db2701b79aeed 100644 --- a/crates/sui-rpc-api/src/rest/transactions/resolve/mod.rs +++ b/crates/sui-rpc-api/src/rest/transactions/resolve/mod.rs @@ -6,12 +6,8 @@ use std::collections::HashMap; use super::execution::SimulateTransactionQueryParameters; use super::TransactionSimulationResponse; +use super::{ApiEndpoint, RouteHandler}; use crate::reader::StateReader; -use crate::rest::openapi::ApiEndpoint; -use crate::rest::openapi::OperationBuilder; -use crate::rest::openapi::RequestBodyBuilder; -use crate::rest::openapi::ResponseBuilder; -use crate::rest::openapi::RouteHandler; use crate::service::objects::ObjectNotFoundError; use crate::Result; use crate::RpcService; @@ -21,13 +17,12 @@ use axum::extract::State; use axum::Json; use itertools::Itertools; use move_binary_format::normalized; -use schemars::JsonSchema; use sui_protocol_config::ProtocolConfig; -use sui_sdk_types::types::unresolved; -use sui_sdk_types::types::Argument; -use sui_sdk_types::types::Command; -use sui_sdk_types::types::ObjectId; -use sui_sdk_types::types::Transaction; +use sui_sdk_transaction_builder::unresolved; +use sui_sdk_types::Argument; +use sui_sdk_types::Command; +use sui_sdk_types::ObjectId; +use sui_sdk_types::Transaction; use sui_types::base_types::ObjectID; use sui_types::base_types::ObjectRef; use sui_types::base_types::SuiAddress; @@ -56,28 +51,6 @@ impl ApiEndpoint for ResolveTransaction { "/transactions/resolve" } - fn operation( - &self, - generator: &mut schemars::gen::SchemaGenerator, - ) -> openapiv3::v3_1::Operation { - OperationBuilder::new() - .tag("Transactions") - .operation_id("ResolveTransaction") - .query_parameters::(generator) - .request_body( - RequestBodyBuilder::new() - .json_content::(generator) - .build(), - ) - .response( - 200, - ResponseBuilder::new() - .json_content::(generator) - .build(), - ) - .build() - } - fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), resolve_transaction) } @@ -184,7 +157,7 @@ async fn resolve_transaction( } /// Query parameters for the resolve transaction endpoint -#[derive(Debug, Default, serde::Serialize, serde::Deserialize, JsonSchema)] +#[derive(Debug, Default, serde::Serialize, serde::Deserialize)] pub struct ResolveTransactionQueryParameters { /// Request that the fully resolved transaction be simulated and have its results sent back in /// the response. @@ -298,7 +271,7 @@ fn resolve_unresolved_transaction( } /// Response type for the execute transaction endpoint -#[derive(Debug, serde::Serialize, serde::Deserialize, JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct ResolveTransactionResponse { pub transaction: Transaction, pub simulation: Option, @@ -409,7 +382,7 @@ fn resolve_arg( ) -> Result { use fastcrypto::encoding::Base64; use fastcrypto::encoding::Encoding; - use sui_sdk_types::types::unresolved::InputKind::*; + use sui_sdk_transaction_builder::unresolved::InputKind::*; let unresolved::Input { kind, @@ -508,8 +481,8 @@ fn resolve_object( commands: &[Command], arg_idx: usize, object_id: ObjectId, - version: Option, - digest: Option, + version: Option, + digest: Option, _mutable: Option, ) -> Result { let id = object_id.into(); @@ -614,7 +587,7 @@ fn is_input_argument_receiving( // real type needs to be lookedup from the provided type args in the MoveCall itself fn arg_type_of_move_call_input<'a>( called_packages: &'a HashMap, - move_call: &sui_sdk_types::types::MoveCall, + move_call: &sui_sdk_types::MoveCall, idx: usize, ) -> Result<&'a move_binary_format::normalized::Type> { let function = called_packages diff --git a/crates/sui-rpc-api/src/service/checkpoints.rs b/crates/sui-rpc-api/src/service/checkpoints.rs index 219a9c7133323..564c8f97500e2 100644 --- a/crates/sui-rpc-api/src/service/checkpoints.rs +++ b/crates/sui-rpc-api/src/service/checkpoints.rs @@ -9,10 +9,10 @@ use crate::types::GetCheckpointOptions; use crate::types::GetFullCheckpointOptions; use crate::Result; use crate::RpcService; -use sui_sdk_types::types::CheckpointContents; -use sui_sdk_types::types::CheckpointDigest; -use sui_sdk_types::types::CheckpointSequenceNumber; -use sui_sdk_types::types::SignedCheckpointSummary; +use sui_sdk_types::CheckpointContents; +use sui_sdk_types::CheckpointDigest; +use sui_sdk_types::CheckpointSequenceNumber; +use sui_sdk_types::SignedCheckpointSummary; use tap::Pipe; impl RpcService { @@ -269,26 +269,14 @@ fn object_to_object_response( .pipe(Ok) } -#[derive(Debug, Copy, Clone, Eq, PartialEq, schemars::JsonSchema)] -#[schemars(untagged)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum CheckpointId { - #[schemars( - title = "SequenceNumber", - example = "CheckpointSequenceNumber::default" - )] /// Sequence number or height of a Checkpoint - SequenceNumber(#[schemars(with = "crate::rest::_schemars::U64")] CheckpointSequenceNumber), - #[schemars(title = "Digest", example = "example_digest")] + SequenceNumber(CheckpointSequenceNumber), /// Base58 encoded 32-byte digest of a Checkpoint Digest(CheckpointDigest), } -fn example_digest() -> CheckpointDigest { - "4btiuiMPvEENsttpZC7CZ53DruC3MAgfznDbASZ7DR6S" - .parse() - .unwrap() -} - impl<'de> serde::Deserialize<'de> for CheckpointId { fn deserialize(deserializer: D) -> std::result::Result where diff --git a/crates/sui-rpc-api/src/service/committee.rs b/crates/sui-rpc-api/src/service/committee.rs index 323c52b9f4e35..20d3a9f5d084d 100644 --- a/crates/sui-rpc-api/src/service/committee.rs +++ b/crates/sui-rpc-api/src/service/committee.rs @@ -3,7 +3,7 @@ use crate::Result; use crate::RpcService; -use sui_sdk_types::types::{EpochId, ValidatorCommittee}; +use sui_sdk_types::{EpochId, ValidatorCommittee}; impl RpcService { pub fn get_committee(&self, epoch: Option) -> Result { diff --git a/crates/sui-rpc-api/src/service/info.rs b/crates/sui-rpc-api/src/service/info.rs index 342c154457c9d..539631cb41d06 100644 --- a/crates/sui-rpc-api/src/service/info.rs +++ b/crates/sui-rpc-api/src/service/info.rs @@ -3,7 +3,7 @@ use crate::Result; use crate::{types::NodeInfo, RpcService}; -use sui_sdk_types::types::CheckpointDigest; +use sui_sdk_types::CheckpointDigest; use tap::Pipe; impl RpcService { diff --git a/crates/sui-rpc-api/src/service/objects.rs b/crates/sui-rpc-api/src/service/objects.rs index 950d65ed002fc..ceec742c31b87 100644 --- a/crates/sui-rpc-api/src/service/objects.rs +++ b/crates/sui-rpc-api/src/service/objects.rs @@ -5,8 +5,8 @@ use crate::types::GetObjectOptions; use crate::types::ObjectResponse; use crate::Result; use crate::RpcService; -use sui_sdk_types::types::ObjectId; -use sui_sdk_types::types::Version; +use sui_sdk_types::ObjectId; +use sui_sdk_types::Version; use tap::Pipe; impl RpcService { diff --git a/crates/sui-rpc-api/src/service/transactions/execution.rs b/crates/sui-rpc-api/src/service/transactions/execution.rs index b0bc83c045de3..cfb4c65358ed4 100644 --- a/crates/sui-rpc-api/src/service/transactions/execution.rs +++ b/crates/sui-rpc-api/src/service/transactions/execution.rs @@ -9,14 +9,14 @@ use crate::types::ExecuteTransactionResponse; use crate::Result; use crate::RpcService; use crate::RpcServiceError; -use sui_sdk_types::types::framework::Coin; -use sui_sdk_types::types::Address; -use sui_sdk_types::types::BalanceChange; -use sui_sdk_types::types::Object; -use sui_sdk_types::types::Owner; -use sui_sdk_types::types::SignedTransaction; -use sui_sdk_types::types::Transaction; -use sui_sdk_types::types::TransactionEffects; +use sui_sdk_types::framework::Coin; +use sui_sdk_types::Address; +use sui_sdk_types::BalanceChange; +use sui_sdk_types::Object; +use sui_sdk_types::Owner; +use sui_sdk_types::SignedTransaction; +use sui_sdk_types::Transaction; +use sui_sdk_types::TransactionEffects; use sui_types::transaction_executor::SimulateTransactionResult; use tap::Pipe; diff --git a/crates/sui-rpc-api/src/service/transactions/mod.rs b/crates/sui-rpc-api/src/service/transactions/mod.rs index b43f17e736877..3c6420f3bfc04 100644 --- a/crates/sui-rpc-api/src/service/transactions/mod.rs +++ b/crates/sui-rpc-api/src/service/transactions/mod.rs @@ -5,7 +5,7 @@ use crate::types::GetTransactionOptions; use crate::types::TransactionResponse; use crate::Result; use crate::RpcService; -use sui_sdk_types::types::TransactionDigest; +use sui_sdk_types::TransactionDigest; use tap::Pipe; mod execution; diff --git a/crates/sui-rpc-api/src/types.rs b/crates/sui-rpc-api/src/types.rs index 188ff120f9bf7..087bd1934fd11 100644 --- a/crates/sui-rpc-api/src/types.rs +++ b/crates/sui-rpc-api/src/types.rs @@ -37,62 +37,55 @@ pub const X_SUI_TIMESTAMP_MS: &str = "x-sui-timestamp-ms"; /// Basic information about the state of a Node #[serde_with::serde_as] -#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct NodeInfo { /// The chain identifier of the chain that this Node is on - pub chain_id: sui_sdk_types::types::CheckpointDigest, + pub chain_id: sui_sdk_types::CheckpointDigest, /// Human readable name of the chain that this Node is on pub chain: std::borrow::Cow<'static, str>, /// Current epoch of the Node based on its highest executed checkpoint #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "crate::rest::_schemars::U64")] pub epoch: u64, /// Checkpoint height of the most recently executed checkpoint #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "crate::rest::_schemars::U64")] pub checkpoint_height: u64, /// Unix timestamp of the most recently executed checkpoint #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "crate::rest::_schemars::U64")] pub timestamp_ms: u64, /// The lowest checkpoint for which checkpoints and transaction data is available #[serde_as(as = "Option>")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub lowest_available_checkpoint: Option, /// The lowest checkpoint for which object data is available #[serde_as(as = "Option>")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub lowest_available_checkpoint_objects: Option, pub software_version: std::borrow::Cow<'static, str>, } #[serde_with::serde_as] -#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] pub struct ObjectResponse { - pub object_id: sui_sdk_types::types::ObjectId, + pub object_id: sui_sdk_types::ObjectId, #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "crate::rest::_schemars::U64")] - pub version: sui_sdk_types::types::Version, - pub digest: sui_sdk_types::types::ObjectDigest, + pub version: sui_sdk_types::Version, + pub digest: sui_sdk_types::ObjectDigest, #[serde(skip_serializing_if = "Option::is_none")] - pub object: Option, + pub object: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub object_bcs: Option>, } -#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct GetObjectOptions { /// Request that `Object` be included in the response /// @@ -117,35 +110,32 @@ impl GetObjectOptions { } #[serde_with::serde_as] -#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] pub struct CheckpointResponse { #[serde_as(as = "sui_types::sui_serde::BigInt")] - #[schemars(with = "crate::rest::_schemars::U64")] - pub sequence_number: sui_sdk_types::types::CheckpointSequenceNumber, + pub sequence_number: sui_sdk_types::CheckpointSequenceNumber, - pub digest: sui_sdk_types::types::CheckpointDigest, + pub digest: sui_sdk_types::CheckpointDigest, #[serde(skip_serializing_if = "Option::is_none")] - pub summary: Option, + pub summary: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub summary_bcs: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub signature: Option, + pub signature: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub contents: Option, + pub contents: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub contents_bcs: Option>, } -#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct GetCheckpointOptions { /// Request `CheckpointSummary` be included in the response /// @@ -201,58 +191,52 @@ impl GetCheckpointOptions { } #[serde_with::serde_as] -#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct TransactionResponse { - pub digest: sui_sdk_types::types::TransactionDigest, + pub digest: sui_sdk_types::TransactionDigest, #[serde(skip_serializing_if = "Option::is_none")] - pub transaction: Option, + pub transaction: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub transaction_bcs: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub signatures: Option>, + pub signatures: Option>, #[serde_as(as = "Option>")] - #[schemars(with = "Option>")] #[serde(skip_serializing_if = "Option::is_none")] pub signatures_bytes: Option>>, #[serde(skip_serializing_if = "Option::is_none")] - pub effects: Option, + pub effects: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub effects_bcs: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub events: Option, + pub events: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub events_bcs: Option>, #[serde_as( as = "Option, _>>" )] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub checkpoint: Option, #[serde_as( as = "Option, _>>" )] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub timestamp_ms: Option, } -#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct GetTransactionOptions { /// Request `Transaction` be included in the response /// @@ -338,7 +322,7 @@ impl GetTransactionOptions { } /// Options for the execute transaction endpoint -#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct ExecuteTransactionOptions { /// Request `TransactionEffects` be included in the Response. /// @@ -403,49 +387,46 @@ impl ExecuteTransactionOptions { /// Response type for the execute transaction endpoint #[serde_with::serde_as] -#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct ExecuteTransactionResponse { pub finality: EffectsFinality, #[serde(skip_serializing_if = "Option::is_none")] - pub effects: Option, + pub effects: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub effects_bcs: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub events: Option, + pub events: Option, #[serde_as(as = "Option")] - #[schemars(with = "Option")] #[serde(skip_serializing_if = "Option::is_none")] pub events_bcs: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub balance_changes: Option>, - // pub input_objects: Option>, - // pub output_objects: Option>, + pub balance_changes: Option>, + // pub input_objects: Option>, + // pub output_objects: Option>, } #[serde_with::serde_as] -#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] #[serde(tag = "finality", rename_all = "snake_case")] pub enum EffectsFinality { Certified { /// Validator aggregated signature - signature: sui_sdk_types::types::ValidatorAggregatedSignature, + signature: sui_sdk_types::ValidatorAggregatedSignature, }, Checkpointed { #[serde_as(as = "sui_types::sui_serde::Readable, _>")] - #[schemars(with = "crate::rest::_schemars::U64")] - checkpoint: sui_sdk_types::types::CheckpointSequenceNumber, + checkpoint: sui_sdk_types::CheckpointSequenceNumber, }, QuorumExecuted, } -#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct GetFullCheckpointOptions { /// Request `CheckpointSummary` be included in the response /// @@ -613,13 +594,13 @@ impl GetFullCheckpointOptions { #[derive(Clone, Debug, PartialEq)] pub struct FullCheckpointResponse { - pub sequence_number: sui_sdk_types::types::CheckpointSequenceNumber, - pub digest: sui_sdk_types::types::CheckpointDigest, + pub sequence_number: sui_sdk_types::CheckpointSequenceNumber, + pub digest: sui_sdk_types::CheckpointDigest, - pub summary: Option, + pub summary: Option, pub summary_bcs: Option>, - pub signature: Option, - pub contents: Option, + pub signature: Option, + pub contents: Option, pub contents_bcs: Option>, pub transactions: Vec, @@ -627,15 +608,15 @@ pub struct FullCheckpointResponse { #[derive(Clone, Debug, PartialEq)] pub struct FullCheckpointTransaction { - pub digest: sui_sdk_types::types::TransactionDigest, + pub digest: sui_sdk_types::TransactionDigest, - pub transaction: Option, + pub transaction: Option, pub transaction_bcs: Option>, - pub effects: Option, + pub effects: Option, pub effects_bcs: Option>, - pub events: Option, + pub events: Option, pub events_bcs: Option>, pub input_objects: Option>, @@ -644,10 +625,10 @@ pub struct FullCheckpointTransaction { #[derive(Clone, Debug, PartialEq)] pub struct FullCheckpointObject { - pub object_id: sui_sdk_types::types::ObjectId, - pub version: sui_sdk_types::types::Version, - pub digest: sui_sdk_types::types::ObjectDigest, + pub object_id: sui_sdk_types::ObjectId, + pub version: sui_sdk_types::Version, + pub digest: sui_sdk_types::ObjectDigest, - pub object: Option, + pub object: Option, pub object_bcs: Option>, } diff --git a/crates/sui-rpc-api/tests/openapi.rs b/crates/sui-rpc-api/tests/openapi.rs deleted file mode 100644 index 08172b7be894d..0000000000000 --- a/crates/sui-rpc-api/tests/openapi.rs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -use sui_rpc_api::rest::info; -use sui_rpc_api::rest::openapi; -use sui_rpc_api::rest::ENDPOINTS; - -#[test] -fn openapi_spec() { - const OPENAPI_SPEC_FILE: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/openapi/openapi.json"); - - let openapi = { - let mut api = openapi::Api::new(info("unknown")); - - api.register_endpoints(ENDPOINTS.iter().copied()); - api.openapi() - }; - - let mut actual = serde_json::to_string_pretty(&openapi).unwrap(); - actual.push('\n'); - - // Update the expected format - if std::env::var_os("UPDATE").is_some() { - std::fs::write(OPENAPI_SPEC_FILE, &actual).unwrap(); - } - - let expected = std::fs::read_to_string(OPENAPI_SPEC_FILE).unwrap(); - - let diff = diffy::create_patch(&expected, &actual); - - if !diff.hunks().is_empty() { - let formatter = if std::io::IsTerminal::is_terminal(&std::io::stderr()) { - diffy::PatchFormatter::new().with_color() - } else { - diffy::PatchFormatter::new() - }; - let header = "Generated and checked-in openapi spec does not match. \ - Re-run with `UPDATE=1` to update expected format"; - panic!("{header}\n\n{}", formatter.fmt_patch(&diff)); - } -} - -#[tokio::test] -async fn openapi_explorer() { - // Unless env var is set, just early return - if std::env::var_os("OPENAPI_EXPLORER").is_none() { - return; - } - - let openapi = { - let mut api = openapi::Api::new(info("unknown")); - api.register_endpoints(ENDPOINTS.to_owned()); - api.openapi() - }; - - let router = openapi::OpenApiDocument::new(openapi).into_router(); - - let listener = tokio::net::TcpListener::bind("127.0.0.1:8000") - .await - .unwrap(); - axum::serve(listener, router).await.unwrap(); -} diff --git a/crates/sui-types/src/sui_sdk_types_conversions.rs b/crates/sui-types/src/sui_sdk_types_conversions.rs index a576fb1828515..915141bf35ba4 100644 --- a/crates/sui-types/src/sui_sdk_types_conversions.rs +++ b/crates/sui-types/src/sui_sdk_types_conversions.rs @@ -9,7 +9,7 @@ //! directly to avoid going through the BCS machinery. use fastcrypto::traits::ToFromBytes; -use sui_sdk_types::types::*; +use sui_sdk_types::*; use tap::Pipe; #[derive(Debug)] diff --git a/scripts/update_all_snapshots.sh b/scripts/update_all_snapshots.sh index e6aa625397d4b..786f71bed5051 100755 --- a/scripts/update_all_snapshots.sh +++ b/scripts/update_all_snapshots.sh @@ -16,4 +16,3 @@ cd "$ROOT/crates/sui-swarm-config" && cargo insta test --review cd "$ROOT/crates/sui-open-rpc" && cargo run --example generate-json-rpc-spec -- record cd "$ROOT/crates/sui-core" && cargo run --example generate-format -- print > tests/staged/sui.yaml UPDATE=1 cargo test -p sui-framework --test build-system-packages -UPDATE=1 cargo test -p sui-rpc-api