From bc1cae845c5c93025702f1ce2b66b8150f45a3ad Mon Sep 17 00:00:00 2001 From: RainRaydium <106001368+RainRaydium@users.noreply.github.com> Date: Thu, 30 May 2024 16:17:43 +0800 Subject: [PATCH] Add client (#11) * Fix: add client lib * Fix: fix for client mint decode error * Style: update notes --- Cargo.lock | 4368 +++++++++++++++-- Cargo.toml | 3 +- client/Cargo.toml | 31 + client/src/instructions/amm_instructions.rs | 312 ++ .../instructions/events_instructions_parse.rs | 503 ++ client/src/instructions/mod.rs | 5 + client/src/instructions/rpc.rs | 57 + client/src/instructions/token_instructions.rs | 291 ++ client/src/instructions/utils.rs | 125 + client/src/main.rs | 753 +++ client_config.ini | 7 + programs/cp-swap/Cargo.toml | 1 + programs/cp-swap/src/curve/calculator.rs | 11 +- .../cp-swap/src/curve/constant_product.rs | 13 +- programs/cp-swap/src/lib.rs | 4 +- programs/cp-swap/src/states/events.rs | 2 + programs/cp-swap/src/states/pool.rs | 2 +- 17 files changed, 6042 insertions(+), 446 deletions(-) create mode 100644 client/Cargo.toml create mode 100644 client/src/instructions/amm_instructions.rs create mode 100644 client/src/instructions/events_instructions_parse.rs create mode 100644 client/src/instructions/mod.rs create mode 100644 client/src/instructions/rpc.rs create mode 100644 client/src/instructions/token_instructions.rs create mode 100644 client/src/instructions/utils.rs create mode 100644 client/src/main.rs create mode 100644 client_config.ini diff --git a/Cargo.lock b/Cargo.lock index 076a7d2..4b9d40e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,31 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aead" version = "0.4.3" @@ -71,6 +96,27 @@ dependencies = [ "memchr", ] +[[package]] +name = "aliasable" +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 = "anchor-attribute-access-control" version = "0.29.0" @@ -78,8 +124,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" dependencies = [ "anchor-syn", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -91,8 +137,8 @@ checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" dependencies = [ "anchor-syn", "bs58 0.5.0", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -103,7 +149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" dependencies = [ "anchor-syn", - "quote", + "quote 1.0.35", "syn 1.0.109", ] @@ -114,7 +160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" dependencies = [ "anchor-syn", - "quote", + "quote 1.0.35", "syn 1.0.109", ] @@ -125,8 +171,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" dependencies = [ "anchor-syn", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -137,10 +183,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" dependencies = [ "anchor-syn", - "quote", + "quote 1.0.35", "syn 1.0.109", ] +[[package]] +name = "anchor-client" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" +dependencies = [ + "anchor-lang", + "anyhow", + "futures", + "regex", + "serde", + "solana-account-decoder", + "solana-client", + "solana-sdk", + "thiserror", + "tokio", + "url", +] + [[package]] name = "anchor-derive-accounts" version = "0.29.0" @@ -148,7 +213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" dependencies = [ "anchor-syn", - "quote", + "quote 1.0.35", "syn 1.0.109", ] @@ -160,8 +225,8 @@ checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -171,8 +236,8 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -223,9 +288,9 @@ checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" dependencies = [ "anyhow", "bs58 0.5.0", - "heck", - "proc-macro2", - "quote", + "heck 0.3.3", + "proc-macro2 1.0.78", + "quote 1.0.35", "serde", "serde_json", "sha2 0.10.8", @@ -233,6 +298,79 @@ dependencies = [ "thiserror", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.80" @@ -280,7 +418,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools", - "num-bigint", + "num-bigint 0.4.4", "num-traits", "paste", "rustc_version", @@ -293,7 +431,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "quote", + "quote 1.0.35", "syn 1.0.109", ] @@ -303,10 +441,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint", + "num-bigint 0.4.4", "num-traits", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -332,7 +470,7 @@ dependencies = [ "ark-serialize-derive", "ark-std", "digest 0.10.7", - "num-bigint", + "num-bigint 0.4.4", ] [[package]] @@ -341,8 +479,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -374,19 +512,109 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", +] + [[package]] name = "assert_matches" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-compression" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", +] + [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -397,6 +625,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.12.3" @@ -415,6 +658,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bincode" version = "1.3.3" @@ -528,7 +777,7 @@ dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", - "proc-macro2", + "proc-macro2 1.0.78", "syn 1.0.109", ] @@ -541,7 +790,7 @@ dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", - "proc-macro2", + "proc-macro2 1.0.78", "syn 1.0.109", ] @@ -551,8 +800,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -562,8 +811,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -573,8 +822,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -584,11 +833,32 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bs58" version = "0.4.0" @@ -635,8 +905,8 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] @@ -646,6 +916,43 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "caps" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" +dependencies = [ + "libc", + "thiserror", +] + [[package]] name = "cc" version = "1.0.90" @@ -668,7 +975,22 @@ version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.4", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", ] [[package]] @@ -681,78 +1003,281 @@ dependencies = [ ] [[package]] -name = "console_error_panic_hook" -version = "0.1.7" +name = "clap" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "cfg-if", - "wasm-bindgen", + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", ] [[package]] -name = "console_log" -version = "0.2.2" +name = "clap" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ - "log", - "web-sys", + "atty", + "bitflags 1.3.2", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap 0.16.1", ] [[package]] -name = "constant_time_eq" -version = "0.3.0" +name = "clap" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +dependencies = [ + "clap_builder", + "clap_derive", +] [[package]] -name = "cpufeatures" -version = "0.2.12" +name = "clap_builder" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ - "libc", + "anstream", + "anstyle", + "clap_lex 0.7.0", + "strsim 0.11.1", ] [[package]] -name = "crossbeam-deque" -version = "0.8.5" +name = "clap_derive" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", + "heck 0.5.0", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", ] [[package]] -name = "crossbeam-epoch" -version = "0.9.18" +name = "clap_lex" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" dependencies = [ - "crossbeam-utils", + "os_str_bytes", ] [[package]] -name = "crossbeam-utils" -version = "0.8.19" +name = "clap_lex" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] -name = "crunchy" +name = "client" +version = "0.1.0" +dependencies = [ + "anchor-client", + "anchor-lang", + "anyhow", + "arrayref", + "bincode", + "bs58 0.5.0", + "clap 4.5.4", + "colorful", + "configparser", + "hex", + "rand 0.7.3", + "raydium-cp-swap", + "regex", + "serde", + "serde_json", + "solana-account-decoder", + "solana-client", + "solana-sdk", + "solana-transaction-status", + "spl-associated-token-account", + "spl-memo", + "spl-token", + "spl-token-2022", + "spl-token-client", +] + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + +[[package]] +name = "colorful" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "97af0562545a7d7f3d9222fcf909963bec36dcb502afaacab98c6ffac8da47ce" [[package]] -name = "crypto-common" -version = "0.1.6" +name = "combine" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" dependencies = [ - "generic-array", + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "configparser" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec6d3da8e550377a85339063af6e3735f4b1d9392108da4e083a1b3b9820288" + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", "typenum", ] @@ -807,9 +1332,9 @@ checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", - "proc-macro2", - "quote", - "strsim", + "proc-macro2 1.0.78", + "quote 1.0.35", + "strsim 0.10.0", "syn 2.0.52", ] @@ -820,10 +1345,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", - "quote", + "quote 1.0.35", "syn 2.0.52", ] +[[package]] +name = "dashmap" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +dependencies = [ + "cfg-if", + "num_cpus", + "rayon", +] + +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint 0.4.4", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "derivation-path" version = "0.2.0" @@ -836,11 +1410,23 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + [[package]] name = "digest" version = "0.9.0" @@ -861,6 +1447,76 @@ dependencies = [ "subtle", ] +[[package]] +name = "dir-diff" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ad16bf5f84253b50d6557681c58c3ab67c47c77d39fed9aeb56e947290bd10" +dependencies = [ + "walkdir", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", +] + +[[package]] +name = "dlopen" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +dependencies = [ + "dlopen_derive", + "lazy_static", + "libc", + "winapi", +] + +[[package]] +name = "dlopen_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +dependencies = [ + "libc", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "eager" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe71d579d1812060163dff96056261deb5bf6729b100fa2e36a68b9649ba3d3" + [[package]] name = "ed25519" version = "1.5.3" @@ -896,12 +1552,72 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "educe" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +dependencies = [ + "enum-ordinalize", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", +] + [[package]] name = "either" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-iterator" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", +] + +[[package]] +name = "enum-ordinalize" +version = "3.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", +] + [[package]] name = "env_logger" version = "0.7.1" @@ -938,9 +1654,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "fastrand" version = "2.0.1" @@ -954,25 +1676,155 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" [[package]] -name = "fnv" -version = "1.0.7" +name = "filetime" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys 0.52.0", +] [[package]] -name = "generic-array" -version = "0.14.7" +name = "flate2" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ - "serde", - "typenum", - "version_check", + "crc32fast", + "miniz_oxide", ] [[package]] -name = "getrandom" -version = "0.1.16" +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ @@ -996,6 +1848,51 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.2.5", + "slab", + "tokio", + "tokio-util 0.7.11", + "tracing", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -1005,6 +1902,15 @@ dependencies = [ "ahash 0.7.8", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + [[package]] name = "hashbrown" version = "0.13.2" @@ -1029,6 +1935,18 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -1038,12 +1956,24 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "histogram" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669" + [[package]] name = "hmac" version = "0.8.1" @@ -1074,18 +2004,123 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.7", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "im" version = "15.1.0" @@ -1102,6 +2137,22 @@ dependencies = [ "version_check", ] +[[package]] +name = "index_list" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70891286cb8e844fdfcf1178b47569699f9e20b5ecc4b45a6240a64771444638" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "2.2.5" @@ -1112,6 +2163,40 @@ dependencies = [ "hashbrown 0.14.3", ] +[[package]] +name = "indicatif" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -1145,6 +2230,21 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpc-core" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" +dependencies = [ + "futures", + "futures-executor", + "futures-util", + "log", + "serde", + "serde_derive", + "serde_json", +] + [[package]] name = "keccak" version = "0.1.5" @@ -1172,6 +2272,16 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.4.2", + "libc", +] + [[package]] name = "libsecp256k1" version = "0.6.0" @@ -1242,6 +2352,35 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "memchr" version = "2.7.1" @@ -1257,6 +2396,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.9.0" @@ -1279,37 +2427,154 @@ dependencies = [ ] [[package]] -name = "mpl-token-metadata" -version = "3.2.3" +name = "mime" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba8ee05284d79b367ae8966d558e1a305a781fc80c9df51f37775169117ba64f" -dependencies = [ - "borsh 0.10.3", - "num-derive 0.3.3", - "num-traits", - "solana-program", - "thiserror", -] +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] -name = "num-bigint" -version = "0.4.4" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", +] + +[[package]] +name = "mpl-token-metadata" +version = "3.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8ee05284d79b367ae8966d558e1a305a781fc80c9df51f37775169117ba64f" +dependencies = [ + "borsh 0.10.3", + "num-derive 0.3.3", + "num-traits", + "solana-program", + "thiserror", +] + +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint 0.2.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ "autocfg", "num-integer", "num-traits", ] +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-derive" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -1319,8 +2584,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] @@ -1333,6 +2598,29 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint 0.2.6", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.18" @@ -1343,6 +2631,16 @@ dependencies = [ "libm", ] +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + [[package]] name = "num_enum" version = "0.6.1" @@ -1368,8 +2666,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] @@ -1380,11 +2678,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -1397,6 +2719,60 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", +] + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "ouroboros" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +dependencies = [ + "aliasable", + "ouroboros_macro", +] + +[[package]] +name = "ouroboros_macro" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +dependencies = [ + "Inflector", + "proc-macro-error", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -1444,12 +2820,85 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "percentage" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" +dependencies = [ + "num", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "polyval" version = "0.5.3" @@ -1462,12 +2911,30 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "pretty-hex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5" + [[package]] name = "proc-macro-crate" version = "0.1.5" @@ -1487,6 +2954,39 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + [[package]] name = "proc-macro2" version = "1.0.78" @@ -1544,40 +3044,99 @@ dependencies = [ ] [[package]] -name = "quote" -version = "1.0.35" +name = "quinn" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" dependencies = [ - "proc-macro2", + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.20.9", + "thiserror", + "tokio", + "tracing", + "webpki", ] [[package]] -name = "rand" -version = "0.7.3" +name = "quinn-proto" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls 0.20.9", + "rustls-native-certs", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki", ] [[package]] -name = "rand" -version = "0.8.5" +name = "quinn-udp" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", + "quinn-proto", + "socket2 0.4.10", + "tracing", + "windows-sys 0.42.0", ] [[package]] -name = "rand_chacha" +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2 1.0.78", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" @@ -1677,6 +3236,18 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -1686,6 +3257,17 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom 0.2.12", + "libredox", + "thiserror", +] + [[package]] name = "regex" version = "1.10.3" @@ -1715,6 +3297,106 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "async-compression", + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls 0.24.1", + "tokio-util 0.7.11", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.12", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "rpassword" +version = "7.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.48.0", +] + +[[package]] +name = "rtoolbox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + [[package]] name = "rustc-hash" version = "1.1.0" @@ -1730,6 +3412,15 @@ dependencies = [ "semver", ] +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + [[package]] name = "rustix" version = "0.38.31" @@ -1740,7 +3431,62 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct", + "webpki", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -1767,12 +3513,83 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "security-framework" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.22" @@ -1803,8 +3620,8 @@ version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] @@ -1819,6 +3636,18 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "serde_with" version = "2.3.3" @@ -1836,11 +3665,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ "darling", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.5", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.9.9" @@ -1887,6 +3740,30 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "1.6.4" @@ -1903,6 +3780,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.13.1" @@ -1910,26 +3796,314 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] -name = "solana-frozen-abi" +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "solana-account-decoder" version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7077f6495ccc313dff49c3e3f3ed03e49058258bae7fee77ac29ba0a474ba82" +checksum = "b5763ba7519b166b152ca2c6f8defa22cd07d3aea42a3a86b74519857fc3d464" dependencies = [ - "ahash 0.8.6", - "blake3", - "block-buffer 0.10.4", + "Inflector", + "base64 0.21.7", + "bincode", "bs58 0.4.0", "bv", - "byteorder", - "cc", - "either", - "generic-array", - "getrandom 0.1.16", - "im", "lazy_static", - "log", - "memmap2", - "once_cell", + "serde", + "serde_derive", + "serde_json", + "solana-address-lookup-table-program", + "solana-config-program", + "solana-sdk", + "spl-token", + "spl-token-2022", + "spl-token-metadata-interface", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-address-lookup-table-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a216474b9d25153d629aa7f4fb2246bc875ebe90e1155380e0436c209e62d5" +dependencies = [ + "bincode", + "bytemuck", + "log", + "num-derive 0.3.3", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-banks-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7f5b9262637ec61f0755d0a657332c61d8d7b6a1fa63c64664391b469a6282" +dependencies = [ + "borsh 0.10.3", + "futures", + "solana-banks-interface", + "solana-program", + "solana-sdk", + "tarpc", + "thiserror", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-banks-interface" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0610d7fee589a2ab66c0f7d08866fa8be7c3851b8e3361948134cd6116b1d077" +dependencies = [ + "serde", + "solana-sdk", + "tarpc", +] + +[[package]] +name = "solana-banks-server" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2209441a76b00a9b8368df8af84fbba695ef08c70fc66e885c5cb533ee4a85b" +dependencies = [ + "bincode", + "crossbeam-channel", + "futures", + "solana-banks-interface", + "solana-client", + "solana-runtime", + "solana-sdk", + "solana-send-transaction-service", + "tarpc", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-bpf-loader-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c23c74148a75c1e5f8bb26113306198be1f030e75f3e23f8335470d9e014227" +dependencies = [ + "bincode", + "byteorder", + "libsecp256k1", + "log", + "rand 0.7.3", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-bucket-map" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dae145ef8145f850fc3fb832802ebed13dd91a51fff457d5f06f5c31a62efee" +dependencies = [ + "bv", + "log", + "memmap2", + "modular-bitfield", + "num_enum 0.6.1", + "rand 0.7.3", + "solana-measure", + "solana-sdk", + "tempfile", +] + +[[package]] +name = "solana-clap-utils" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef7e2234cf1179b8ceadfae922d38d79f82932a762ff62b0051e0b3205984f" +dependencies = [ + "chrono", + "clap 2.34.0", + "rpassword", + "solana-perf", + "solana-remote-wallet", + "solana-sdk", + "thiserror", + "tiny-bip39", + "uriparse", + "url", +] + +[[package]] +name = "solana-cli-config" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cb6252b2728b4e99fa293df02e7a40ef86c9b3fb5863e8b1430e09ec77f1ee" +dependencies = [ + "dirs-next", + "lazy_static", + "serde", + "serde_derive", + "serde_yaml", + "solana-clap-utils", + "solana-sdk", + "url", +] + +[[package]] +name = "solana-cli-output" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f159afe31f04fa5bd57ead3d5748f1f546b9d73203ac67559f48a4abeee39f76" +dependencies = [ + "Inflector", + "base64 0.21.7", + "chrono", + "clap 2.34.0", + "console", + "humantime", + "indicatif", + "pretty-hex", + "semver", + "serde", + "serde_json", + "solana-account-decoder", + "solana-clap-utils", + "solana-cli-config", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction-status", + "solana-vote-program", + "spl-memo", +] + +[[package]] +name = "solana-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2644f5a0c91f8c44db175d35d52bf772799597dbedf6a5d9f138d61e2b52b826" +dependencies = [ + "async-trait", + "bincode", + "futures", + "futures-util", + "indexmap 1.9.3", + "indicatif", + "log", + "quinn", + "rand 0.7.3", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-quic-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-rpc-client-nonce-utils", + "solana-sdk", + "solana-streamer", + "solana-thin-client", + "solana-tpu-client", + "solana-udp-client", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-compute-budget-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61fe4b2d4e756c32139444cc3f8ee32fdc9b9aceb02e82216694fd36141dd126" +dependencies = [ + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-config-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bb9b6d2c575e1eecd85380cb6442525a0d2639afa627552264eaa7050f47fb3" +dependencies = [ + "bincode", + "chrono", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-connection-cache" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcd27f413c3702ee20bbf1152e928f9adff0a37fef0f36b956d4eb34aae2be71" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap 1.9.3", + "log", + "rand 0.7.3", + "rayon", + "rcgen", + "solana-measure", + "solana-metrics", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-frozen-abi" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7077f6495ccc313dff49c3e3f3ed03e49058258bae7fee77ac29ba0a474ba82" +dependencies = [ + "ahash 0.8.6", + "blake3", + "block-buffer 0.10.4", + "bs58 0.4.0", + "bv", + "byteorder", + "cc", + "either", + "generic-array", + "getrandom 0.1.16", + "im", + "lazy_static", + "log", + "memmap2", + "once_cell", "rand_core 0.6.4", "rustc_version", "serde", @@ -1948,12 +4122,26 @@ version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f516f992211a2ab70de5c367190575c97e02d156f9f1d8b76886d673f30e88a2" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "rustc_version", "syn 2.0.52", ] +[[package]] +name = "solana-loader-v4-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb13799b6df3e8ebd19862dabbb51781774d300405cbab244b35c482edc700ca" +dependencies = [ + "log", + "rand 0.7.3", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana_rbpf", +] + [[package]] name = "solana-logger" version = "1.16.25" @@ -1965,6 +4153,79 @@ dependencies = [ "log", ] +[[package]] +name = "solana-measure" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "932db6604bcf8ba3bba68e80564d7eaa0dd7b9667407e15c3557caa83203aee7" +dependencies = [ + "log", + "solana-sdk", +] + +[[package]] +name = "solana-metrics" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d81931f224798c0e52062b0683a07eebe1c1904954c8765773c9802a28fbd0c" +dependencies = [ + "crossbeam-channel", + "gethostname", + "lazy_static", + "log", + "reqwest", + "solana-sdk", +] + +[[package]] +name = "solana-net-utils" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ea3420fa9da3789548f31b3c68e6a090bfd1320c735289851b711546d38e3b0" +dependencies = [ + "bincode", + "clap 3.2.25", + "crossbeam-channel", + "log", + "nix", + "rand 0.7.3", + "serde", + "serde_derive", + "socket2 0.4.10", + "solana-logger", + "solana-sdk", + "solana-version", + "tokio", + "url", +] + +[[package]] +name = "solana-perf" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5859de708bd12fb189f3c161cda03fdd341ffcf6be4fe787c7d730a30d589ac6" +dependencies = [ + "ahash 0.8.6", + "bincode", + "bv", + "caps", + "curve25519-dalek", + "dlopen", + "dlopen_derive", + "fnv", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.7.3", + "rayon", + "serde", + "solana-metrics", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-vote-program", +] + [[package]] name = "solana-program" version = "1.16.25" @@ -1996,8 +4257,8 @@ dependencies = [ "libc", "libsecp256k1", "log", - "memoffset", - "num-bigint", + "memoffset 0.9.0", + "num-bigint 0.4.4", "num-derive 0.3.3", "num-traits", "parking_lot", @@ -2021,32 +4282,302 @@ dependencies = [ ] [[package]] -name = "solana-sdk" +name = "solana-program-runtime" version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2087e15c92d4d6b3f085dc12fbe9614141c811f90a54cc418240ac30b608133f" +checksum = "3da0e9dd63326ded2055b42e54aa37baa6aeb8adaea658a0059c234af6d05c02" dependencies = [ - "assert_matches", "base64 0.21.7", "bincode", - "bitflags 1.3.2", - "borsh 0.10.3", - "bs58 0.4.0", - "bytemuck", - "byteorder", - "chrono", - "derivation-path", - "digest 0.10.7", - "ed25519-dalek", - "ed25519-dalek-bip32", - "generic-array", - "hmac 0.12.1", + "eager", + "enum-iterator", "itertools", - "js-sys", - "lazy_static", - "libsecp256k1", + "libc", "log", - "memmap2", + "num-derive 0.3.3", + "num-traits", + "percentage", + "rand 0.7.3", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-program-test" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d72aaaabfc85bb6750c14ff6b69df500ed07749dbc2b775d4499f6b1eb5ceef7" +dependencies = [ + "assert_matches", + "async-trait", + "base64 0.21.7", + "bincode", + "chrono-humanize", + "crossbeam-channel", + "log", + "serde", + "solana-banks-client", + "solana-banks-interface", + "solana-banks-server", + "solana-bpf-loader-program", + "solana-logger", + "solana-program-runtime", + "solana-runtime", + "solana-sdk", + "solana-vote-program", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-pubsub-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d1ad6fa8f0e154b91e67969fdf5478e74b75a87d5e3dce14ab83f4cb2f60f1" +dependencies = [ + "crossbeam-channel", + "futures-util", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +name = "solana-quic-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de9426ee9c0f98522242d6656db18175a022959af0b8ed3f170729e29933cf08" +dependencies = [ + "async-mutex", + "async-trait", + "futures", + "itertools", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "quinn-udp", + "rcgen", + "rustls 0.20.9", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-rpc-client-api", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-rayon-threadlimit" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e6c7a43e34d7db0ad158690b331df15b92f6996e3b9b03629591a54fc3e97f" +dependencies = [ + "lazy_static", + "num_cpus", +] + +[[package]] +name = "solana-remote-wallet" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed87a28ede1536be71352e13965b1fe7a2cf205e3e4fae2eef8a3407219ba1cd" +dependencies = [ + "console", + "dialoguer", + "log", + "num-derive 0.3.3", + "num-traits", + "parking_lot", + "qstring", + "semver", + "solana-sdk", + "thiserror", + "uriparse", +] + +[[package]] +name = "solana-rpc-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f273acbce4493bc1de8174b94cfaee112b72263ae1684a6e13890f5004be53fb" +dependencies = [ + "async-trait", + "base64 0.21.7", + "bincode", + "bs58 0.4.0", + "indicatif", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "tokio", +] + +[[package]] +name = "solana-rpc-client-api" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4462198830687b83870985db945c5d49c720d83abf516c8206fefba12cca689d" +dependencies = [ + "base64 0.21.7", + "bs58 0.4.0", + "jsonrpc-core", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "solana-rpc-client-nonce-utils" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91b3abad7b1ffd4b29d33b7525ebbc2ec8d0ca5928e4d8f28e364928d68a8dd9" +dependencies = [ + "clap 2.34.0", + "solana-clap-utils", + "solana-rpc-client", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-runtime" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c014aff6ce20b28f1e5057a3f78081821d4b62eccd9dc3b6a7e756be85f8bc4" +dependencies = [ + "arrayref", + "base64 0.21.7", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "dir-diff", + "flate2", + "fnv", + "im", + "index_list", + "itertools", + "lazy_static", + "log", + "lru", + "lz4", + "memmap2", + "modular-bitfield", + "num-derive 0.3.3", + "num-traits", + "num_cpus", + "num_enum 0.6.1", + "once_cell", + "ouroboros", + "percentage", + "rand 0.7.3", + "rayon", + "regex", + "rustc_version", + "serde", + "serde_derive", + "serde_json", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-bucket-map", + "solana-compute-budget-program", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-measure", + "solana-metrics", + "solana-perf", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-version", + "solana-vote-program", + "solana-zk-token-proof-program", + "solana-zk-token-sdk", + "static_assertions", + "strum", + "strum_macros", + "symlink", + "tar", + "tempfile", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-sdk" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2087e15c92d4d6b3f085dc12fbe9614141c811f90a54cc418240ac30b608133f" +dependencies = [ + "assert_matches", + "base64 0.21.7", + "bincode", + "bitflags 1.3.2", + "borsh 0.10.3", + "bs58 0.4.0", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.7", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", "num-derive 0.3.3", "num-traits", "num_enum 0.6.1", @@ -2074,398 +4605,1081 @@ dependencies = [ ] [[package]] -name = "solana-sdk-macro" -version = "1.16.25" +name = "solana-sdk-macro" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e0e0e7ee984b0f9179a1d4f4e9e67ce675de2324b5a98b61d2bdb61be3c19bb" +dependencies = [ + "bs58 0.4.0", + "proc-macro2 1.0.78", + "quote 1.0.35", + "rustversion", + "syn 2.0.52", +] + +[[package]] +name = "solana-security-txt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" + +[[package]] +name = "solana-send-transaction-service" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1afb10d881ba8eecf2edbfffe7d51b7f27b953f1ab2148cb3ba0157e4bf6c75" +dependencies = [ + "crossbeam-channel", + "log", + "solana-client", + "solana-measure", + "solana-metrics", + "solana-runtime", + "solana-sdk", + "solana-tpu-client", +] + +[[package]] +name = "solana-stake-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a543a3de0eb703e856dca5b92b4fe461bac5aa12080bd8486105acf265cbb68d" +dependencies = [ + "bincode", + "log", + "rustc_version", + "solana-config-program", + "solana-program-runtime", + "solana-sdk", + "solana-vote-program", +] + +[[package]] +name = "solana-streamer" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a868a782cab696677cd12deacda1862dbeeba903a4a8d8404a4d6bf45e8a556c" +dependencies = [ + "async-channel", + "bytes", + "crossbeam-channel", + "futures-util", + "histogram", + "indexmap 1.9.3", + "itertools", + "libc", + "log", + "nix", + "pem", + "percentage", + "pkcs8", + "quinn", + "quinn-proto", + "quinn-udp", + "rand 0.7.3", + "rcgen", + "rustls 0.20.9", + "solana-metrics", + "solana-perf", + "solana-sdk", + "thiserror", + "tokio", + "x509-parser", +] + +[[package]] +name = "solana-system-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf47ccfe21b717fa4a3d6c26d8d77a039648c456d3fc37ebf3e0c8ea95c5f37b" +dependencies = [ + "bincode", + "log", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-thin-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222f5539a4b01a5374c919e78aca5d4472fa5af6e551bf9f4ddd97ca59374f6d" +dependencies = [ + "bincode", + "log", + "rayon", + "solana-connection-cache", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", +] + +[[package]] +name = "solana-tpu-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c0f954b48dda0a907dbdb54387459c8eb7e9c702f278bf70a2caf3ebc417c88" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap 1.9.3", + "indicatif", + "log", + "rand 0.7.3", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-transaction-status" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7992d9605a65967b5e40e6ef8e285a953888e4789f0f5e3fb7339bf018cbb677" +dependencies = [ + "Inflector", + "base64 0.21.7", + "bincode", + "borsh 0.10.3", + "bs58 0.4.0", + "lazy_static", + "log", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-address-lookup-table-program", + "solana-sdk", + "spl-associated-token-account", + "spl-memo", + "spl-token", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "solana-udp-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4329dfe364cb276c7137b459e3737a27d6ae180f60d0aa2274d8be86cac3472c" +dependencies = [ + "async-trait", + "solana-connection-cache", + "solana-net-utils", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-version" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1931390daf0938c072c167611a263a8b95c13476d7fff7c8eb12789a981685b3" +dependencies = [ + "log", + "rustc_version", + "semver", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", +] + +[[package]] +name = "solana-vote-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25669860e2c5e821a8caa5372589289fbb6ac3084096133fdd1c6af6546536a2" +dependencies = [ + "bincode", + "log", + "num-derive 0.3.3", + "num-traits", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-zk-token-proof-program" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1a6a21efae8933fbdafef2f913a1a5791b061fa3e902c145173d444d09fe31e" +dependencies = [ + "bytemuck", + "getrandom 0.1.16", + "num-derive 0.3.3", + "num-traits", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", +] + +[[package]] +name = "solana-zk-token-sdk" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1457c85ab70a518438b9ac2b0c56037b9f6693060dfb617bbb93c7116e4f0c22" +dependencies = [ + "aes-gcm-siv", + "base64 0.21.7", + "bincode", + "bytemuck", + "byteorder", + "curve25519-dalek", + "getrandom 0.1.16", + "itertools", + "lazy_static", + "merlin", + "num-derive 0.3.3", + "num-traits", + "rand 0.7.3", + "serde", + "serde_json", + "sha3 0.9.1", + "solana-program", + "solana-sdk", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "solana_rbpf" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" +dependencies = [ + "byteorder", + "combine", + "goblin", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "scroll", + "thiserror", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "spl-associated-token-account" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" +dependencies = [ + "assert_matches", + "borsh 0.10.3", + "num-derive 0.4.2", + "num-traits", + "solana-program", + "spl-token", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "spl-discriminator" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" +dependencies = [ + "quote 1.0.35", + "spl-discriminator-syn", + "syn 2.0.52", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "sha2 0.10.8", + "syn 2.0.52", + "thiserror", +] + +[[package]] +name = "spl-math" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102d87a7608c793497fa3e85e9d0e24a33be06a94fb029b2cd30d794295f8110" +dependencies = [ + "borsh 0.10.3", + "num-derive 0.3.3", + "num-traits", + "solana-program", + "thiserror", + "uint", +] + +[[package]] +name = "spl-memo" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-pod" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" +dependencies = [ + "borsh 0.10.3", + "bytemuck", + "solana-program", + "solana-zk-token-sdk", + "spl-program-error", +] + +[[package]] +name = "spl-program-error" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" +dependencies = [ + "num-derive 0.4.2", + "num-traits", + "solana-program", + "spl-program-error-derive", + "thiserror", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "sha2 0.10.8", + "syn 2.0.52", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-token" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.6.1", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.4.2", + "num-traits", + "num_enum 0.7.2", + "solana-program", + "solana-zk-token-sdk", + "spl-memo", + "spl-pod", + "spl-token", + "spl-token-metadata-interface", + "spl-transfer-hook-interface", + "spl-type-length-value", + "thiserror", +] + +[[package]] +name = "spl-token-client" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92490d4e0381c7456078db4ba7d97a19606933b53495154da7197ba703ac276" +dependencies = [ + "async-trait", + "curve25519-dalek", + "futures", + "futures-util", + "solana-banks-interface", + "solana-cli-output", + "solana-program-test", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", + "spl-associated-token-account", + "spl-memo", + "spl-token", + "spl-token-2022", + "spl-token-metadata-interface", + "spl-transfer-hook-interface", + "thiserror", +] + +[[package]] +name = "spl-token-metadata-interface" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" +dependencies = [ + "borsh 0.10.3", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-tlv-account-resolution", + "spl-type-length-value", +] + +[[package]] +name = "spl-type-length-value" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2 1.0.78", + "quote 1.0.35", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", + "unicode-xid 0.2.4", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tarpc" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0e0e7ee984b0f9179a1d4f4e9e67ce675de2324b5a98b61d2bdb61be3c19bb" +checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" dependencies = [ - "bs58 0.4.0", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.52", + "anyhow", + "fnv", + "futures", + "humantime", + "opentelemetry", + "pin-project", + "rand 0.8.5", + "serde", + "static_assertions", + "tarpc-plugins", + "thiserror", + "tokio", + "tokio-serde", + "tokio-util 0.6.10", + "tracing", + "tracing-opentelemetry", ] [[package]] -name = "solana-security-txt" -version = "1.1.1" +name = "tarpc-plugins" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" +checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", +] [[package]] -name = "solana-zk-token-sdk" -version = "1.16.25" +name = "tempfile" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1457c85ab70a518438b9ac2b0c56037b9f6693060dfb617bbb93c7116e4f0c22" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "aes-gcm-siv", - "base64 0.21.7", - "bincode", - "bytemuck", - "byteorder", - "curve25519-dalek", - "getrandom 0.1.16", - "itertools", - "lazy_static", - "merlin", - "num-derive 0.3.3", - "num-traits", - "rand 0.7.3", - "serde", - "serde_json", - "sha3 0.9.1", - "solana-program", - "solana-sdk", - "subtle", - "thiserror", - "zeroize", + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", ] [[package]] -name = "spl-associated-token-account" -version = "2.2.0" +name = "termcolor" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ - "assert_matches", - "borsh 0.10.3", - "num-derive 0.4.2", - "num-traits", - "solana-program", - "spl-token", - "spl-token-2022", - "thiserror", + "winapi-util", ] [[package]] -name = "spl-discriminator" -version = "0.1.0" +name = "textwrap" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator-derive", + "unicode-width", ] [[package]] -name = "spl-discriminator-derive" -version = "0.1.2" +name = "textwrap" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + +[[package]] +name = "thiserror" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ - "quote", - "spl-discriminator-syn", - "syn 2.0.52", + "thiserror-impl", ] [[package]] -name = "spl-discriminator-syn" -version = "0.1.2" +name = "thiserror-impl" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ - "proc-macro2", - "quote", - "sha2 0.10.8", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", - "thiserror", ] [[package]] -name = "spl-math" -version = "0.2.0" +name = "thread_local" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102d87a7608c793497fa3e85e9d0e24a33be06a94fb029b2cd30d794295f8110" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "borsh 0.10.3", - "num-derive 0.3.3", - "num-traits", - "solana-program", - "thiserror", - "uint", + "cfg-if", + "once_cell", ] [[package]] -name = "spl-memo" -version = "4.0.0" +name = "time" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ - "solana-program", + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", ] [[package]] -name = "spl-pod" -version = "0.1.0" +name = "time-core" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ - "borsh 0.10.3", - "bytemuck", - "solana-program", - "solana-zk-token-sdk", - "spl-program-error", + "num-conv", + "time-core", ] [[package]] -name = "spl-program-error" -version = "0.3.0" +name = "tiny-bip39" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" dependencies = [ - "num-derive 0.4.2", - "num-traits", - "solana-program", - "spl-program-error-derive", + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", ] [[package]] -name = "spl-program-error-derive" -version = "0.3.2" +name = "tinyvec" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ - "proc-macro2", - "quote", - "sha2 0.10.8", - "syn 2.0.52", + "tinyvec_macros", ] [[package]] -name = "spl-tlv-account-resolution" -version = "0.4.0" +name = "tinyvec_macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" -dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] -name = "spl-token" -version = "4.0.0" +name = "tokio" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ - "arrayref", - "bytemuck", - "num-derive 0.3.3", - "num-traits", - "num_enum 0.6.1", - "solana-program", - "thiserror", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.7", + "tokio-macros", + "windows-sys 0.48.0", ] [[package]] -name = "spl-token-2022" -version = "0.9.0" +name = "tokio-macros" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ - "arrayref", - "bytemuck", - "num-derive 0.4.2", - "num-traits", - "num_enum 0.7.2", - "solana-program", - "solana-zk-token-sdk", - "spl-memo", - "spl-pod", - "spl-token", - "spl-token-metadata-interface", - "spl-transfer-hook-interface", - "spl-type-length-value", - "thiserror", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.52", ] [[package]] -name = "spl-token-metadata-interface" -version = "0.2.0" +name = "tokio-rustls" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "borsh 0.10.3", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", + "rustls 0.20.9", + "tokio", + "webpki", ] [[package]] -name = "spl-transfer-hook-interface" -version = "0.3.0" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "arrayref", - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-tlv-account-resolution", - "spl-type-length-value", + "rustls 0.21.12", + "tokio", ] [[package]] -name = "spl-type-length-value" -version = "0.3.0" +name = "tokio-serde" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", + "bincode", + "bytes", + "educe", + "futures-core", + "futures-sink", + "pin-project", + "serde", + "serde_json", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "tokio-stream" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] [[package]] -name = "strsim" -version = "0.10.0" +name = "tokio-tungstenite" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +dependencies = [ + "futures-util", + "log", + "rustls 0.20.9", + "tokio", + "tokio-rustls 0.23.4", + "tungstenite", + "webpki", + "webpki-roots 0.22.6", +] [[package]] -name = "subtle" -version = "2.4.1" +name = "tokio-util" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "slab", + "tokio", +] [[package]] -name = "syn" -version = "1.0.109" +name = "tokio-util" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] -name = "syn" -version = "2.0.52" +name = "toml" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "serde", ] [[package]] -name = "tempfile" -version = "3.10.1" +name = "toml_datetime" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys", -] +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] -name = "termcolor" -version = "1.4.1" +name = "toml_edit" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "winapi-util", + "indexmap 2.2.5", + "toml_datetime", + "winnow", ] [[package]] -name = "thiserror" -version = "1.0.57" +name = "tower-service" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "thiserror-impl", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", ] [[package]] -name = "thiserror-impl" -version = "1.0.57" +name = "tracing-attributes" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] [[package]] -name = "tiny-bip39" -version = "0.8.2" +name = "tracing-core" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ - "anyhow", - "hmac 0.8.1", "once_cell", - "pbkdf2 0.4.0", - "rand 0.7.3", - "rustc-hash", - "sha2 0.9.9", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", + "valuable", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tracing-opentelemetry" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" dependencies = [ - "tinyvec_macros", + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", ] [[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "toml" -version = "0.5.11" +name = "tracing-subscriber" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "serde", + "sharded-slab", + "thread_local", + "tracing-core", ] [[package]] -name = "toml_datetime" -version = "0.6.5" +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] -name = "toml_edit" -version = "0.19.15" +name = "tungstenite" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "indexmap", - "toml_datetime", - "winnow", + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls 0.20.9", + "sha-1", + "thiserror", + "url", + "utf-8", + "webpki", + "webpki-roots 0.22.6", ] [[package]] @@ -2492,6 +5706,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -2513,6 +5733,24 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "unicode-width" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "universal-hash" version = "0.4.1" @@ -2523,6 +5761,33 @@ dependencies = [ "subtle", ] +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "uriparse" version = "0.6.4" @@ -2533,12 +5798,53 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "wait-timeout" version = "0.2.0" @@ -2548,6 +5854,25 @@ dependencies = [ "libc", ] +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -2579,19 +5904,31 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ - "quote", + "quote 1.0.35", "wasm-bindgen-macro-support", ] @@ -2601,8 +5938,8 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -2624,6 +5961,31 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "winapi" version = "0.3.9" @@ -2655,6 +6017,39 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -2694,6 +6089,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.4", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -2706,6 +6107,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -2718,6 +6125,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -2730,6 +6143,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -2742,6 +6161,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -2754,6 +6179,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -2766,6 +6197,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -2787,6 +6224,54 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs", + "base64 0.13.1", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time", +] + [[package]] name = "zerocopy" version = "0.7.32" @@ -2802,8 +6287,8 @@ version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] @@ -2822,7 +6307,36 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 2.0.52", ] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index ef17a63..9642629 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ - "programs/*" + "programs/*", + "client", ] [profile.release] diff --git a/client/Cargo.toml b/client/Cargo.toml new file mode 100644 index 0000000..d054479 --- /dev/null +++ b/client/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "client" +version = "0.1.0" +rust-version = "1.75.0" +edition = "2021" + +[dependencies] +anchor-client = "0.29.0" +anchor-lang = "0.29.0" +raydium-cp-swap = {path = "../programs/cp-swap", features = ["no-entrypoint", "client"]} +solana-sdk = ">=1.14, <1.17" +solana-client = ">=1.14, <1.17" +solana-account-decoder = ">=1.14, <1.17" +solana-transaction-status = ">=1.14, <1.17" +spl-token = { version = "4.0.0", features=["no-entrypoint"] } +spl-token-client = "0.7.0" +spl-memo = "4.0.0" +spl-associated-token-account = { version = "2.2.0", features = ["no-entrypoint"]} +spl-token-2022 = { version = "0.9.0", features = ["no-entrypoint"]} +clap = { version = "4.1.8", features = ["derive"] } +anyhow = "1.0.32" +rand = "0.7.3" +hex = "0.4.3" +configparser = "3.0.0" +serde_json = { version = "1.0.78" } +serde = { version = "1.0", features = ["derive"] } +arrayref = "0.3.7" +bs58 = { version = "0.5.0"} +bincode = { version = "1.3.3" } +regex = "1" +colorful = "0.2.2" \ No newline at end of file diff --git a/client/src/instructions/amm_instructions.rs b/client/src/instructions/amm_instructions.rs new file mode 100644 index 0000000..ff6725d --- /dev/null +++ b/client/src/instructions/amm_instructions.rs @@ -0,0 +1,312 @@ +use anchor_client::{Client, Cluster}; +use anyhow::Result; +use solana_sdk::{instruction::Instruction, pubkey::Pubkey, system_program, sysvar}; + +use raydium_cp_swap::accounts as raydium_cp_accounts; +use raydium_cp_swap::instruction as raydium_cp_instructions; +use raydium_cp_swap::{ + states::{AMM_CONFIG_SEED, OBSERVATION_SEED, POOL_LP_MINT_SEED, POOL_SEED, POOL_VAULT_SEED}, + AUTH_SEED, +}; +use std::rc::Rc; + +use super::super::{read_keypair_file, ClientConfig}; + +pub fn initialize_pool_instr( + config: &ClientConfig, + token_0_mint: Pubkey, + token_1_mint: Pubkey, + token_0_program: Pubkey, + token_1_program: Pubkey, + user_token_0_account: Pubkey, + user_token_1_account: Pubkey, + create_pool_fee: Pubkey, + init_amount_0: u64, + init_amount_1: u64, + open_time: u64, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(config.raydium_cp_program)?; + + let amm_config_index = 0u16; + let (amm_config_key, __bump) = Pubkey::find_program_address( + &[AMM_CONFIG_SEED.as_bytes(), &amm_config_index.to_be_bytes()], + &program.id(), + ); + + let (pool_account_key, __bump) = Pubkey::find_program_address( + &[ + POOL_SEED.as_bytes(), + amm_config_key.to_bytes().as_ref(), + token_0_mint.to_bytes().as_ref(), + token_1_mint.to_bytes().as_ref(), + ], + &program.id(), + ); + let (authority, __bump) = Pubkey::find_program_address(&[AUTH_SEED.as_bytes()], &program.id()); + let (token_0_vault, __bump) = Pubkey::find_program_address( + &[ + POOL_VAULT_SEED.as_bytes(), + pool_account_key.to_bytes().as_ref(), + token_0_mint.to_bytes().as_ref(), + ], + &program.id(), + ); + let (token_1_vault, __bump) = Pubkey::find_program_address( + &[ + POOL_VAULT_SEED.as_bytes(), + pool_account_key.to_bytes().as_ref(), + token_1_mint.to_bytes().as_ref(), + ], + &program.id(), + ); + let (lp_mint_key, __bump) = Pubkey::find_program_address( + &[ + POOL_LP_MINT_SEED.as_bytes(), + pool_account_key.to_bytes().as_ref(), + ], + &program.id(), + ); + let (observation_key, __bump) = Pubkey::find_program_address( + &[ + OBSERVATION_SEED.as_bytes(), + pool_account_key.to_bytes().as_ref(), + ], + &program.id(), + ); + + let instructions = program + .request() + .accounts(raydium_cp_accounts::Initialize { + creator: program.payer(), + amm_config: amm_config_key, + authority, + pool_state: pool_account_key, + token_0_mint, + token_1_mint, + lp_mint: lp_mint_key, + creator_token_0: user_token_0_account, + creator_token_1: user_token_1_account, + creator_lp_token: spl_associated_token_account::get_associated_token_address( + &program.payer(), + &lp_mint_key, + ), + token_0_vault, + token_1_vault, + create_pool_fee, + observation_state: observation_key, + token_program: spl_token::id(), + token_0_program, + token_1_program, + associated_token_program: spl_associated_token_account::id(), + system_program: system_program::id(), + rent: sysvar::rent::id(), + }) + .args(raydium_cp_instructions::Initialize { + init_amount_0, + init_amount_1, + open_time, + }) + .instructions()?; + Ok(instructions) +} + +pub fn deposit_instr( + config: &ClientConfig, + pool_id: Pubkey, + token_0_mint: Pubkey, + token_1_mint: Pubkey, + token_lp_mint: Pubkey, + token_0_vault: Pubkey, + token_1_vault: Pubkey, + user_token_0_account: Pubkey, + user_token_1_account: Pubkey, + user_token_lp_account: Pubkey, + lp_token_amount: u64, + maximum_token_0_amount: u64, + maximum_token_1_amount: u64, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(config.raydium_cp_program)?; + + let (authority, __bump) = Pubkey::find_program_address(&[AUTH_SEED.as_bytes()], &program.id()); + + let instructions = program + .request() + .accounts(raydium_cp_accounts::Deposit { + owner: program.payer(), + authority, + pool_state: pool_id, + owner_lp_token: user_token_lp_account, + token_0_account: user_token_0_account, + token_1_account: user_token_1_account, + token_0_vault, + token_1_vault, + token_program: spl_token::id(), + token_program_2022: spl_token_2022::id(), + vault_0_mint: token_0_mint, + vault_1_mint: token_1_mint, + lp_mint: token_lp_mint, + }) + .args(raydium_cp_instructions::Deposit { + lp_token_amount, + maximum_token_0_amount, + maximum_token_1_amount, + }) + .instructions()?; + Ok(instructions) +} + +pub fn withdraw_instr( + config: &ClientConfig, + pool_id: Pubkey, + token_0_mint: Pubkey, + token_1_mint: Pubkey, + token_lp_mint: Pubkey, + token_0_vault: Pubkey, + token_1_vault: Pubkey, + user_token_0_account: Pubkey, + user_token_1_account: Pubkey, + user_token_lp_account: Pubkey, + lp_token_amount: u64, + minimum_token_0_amount: u64, + minimum_token_1_amount: u64, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(config.raydium_cp_program)?; + + let (authority, __bump) = Pubkey::find_program_address(&[AUTH_SEED.as_bytes()], &program.id()); + + let instructions = program + .request() + .accounts(raydium_cp_accounts::Withdraw { + owner: program.payer(), + authority, + pool_state: pool_id, + owner_lp_token: user_token_lp_account, + token_0_account: user_token_0_account, + token_1_account: user_token_1_account, + token_0_vault, + token_1_vault, + token_program: spl_token::id(), + token_program_2022: spl_token_2022::id(), + vault_0_mint: token_0_mint, + vault_1_mint: token_1_mint, + lp_mint: token_lp_mint, + memo_program: spl_memo::id(), + }) + .args(raydium_cp_instructions::Withdraw { + lp_token_amount, + minimum_token_0_amount, + minimum_token_1_amount, + }) + .instructions()?; + Ok(instructions) +} + +pub fn swap_base_input_instr( + config: &ClientConfig, + pool_id: Pubkey, + amm_config: Pubkey, + observation_account: Pubkey, + input_token_account: Pubkey, + output_token_account: Pubkey, + input_vault: Pubkey, + output_vault: Pubkey, + input_token_mint: Pubkey, + output_token_mint: Pubkey, + input_token_program: Pubkey, + output_token_program: Pubkey, + amount_in: u64, + minimum_amount_out: u64, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(config.raydium_cp_program)?; + + let (authority, __bump) = Pubkey::find_program_address(&[AUTH_SEED.as_bytes()], &program.id()); + + let instructions = program + .request() + .accounts(raydium_cp_accounts::Swap { + payer: program.payer(), + authority, + amm_config, + pool_state: pool_id, + input_token_account, + output_token_account, + input_vault, + output_vault, + input_token_program, + output_token_program, + input_token_mint, + output_token_mint, + observation_state: observation_account, + }) + .args(raydium_cp_instructions::SwapBaseInput { + amount_in, + minimum_amount_out, + }) + .instructions()?; + Ok(instructions) +} + +pub fn swap_base_output_instr( + config: &ClientConfig, + pool_id: Pubkey, + amm_config: Pubkey, + observation_account: Pubkey, + input_token_account: Pubkey, + output_token_account: Pubkey, + input_vault: Pubkey, + output_vault: Pubkey, + input_token_mint: Pubkey, + output_token_mint: Pubkey, + input_token_program: Pubkey, + output_token_program: Pubkey, + max_amount_in: u64, + amount_out: u64, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(config.raydium_cp_program)?; + + let (authority, __bump) = Pubkey::find_program_address(&[AUTH_SEED.as_bytes()], &program.id()); + + let instructions = program + .request() + .accounts(raydium_cp_accounts::Swap { + payer: program.payer(), + authority, + amm_config, + pool_state: pool_id, + input_token_account, + output_token_account, + input_vault, + output_vault, + input_token_program, + output_token_program, + input_token_mint, + output_token_mint, + observation_state: observation_account, + }) + .args(raydium_cp_instructions::SwapBaseOutput { + max_amount_in, + amount_out, + }) + .instructions()?; + Ok(instructions) +} diff --git a/client/src/instructions/events_instructions_parse.rs b/client/src/instructions/events_instructions_parse.rs new file mode 100644 index 0000000..b0549b8 --- /dev/null +++ b/client/src/instructions/events_instructions_parse.rs @@ -0,0 +1,503 @@ +use anchor_client::ClientError; +use anchor_lang::Discriminator; +use anyhow::Result; +use colorful::Color; +use colorful::Colorful; +use raydium_cp_swap::instruction; +use raydium_cp_swap::states::*; +use regex::Regex; +use solana_transaction_status::{ + option_serializer::OptionSerializer, EncodedTransaction, UiTransactionStatusMeta, +}; + +const PROGRAM_LOG: &str = "Program log: "; +const PROGRAM_DATA: &str = "Program data: "; + +pub enum InstructionDecodeType { + BaseHex, + Base64, + Base58, +} + +pub fn parse_program_event( + self_program_str: &str, + meta: Option, +) -> Result<(), ClientError> { + let logs: Vec = if let Some(meta_data) = meta { + let log_messages = if let OptionSerializer::Some(log_messages) = meta_data.log_messages { + log_messages + } else { + Vec::new() + }; + log_messages + } else { + Vec::new() + }; + let mut logs = &logs[..]; + if !logs.is_empty() { + if let Ok(mut execution) = Execution::new(&mut logs) { + for l in logs { + let (new_program, did_pop) = + if !execution.is_empty() && self_program_str == execution.program() { + handle_program_log(self_program_str, &l, true).unwrap_or_else(|e| { + println!("Unable to parse log: {e}"); + std::process::exit(1); + }) + } else { + let (program, did_pop) = handle_system_log(self_program_str, l); + (program, did_pop) + }; + // Switch program context on CPI. + if let Some(new_program) = new_program { + execution.push(new_program); + } + // Program returned. + if did_pop { + execution.pop(); + } + } + } + } else { + println!("log is empty"); + } + Ok(()) +} + +struct Execution { + stack: Vec, +} + +impl Execution { + pub fn new(logs: &mut &[String]) -> Result { + let l = &logs[0]; + *logs = &logs[1..]; + + let re = Regex::new(r"^Program (.*) invoke.*$").unwrap(); + let c = re + .captures(l) + .ok_or_else(|| ClientError::LogParseError(l.to_string()))?; + let program = c + .get(1) + .ok_or_else(|| ClientError::LogParseError(l.to_string()))? + .as_str() + .to_string(); + Ok(Self { + stack: vec![program], + }) + } + + pub fn program(&self) -> String { + assert!(!self.stack.is_empty()); + self.stack[self.stack.len() - 1].clone() + } + + pub fn is_empty(&self) -> bool { + self.stack.is_empty() + } + + pub fn push(&mut self, new_program: String) { + self.stack.push(new_program); + } + + pub fn pop(&mut self) { + assert!(!self.stack.is_empty()); + self.stack.pop().unwrap(); + } +} + +pub fn handle_program_log( + self_program_str: &str, + l: &str, + with_prefix: bool, +) -> Result<(Option, bool), ClientError> { + // Log emitted from the current program. + if let Some(log) = if with_prefix { + l.strip_prefix(PROGRAM_LOG) + .or_else(|| l.strip_prefix(PROGRAM_DATA)) + } else { + Some(l) + } { + if l.starts_with(&format!("Program log:")) { + // not log event + return Ok((None, false)); + } + let borsh_bytes = match anchor_lang::__private::base64::decode(log) { + Ok(borsh_bytes) => borsh_bytes, + _ => { + println!("Could not base64 decode log: {}", log); + return Ok((None, false)); + } + }; + + let mut slice: &[u8] = &borsh_bytes[..]; + let disc: [u8; 8] = { + let mut disc = [0; 8]; + disc.copy_from_slice(&borsh_bytes[..8]); + slice = &slice[8..]; + disc + }; + match disc { + SwapEvent::DISCRIMINATOR => { + println!("{:#?}", decode_event::(&mut slice)?); + } + LpChangeEvent::DISCRIMINATOR => { + println!("{:#?}", decode_event::(&mut slice)?); + } + _ => { + println!("unknow event: {}", l); + } + } + return Ok((None, false)); + } else { + let (program, did_pop) = handle_system_log(self_program_str, l); + return Ok((program, did_pop)); + } +} + +fn handle_system_log(this_program_str: &str, log: &str) -> (Option, bool) { + if log.starts_with(&format!("Program {this_program_str} invoke")) { + (Some(this_program_str.to_string()), false) + } else if log.contains("invoke") { + (Some("cpi".to_string()), false) // Any string will do. + } else { + let re = Regex::new(r"^Program (.*) success*$").unwrap(); + if re.is_match(log) { + (None, true) + } else { + (None, false) + } + } +} + +fn decode_event( + slice: &mut &[u8], +) -> Result { + let event: T = anchor_lang::AnchorDeserialize::deserialize(slice) + .map_err(|e| ClientError::LogParseError(e.to_string()))?; + Ok(event) +} + +pub fn parse_program_instruction( + self_program_str: &str, + encoded_transaction: EncodedTransaction, + meta: Option, +) -> Result<(), ClientError> { + let ui_raw_msg = match encoded_transaction { + solana_transaction_status::EncodedTransaction::Json(ui_tx) => { + let ui_message = ui_tx.message; + // println!("{:#?}", ui_message); + match ui_message { + solana_transaction_status::UiMessage::Raw(ui_raw_msg) => ui_raw_msg, + _ => solana_transaction_status::UiRawMessage { + header: solana_sdk::message::MessageHeader::default(), + account_keys: Vec::new(), + recent_blockhash: "".to_string(), + instructions: Vec::new(), + address_table_lookups: None, + }, + } + } + _ => solana_transaction_status::UiRawMessage { + header: solana_sdk::message::MessageHeader::default(), + account_keys: Vec::new(), + recent_blockhash: "".to_string(), + instructions: Vec::new(), + address_table_lookups: None, + }, + }; + // append lookup table keys if necessary + if meta.is_some() { + let mut account_keys = ui_raw_msg.account_keys; + let meta = meta.clone().unwrap(); + match meta.loaded_addresses { + OptionSerializer::Some(addresses) => { + let mut writeable_address = addresses.writable; + let mut readonly_address = addresses.readonly; + account_keys.append(&mut writeable_address); + account_keys.append(&mut readonly_address); + } + _ => {} + } + let program_index = account_keys + .iter() + .position(|r| r == self_program_str) + .unwrap(); + // println!("{}", program_index); + // println!("{:#?}", account_keys); + for (i, ui_compiled_instruction) in ui_raw_msg.instructions.iter().enumerate() { + if (ui_compiled_instruction.program_id_index as usize) == program_index { + let out_put = format!("instruction #{}", i + 1); + println!("{}", out_put.gradient(Color::Green)); + handle_program_instruction( + &ui_compiled_instruction.data, + InstructionDecodeType::Base58, + )?; + } + } + + match meta.inner_instructions { + OptionSerializer::Some(inner_instructions) => { + for inner in inner_instructions { + for (i, instruction) in inner.instructions.iter().enumerate() { + match instruction { + solana_transaction_status::UiInstruction::Compiled( + ui_compiled_instruction, + ) => { + if (ui_compiled_instruction.program_id_index as usize) + == program_index + { + let out_put = + format!("inner_instruction #{}.{}", inner.index + 1, i + 1); + println!("{}", out_put.gradient(Color::Green)); + handle_program_instruction( + &ui_compiled_instruction.data, + InstructionDecodeType::Base58, + )?; + } + } + _ => {} + } + } + } + } + _ => {} + } + } + Ok(()) +} + +pub fn handle_program_instruction( + instr_data: &str, + decode_type: InstructionDecodeType, +) -> Result<(), ClientError> { + let data; + match decode_type { + InstructionDecodeType::BaseHex => { + data = hex::decode(instr_data).unwrap(); + } + InstructionDecodeType::Base64 => { + let borsh_bytes = match anchor_lang::__private::base64::decode(instr_data) { + Ok(borsh_bytes) => borsh_bytes, + _ => { + println!("Could not base64 decode instruction: {}", instr_data); + return Ok(()); + } + }; + data = borsh_bytes; + } + InstructionDecodeType::Base58 => { + let borsh_bytes = match bs58::decode(instr_data).into_vec() { + Ok(borsh_bytes) => borsh_bytes, + _ => { + println!("Could not base58 decode instruction: {}", instr_data); + return Ok(()); + } + }; + data = borsh_bytes; + } + } + + let mut ix_data: &[u8] = &data[..]; + let disc: [u8; 8] = { + let mut disc = [0; 8]; + disc.copy_from_slice(&data[..8]); + ix_data = &ix_data[8..]; + disc + }; + // println!("{:?}", disc); + + match disc { + instruction::CreateAmmConfig::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct CreateAmmConfig { + pub index: u16, + pub trade_fee_rate: u64, + pub protocol_fee_rate: u64, + pub fund_fee_rate: u64, + pub create_pool_fee: u64, + } + impl From for CreateAmmConfig { + fn from(instr: instruction::CreateAmmConfig) -> CreateAmmConfig { + CreateAmmConfig { + index: instr.index, + trade_fee_rate: instr.trade_fee_rate, + protocol_fee_rate: instr.protocol_fee_rate, + fund_fee_rate: instr.fund_fee_rate, + create_pool_fee: instr.create_pool_fee, + } + } + } + println!("{:#?}", CreateAmmConfig::from(ix)); + } + instruction::UpdateAmmConfig::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct UpdateAmmConfig { + pub param: u8, + pub value: u64, + } + impl From for UpdateAmmConfig { + fn from(instr: instruction::UpdateAmmConfig) -> UpdateAmmConfig { + UpdateAmmConfig { + param: instr.param, + value: instr.value, + } + } + } + println!("{:#?}", UpdateAmmConfig::from(ix)); + } + instruction::Initialize::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct Initialize { + pub init_amount_0: u64, + pub init_amount_1: u64, + pub open_time: u64, + } + impl From for Initialize { + fn from(instr: instruction::Initialize) -> Initialize { + Initialize { + init_amount_0: instr.init_amount_0, + init_amount_1: instr.init_amount_1, + open_time: instr.open_time, + } + } + } + println!("{:#?}", Initialize::from(ix)); + } + instruction::UpdatePoolStatus::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct UpdatePoolStatus { + pub status: u8, + } + impl From for UpdatePoolStatus { + fn from(instr: instruction::UpdatePoolStatus) -> UpdatePoolStatus { + UpdatePoolStatus { + status: instr.status, + } + } + } + println!("{:#?}", UpdatePoolStatus::from(ix)); + } + instruction::CollectProtocolFee::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct CollectProtocolFee { + pub amount_0_requested: u64, + pub amount_1_requested: u64, + } + impl From for CollectProtocolFee { + fn from(instr: instruction::CollectProtocolFee) -> CollectProtocolFee { + CollectProtocolFee { + amount_0_requested: instr.amount_0_requested, + amount_1_requested: instr.amount_1_requested, + } + } + } + println!("{:#?}", CollectProtocolFee::from(ix)); + } + instruction::CollectFundFee::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct CollectFundFee { + pub amount_0_requested: u64, + pub amount_1_requested: u64, + } + impl From for CollectFundFee { + fn from(instr: instruction::CollectFundFee) -> CollectFundFee { + CollectFundFee { + amount_0_requested: instr.amount_0_requested, + amount_1_requested: instr.amount_1_requested, + } + } + } + println!("{:#?}", CollectFundFee::from(ix)); + } + instruction::Deposit::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct Deposit { + pub lp_token_amount: u64, + pub maximum_token_0_amount: u64, + pub maximum_token_1_amount: u64, + } + impl From for Deposit { + fn from(instr: instruction::Deposit) -> Deposit { + Deposit { + lp_token_amount: instr.lp_token_amount, + maximum_token_0_amount: instr.maximum_token_0_amount, + maximum_token_1_amount: instr.maximum_token_1_amount, + } + } + } + println!("{:#?}", Deposit::from(ix)); + } + instruction::Withdraw::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct Withdraw { + pub lp_token_amount: u64, + pub minimum_token_0_amount: u64, + pub minimum_token_1_amount: u64, + } + impl From for Withdraw { + fn from(instr: instruction::Withdraw) -> Withdraw { + Withdraw { + lp_token_amount: instr.lp_token_amount, + minimum_token_0_amount: instr.minimum_token_0_amount, + minimum_token_1_amount: instr.minimum_token_1_amount, + } + } + } + println!("{:#?}", Withdraw::from(ix)); + } + instruction::SwapBaseInput::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct SwapBaseInput { + pub amount_in: u64, + pub minimum_amount_out: u64, + } + impl From for SwapBaseInput { + fn from(instr: instruction::SwapBaseInput) -> SwapBaseInput { + SwapBaseInput { + amount_in: instr.amount_in, + minimum_amount_out: instr.minimum_amount_out, + } + } + } + println!("{:#?}", SwapBaseInput::from(ix)); + } + instruction::SwapBaseOutput::DISCRIMINATOR => { + let ix = decode_instruction::(&mut ix_data).unwrap(); + #[derive(Debug)] + pub struct SwapBaseOutput { + pub max_amount_in: u64, + pub amount_out: u64, + } + impl From for SwapBaseOutput { + fn from(instr: instruction::SwapBaseOutput) -> SwapBaseOutput { + SwapBaseOutput { + max_amount_in: instr.max_amount_in, + amount_out: instr.amount_out, + } + } + } + println!("{:#?}", SwapBaseOutput::from(ix)); + } + _ => { + println!("unknow instruction: {}", instr_data); + } + } + Ok(()) +} + +fn decode_instruction( + slice: &mut &[u8], +) -> Result { + let instruction: T = anchor_lang::AnchorDeserialize::deserialize(slice) + .map_err(|_| anchor_lang::error::ErrorCode::InstructionDidNotDeserialize)?; + Ok(instruction) +} diff --git a/client/src/instructions/mod.rs b/client/src/instructions/mod.rs new file mode 100644 index 0000000..77b482b --- /dev/null +++ b/client/src/instructions/mod.rs @@ -0,0 +1,5 @@ +pub mod amm_instructions; +pub mod events_instructions_parse; +pub mod rpc; +pub mod token_instructions; +pub mod utils; diff --git a/client/src/instructions/rpc.rs b/client/src/instructions/rpc.rs new file mode 100644 index 0000000..7dc2ff6 --- /dev/null +++ b/client/src/instructions/rpc.rs @@ -0,0 +1,57 @@ +use anyhow::{anyhow, Result}; +use solana_client::{ + rpc_client::RpcClient, + rpc_config::RpcSendTransactionConfig, + rpc_request::RpcRequest, + rpc_response::{RpcResult, RpcSimulateTransactionResult}, +}; +use solana_sdk::{ + account::Account, commitment_config::CommitmentConfig, program_pack::Pack as TokenPack, + pubkey::Pubkey, signature::Signature, transaction::Transaction, +}; +use std::convert::Into; + +pub fn simulate_transaction( + client: &RpcClient, + transaction: &Transaction, + sig_verify: bool, + cfg: CommitmentConfig, +) -> RpcResult { + let serialized_encoded = bs58::encode(bincode::serialize(transaction).unwrap()).into_string(); + client.send( + RpcRequest::SimulateTransaction, + serde_json::json!([serialized_encoded, { + "sigVerify": sig_verify, "commitment": cfg.commitment + }]), + ) +} + +pub fn send_txn(client: &RpcClient, txn: &Transaction, wait_confirm: bool) -> Result { + Ok(client.send_and_confirm_transaction_with_spinner_and_config( + txn, + if wait_confirm { + CommitmentConfig::confirmed() + } else { + CommitmentConfig::processed() + }, + RpcSendTransactionConfig { + skip_preflight: true, + ..RpcSendTransactionConfig::default() + }, + )?) +} + +pub fn get_token_account(client: &RpcClient, addr: &Pubkey) -> Result { + let account = client + .get_account_with_commitment(addr, CommitmentConfig::processed())? + .value + .map_or(Err(anyhow!("Account not found")), Ok)?; + T::unpack_from_slice(&account.data).map_err(Into::into) +} + +pub fn get_multiple_accounts( + client: &RpcClient, + pubkeys: &[Pubkey], +) -> Result>> { + Ok(client.get_multiple_accounts(pubkeys)?) +} diff --git a/client/src/instructions/token_instructions.rs b/client/src/instructions/token_instructions.rs new file mode 100644 index 0000000..088f5a0 --- /dev/null +++ b/client/src/instructions/token_instructions.rs @@ -0,0 +1,291 @@ +use super::super::{read_keypair_file, ClientConfig}; +use anchor_client::{Client, Cluster}; +use anyhow::Result; +use solana_client::rpc_client::RpcClient; +use solana_sdk::{ + account::WritableAccount, + instruction::Instruction, + program_pack::Pack, + pubkey::Pubkey, + signature::{Keypair, Signer}, + system_instruction, +}; +use spl_token_2022::{ + extension::{BaseStateWithExtensions, ExtensionType, StateWithExtensionsMut}, + state::{Account, Mint}, +}; +use spl_token_client::token::ExtensionInitializationParams; +use std::{rc::Rc, str::FromStr}; + +pub fn create_and_init_mint_instr( + config: &ClientConfig, + token_program: Pubkey, + mint_key: &Pubkey, + mint_authority: &Pubkey, + freeze_authority: Option<&Pubkey>, + extension_init_params: Vec, + decimals: u8, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = if token_program == spl_token::id() { + client.program(spl_token::id())? + } else { + client.program(spl_token_2022::id())? + }; + let extension_types = extension_init_params + .iter() + .map(|e| e.extension()) + .collect::>(); + let space = ExtensionType::try_calculate_account_len::(&extension_types)?; + + let mut instructions = vec![system_instruction::create_account( + &program.payer(), + mint_key, + program + .rpc() + .get_minimum_balance_for_rent_exemption(space)?, + space as u64, + &program.id(), + )]; + for params in extension_init_params { + instructions.push(params.instruction(&token_program, &mint_key)?); + } + instructions.push(spl_token_2022::instruction::initialize_mint( + &program.id(), + mint_key, + mint_authority, + freeze_authority, + decimals, + )?); + Ok(instructions) +} + +pub fn create_account_rent_exmpt_instr( + config: &ClientConfig, + new_account_key: &Pubkey, + owner: Pubkey, + data_size: usize, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(owner)?; + let instructions = program + .request() + .instruction(system_instruction::create_account( + &program.payer(), + &new_account_key, + program + .rpc() + .get_minimum_balance_for_rent_exemption(data_size)?, + data_size as u64, + &program.id(), + )) + .instructions()?; + Ok(instructions) +} + +pub fn create_ata_token_account_instr( + config: &ClientConfig, + token_program: Pubkey, + mint: &Pubkey, + owner: &Pubkey, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(token_program)?; + let instructions = program + .request() + .instruction( + spl_associated_token_account::instruction::create_associated_token_account_idempotent( + &program.payer(), + owner, + mint, + &token_program, + ), + ) + .instructions()?; + Ok(instructions) +} + +pub fn create_and_init_auxiliary_token( + config: &ClientConfig, + new_account_key: &Pubkey, + mint: &Pubkey, + owner: &Pubkey, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + let mint_account = &mut RpcClient::new(config.http_url.to_string()).get_account(&mint)?; + // Client. + let client = Client::new(url, Rc::new(payer)); + let (program, space) = if mint_account.owner == spl_token::id() { + ( + client.program(spl_token::id())?, + spl_token::state::Account::LEN, + ) + } else { + let mut extensions = vec![]; + extensions.push(ExtensionType::ImmutableOwner); + let mint_state = StateWithExtensionsMut::::unpack(mint_account.data_as_mut_slice())?; + let mint_extension_types = mint_state.get_extension_types()?; + let mut required_extensions = + ExtensionType::get_required_init_account_extensions(&mint_extension_types); + for extension_type in extensions.into_iter() { + if !required_extensions.contains(&extension_type) { + required_extensions.push(extension_type); + } + } + let space = ExtensionType::try_calculate_account_len::(&required_extensions)?; + + (client.program(spl_token_2022::id())?, space) + }; + + let instructions = program + .request() + .instruction(system_instruction::create_account( + &program.payer(), + &mint, + program + .rpc() + .get_minimum_balance_for_rent_exemption(space)?, + space as u64, + &program.id(), + )) + .instruction(spl_token_2022::instruction::initialize_immutable_owner( + &program.id(), + new_account_key, + )?) + .instruction(spl_token_2022::instruction::initialize_account( + &program.id(), + new_account_key, + mint, + owner, + )?) + .instructions()?; + Ok(instructions) +} + +pub fn close_token_account( + config: &ClientConfig, + close_account: &Pubkey, + destination: &Pubkey, + owner: &Keypair, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(spl_token::id())?; + let instructions = program + .request() + .instruction(spl_token::instruction::close_account( + &program.id(), + close_account, + destination, + &owner.pubkey(), + &[], + )?) + .signer(owner) + .instructions()?; + Ok(instructions) +} + +pub fn spl_token_transfer_instr( + config: &ClientConfig, + from: &Pubkey, + to: &Pubkey, + amount: u64, + from_authority: &Keypair, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(spl_token::id())?; + let instructions = program + .request() + .instruction(spl_token::instruction::transfer( + &program.id(), + from, + to, + &from_authority.pubkey(), + &[], + amount, + )?) + .signer(from_authority) + .instructions()?; + Ok(instructions) +} + +pub fn spl_token_mint_to_instr( + config: &ClientConfig, + token_program: Pubkey, + mint: &Pubkey, + to: &Pubkey, + amount: u64, + mint_authority: &Keypair, +) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = if token_program == spl_token::id() { + client.program(spl_token::id())? + } else { + client.program(spl_token_2022::id())? + }; + let instructions = program + .request() + .instruction(spl_token_2022::instruction::mint_to( + &program.id(), + mint, + to, + &mint_authority.pubkey(), + &[], + amount, + )?) + .signer(mint_authority) + .instructions()?; + Ok(instructions) +} + +pub fn wrap_sol_instr(config: &ClientConfig, amount: u64) -> Result> { + let payer = read_keypair_file(&config.payer_path)?; + let wallet_key = payer.pubkey(); + let url = Cluster::Custom(config.http_url.clone(), config.ws_url.clone()); + let wsol_mint = Pubkey::from_str("So11111111111111111111111111111111111111112")?; + let wsol_ata_account = + spl_associated_token_account::get_associated_token_address(&wallet_key, &wsol_mint); + // Client. + let client = Client::new(url, Rc::new(payer)); + let program = client.program(spl_token::id())?; + + let instructions = program + .request() + .instruction( + spl_associated_token_account::instruction::create_associated_token_account_idempotent( + &program.payer(), + &wallet_key, + &wsol_mint, + &program.id(), + ), + ) + .instruction(system_instruction::transfer( + &wallet_key, + &wsol_ata_account, + amount, + )) + .instruction(spl_token::instruction::sync_native( + &program.id(), + &wsol_ata_account, + )?) + .instructions()?; + Ok(instructions) +} diff --git a/client/src/instructions/utils.rs b/client/src/instructions/utils.rs new file mode 100644 index 0000000..aa946a1 --- /dev/null +++ b/client/src/instructions/utils.rs @@ -0,0 +1,125 @@ +use anchor_lang::AccountDeserialize; +use anyhow::Result; +use solana_client::rpc_client::RpcClient; +use solana_sdk::{account::Account, pubkey::Pubkey}; +use spl_token_2022::{ + extension::{ + transfer_fee::{TransferFeeConfig, MAX_FEE_BASIS_POINTS}, + BaseState, BaseStateWithExtensions, StateWithExtensionsMut, + }, + state::Mint, +}; +use std::ops::Mul; + +pub fn deserialize_anchor_account(account: &Account) -> Result { + let mut data: &[u8] = &account.data; + T::try_deserialize(&mut data).map_err(Into::into) +} + +#[derive(Debug)] +pub struct TransferFeeInfo { + pub mint: Pubkey, + pub owner: Pubkey, + pub transfer_fee: u64, +} + +pub fn amount_with_slippage(amount: u64, slippage: f64, round_up: bool) -> u64 { + if round_up { + (amount as f64).mul(1_f64 + slippage).ceil() as u64 + } else { + (amount as f64).mul(1_f64 - slippage).floor() as u64 + } +} + +pub fn get_pool_mints_inverse_fee( + rpc_client: &RpcClient, + token_mint_0: Pubkey, + token_mint_1: Pubkey, + post_fee_amount_0: u64, + post_fee_amount_1: u64, +) -> (TransferFeeInfo, TransferFeeInfo) { + let load_accounts = vec![token_mint_0, token_mint_1]; + let rsps = rpc_client.get_multiple_accounts(&load_accounts).unwrap(); + let epoch = rpc_client.get_epoch_info().unwrap().epoch; + let mut mint0_account = rsps[0].clone().ok_or("load mint0 rps error!").unwrap(); + let mut mint1_account = rsps[1].clone().ok_or("load mint0 rps error!").unwrap(); + let mint0_state = StateWithExtensionsMut::::unpack(&mut mint0_account.data).unwrap(); + let mint1_state = StateWithExtensionsMut::::unpack(&mut mint1_account.data).unwrap(); + ( + TransferFeeInfo { + mint: token_mint_0, + owner: mint0_account.owner, + transfer_fee: get_transfer_inverse_fee(&mint0_state, post_fee_amount_0, epoch), + }, + TransferFeeInfo { + mint: token_mint_1, + owner: mint1_account.owner, + transfer_fee: get_transfer_inverse_fee(&mint1_state, post_fee_amount_1, epoch), + }, + ) +} + +pub fn get_pool_mints_transfer_fee( + rpc_client: &RpcClient, + token_mint_0: Pubkey, + token_mint_1: Pubkey, + pre_fee_amount_0: u64, + pre_fee_amount_1: u64, +) -> (TransferFeeInfo, TransferFeeInfo) { + let load_accounts = vec![token_mint_0, token_mint_1]; + let rsps = rpc_client.get_multiple_accounts(&load_accounts).unwrap(); + let epoch = rpc_client.get_epoch_info().unwrap().epoch; + let mut mint0_account = rsps[0].clone().ok_or("load mint0 rps error!").unwrap(); + let mut mint1_account = rsps[1].clone().ok_or("load mint0 rps error!").unwrap(); + let mint0_state = StateWithExtensionsMut::::unpack(&mut mint0_account.data).unwrap(); + let mint1_state = StateWithExtensionsMut::::unpack(&mut mint1_account.data).unwrap(); + ( + TransferFeeInfo { + mint: token_mint_0, + owner: mint0_account.owner, + transfer_fee: get_transfer_fee(&mint0_state, pre_fee_amount_0, epoch), + }, + TransferFeeInfo { + mint: token_mint_1, + owner: mint1_account.owner, + transfer_fee: get_transfer_fee(&mint1_state, pre_fee_amount_1, epoch), + }, + ) +} + +/// Calculate the fee for output amount +pub fn get_transfer_inverse_fee<'data, S: BaseState>( + account_state: &StateWithExtensionsMut<'data, S>, + epoch: u64, + post_fee_amount: u64, +) -> u64 { + let fee = if let Ok(transfer_fee_config) = account_state.get_extension::() { + let transfer_fee = transfer_fee_config.get_epoch_fee(epoch); + if u16::from(transfer_fee.transfer_fee_basis_points) == MAX_FEE_BASIS_POINTS { + u64::from(transfer_fee.maximum_fee) + } else { + transfer_fee_config + .calculate_inverse_epoch_fee(epoch, post_fee_amount) + .unwrap() + } + } else { + 0 + }; + fee +} + +/// Calculate the fee for input amount +pub fn get_transfer_fee<'data, S: BaseState>( + account_state: &StateWithExtensionsMut<'data, S>, + epoch: u64, + pre_fee_amount: u64, +) -> u64 { + let fee = if let Ok(transfer_fee_config) = account_state.get_extension::() { + transfer_fee_config + .calculate_epoch_fee(epoch, pre_fee_amount) + .unwrap() + } else { + 0 + }; + fee +} diff --git a/client/src/main.rs b/client/src/main.rs new file mode 100644 index 0000000..e816215 --- /dev/null +++ b/client/src/main.rs @@ -0,0 +1,753 @@ +#![allow(dead_code)] +use anchor_client::{Client, Cluster}; +use anyhow::{format_err, Result}; +use arrayref::array_ref; +use clap::Parser; +use configparser::ini::Ini; +use solana_client::{rpc_client::RpcClient, rpc_config::RpcTransactionConfig}; +use solana_sdk::{ + commitment_config::CommitmentConfig, + pubkey::Pubkey, + signature::{Keypair, Signature, Signer}, + transaction::Transaction, +}; +use solana_transaction_status::UiTransactionEncoding; +use std::rc::Rc; +use std::str::FromStr; + +mod instructions; +use instructions::amm_instructions::*; +use instructions::events_instructions_parse::*; +use instructions::rpc::*; +use instructions::token_instructions::*; +use instructions::utils::*; +use spl_token_2022::{ + extension::StateWithExtensionsMut, + state::{Account, Mint}, +}; + +#[derive(Clone, Debug, PartialEq)] +pub struct ClientConfig { + http_url: String, + ws_url: String, + payer_path: String, + admin_path: String, + raydium_cp_program: Pubkey, + slippage: f64, +} + +fn load_cfg(client_config: &String) -> Result { + let mut config = Ini::new(); + let _map = config.load(client_config).unwrap(); + let http_url = config.get("Global", "http_url").unwrap(); + if http_url.is_empty() { + panic!("http_url must not be empty"); + } + let ws_url = config.get("Global", "ws_url").unwrap(); + if ws_url.is_empty() { + panic!("ws_url must not be empty"); + } + let payer_path = config.get("Global", "payer_path").unwrap(); + if payer_path.is_empty() { + panic!("payer_path must not be empty"); + } + let admin_path = config.get("Global", "admin_path").unwrap(); + if admin_path.is_empty() { + panic!("admin_path must not be empty"); + } + + let raydium_cp_program_str = config.get("Global", "raydium_cp_program").unwrap(); + if raydium_cp_program_str.is_empty() { + panic!("raydium_cp_program must not be empty"); + } + let raydium_cp_program = Pubkey::from_str(&raydium_cp_program_str).unwrap(); + let slippage = config.getfloat("Global", "slippage").unwrap().unwrap(); + + Ok(ClientConfig { + http_url, + ws_url, + payer_path, + admin_path, + raydium_cp_program, + slippage, + }) +} + +fn read_keypair_file(s: &str) -> Result { + solana_sdk::signature::read_keypair_file(s) + .map_err(|_| format_err!("failed to read keypair from {}", s)) +} + +#[derive(Debug, Parser)] +pub struct Opts { + #[clap(subcommand)] + pub command: RaydiumCpCommands, +} + +#[derive(Debug, Parser)] +pub enum RaydiumCpCommands { + InitializePool { + mint0: Pubkey, + mint1: Pubkey, + init_amount_0: u64, + init_amount_1: u64, + #[arg(short, long, default_value_t = 0)] + open_time: u64, + }, + Deposit { + pool_id: Pubkey, + user_token_0: Pubkey, + user_token_1: Pubkey, + lp_token_amount: u64, + }, + Withdraw { + pool_id: Pubkey, + user_lp_token: Pubkey, + lp_token_amount: u64, + }, + SwapBaseIn { + pool_id: Pubkey, + user_input_token: Pubkey, + user_input_amount: u64, + }, + SwapBaseOut { + pool_id: Pubkey, + user_input_token: Pubkey, + amount_out_less_fee: u64, + }, + DecodeInstruction { + instr_hex_data: String, + }, + DecodeEvent { + log_event: String, + }, + DecodeTxLog { + tx_id: String, + }, +} + +fn main() -> Result<()> { + let client_config = "client_config.ini"; + let pool_config = load_cfg(&client_config.to_string()).unwrap(); + // cluster params. + let payer = read_keypair_file(&pool_config.payer_path)?; + // solana rpc client + let rpc_client = RpcClient::new(pool_config.http_url.to_string()); + + // anchor client. + let anchor_config = pool_config.clone(); + let url = Cluster::Custom(anchor_config.http_url, anchor_config.ws_url); + let wallet = read_keypair_file(&pool_config.payer_path)?; + let anchor_client = Client::new(url, Rc::new(wallet)); + let program = anchor_client.program(pool_config.raydium_cp_program)?; + + let opts = Opts::parse(); + match opts.command { + RaydiumCpCommands::InitializePool { + mint0, + mint1, + init_amount_0, + init_amount_1, + open_time, + } => { + let (mint0, mint1, init_amount_0, init_amount_1) = if mint0 > mint1 { + (mint1, mint0, init_amount_1, init_amount_0) + } else { + (mint0, mint1, init_amount_0, init_amount_1) + }; + let load_pubkeys = vec![mint0, mint1]; + let rsps = rpc_client.get_multiple_accounts(&load_pubkeys)?; + let token_0_program = rsps[0].clone().unwrap().owner; + let token_1_program = rsps[1].clone().unwrap().owner; + + let initialize_pool_instr = initialize_pool_instr( + &pool_config, + mint0, + mint1, + token_0_program, + token_1_program, + spl_associated_token_account::get_associated_token_address(&payer.pubkey(), &mint0), + spl_associated_token_account::get_associated_token_address(&payer.pubkey(), &mint1), + raydium_cp_swap::create_pool_fee_reveiver::id(), + init_amount_0, + init_amount_1, + open_time, + )?; + + let signers = vec![&payer]; + let recent_hash = rpc_client.get_latest_blockhash()?; + let txn = Transaction::new_signed_with_payer( + &initialize_pool_instr, + Some(&payer.pubkey()), + &signers, + recent_hash, + ); + let signature = send_txn(&rpc_client, &txn, true)?; + println!("{}", signature); + } + RaydiumCpCommands::Deposit { + pool_id, + user_token_0, + user_token_1, + lp_token_amount, + } => { + let pool_state: raydium_cp_swap::states::PoolState = program.account(pool_id)?; + // load account + let load_pubkeys = vec![pool_state.token_0_vault, pool_state.token_1_vault]; + let rsps = rpc_client.get_multiple_accounts(&load_pubkeys)?; + let [token_0_vault_account, token_1_vault_account] = array_ref![rsps, 0, 2]; + // docode account + let mut token_0_vault_data = token_0_vault_account.clone().unwrap().data; + let mut token_1_vault_data = token_1_vault_account.clone().unwrap().data; + let token_0_vault_info = + StateWithExtensionsMut::::unpack(&mut token_0_vault_data)?; + let token_1_vault_info = + StateWithExtensionsMut::::unpack(&mut token_1_vault_data)?; + + let (total_token_0_amount, total_token_1_amount) = pool_state.vault_amount_without_fee( + token_0_vault_info.base.amount, + token_1_vault_info.base.amount, + ); + // calculate amount + let results = raydium_cp_swap::curve::CurveCalculator::lp_tokens_to_trading_tokens( + u128::from(lp_token_amount), + u128::from(pool_state.lp_supply), + u128::from(total_token_0_amount), + u128::from(total_token_1_amount), + raydium_cp_swap::curve::RoundDirection::Ceiling, + ) + .ok_or(raydium_cp_swap::error::ErrorCode::ZeroTradingTokens) + .unwrap(); + println!( + "amount_0:{}, amount_1:{}, lp_token_amount:{}", + results.token_0_amount, results.token_1_amount, lp_token_amount + ); + // calc with slippage + let amount_0_with_slippage = + amount_with_slippage(results.token_0_amount as u64, pool_config.slippage, true); + let amount_1_with_slippage = + amount_with_slippage(results.token_1_amount as u64, pool_config.slippage, true); + // calc with transfer_fee + let transfer_fee = get_pool_mints_inverse_fee( + &rpc_client, + pool_state.token_0_mint, + pool_state.token_1_mint, + amount_0_with_slippage, + amount_1_with_slippage, + ); + println!( + "transfer_fee_0:{}, transfer_fee_1:{}", + transfer_fee.0.transfer_fee, transfer_fee.1.transfer_fee + ); + let amount_0_max = (amount_0_with_slippage as u64) + .checked_add(transfer_fee.0.transfer_fee) + .unwrap(); + let amount_1_max = (amount_1_with_slippage as u64) + .checked_add(transfer_fee.1.transfer_fee) + .unwrap(); + println!( + "amount_0_max:{}, amount_1_max:{}", + amount_0_max, amount_1_max + ); + let mut instructions = Vec::new(); + let create_user_lp_token_instr = create_ata_token_account_instr( + &pool_config, + spl_token::id(), + &pool_state.lp_mint, + &payer.pubkey(), + )?; + instructions.extend(create_user_lp_token_instr); + let deposit_instr = deposit_instr( + &pool_config, + pool_id, + pool_state.token_0_mint, + pool_state.token_1_mint, + pool_state.lp_mint, + pool_state.token_0_vault, + pool_state.token_1_vault, + user_token_0, + user_token_1, + spl_associated_token_account::get_associated_token_address( + &payer.pubkey(), + &pool_state.lp_mint, + ), + lp_token_amount, + amount_0_max, + amount_1_max, + )?; + instructions.extend(deposit_instr); + let signers = vec![&payer]; + let recent_hash = rpc_client.get_latest_blockhash()?; + let txn = Transaction::new_signed_with_payer( + &instructions, + Some(&payer.pubkey()), + &signers, + recent_hash, + ); + let signature = send_txn(&rpc_client, &txn, true)?; + println!("{}", signature); + } + RaydiumCpCommands::Withdraw { + pool_id, + user_lp_token, + lp_token_amount, + } => { + let pool_state: raydium_cp_swap::states::PoolState = program.account(pool_id)?; + // load account + let load_pubkeys = vec![pool_state.token_0_vault, pool_state.token_1_vault]; + let rsps = rpc_client.get_multiple_accounts(&load_pubkeys)?; + let [token_0_vault_account, token_1_vault_account] = array_ref![rsps, 0, 2]; + // docode account + let mut token_0_vault_data = token_0_vault_account.clone().unwrap().data; + let mut token_1_vault_data = token_1_vault_account.clone().unwrap().data; + let token_0_vault_info = + StateWithExtensionsMut::::unpack(&mut token_0_vault_data)?; + let token_1_vault_info = + StateWithExtensionsMut::::unpack(&mut token_1_vault_data)?; + + let (total_token_0_amount, total_token_1_amount) = pool_state.vault_amount_without_fee( + token_0_vault_info.base.amount, + token_1_vault_info.base.amount, + ); + // calculate amount + let results = raydium_cp_swap::curve::CurveCalculator::lp_tokens_to_trading_tokens( + u128::from(lp_token_amount), + u128::from(pool_state.lp_supply), + u128::from(total_token_0_amount), + u128::from(total_token_1_amount), + raydium_cp_swap::curve::RoundDirection::Ceiling, + ) + .ok_or(raydium_cp_swap::error::ErrorCode::ZeroTradingTokens) + .unwrap(); + println!( + "amount_0:{}, amount_1:{}, lp_token_amount:{}", + results.token_0_amount, results.token_1_amount, lp_token_amount + ); + + // calc with slippage + let amount_0_with_slippage = + amount_with_slippage(results.token_0_amount as u64, pool_config.slippage, false); + let amount_1_with_slippage = + amount_with_slippage(results.token_1_amount as u64, pool_config.slippage, false); + + let transfer_fee = get_pool_mints_transfer_fee( + &rpc_client, + pool_state.token_0_mint, + pool_state.token_1_mint, + amount_0_with_slippage, + amount_1_with_slippage, + ); + println!( + "transfer_fee_0:{}, transfer_fee_1:{}", + transfer_fee.0.transfer_fee, transfer_fee.1.transfer_fee + ); + let amount_0_min = amount_0_with_slippage + .checked_sub(transfer_fee.0.transfer_fee) + .unwrap(); + let amount_1_min = amount_1_with_slippage + .checked_sub(transfer_fee.1.transfer_fee) + .unwrap(); + println!( + "amount_0_min:{}, amount_1_min:{}", + amount_0_min, amount_1_min + ); + let mut instructions = Vec::new(); + let create_user_token_0_instr = create_ata_token_account_instr( + &pool_config, + spl_token::id(), + &pool_state.token_0_mint, + &payer.pubkey(), + )?; + instructions.extend(create_user_token_0_instr); + let create_user_token_1_instr = create_ata_token_account_instr( + &pool_config, + spl_token::id(), + &pool_state.token_1_mint, + &payer.pubkey(), + )?; + instructions.extend(create_user_token_1_instr); + let withdraw_instr = withdraw_instr( + &pool_config, + pool_id, + pool_state.token_0_mint, + pool_state.token_1_mint, + pool_state.lp_mint, + pool_state.token_0_vault, + pool_state.token_1_vault, + spl_associated_token_account::get_associated_token_address( + &payer.pubkey(), + &pool_state.token_0_mint, + ), + spl_associated_token_account::get_associated_token_address( + &payer.pubkey(), + &pool_state.token_1_mint, + ), + user_lp_token, + lp_token_amount, + amount_0_min, + amount_1_min, + )?; + instructions.extend(withdraw_instr); + let signers = vec![&payer]; + let recent_hash = rpc_client.get_latest_blockhash()?; + let txn = Transaction::new_signed_with_payer( + &instructions, + Some(&payer.pubkey()), + &signers, + recent_hash, + ); + let signature = send_txn(&rpc_client, &txn, true)?; + println!("{}", signature); + } + RaydiumCpCommands::SwapBaseIn { + pool_id, + user_input_token, + user_input_amount, + } => { + let pool_state: raydium_cp_swap::states::PoolState = program.account(pool_id)?; + // load account + let load_pubkeys = vec![ + pool_state.amm_config, + pool_state.token_0_vault, + pool_state.token_1_vault, + pool_state.token_0_mint, + pool_state.token_1_mint, + user_input_token, + ]; + let rsps = rpc_client.get_multiple_accounts(&load_pubkeys)?; + let epoch = rpc_client.get_epoch_info().unwrap().epoch; + let [amm_config_account, token_0_vault_account, token_1_vault_account, token_0_mint_account, token_1_mint_account, user_input_token_account] = + array_ref![rsps, 0, 6]; + // docode account + let mut token_0_vault_data = token_0_vault_account.clone().unwrap().data; + let mut token_1_vault_data = token_1_vault_account.clone().unwrap().data; + let mut token_0_mint_data = token_0_mint_account.clone().unwrap().data; + let mut token_1_mint_data = token_1_mint_account.clone().unwrap().data; + let mut user_input_token_data = user_input_token_account.clone().unwrap().data; + let amm_config_state = deserialize_anchor_account::( + amm_config_account.as_ref().unwrap(), + )?; + let token_0_vault_info = + StateWithExtensionsMut::::unpack(&mut token_0_vault_data)?; + let token_1_vault_info = + StateWithExtensionsMut::::unpack(&mut token_1_vault_data)?; + let token_0_mint_info = StateWithExtensionsMut::::unpack(&mut token_0_mint_data)?; + let token_1_mint_info = StateWithExtensionsMut::::unpack(&mut token_1_mint_data)?; + let user_input_token_info = + StateWithExtensionsMut::::unpack(&mut user_input_token_data)?; + + let (total_token_0_amount, total_token_1_amount) = pool_state.vault_amount_without_fee( + token_0_vault_info.base.amount, + token_1_vault_info.base.amount, + ); + + let ( + trade_direction, + total_input_token_amount, + total_output_token_amount, + user_input_token, + user_output_token, + input_vault, + output_vault, + input_token_mint, + output_token_mint, + input_token_program, + output_token_program, + transfer_fee, + ) = if user_input_token_info.base.mint == token_0_vault_info.base.mint { + ( + raydium_cp_swap::curve::TradeDirection::ZeroForOne, + total_token_0_amount, + total_token_1_amount, + user_input_token, + spl_associated_token_account::get_associated_token_address( + &payer.pubkey(), + &pool_state.token_1_mint, + ), + pool_state.token_0_vault, + pool_state.token_1_vault, + pool_state.token_0_mint, + pool_state.token_1_mint, + pool_state.token_0_program, + pool_state.token_1_program, + get_transfer_fee(&token_0_mint_info, epoch, user_input_amount), + ) + } else { + ( + raydium_cp_swap::curve::TradeDirection::OneForZero, + total_token_1_amount, + total_token_0_amount, + user_input_token, + spl_associated_token_account::get_associated_token_address( + &payer.pubkey(), + &pool_state.token_0_mint, + ), + pool_state.token_1_vault, + pool_state.token_0_vault, + pool_state.token_1_mint, + pool_state.token_0_mint, + pool_state.token_1_program, + pool_state.token_0_program, + get_transfer_fee(&token_1_mint_info, epoch, user_input_amount), + ) + }; + // Take transfer fees into account for actual amount transferred in + let actual_amount_in = user_input_amount.saturating_sub(transfer_fee); + let result = raydium_cp_swap::curve::CurveCalculator::swap_base_input( + u128::from(actual_amount_in), + u128::from(total_input_token_amount), + u128::from(total_output_token_amount), + amm_config_state.trade_fee_rate, + amm_config_state.protocol_fee_rate, + amm_config_state.fund_fee_rate, + ) + .ok_or(raydium_cp_swap::error::ErrorCode::ZeroTradingTokens) + .unwrap(); + let amount_out = u64::try_from(result.destination_amount_swapped).unwrap(); + let transfer_fee = match trade_direction { + raydium_cp_swap::curve::TradeDirection::ZeroForOne => { + get_transfer_fee(&token_1_mint_info, epoch, amount_out) + } + raydium_cp_swap::curve::TradeDirection::OneForZero => { + get_transfer_fee(&token_0_mint_info, epoch, amount_out) + } + }; + let amount_received = amount_out.checked_sub(transfer_fee).unwrap(); + // calc mint out amount with slippage + let minimum_amount_out = + amount_with_slippage(amount_received, pool_config.slippage, false); + + let mut instructions = Vec::new(); + let create_user_output_token_instr = create_ata_token_account_instr( + &pool_config, + spl_token::id(), + &output_token_mint, + &payer.pubkey(), + )?; + instructions.extend(create_user_output_token_instr); + let swap_base_in_instr = swap_base_input_instr( + &pool_config, + pool_id, + pool_state.amm_config, + pool_state.observation_key, + user_input_token, + user_output_token, + input_vault, + output_vault, + input_token_mint, + output_token_mint, + input_token_program, + output_token_program, + user_input_amount, + minimum_amount_out, + )?; + instructions.extend(swap_base_in_instr); + let signers = vec![&payer]; + let recent_hash = rpc_client.get_latest_blockhash()?; + let txn = Transaction::new_signed_with_payer( + &instructions, + Some(&payer.pubkey()), + &signers, + recent_hash, + ); + let signature = send_txn(&rpc_client, &txn, true)?; + println!("{}", signature); + } + RaydiumCpCommands::SwapBaseOut { + pool_id, + user_input_token, + amount_out_less_fee, + } => { + let pool_state: raydium_cp_swap::states::PoolState = program.account(pool_id)?; + // load account + let load_pubkeys = vec![ + pool_state.amm_config, + pool_state.token_0_vault, + pool_state.token_1_vault, + pool_state.token_0_mint, + pool_state.token_1_mint, + user_input_token, + ]; + let rsps = rpc_client.get_multiple_accounts(&load_pubkeys)?; + let epoch = rpc_client.get_epoch_info().unwrap().epoch; + let [amm_config_account, token_0_vault_account, token_1_vault_account, token_0_mint_account, token_1_mint_account, user_input_token_account] = + array_ref![rsps, 0, 6]; + // docode account + let mut token_0_vault_data = token_0_vault_account.clone().unwrap().data; + let mut token_1_vault_data = token_1_vault_account.clone().unwrap().data; + let mut token_0_mint_data = token_0_mint_account.clone().unwrap().data; + let mut token_1_mint_data = token_1_mint_account.clone().unwrap().data; + let mut user_input_token_data = user_input_token_account.clone().unwrap().data; + let amm_config_state = deserialize_anchor_account::( + amm_config_account.as_ref().unwrap(), + )?; + let token_0_vault_info = + StateWithExtensionsMut::::unpack(&mut token_0_vault_data)?; + let token_1_vault_info = + StateWithExtensionsMut::::unpack(&mut token_1_vault_data)?; + let token_0_mint_info = StateWithExtensionsMut::::unpack(&mut token_0_mint_data)?; + let token_1_mint_info = StateWithExtensionsMut::::unpack(&mut token_1_mint_data)?; + let user_input_token_info = + StateWithExtensionsMut::::unpack(&mut user_input_token_data)?; + + let (total_token_0_amount, total_token_1_amount) = pool_state.vault_amount_without_fee( + token_0_vault_info.base.amount, + token_1_vault_info.base.amount, + ); + + let ( + trade_direction, + total_input_token_amount, + total_output_token_amount, + user_input_token, + user_output_token, + input_vault, + output_vault, + input_token_mint, + output_token_mint, + input_token_program, + output_token_program, + out_transfer_fee, + ) = if user_input_token_info.base.mint == token_0_vault_info.base.mint { + ( + raydium_cp_swap::curve::TradeDirection::ZeroForOne, + total_token_0_amount, + total_token_1_amount, + user_input_token, + spl_associated_token_account::get_associated_token_address( + &payer.pubkey(), + &pool_state.token_1_mint, + ), + pool_state.token_0_vault, + pool_state.token_1_vault, + pool_state.token_0_mint, + pool_state.token_1_mint, + pool_state.token_0_program, + pool_state.token_1_program, + get_transfer_inverse_fee(&token_1_mint_info, epoch, amount_out_less_fee), + ) + } else { + ( + raydium_cp_swap::curve::TradeDirection::OneForZero, + total_token_1_amount, + total_token_0_amount, + user_input_token, + spl_associated_token_account::get_associated_token_address( + &payer.pubkey(), + &pool_state.token_0_mint, + ), + pool_state.token_1_vault, + pool_state.token_0_vault, + pool_state.token_1_mint, + pool_state.token_0_mint, + pool_state.token_1_program, + pool_state.token_0_program, + get_transfer_inverse_fee(&token_0_mint_info, epoch, amount_out_less_fee), + ) + }; + let actual_amount_out = amount_out_less_fee.checked_add(out_transfer_fee).unwrap(); + + let result = raydium_cp_swap::curve::CurveCalculator::swap_base_output( + u128::from(actual_amount_out), + u128::from(total_input_token_amount), + u128::from(total_output_token_amount), + amm_config_state.trade_fee_rate, + amm_config_state.protocol_fee_rate, + amm_config_state.fund_fee_rate, + ) + .ok_or(raydium_cp_swap::error::ErrorCode::ZeroTradingTokens) + .unwrap(); + + let source_amount_swapped = u64::try_from(result.source_amount_swapped).unwrap(); + let amount_in_transfer_fee = match trade_direction { + raydium_cp_swap::curve::TradeDirection::ZeroForOne => { + get_transfer_inverse_fee(&token_0_mint_info, epoch, source_amount_swapped) + } + raydium_cp_swap::curve::TradeDirection::OneForZero => { + get_transfer_inverse_fee(&token_1_mint_info, epoch, source_amount_swapped) + } + }; + + let input_transfer_amount = source_amount_swapped + .checked_add(amount_in_transfer_fee) + .unwrap(); + // calc max in with slippage + let max_amount_in = + amount_with_slippage(input_transfer_amount, pool_config.slippage, true); + let mut instructions = Vec::new(); + let create_user_output_token_instr = create_ata_token_account_instr( + &pool_config, + spl_token::id(), + &output_token_mint, + &payer.pubkey(), + )?; + instructions.extend(create_user_output_token_instr); + let swap_base_in_instr = swap_base_output_instr( + &pool_config, + pool_id, + pool_state.amm_config, + pool_state.observation_key, + user_input_token, + user_output_token, + input_vault, + output_vault, + input_token_mint, + output_token_mint, + input_token_program, + output_token_program, + max_amount_in, + amount_out_less_fee, + )?; + instructions.extend(swap_base_in_instr); + let signers = vec![&payer]; + let recent_hash = rpc_client.get_latest_blockhash()?; + let txn = Transaction::new_signed_with_payer( + &instructions, + Some(&payer.pubkey()), + &signers, + recent_hash, + ); + let signature = send_txn(&rpc_client, &txn, true)?; + println!("{}", signature); + } + RaydiumCpCommands::DecodeInstruction { instr_hex_data } => { + handle_program_instruction(&instr_hex_data, InstructionDecodeType::BaseHex)?; + } + RaydiumCpCommands::DecodeEvent { log_event } => { + handle_program_log( + &pool_config.raydium_cp_program.to_string(), + &log_event, + false, + )?; + } + RaydiumCpCommands::DecodeTxLog { tx_id } => { + let signature = Signature::from_str(&tx_id)?; + let tx = rpc_client.get_transaction_with_config( + &signature, + RpcTransactionConfig { + encoding: Some(UiTransactionEncoding::Json), + commitment: Some(CommitmentConfig::confirmed()), + max_supported_transaction_version: Some(0), + }, + )?; + let transaction = tx.transaction; + // get meta + let meta = if transaction.meta.is_some() { + transaction.meta + } else { + None + }; + // get encoded_transaction + let encoded_transaction = transaction.transaction; + // decode instruction data + parse_program_instruction( + &pool_config.raydium_cp_program.to_string(), + encoded_transaction, + meta.clone(), + )?; + // decode logs + parse_program_event(&pool_config.raydium_cp_program.to_string(), meta.clone())?; + } + } + Ok(()) +} diff --git a/client_config.ini b/client_config.ini new file mode 100644 index 0000000..05caa71 --- /dev/null +++ b/client_config.ini @@ -0,0 +1,7 @@ +[Global] +http_url = https://api.devnet.solana.com +ws_url = wss://api.devnet.solana.com/ +payer_path = id.json +admin_path = adMCyoCgfkg7bQiJ9aBJ59H3BXLY3r5LNLfPpQfMzBe.json +raydium_cp_program = CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW +slippage = 0.01 \ No newline at end of file diff --git a/programs/cp-swap/Cargo.toml b/programs/cp-swap/Cargo.toml index 00a4263..4af8457 100644 --- a/programs/cp-swap/Cargo.toml +++ b/programs/cp-swap/Cargo.toml @@ -16,6 +16,7 @@ cpi = ["no-entrypoint"] default = [] enable-log = [] devnet = [] +client = [] [dependencies] anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } diff --git a/programs/cp-swap/src/curve/calculator.rs b/programs/cp-swap/src/curve/calculator.rs index 7fc423a..f012e0c 100644 --- a/programs/cp-swap/src/curve/calculator.rs +++ b/programs/cp-swap/src/curve/calculator.rs @@ -217,12 +217,11 @@ pub mod test { swap_destination_amount: u128, trade_direction: TradeDirection, ) { - let results = ConstantProductCurve::swap_base_input_without_fees( + let destination_amount_swapped = ConstantProductCurve::swap_base_input_without_fees( source_token_amount, swap_source_amount, swap_destination_amount, - ) - .unwrap(); + ); let (swap_token_0_amount, swap_token_1_amount) = match trade_direction { TradeDirection::ZeroForOne => (swap_source_amount, swap_destination_amount), @@ -232,11 +231,9 @@ pub mod test { .checked_mul(swap_token_1_amount) .unwrap(); - let new_swap_source_amount = swap_source_amount - .checked_add(results.source_amount_swapped) - .unwrap(); + let new_swap_source_amount = swap_source_amount.checked_add(source_token_amount).unwrap(); let new_swap_destination_amount = swap_destination_amount - .checked_sub(results.destination_amount_swapped) + .checked_sub(destination_amount_swapped) .unwrap(); let (swap_token_0_amount, swap_token_1_amount) = match trade_direction { TradeDirection::ZeroForOne => (new_swap_source_amount, new_swap_destination_amount), diff --git a/programs/cp-swap/src/curve/constant_product.rs b/programs/cp-swap/src/curve/constant_product.rs index 762f0ac..f46d9f8 100644 --- a/programs/cp-swap/src/curve/constant_product.rs +++ b/programs/cp-swap/src/curve/constant_product.rs @@ -161,19 +161,18 @@ mod tests { expected_destination_amount_swapped: u128, ) { let invariant = swap_source_amount * swap_destination_amount; - let result = ConstantProductCurve::swap_base_input_without_fees( + let destination_amount_swapped = ConstantProductCurve::swap_base_input_without_fees( source_amount, swap_source_amount, swap_destination_amount, - ) - .unwrap(); - assert_eq!(result.source_amount_swapped, expected_source_amount_swapped); + ); + assert_eq!(source_amount, expected_source_amount_swapped); assert_eq!( - result.destination_amount_swapped, + destination_amount_swapped, expected_destination_amount_swapped ); - let new_invariant = (swap_source_amount + result.source_amount_swapped) - * (swap_destination_amount - result.destination_amount_swapped); + let new_invariant = (swap_source_amount + source_amount) + * (swap_destination_amount - destination_amount_swapped); assert!(new_invariant >= invariant); } diff --git a/programs/cp-swap/src/lib.rs b/programs/cp-swap/src/lib.rs index 6d45b5f..b3d1a5e 100644 --- a/programs/cp-swap/src/lib.rs +++ b/programs/cp-swap/src/lib.rs @@ -8,10 +8,8 @@ use crate::curve::fees::FEE_RATE_DENOMINATOR_VALUE; use anchor_lang::prelude::*; use instructions::*; -use solana_security_txt::security_txt; - #[cfg(not(feature = "no-entrypoint"))] -security_txt! { +solana_security_txt::security_txt! { name: "raydium-cp-swap", project_url: "https://raydium.io", contacts: "link:https://immunefi.com/bounty/raydium", diff --git a/programs/cp-swap/src/states/events.rs b/programs/cp-swap/src/states/events.rs index 4cb6f8c..0de1b87 100644 --- a/programs/cp-swap/src/states/events.rs +++ b/programs/cp-swap/src/states/events.rs @@ -2,6 +2,7 @@ use anchor_lang::prelude::*; /// Emitted when deposit and withdraw #[event] +#[cfg_attr(feature = "client", derive(Debug))] pub struct LpChangeEvent { #[index] pub pool_id: Pubkey, @@ -22,6 +23,7 @@ pub struct LpChangeEvent { /// Emitted when swap #[event] +#[cfg_attr(feature = "client", derive(Debug))] pub struct SwapEvent { #[index] pub pool_id: Pubkey, diff --git a/programs/cp-swap/src/states/pool.rs b/programs/cp-swap/src/states/pool.rs index 8e97bae..cc2436b 100644 --- a/programs/cp-swap/src/states/pool.rs +++ b/programs/cp-swap/src/states/pool.rs @@ -61,7 +61,7 @@ pub struct PoolState { pub mint_0_decimals: u8, pub mint_1_decimals: u8, - /// lp mint supply + /// True circulating supply without burns and lock ups pub lp_supply: u64, /// The amounts of token_0 and token_1 that are owed to the liquidity provider. pub protocol_fees_token_0: u64,