diff --git a/.github/workflows/indexer-processor-testing.yaml b/.github/workflows/indexer-processor-testing.yaml index de9656487c1fa..9c93b737076d8 100644 --- a/.github/workflows/indexer-processor-testing.yaml +++ b/.github/workflows/indexer-processor-testing.yaml @@ -63,7 +63,7 @@ jobs: sed -i "s/MAINNET_API_KEY/${{ steps.api_key_tokens.outputs.mainnet_api_key }}/g" ./imported_transactions/imported_transactions.yaml cat ./imported_transactions/imported_transactions.yaml # Print the updated file for verification - cargo run -- --testing-folder ./imported_transactions --output-folder ../indexer-test-transactions/new_json_transactions + cargo run -- --testing-folder ./imported_transactions --output-folder ../indexer-test-transactions/src/new_json_transactions - name: Install jq run: sudo apt-get install jq # Ensure jq is installed for JSON processing @@ -72,10 +72,10 @@ jobs: # Prepare Original and New JSON Files - name: Prepare and Clean JSON Files run: | - cd ecosystem/indexer-grpc/indexer-test-transactions - ls -al ./new_json_transactions/scripted_transactions + cd ecosystem/indexer-grpc/indexer-test-transactions/src + ls -al ./new_json_transactions - for folder in json_transactions/scripted_transactions new_json_transactions/scripted_transactions; do + for folder in json_transactions/scripted_transactions new_json_transactions/json_transactions/scripted_transactions; do for file in $folder/*.json; do echo "Processing $file..." base_file=$(basename "$file") diff --git a/Cargo.lock b/Cargo.lock index 1a0c1b7d43a64..9e6a80da4bbeb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,6 +131,21 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "allocative" version = "0.3.3" @@ -275,7 +290,7 @@ dependencies = [ [[package]] name = "aptos" -version = "5.1.0" +version = "6.0.1" dependencies = [ "anyhow", "aptos-api-types", @@ -947,7 +962,7 @@ dependencies = [ "maplit", "mini-moka", "mirai-annotations", - "mockall 0.11.4", + "mockall", "move-core-types", "num-derive", "num-traits", @@ -1128,7 +1143,7 @@ dependencies = [ "futures", "itertools 0.13.0", "maplit", - "mockall 0.11.4", + "mockall", "ordered-float 3.9.2", "rand 0.8.5", "serde", @@ -1174,7 +1189,6 @@ dependencies = [ "aptos-crypto", "aptos-db-indexer", "aptos-db-indexer-schemas", - "aptos-executor", "aptos-executor-types", "aptos-experimental-runtimes", "aptos-infallible", @@ -1197,14 +1211,12 @@ dependencies = [ "clap 4.5.21", "crossbeam-channel", "dashmap", - "derive_more", "either", "hex", "indicatif 0.15.0", "itertools 0.13.0", "lru 0.7.8", "move-core-types", - "num-derive", "once_cell", "owo-colors", "proptest", @@ -1450,18 +1462,15 @@ dependencies = [ "aptos-crypto", "aptos-db", "aptos-db-indexer", - "aptos-db-indexer-schemas", "aptos-drop-helper", "aptos-executor-service", "aptos-executor-test-helpers", "aptos-executor-types", "aptos-experimental-runtimes", - "aptos-genesis", "aptos-indexer-grpc-table-info", "aptos-infallible", "aptos-logger", "aptos-metrics-core", - "aptos-scratchpad", "aptos-sdk", "aptos-storage-interface", "aptos-temppath", @@ -1472,7 +1481,6 @@ dependencies = [ "bcs 0.1.4", "bytes", "criterion", - "dashmap", "fail", "itertools 0.13.0", "move-core-types", @@ -1605,7 +1613,7 @@ dependencies = [ "aptos-types", "bcs 0.1.4", "criterion", - "derive_more", + "derive_more 0.99.17", "itertools 0.13.0", "once_cell", "ouroboros", @@ -2111,7 +2119,7 @@ dependencies = [ "aptos-indexer-grpc-server-framework", "aptos-indexer-grpc-utils", "aptos-metrics-core", - "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=4801acae7aea30d7e96bbfbe5ec5b04056dfa4cf)", + "aptos-moving-average", "aptos-protos 1.3.1", "async-trait", "clap 4.5.21", @@ -2138,7 +2146,7 @@ dependencies = [ "aptos-indexer-grpc-server-framework", "aptos-indexer-grpc-utils", "aptos-metrics-core", - "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=4801acae7aea30d7e96bbfbe5ec5b04056dfa4cf)", + "aptos-moving-average", "aptos-protos 1.3.1", "aptos-transaction-filter", "async-trait", @@ -2198,7 +2206,7 @@ dependencies = [ "aptos-indexer-grpc-server-framework", "aptos-indexer-grpc-utils", "aptos-metrics-core", - "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=4801acae7aea30d7e96bbfbe5ec5b04056dfa4cf)", + "aptos-moving-average", "async-trait", "clap 4.5.21", "futures", @@ -2252,7 +2260,7 @@ dependencies = [ "aptos-mempool", "aptos-mempool-notifications", "aptos-metrics-core", - "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=4801acae7aea30d7e96bbfbe5ec5b04056dfa4cf)", + "aptos-moving-average", "aptos-proptest-helpers", "aptos-protos 1.3.1", "aptos-runtimes", @@ -2306,12 +2314,17 @@ name = "aptos-indexer-grpc-manager" version = "1.0.0" dependencies = [ "anyhow", + "aptos-config", "aptos-indexer-grpc-server-framework", + "aptos-protos 1.3.1", "async-trait", "clap 4.5.21", "jemallocator", "serde", "tokio", + "tokio-scoped", + "tonic 0.12.3", + "tracing", ] [[package]] @@ -2399,38 +2412,6 @@ dependencies = [ "url", ] -[[package]] -name = "aptos-indexer-processor-sdk" -version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=9ecd252ccff53023664562001dd04c2886488c0d#9ecd252ccff53023664562001dd04c2886488c0d" -dependencies = [ - "anyhow", - "aptos-indexer-transaction-stream", - "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb)", - "async-trait", - "bcs 0.1.4", - "bigdecimal", - "chrono", - "derive_builder", - "futures", - "hex", - "instrumented-channel", - "kanal", - "mockall 0.12.1", - "num_cpus", - "once_cell", - "petgraph 0.6.5", - "prometheus", - "prometheus-client", - "serde", - "serde_json", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "url", -] - [[package]] name = "aptos-indexer-test-transactions" version = "1.0.0" @@ -2464,27 +2445,6 @@ dependencies = [ "url", ] -[[package]] -name = "aptos-indexer-transaction-stream" -version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=9ecd252ccff53023664562001dd04c2886488c0d#9ecd252ccff53023664562001dd04c2886488c0d" -dependencies = [ - "anyhow", - "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=9ecd252ccff53023664562001dd04c2886488c0d)", - "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb)", - "chrono", - "futures-util", - "once_cell", - "prometheus", - "prost 0.12.3", - "sample", - "serde", - "tokio", - "tonic 0.11.0", - "tracing", - "url", -] - [[package]] name = "aptos-infallible" version = "0.1.0" @@ -2665,8 +2625,10 @@ dependencies = [ "aptos-metrics-core", "aptos-types", "ark-bls12-381", + "ark-bn254", "ark-ec", "ark-ff", + "ark-groth16", "ark-serialize", "bcs 0.1.4", "dashmap", @@ -2970,23 +2932,7 @@ dependencies = [ [[package]] name = "aptos-moving-average" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=4801acae7aea30d7e96bbfbe5ec5b04056dfa4cf#4801acae7aea30d7e96bbfbe5ec5b04056dfa4cf" -dependencies = [ - "chrono", -] - -[[package]] -name = "aptos-moving-average" -version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=51a34901b40d7f75767ac907b4d2478104d6a515#51a34901b40d7f75767ac907b4d2478104d6a515" -dependencies = [ - "chrono", -] - -[[package]] -name = "aptos-moving-average" -version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=9ecd252ccff53023664562001dd04c2886488c0d#9ecd252ccff53023664562001dd04c2886488c0d" +source = "git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=3064a075e1abc06c60363f3f2551cc41f5c091de#3064a075e1abc06c60363f3f2551cc41f5c091de" dependencies = [ "chrono", ] @@ -3438,7 +3384,7 @@ dependencies = [ "claims", "futures", "maplit", - "mockall 0.11.4", + "mockall", "once_cell", "rand 0.7.3", "serde", @@ -3504,13 +3450,12 @@ dependencies = [ [[package]] name = "aptos-protos" version = "1.3.1" -source = "git+https://github.com/aptos-labs/aptos-core.git?rev=5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb#5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb" +source = "git+https://github.com/aptos-labs/aptos-core.git?rev=6116af69aa173ca49e1761daabd6fe103fe2c65e#6116af69aa173ca49e1761daabd6fe103fe2c65e" dependencies = [ - "futures-core", "pbjson", - "prost 0.12.3", + "prost 0.13.4", "serde", - "tonic 0.11.0", + "tonic 0.12.3", ] [[package]] @@ -3526,6 +3471,7 @@ version = "0.1.0" dependencies = [ "aptos-logger", "aptos-metrics-core", + "rand 0.7.3", "ureq", "url", ] @@ -3777,7 +3723,7 @@ name = "aptos-schemadb" version = "0.1.0" dependencies = [ "anyhow", - "aptos-infallible", + "aptos-drop-helper", "aptos-logger", "aptos-metrics-core", "aptos-storage-interface", @@ -3796,10 +3742,10 @@ version = "0.1.0" dependencies = [ "aptos-crypto", "aptos-drop-helper", - "aptos-experimental-runtimes", "aptos-infallible", "aptos-metrics-core", "aptos-types", + "aptos-vm", "bitvec 1.0.1", "criterion", "itertools 0.13.0", @@ -3826,6 +3772,7 @@ dependencies = [ "bcs 0.1.4", "ed25519-dalek-bip32", "hex", + "lazy_static", "move-core-types", "once_cell", "rand 0.7.3", @@ -3961,7 +3908,7 @@ dependencies = [ "bcs 0.1.4", "claims", "futures", - "mockall 0.11.4", + "mockall", "move-core-types", "ntest", "once_cell", @@ -3978,27 +3925,24 @@ version = "0.1.0" dependencies = [ "anyhow", "aptos-crypto", - "aptos-drop-helper", - "aptos-experimental-runtimes", - "aptos-logger", + "aptos-experimental-layered-map", "aptos-metrics-core", "aptos-scratchpad", "aptos-secure-net", "aptos-types", - "aptos-vm", "arr_macro", - "assert_unordered", "bcs 0.1.4", - "crossbeam-channel", "dashmap", + "derive_more 0.99.17", + "itertools 0.13.0", "once_cell", "parking_lot 0.12.1", "proptest", "proptest-derive", + "rand 0.7.3", "rayon", "serde", "thiserror", - "threadpool", ] [[package]] @@ -4052,7 +3996,7 @@ dependencies = [ "futures", "maplit", "mini-moka", - "mockall 0.11.4", + "mockall", "once_cell", "rand 0.7.3", "serde", @@ -4435,7 +4379,6 @@ dependencies = [ "aptos-proptest-helpers", "arbitrary", "ark-bn254", - "ark-crypto-primitives", "ark-ec", "ark-ff", "ark-groth16", @@ -4477,7 +4420,6 @@ dependencies = [ "quick_cache", "rand 0.7.3", "rayon", - "regex", "reqwest 0.11.23", "ring 0.16.20", "rsa 0.9.6", @@ -4583,10 +4525,11 @@ dependencies = [ "bytes", "claims", "crossbeam-channel", - "derive_more", + "derive_more 0.99.17", "fail", "futures", "hex", + "itertools 0.13.0", "move-binary-format", "move-core-types", "move-unit-test", @@ -4750,9 +4693,11 @@ dependencies = [ "aptos-vm-environment", "aptos-vm-genesis", "aptos-vm-logging", - "aptos-vm-types", "fail", + "move-binary-format", "move-core-types", + "move-vm-runtime", + "move-vm-types", "rand 0.7.3", ] @@ -5079,15 +5024,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c07dab4369547dbe5114677b33fbbf724971019f3818172d59a97a61c774ffd" -[[package]] -name = "assert_unordered" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74323b7881323eb351134e08ee5331594826789557afef8e309baf481b2264" -dependencies = [ - "ansi_term", -] - [[package]] name = "async-channel" version = "1.9.0" @@ -5118,6 +5054,7 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" dependencies = [ + "brotli", "flate2", "futures-core", "memchr", @@ -5925,6 +5862,27 @@ dependencies = [ "serde_with", ] +[[package]] +name = "brotli" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bstr" version = "0.2.17" @@ -6201,9 +6159,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" @@ -6622,18 +6580,18 @@ checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" [[package]] name = "const_format" -version = "0.2.32" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.32" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" dependencies = [ "proc-macro2", "quote", @@ -7137,12 +7095,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.9", - "darling_macro 0.20.9", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -7161,9 +7119,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", @@ -7186,11 +7144,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.9", + "darling_core 0.20.10", "quote", "syn 2.0.87", ] @@ -7284,17 +7242,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "delegate" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e018fccbeeb50ff26562ece792ed06659b9c2dae79ece77c4456bb10d9bf79b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "der" version = "0.5.1" @@ -7370,7 +7317,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" dependencies = [ - "darling 0.20.9", + "darling 0.20.10", "proc-macro2", "quote", "syn 2.0.87", @@ -7410,6 +7357,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + [[package]] name = "determinator" version = "0.12.0" @@ -7646,12 +7614,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" -[[package]] -name = "dtoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" - [[package]] name = "dunce" version = "1.0.4" @@ -9072,7 +9034,7 @@ dependencies = [ "fixedbitset 0.4.2", "guppy-summaries", "guppy-workspace-hack", - "indexmap 2.6.0", + "indexmap 2.7.0", "itertools 0.12.1", "nested", "once_cell", @@ -9121,7 +9083,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.11", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util 0.7.10", @@ -9140,7 +9102,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util 0.7.10", @@ -9569,7 +9531,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -9919,9 +9881,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown 0.15.1", @@ -9971,7 +9933,7 @@ dependencies = [ "crossbeam-utils", "dashmap", "env_logger", - "indexmap 2.6.0", + "indexmap 2.7.0", "is-terminal", "itoa", "log", @@ -10003,19 +9965,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "instrumented-channel" -version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=9ecd252ccff53023664562001dd04c2886488c0d#9ecd252ccff53023664562001dd04c2886488c0d" -dependencies = [ - "delegate", - "derive_builder", - "kanal", - "once_cell", - "prometheus", - "prometheus-client", -] - [[package]] name = "integer-encoding" version = "3.0.4" @@ -11005,23 +10954,8 @@ dependencies = [ "downcast", "fragile", "lazy_static", - "mockall_derive 0.11.4", - "predicates 2.1.5", - "predicates-tree", -] - -[[package]] -name = "mockall" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43766c2b5203b10de348ffe19f7e54564b64f3d6018ff7648d1e2d6d3a0f0a48" -dependencies = [ - "cfg-if", - "downcast", - "fragile", - "lazy_static", - "mockall_derive 0.12.1", - "predicates 3.1.2", + "mockall_derive", + "predicates", "predicates-tree", ] @@ -11037,18 +10971,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "mockall_derive" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2" -dependencies = [ - "cfg-if", - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "module-generation" version = "0.1.0" @@ -11120,7 +11042,7 @@ dependencies = [ "arbitrary", "backtrace", "dearbitrary", - "indexmap 1.9.3", + "indexmap 2.7.0", "move-bytecode-spec", "move-core-types", "proptest", @@ -12216,9 +12138,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -12290,7 +12212,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc7c92f190c97f79b4a332f5e81dcf68c8420af2045c936c9be0bc9de6f63b5" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -12554,9 +12476,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open" -version = "5.3.1" +version = "5.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ecd52f0b8d15c40ce4820aa251ed5de032e5d91fab27f7db2f40d42a8bdf69c" +checksum = "e2483562e62ea94312f3576a7aca397306df7990b8d89033e18766744377ef95" dependencies = [ "is-wsl", "libc", @@ -12860,7 +12782,7 @@ dependencies = [ "async-trait", "coset", "log", - "mockall 0.11.4", + "mockall", "p256", "passkey-types", "rand 0.8.5", @@ -12894,7 +12816,7 @@ dependencies = [ "ciborium", "coset", "data-encoding", - "indexmap 2.6.0", + "indexmap 2.7.0", "rand 0.8.5", "serde", "serde_json", @@ -13080,7 +13002,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.6.0", + "indexmap 2.7.0", ] [[package]] @@ -13291,10 +13213,12 @@ dependencies = [ [[package]] name = "poem" -version = "3.0.1" -source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3fdfe9432d654c5b#809b2816d3504beeba140fef3fdfe9432d654c5b" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fef0e102c6b811e0e01928eed4872b3ff63917f37dc2dab39a93db55f25d314d" dependencies = [ "anyhow", + "async-compression", "bytes", "chrono", "cookie 0.18.1", @@ -13306,12 +13230,12 @@ dependencies = [ "hyper-util", "mime", "multer 3.1.0", - "nix 0.28.0", + "nix 0.29.0", "parking_lot 0.12.1", "percent-encoding", "pin-project-lite", "poem-derive", - "quick-xml 0.32.0", + "quick-xml 0.36.2", "regex", "rfc7239", "rustls-pemfile 2.1.1", @@ -13334,8 +13258,9 @@ dependencies = [ [[package]] name = "poem-derive" -version = "3.0.0" -source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3fdfe9432d654c5b#809b2816d3504beeba140fef3fdfe9432d654c5b" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdfed15c1102d2a9a51b9f1aba945628c72ccb52fc5d3e4ad4ffbbd222e11821" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", @@ -13345,19 +13270,20 @@ dependencies = [ [[package]] name = "poem-openapi" -version = "5.0.2" -source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3fdfe9432d654c5b#809b2816d3504beeba140fef3fdfe9432d654c5b" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c354a706a81a17657da8441869c6ce3d486ef5e72705919d6035fb038a6f7b5" dependencies = [ "base64 0.22.1", "bytes", - "derive_more", + "derive_more 1.0.0", "futures-util", - "indexmap 2.6.0", + "indexmap 2.7.0", "mime", "num-traits", "poem", "poem-openapi-derive", - "quick-xml 0.32.0", + "quick-xml 0.36.2", "regex", "serde", "serde_json", @@ -13370,12 +13296,13 @@ dependencies = [ [[package]] name = "poem-openapi-derive" -version = "5.0.2" -source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3fdfe9432d654c5b#809b2816d3504beeba140fef3fdfe9432d654c5b" +version = "5.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88e4cd0c926ab1d9a015ecc1077c950d5897577554691ff70efcd9c90ddeb614" dependencies = [ - "darling 0.20.9", + "darling 0.20.10", "http 1.1.0", - "indexmap 2.6.0", + "indexmap 2.7.0", "mime", "proc-macro-crate 3.1.0", "proc-macro2", @@ -13569,16 +13496,6 @@ dependencies = [ "regex", ] -[[package]] -name = "predicates" -version = "3.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" -dependencies = [ - "anstyle", - "predicates-core", -] - [[package]] name = "predicates-core" version = "1.0.6" @@ -13753,15 +13670,14 @@ dependencies = [ [[package]] name = "processor" version = "1.0.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=51a34901b40d7f75767ac907b4d2478104d6a515#51a34901b40d7f75767ac907b4d2478104d6a515" +source = "git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=3064a075e1abc06c60363f3f2551cc41f5c091de#3064a075e1abc06c60363f3f2551cc41f5c091de" dependencies = [ "ahash 0.8.11", "allocative", "allocative_derive", "anyhow", - "aptos-indexer-processor-sdk", - "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=51a34901b40d7f75767ac907b4d2478104d6a515)", - "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb)", + "aptos-moving-average", + "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=6116af69aa173ca49e1761daabd6fe103fe2c65e)", "async-trait", "bcs 0.1.4", "bigdecimal", @@ -13769,6 +13685,7 @@ dependencies = [ "canonical_json", "chrono", "clap 4.5.21", + "const_format", "diesel", "diesel-async", "diesel_migrations", @@ -13781,19 +13698,19 @@ dependencies = [ "google-cloud-storage", "hex", "hyper 0.14.28", + "indexmap 2.7.0", "itertools 0.12.1", "jemallocator", "kanal", "lazy_static", "native-tls", - "num 0.4.1", "num_cpus", "once_cell", "parquet", "parquet_derive", "postgres-native-tls", "prometheus", - "prost 0.12.3", + "prost 0.13.4", "rayon", "regex", "serde", @@ -13805,7 +13722,7 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-postgres", - "tonic 0.11.0", + "tonic 0.12.3", "tracing", "unescape", "url", @@ -13843,33 +13760,9 @@ dependencies = [ "lazy_static", "memchr", "parking_lot 0.12.1", - "protobuf", "thiserror", ] -[[package]] -name = "prometheus-client" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" -dependencies = [ - "dtoa", - "itoa", - "parking_lot 0.12.1", - "prometheus-client-derive-encode", -] - -[[package]] -name = "prometheus-client-derive-encode" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "prometheus-http-query" version = "0.5.2" @@ -14111,7 +14004,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62ffd2f9a162cfae131bed6d9d1ed60adced33be340a94f96952897d7cb0c240" dependencies = [ "chrono", - "indexmap 2.6.0", + "indexmap 2.7.0", "newtype-uuid", "quick-xml 0.36.2", "strip-ansi-escapes", @@ -14137,16 +14030,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "quick-xml" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "quick-xml" version = "0.36.2" @@ -14154,6 +14037,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" dependencies = [ "memchr", + "serde", ] [[package]] @@ -15141,11 +15025,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "sample" -version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=9ecd252ccff53023664562001dd04c2886488c0d#9ecd252ccff53023664562001dd04c2886488c0d" - [[package]] name = "scale-info" version = "1.0.0" @@ -15154,7 +15033,7 @@ checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" dependencies = [ "bitvec 0.20.4", "cfg-if", - "derive_more", + "derive_more 0.99.17", "parity-scale-codec 2.3.1", "scale-info-derive", ] @@ -15439,7 +15318,7 @@ version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "ryu", "serde", @@ -15518,7 +15397,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_json", "serde_with_macros", @@ -15531,7 +15410,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" dependencies = [ - "darling 0.20.9", + "darling 0.20.10", "proc-macro2", "quote", "syn 2.0.87", @@ -15555,7 +15434,7 @@ version = "0.9.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "ryu", "serde", @@ -15585,7 +15464,7 @@ dependencies = [ [[package]] name = "server-framework" version = "1.0.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=51a34901b40d7f75767ac907b4d2478104d6a515#51a34901b40d7f75767ac907b4d2478104d6a515" +source = "git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=3064a075e1abc06c60363f3f2551cc41f5c091de#3064a075e1abc06c60363f3f2551cc41f5c091de" dependencies = [ "anyhow", "aptos-system-utils 0.1.0 (git+https://github.com/aptos-labs/aptos-core.git?rev=202bdccff2b2d333a385ae86a4fcf23e89da9f62)", @@ -15983,6 +15862,7 @@ dependencies = [ "hex", "hyper 0.14.28", "itertools 0.13.0", + "move-binary-format", "move-core-types", "num_cpus", "once_cell", @@ -16946,7 +16826,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -16959,7 +16839,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "toml_datetime", "winnow", ] @@ -16970,7 +16850,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "toml_datetime", "winnow", ] @@ -17019,7 +16899,6 @@ dependencies = [ "axum 0.6.20", "base64 0.21.7", "bytes", - "flate2", "h2 0.3.26", "http 0.2.11", "http-body 0.4.6", @@ -17028,17 +16907,12 @@ dependencies = [ "percent-encoding", "pin-project 1.1.3", "prost 0.12.3", - "rustls-native-certs 0.7.0", - "rustls-pemfile 2.1.1", - "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", "tokio-stream", "tower", "tower-layer", "tower-service", "tracing", - "zstd 0.12.4", ] [[package]] @@ -17073,7 +16947,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", - "zstd 0.13.0", + "zstd", ] [[package]] @@ -17657,7 +17531,7 @@ dependencies = [ "errno", "js-sys", "libc", - "rustix 0.38.28", + "rustix 0.37.27", "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", "winapi 0.3.9", @@ -18490,32 +18364,13 @@ dependencies = [ "thiserror", ] -[[package]] -name = "zstd" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" -dependencies = [ - "zstd-safe 6.0.6", -] - [[package]] name = "zstd" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" dependencies = [ - "zstd-safe 7.0.0", -] - -[[package]] -name = "zstd-safe" -version = "6.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" -dependencies = [ - "libc", - "zstd-sys", + "zstd-safe", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 7eb0a47c949b8..d70df5de06172 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -492,30 +492,24 @@ arc-swap = "1.6.0" arr_macro = "0.2.1" ark-bls12-381 = "0.4.0" ark-bn254 = "0.4.0" -ark-circom = { git = "https://github.com/aptos-labs/circom-compat", rev = "e3d686641a3dd9d66087a74acdc20dc2a3c24f63" } -ark-crypto-primitives = "0.4.0" ark-ec = "0.4.0" ark-ff = "0.4.0" ark-groth16 = "0.4.0" ark-relations = "0.4.0" ark-serialize = "0.4.0" ark-std = { version = "0.4.0", features = ["getrandom"] } -aptos-moving-average = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "4801acae7aea30d7e96bbfbe5ec5b04056dfa4cf" } +aptos-moving-average = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "3064a075e1abc06c60363f3f2551cc41f5c091de" } assert_approx_eq = "1.1.0" -assert_unordered = "0.3.5" async-channel = "1.7.1" async-mutex = "1.4.0" async-recursion = "1.0.5" -async-stream = "0.3" async-trait = "0.1.53" axum = "0.7.5" base64 = "0.13.0" -base64-url = "2.0.1" backoff = { version = "0.4.0", features = ["tokio"] } backtrace = "0.3.58" bcs = { git = "https://github.com/aptos-labs/bcs.git", rev = "d31fab9d81748e2594be5cd5cdf845786a30562d" } better_any = "0.1.1" -bellman = { version = "0.13.1", default-features = false } bigdecimal = { version = "0.4.0", features = ["serde"] } version-compare = "0.1.1" bitvec = "1.0.1" @@ -530,7 +524,6 @@ byteorder = "1.4.3" bytes = { version = "1.4.0", features = ["serde"] } camino = { version = "1.1.6" } chrono = { version = "0.4.19", features = ["clock", "serde"] } -cfg_block = "0.1.1" cfg-if = "1.0.0" ciborium = "0.2" claims = "0.7" @@ -551,7 +544,6 @@ codespan-reporting = "0.11.1" colored = "2.0.0" concurrent-queue = "2.2.0" console-subscriber = "0.3.0" -const_format = "0.2.26" core_affinity = "0.8.1" coset = "0.3" criterion = "0.3.5" @@ -594,7 +586,6 @@ env_logger = "0.10.0" erased-serde = "0.3.13" ethabi = "18.0.0" ethnum = "1.5.0" -event-listener = "2.5.3" evm = { version = "0.33.1", features = ["tracing"] } evm-runtime = { version = "0.33.0", features = ["tracing"] } dearbitrary = { version = "1.0.4", features = ["derive"] } @@ -632,11 +623,9 @@ hostname = "0.3.1" http = "0.2.9" httpmock = "0.6.8" hyper = { version = "0.14.18", features = ["full"] } -hyper-tls = "0.5.0" im = "15.0.0" image = "0.24.5" -indexmap = "1.9.3" -include_dir = { version = "0.7.2", features = ["glob"] } +indexmap = "2.7.0" indicatif = "0.15.0" indoc = "1.0.6" inferno = "0.11.14" @@ -685,7 +674,6 @@ p256 = { version = "0.13.2" } prettydiff = "0.6.2" primitive-types = { version = "0.10" } signature = "2.1.0" -sec1 = "0.7.0" pairing = "0.23" parking_lot = "0.12.0" paste = "1.0.7" @@ -698,20 +686,16 @@ percent-encoding = "2.1.0" petgraph = "0.6.5" pin-project = "1.0.10" plotters = { version = "0.3.5", default-features = false } -# We're using git deps until https://github.com/poem-web/poem/pull/829 gets formally released. -poem = { git = "https://github.com/poem-web/poem.git", rev = "809b2816d3504beeba140fef3fdfe9432d654c5b", features = [ - "anyhow", - "rustls", -] } -poem-openapi = { git = "https://github.com/poem-web/poem.git", rev = "809b2816d3504beeba140fef3fdfe9432d654c5b", features = [ - "swagger-ui", - "url", -] } -poem-openapi-derive = { git = "https://github.com/poem-web/poem.git", rev = "809b2816d3504beeba140fef3fdfe9432d654c5b" } +poem = { version = "3.1.3", features = ["anyhow", "compression", "rustls"] } +poem-openapi = { version = "5.1.2", features = ["swagger-ui", "url"] } +poem-openapi-derive = "5.1.1" poseidon-ark = { git = "https://github.com/arnaucube/poseidon-ark.git", rev = "6d2487aa1308d9d3860a2b724c485d73095c1c68" } pprof = { version = "0.11", features = ["flamegraph", "protobuf-codec"] } pretty = "0.10.0" pretty_assertions = "1.2.1" +# We set default-features to false so we don't onboard the libpq dep. See more here: +# https://github.com/aptos-labs/aptos-core/pull/12568 +processor = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "3064a075e1abc06c60363f3f2551cc41f5c091de", default-features = false } procfs = "0.14.1" proc-macro2 = "1.0.38" project-root = "0.2.2" @@ -721,8 +705,6 @@ prometheus-parse = "0.2.4" proptest = "1.4.0" proptest-derive = "0.4.0" prost = { version = "0.13.4", features = ["no-recursion-limit"] } -prost-types = "0.13.4" -quanta = "0.10.1" quick_cache = "0.5.1" quick-junit = "0.5.0" quote = "1.0.18" @@ -756,7 +738,6 @@ rstest = "0.15.0" rusty-fork = "0.3.0" rustversion = "1.0.14" scopeguard = "1.2.0" -sha-1 = "0.10.0" sha2 = "0.9.3" sha256 = "1.4.0" sha2_0_10_6 = { package = "sha2", version = "0.10.6" } @@ -777,13 +758,13 @@ serde-generate = { git = "https://github.com/aptos-labs/serde-reflection", rev = serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "73b6bbf748334b71ff6d7d09d06a29e3062ca075" } serde_with = "3.4.0" serde_yaml = "0.8.24" +server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "3064a075e1abc06c60363f3f2551cc41f5c091de" } set_env = "1.3.4" shadow-rs = "0.16.2" simplelog = "0.9.0" smallbitvec = "2.5.1" smallvec = "1.8.0" static_assertions = "1.1.0" -stats_alloc = "0.1.8" status-line = "0.2.0" strum = "0.24.1" strum_macros = "0.24.2" @@ -799,17 +780,14 @@ textwrap = "0.15.0" thiserror = "1.0.37" threadpool = "1.8.1" thread_local = "1.1.7" -time = { version = "0.3.24", features = ["serde"] } tiny-bip39 = "0.8.2" tiny-keccak = { version = "2.0.2", features = ["keccak", "sha3"] } -toml_edit = "0.14.3" tracing = "0.1.37" tracing-subscriber = { version = "0.3.17", features = ["json", "env-filter"] } trybuild = "1.0.80" try_match = "0.4.2" tokio = { version = "1.35.1", features = ["full"] } tokio-io-timeout = "1.2.0" -tokio-metrics = "0.3.1" tokio-retry = "0.3.0" tokio-scoped = { version = "0.2.0" } tokio-stream = { version = "0.1.14", features = ["fs"] } @@ -827,7 +805,6 @@ tonic = { version = "0.12.3", features = [ tonic-reflection = "0.12.3" topological-sort = "0.2.2" triomphe = "0.1.9" -tsify-next = "0.5.4" tui = "0.19.0" typed-arena = "2.0.2" typenum = "1.17.0" diff --git a/api/Cargo.toml b/api/Cargo.toml index fcc5efdca74ec..4bda07ed5528d 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -25,6 +25,7 @@ aptos-logger = { workspace = true } aptos-mempool = { workspace = true } aptos-metrics-core = { workspace = true } aptos-runtimes = { workspace = true } +aptos-sdk = { workspace = true } aptos-storage-interface = { workspace = true } aptos-types = { workspace = true } aptos-vm = { workspace = true } @@ -55,7 +56,6 @@ aptos-gas-meter = { workspace = true } aptos-gas-schedule = { workspace = true, features = ["testing"] } aptos-move-stdlib = { workspace = true } aptos-proptest-helpers = { workspace = true } -aptos-sdk = { workspace = true } move-package = { workspace = true } passkey-types = { workspace = true } percent-encoding = { workspace = true } diff --git a/api/Makefile b/api/Makefile index bebdb02971bbc..a0ba7110c7502 100644 --- a/api/Makefile +++ b/api/Makefile @@ -2,20 +2,14 @@ # Parts of the project are originally copyright © Meta Platforms, Inc. # SPDX-License-Identifier: Apache-2.0 -test: clean lint-v0 lint-v1 test-code-gen-v0 test-code-gen-v1 test-api-spec-v0 test-api-spec-v1 clean +test: clean lint test-code-gen clean -lint-v0: - $(call lint,doc/v0/openapi.yaml) - -lint-v1: - $(call lint,doc/v1/spec.yaml) - -test-code-gen-v0: - $(call test_code_gen,doc/v0/openapi.yaml) +lint: + $(call lint,doc/spec.yaml) # This doesn't work right now: https://github.com/OpenAPITools/openapi-generator/issues/13038. -test-code-gen-v1: - $(call test_code_gen,doc/v1/spec.yaml) +test-code-gen: + $(call test_code_gen,doc/spec.yaml) clean: - pkill aptos-node @@ -23,33 +17,9 @@ clean: - rm -f openapitools.json - rm -rf .hypothesis -test-api-spec-v0: - $(call test_api_spec,openapi.yaml) - -test-api-spec-v1: - $(call test_api_spec,spec.yaml) - serve: cd doc && python3 -m http.server 8888 -define test_api_spec - - pkill aptos-node - cargo build -p aptos-node - ./../target/debug/aptos-node --test --lazy & - - curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /tmp/wait-for-it.sh - chmod +x /tmp/wait-for-it.sh - /tmp/wait-for-it.sh -t 300 localhost:8080 - - schemathesis run --method GET \ - --show-errors-tracebacks \ - --code-sample-style=curl \ - --store-network-log=./../target/schemathesis-network-log.yaml \ - --checks all \ - --base-url http://localhost:8080 \ - http://localhost:8080/$(1) -endef - define lint npx @redocly/openapi-cli lint $(1) --skip-rule no-empty-servers endef @@ -60,4 +30,4 @@ define test_code_gen cd /tmp/aptos_api_client && cargo build endef -.PHONY: test lint-v0 lint-v1 test-code-gen-v0 test-code-gen-v1 test-api-spec-v0 test-api-spec-v1 clean serve +.PHONY: test lint test-code-gen test-api-spec clean serve diff --git a/api/doc/spec.json b/api/doc/spec.json index c436c7f51082b..5bfa0accdcf43 100644 --- a/api/doc/spec.json +++ b/api/doc/spec.json @@ -1261,6 +1261,608 @@ "operationId": "get_account_resources" } }, + "/accounts/{address}/balance/{asset_type}": { + "get": { + "tags": [ + "Accounts" + ], + "summary": "Get account resources", + "description": "Retrieves all account resources for a given account and a specific ledger version. If the\nledger version is not specified in the request, the latest ledger version is used.\n\nThe Aptos nodes prune account state history, via a configurable time window.\nIf the requested ledger version has been pruned, the server responds with a 410.", + "parameters": [ + { + "name": "address", + "schema": { + "$ref": "#/components/schemas/Address" + }, + "in": "path", + "description": "Address of account with or without a `0x` prefix", + "required": true, + "deprecated": false, + "explode": true + }, + { + "name": "asset_type", + "schema": { + "$ref": "#/components/schemas/AssetType" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + }, + { + "name": "ledger_version", + "schema": { + "$ref": "#/components/schemas/U64" + }, + "in": "query", + "description": "Ledger version to get state of account\n\nIf not provided, it will be the latest version", + "required": false, + "deprecated": false, + "explode": true + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "application/x-bcs": { + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + } + }, + "headers": { + "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", + "required": true, + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint8" + } + }, + "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", + "required": true, + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", + "required": true, + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", + "required": true, + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", + "required": true, + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", + "required": true, + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", + "required": true, + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-GAS-USED": { + "description": "The cost of the call in terms of gas", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-CURSOR": { + "description": "Cursor to be used for endpoints that support cursor-based\npagination. Pass this to the `start` field of the endpoint\non the next call to get the next page of results.", + "deprecated": false, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AptosError" + } + } + }, + "headers": { + "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint8" + } + }, + "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-GAS-USED": { + "description": "The cost of the call in terms of gas", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AptosError" + } + } + }, + "headers": { + "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint8" + } + }, + "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-GAS-USED": { + "description": "The cost of the call in terms of gas", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AptosError" + } + } + }, + "headers": { + "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint8" + } + }, + "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-GAS-USED": { + "description": "The cost of the call in terms of gas", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + } + } + }, + "410": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AptosError" + } + } + }, + "headers": { + "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint8" + } + }, + "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-GAS-USED": { + "description": "The cost of the call in terms of gas", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AptosError" + } + } + }, + "headers": { + "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint8" + } + }, + "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-GAS-USED": { + "description": "The cost of the call in terms of gas", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AptosError" + } + } + }, + "headers": { + "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint8" + } + }, + "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + "X-APTOS-GAS-USED": { + "description": "The cost of the call in terms of gas", + "deprecated": false, + "schema": { + "type": "integer", + "format": "uint64" + } + } + } + } + }, + "operationId": "get_account_balance" + } + }, "/accounts/{address}/modules": { "get": { "tags": [ @@ -13959,6 +14561,21 @@ }, "components": { "schemas": { + "AbstractionSignature": { + "type": "object", + "required": [ + "function_info", + "auth_data" + ], + "properties": { + "function_info": { + "type": "string" + }, + "auth_data": { + "$ref": "#/components/schemas/HexEncodedBytes" + } + } + }, "AccountData": { "type": "object", "description": "Account data\n\nA simplified version of the onchain Account resource", @@ -13993,6 +14610,9 @@ }, { "$ref": "#/components/schemas/AccountSignature_NoAccountSignature" + }, + { + "$ref": "#/components/schemas/AccountSignature_AbstractionSignature" } ], "discriminator": { @@ -14002,10 +14622,33 @@ "multi_ed25519_signature": "#/components/schemas/AccountSignature_MultiEd25519Signature", "single_key_signature": "#/components/schemas/AccountSignature_SingleKeySignature", "multi_key_signature": "#/components/schemas/AccountSignature_MultiKeySignature", - "no_account_signature": "#/components/schemas/AccountSignature_NoAccountSignature" + "no_account_signature": "#/components/schemas/AccountSignature_NoAccountSignature", + "abstraction_signature": "#/components/schemas/AccountSignature_AbstractionSignature" } } }, + "AccountSignature_AbstractionSignature": { + "allOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "abstraction_signature" + ], + "example": "abstraction_signature" + } + } + }, + { + "$ref": "#/components/schemas/AbstractionSignature" + } + ] + }, "AccountSignature_Ed25519Signature": { "allOf": [ { @@ -14171,6 +14814,12 @@ "api_disabled" ] }, + "AssetType": { + "type": "string", + "format": "hex", + "description": "A hex encoded 32 byte Aptos account address or a struct tag.\n\nThis is represented in a string as a 64 character hex string, sometimes\nshortened by stripping leading 0s, and adding a 0x or\nFormat: `{address}::{module name}::{struct name}`\n", + "example": "0x1::aptos_coin::AptosCoin" + }, "Block": { "type": "object", "description": "A Block with or without transactions\n\nThis contains the information about a transactions along with\nassociated transactions if requested", diff --git a/api/doc/spec.yaml b/api/doc/spec.yaml index 8fef310321eda..5364dfa20571a 100644 --- a/api/doc/spec.yaml +++ b/api/doc/spec.yaml @@ -933,6 +933,453 @@ paths: type: integer format: uint64 operationId: get_account_resources + /accounts/{address}/balance/{asset_type}: + get: + tags: + - Accounts + summary: Get account resources + description: |- + Retrieves all account resources for a given account and a specific ledger version. If the + ledger version is not specified in the request, the latest ledger version is used. + + The Aptos nodes prune account state history, via a configurable time window. + If the requested ledger version has been pruned, the server responds with a 410. + parameters: + - name: address + schema: + $ref: '#/components/schemas/Address' + in: path + description: Address of account with or without a `0x` prefix + required: true + deprecated: false + explode: true + - name: asset_type + schema: + $ref: '#/components/schemas/AssetType' + in: path + required: true + deprecated: false + explode: true + - name: ledger_version + schema: + $ref: '#/components/schemas/U64' + in: query + description: |- + Ledger version to get state of account + + If not provided, it will be the latest version + required: false + deprecated: false + explode: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: integer + format: uint64 + application/x-bcs: + schema: + type: array + items: + type: integer + format: uint8 + headers: + X-APTOS-CHAIN-ID: + description: Chain ID of the current chain + required: true + deprecated: false + schema: + type: integer + format: uint8 + X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain + required: true + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain + required: true + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain + required: true + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-EPOCH: + description: Current epoch of the chain + required: true + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain + required: true + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain + required: true + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-GAS-USED: + description: The cost of the call in terms of gas + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-CURSOR: + description: |- + Cursor to be used for endpoints that support cursor-based + pagination. Pass this to the `start` field of the endpoint + on the next call to get the next page of results. + deprecated: false + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AptosError' + headers: + X-APTOS-CHAIN-ID: + description: Chain ID of the current chain + deprecated: false + schema: + type: integer + format: uint8 + X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-EPOCH: + description: Current epoch of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-GAS-USED: + description: The cost of the call in terms of gas + deprecated: false + schema: + type: integer + format: uint64 + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AptosError' + headers: + X-APTOS-CHAIN-ID: + description: Chain ID of the current chain + deprecated: false + schema: + type: integer + format: uint8 + X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-EPOCH: + description: Current epoch of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-GAS-USED: + description: The cost of the call in terms of gas + deprecated: false + schema: + type: integer + format: uint64 + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AptosError' + headers: + X-APTOS-CHAIN-ID: + description: Chain ID of the current chain + deprecated: false + schema: + type: integer + format: uint8 + X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-EPOCH: + description: Current epoch of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-GAS-USED: + description: The cost of the call in terms of gas + deprecated: false + schema: + type: integer + format: uint64 + '410': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AptosError' + headers: + X-APTOS-CHAIN-ID: + description: Chain ID of the current chain + deprecated: false + schema: + type: integer + format: uint8 + X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-EPOCH: + description: Current epoch of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-GAS-USED: + description: The cost of the call in terms of gas + deprecated: false + schema: + type: integer + format: uint64 + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AptosError' + headers: + X-APTOS-CHAIN-ID: + description: Chain ID of the current chain + deprecated: false + schema: + type: integer + format: uint8 + X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-EPOCH: + description: Current epoch of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-GAS-USED: + description: The cost of the call in terms of gas + deprecated: false + schema: + type: integer + format: uint64 + '503': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AptosError' + headers: + X-APTOS-CHAIN-ID: + description: Chain ID of the current chain + deprecated: false + schema: + type: integer + format: uint8 + X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-EPOCH: + description: Current epoch of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain + deprecated: false + schema: + type: integer + format: uint64 + X-APTOS-GAS-USED: + description: The cost of the call in terms of gas + deprecated: false + schema: + type: integer + format: uint64 + operationId: get_account_balance /accounts/{address}/modules: get: tags: @@ -10438,6 +10885,16 @@ paths: operationId: view components: schemas: + AbstractionSignature: + type: object + required: + - function_info + - auth_data + properties: + function_info: + type: string + auth_data: + $ref: '#/components/schemas/HexEncodedBytes' AccountData: type: object description: |- @@ -10468,6 +10925,7 @@ components: - $ref: '#/components/schemas/AccountSignature_SingleKeySignature' - $ref: '#/components/schemas/AccountSignature_MultiKeySignature' - $ref: '#/components/schemas/AccountSignature_NoAccountSignature' + - $ref: '#/components/schemas/AccountSignature_AbstractionSignature' discriminator: propertyName: type mapping: @@ -10476,6 +10934,19 @@ components: single_key_signature: '#/components/schemas/AccountSignature_SingleKeySignature' multi_key_signature: '#/components/schemas/AccountSignature_MultiKeySignature' no_account_signature: '#/components/schemas/AccountSignature_NoAccountSignature' + abstraction_signature: '#/components/schemas/AccountSignature_AbstractionSignature' + AccountSignature_AbstractionSignature: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - abstraction_signature + example: abstraction_signature + - $ref: '#/components/schemas/AbstractionSignature' AccountSignature_Ed25519Signature: allOf: - type: object @@ -10592,6 +11063,16 @@ components: - web_framework_error - bcs_not_supported - api_disabled + AssetType: + type: string + format: hex + description: | + A hex encoded 32 byte Aptos account address or a struct tag. + + This is represented in a string as a 64 character hex string, sometimes + shortened by stripping leading 0s, and adding a 0x or + Format: `{address}::{module name}::{struct name}` + example: 0x1::aptos_coin::AptosCoin Block: type: object description: |- diff --git a/api/src/accounts.rs b/api/src/accounts.rs index d94454f6b34e3..4427f01b2f2c7 100644 --- a/api/src/accounts.rs +++ b/api/src/accounts.rs @@ -15,11 +15,15 @@ use crate::{ }; use anyhow::Context as AnyhowContext; use aptos_api_types::{ - AccountData, Address, AptosErrorCode, AsConverter, LedgerInfo, MoveModuleBytecode, + AccountData, Address, AptosErrorCode, AsConverter, AssetType, LedgerInfo, MoveModuleBytecode, MoveModuleId, MoveResource, MoveStructTag, StateKeyWrapper, U64, }; +use aptos_sdk::types::{get_paired_fa_metadata_address, get_paired_fa_primary_store_address}; use aptos_types::{ - account_config::{AccountResource, ObjectGroupResource}, + account_config::{ + AccountResource, CoinStoreResourceUntyped, ConcurrentFungibleBalanceResource, + FungibleStoreResource, ObjectGroupResource, + }, event::{EventHandle, EventKey}, state_store::state_key::StateKey, }; @@ -30,7 +34,7 @@ use poem_openapi::{ param::{Path, Query}, OpenApi, }; -use std::{collections::BTreeMap, convert::TryInto, sync::Arc}; +use std::{collections::BTreeMap, convert::TryInto, str::FromStr, sync::Arc}; /// API for accounts, their associated resources, and modules pub struct AccountsApi { @@ -124,6 +128,42 @@ impl AccountsApi { .await } + /// Get account resources + /// + /// Retrieves all account resources for a given account and a specific ledger version. If the + /// ledger version is not specified in the request, the latest ledger version is used. + /// + /// The Aptos nodes prune account state history, via a configurable time window. + /// If the requested ledger version has been pruned, the server responds with a 410. + #[oai( + path = "/accounts/:address/balance/:asset_type", + method = "get", + operation_id = "get_account_balance", + tag = "ApiTags::Accounts" + )] + async fn get_account_balance( + &self, + accept_type: AcceptType, + /// Address of account with or without a `0x` prefix + address: Path
, + asset_type: Path